]> git.baikalelectronics.ru Git - kernel.git/commit
net: bcmgenet: Implement TX coalescing control knobs
authorFlorian Fainelli <f.fainelli@gmail.com>
Wed, 16 Sep 2015 23:47:39 +0000 (16:47 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Sep 2015 05:17:14 +0000 (22:17 -0700)
commita1051bed0c236be67ebdfd1b2b3100cae0cda551
treef83b6dc8d897dd55d7baae5d5c20aea6dcc856aa
parent1f372f0a08aa3e775f0798ec79cd308f835febfd
net: bcmgenet: Implement TX coalescing control knobs

Configuring the ethtool tx-frames property, which translates into N
packets before a TX interrupt is the simplest configuration scheme
because it requires no locking neither at the softare nor hardware
level, and is completely indepedent from the link speed. Since ethtool
does not allow per-tx queue coalescing parameters, we apply the same
setting to any transmit queue.

We can no longer enable the BDONE/PDONE interrupts as those would fire
for each packet/buffer received, which would defeat the MBDONE interrupt
purpose. The MBDONE interrupt is guaranteed to correspond to a
PDONE/BDONE interrupt when the threshold is set to 1, but offers
interrupt coalescing when the value is > 1.

Since the HW is configured to generate an interrupt when the ring
becomes emtpy, we have to deny any timeout/timer settings coming from
user-space to indicate we can only generate an interrupt very <N>
packets.

While we are at it, fix the DMA_INTR_THRESHOLD_MASK value which was off
by one bit (0xff vs. 0x1ff).

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c
drivers/net/ethernet/broadcom/genet/bcmgenet.h