linux_dsm_epyc7002/drivers/net/ethernet/broadcom
Petri Gynther 66d06757d9 net: bcmgenet: simplify __bcmgenet_tx_reclaim()
1. Use c_index and ring->c_index to determine how many TxCBs/TxBDs are
   ready for cleanup
   - c_index = the current value of TDMA_CONS_INDEX
   - TDMA_CONS_INDEX is HW-incremented and auto-wraparound (0x0-0xFFFF)
   - ring->c_index = __bcmgenet_tx_reclaim() cleaned up to this point on
     the previous invocation

2. Add bcmgenet_tx_ring->clean_ptr
   - index of the next TxCB to be cleaned
   - incremented as TxCBs/TxBDs are processed
   - value always in range [ring->cb_ptr, ring->end_ptr]

3. Fix incrementing of dev->stats.tx_packets
   - should be incremented only when tx_cb_ptr->skb != NULL

These changes simplify __bcmgenet_tx_reclaim(). Furthermore, Tx ring size
can now be any value.

With the old code, Tx ring size had to be a power-of-2:
   num_tx_bds = ring->size;
   c_index &= (num_tx_bds - 1);
   last_c_index &= (num_tx_bds - 1);

Signed-off-by: Petri Gynther <pgynther@google.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-04 23:54:54 -05:00
..
bnx2x ethernet: Use eth_<foo>_addr instead of memset 2015-03-03 17:01:36 -05:00
genet net: bcmgenet: simplify __bcmgenet_tx_reclaim() 2015-03-04 23:54:54 -05:00
b44.c treewide: Remove unnecessary SSB_DEVTABLE_END macro 2015-02-11 14:38:29 -08:00
b44.h b44: use fixed PHY device if we do not find any 2013-12-20 20:48:49 -05:00
bcm63xx_enet.c ethernet/broadcom: Use napi_alloc_skb instead of netdev_alloc_skb_ip_align 2014-12-10 13:31:58 -05:00
bcm63xx_enet.h bcm63xx_enet: add support Broadcom BCM6345 Ethernet 2013-06-13 17:22:08 -07:00
bcmsysport.c net: systemport: fix software maintained statistics 2015-03-01 14:02:11 -05:00
bcmsysport.h net: systemport: fix software maintained statistics 2015-03-01 14:02:11 -05:00
bgmac.c bgmac: fix device initialization on Northstar SoCs (condition typo) 2015-02-11 19:44:21 -08:00
bgmac.h bgmac: add support for Northstar SoC (BCM4707, BCM53018) 2014-01-04 20:25:20 -05:00
bnx2_fw.h bnx2-cnic: Driver Rebranding Changes 2015-02-20 15:46:49 -05:00
bnx2.c bnx2: disable toggling of rxvlan if necessary 2015-03-01 23:25:51 -05:00
bnx2.h bnx2-cnic: Driver Rebranding Changes 2015-02-20 15:46:49 -05:00
cnic_defs.h cnic: Rebranding cnic driver. 2014-06-25 16:27:27 -07:00
cnic_if.h bnx2-cnic: Driver Version Update 2015-02-20 15:46:49 -05:00
cnic.c bnx2-cnic: Driver Rebranding Changes 2015-02-20 15:46:49 -05:00
cnic.h cnic: Rebranding cnic driver. 2014-06-25 16:27:27 -07:00
Kconfig bnx2-cnic: Driver Rebranding Changes 2015-02-20 15:46:49 -05:00
Makefile net: systemport: hook SYSTEMPORT driver in the build 2014-04-26 12:57:40 -04:00
sb1250-mac.c net: ethernet: broadcom: drop owner assignment from platform_drivers 2014-10-20 16:21:05 +02:00
tg3.c tg3: Hold tp->lock before calling tg3_halt() from tg3_init_one() 2015-02-11 19:51:08 -08:00
tg3.h tg3: prevent ifup/ifdown during PCI error recovery 2014-09-02 13:02:19 -07:00