Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cacd9222 authored by Stephen Hemminger's avatar Stephen Hemminger
Browse files

beceem: statistics and transmit queue changes



Use standard network statistics variables and routines.
Transmit counters are per queue, and skb mapping is already in
skb and does not need to be recomputed. Move SearchVcId to only
place it is used.

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
parent b5ebd85b
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -414,17 +414,8 @@ struct _MINI_ADAPTER
	// this to keep track of the Tx and Rx MailBox Registers.
	atomic_t		    CurrNumFreeTxDesc;
	// to keep track the no of byte recieved
	atomic_t			RxRollOverCount;
	USHORT				PrevNumRecvDescs;
	USHORT				CurrNumRecvDescs;
	atomic_t			GoodRxByteCount;
	atomic_t			GoodRxPktCount;
	atomic_t			BadRxByteCount;
	atomic_t			RxPacketDroppedCount;
	atomic_t			GoodTxByteCount;
	atomic_t			TxTotalPacketCount;
	atomic_t			TxDroppedPacketCount;

	UINT				u32TotalDSD;
	PacketInfo		    PackInfo[NO_OF_QUEUES];
	S_CLASSIFIER_RULE	astClassifierTable[MAX_CLASSIFIERS];
+0 −20
Original line number Diff line number Diff line
@@ -48,25 +48,6 @@ static INT bcm_close(struct net_device *dev)
	return 0;
}

static struct net_device_stats *bcm_get_stats(struct net_device *dev)
{
	PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(dev);
	struct net_device_stats*  	netstats = &dev->stats;

	netstats->rx_packets = atomic_read(&Adapter->RxRollOverCount)*64*1024
		+ Adapter->PrevNumRecvDescs;
	netstats->rx_bytes = atomic_read(&Adapter->GoodRxByteCount)
		+ atomic_read(&Adapter->BadRxByteCount);

	netstats->rx_dropped = atomic_read(&Adapter->RxPacketDroppedCount);
	netstats->rx_errors  = atomic_read(&Adapter->RxPacketDroppedCount);
	netstats->tx_bytes   = atomic_read(&Adapter->GoodTxByteCount);
	netstats->tx_packets = atomic_read(&Adapter->TxTotalPacketCount);
	netstats->tx_dropped = atomic_read(&Adapter->TxDroppedPacketCount);

	return netstats;
}

static u16 bcm_select_queue(struct net_device *dev, struct sk_buff *skb)
{
	return ClassifyPacket(netdev_priv(dev), skb);
@@ -140,7 +121,6 @@ Register other driver entry points with the kernel
static const struct net_device_ops bcmNetDevOps = {
    .ndo_open		= bcm_open,
    .ndo_stop 		= bcm_close,
    .ndo_get_stats 	= bcm_get_stats,
    .ndo_start_xmit	= bcm_transmit,
    .ndo_change_mtu	= eth_change_mtu,
    .ndo_set_mac_address = eth_mac_addr,
+0 −12
Original line number Diff line number Diff line
@@ -58,18 +58,6 @@ static INT SearchFreeSfid(PMINI_ADAPTER Adapter)
	return NO_OF_QUEUES+1;
}

int SearchVcid(PMINI_ADAPTER Adapter,unsigned short usVcid)
{
	int iIndex=0;

	for(iIndex=(NO_OF_QUEUES-1);iIndex>=0;iIndex--)
		if(Adapter->PackInfo[iIndex].usVCID_Value == usVcid)
			return iIndex;
	return NO_OF_QUEUES+1;

}


/*
Function:				SearchClsid
Description:			This routinue would search Classifier  having specified ClassifierID as input parameter
+16 −5
Original line number Diff line number Diff line
#include "headers.h"
extern int SearchVcid(PMINI_ADAPTER , unsigned short);

static int SearchVcid(PMINI_ADAPTER Adapter,unsigned short usVcid)
{
	int iIndex=0;

	for(iIndex=(NO_OF_QUEUES-1);iIndex>=0;iIndex--)
		if(Adapter->PackInfo[iIndex].usVCID_Value == usVcid)
			return iIndex;
	return NO_OF_QUEUES+1;

}


static PUSB_RCB
@@ -88,8 +98,7 @@ static void read_bulk_callback(struct urb *urb)
		if (netif_msg_rx_err(Adapter))
			pr_info(PFX "%s: corrupted leader length...%d\n",
				Adapter->dev->name, pLeader->PLength);
		atomic_inc(&Adapter->RxPacketDroppedCount);
		atomic_add(pLeader->PLength, &Adapter->BadRxByteCount);
		++Adapter->dev->stats.rx_dropped;
		atomic_dec(&psIntfAdapter->uNumRcbUsed);
		return;
	}
@@ -142,7 +151,6 @@ static void read_bulk_callback(struct urb *urb)
		skb_put (skb, pLeader->PLength + ETH_HLEN);
		Adapter->PackInfo[QueueIndex].uiTotalRxBytes+=pLeader->PLength;
		Adapter->PackInfo[QueueIndex].uiThisPeriodRxBytes+= pLeader->PLength;
		atomic_add(pLeader->PLength, &Adapter->GoodRxByteCount);
        BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Recived Data pkt of len :0x%X", pLeader->PLength);

		if(netif_running(Adapter->dev))
@@ -172,7 +180,10 @@ static void read_bulk_callback(struct urb *urb)
		    BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "i/f not up hance freeing SKB...");
			dev_kfree_skb(skb);
		}
		atomic_inc(&Adapter->GoodRxPktCount);

		++Adapter->dev->stats.rx_packets;
		Adapter->dev->stats.rx_bytes += pLeader->PLength;

		for(uiIndex = 0 ; uiIndex < MIBS_MAX_HIST_ENTRIES ; uiIndex++)
		{
			if((pLeader->PLength <= MIBS_PKTSIZEHIST_RANGE*(uiIndex+1))
+0 −2
Original line number Diff line number Diff line
@@ -1859,8 +1859,6 @@ void flush_queue(PMINI_ADAPTER Adapter, UINT iQIndex)

			dev_kfree_skb(PacketToDrop);
			atomic_dec(&Adapter->TotalPacketCount);
			atomic_inc(&Adapter->TxDroppedPacketCount);

		}
	}
	spin_unlock_bh(&Adapter->PackInfo[iQIndex].SFQueueLock);
Loading