diff options
author | Pavel Belous <pavel.belous@aquantia.com> | 2017-02-20 22:36:48 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-20 17:11:09 -0500 |
commit | c0788f7463f138bb1d30552b3edac442781b4e11 (patch) | |
tree | 5bfd232af73b0fccafaf68724846b97649c8eb64 /drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | |
parent | net: ethernet: aquantia: Call netdev_register after all initialized. (diff) | |
download | linux-dev-c0788f7463f138bb1d30552b3edac442781b4e11.tar.xz linux-dev-c0788f7463f138bb1d30552b3edac442781b4e11.zip |
net: ethernet: aquantia: Fixed incorrect buff->len calculation.
rxd_wb->pkt_len is the total length of the packet.
If we received a large packet (with length > AQ_CFG_RX_FRAME_MAX) then we
will get multiple buffers. We need to fix the length of the last buffer.
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c index e7e694f693bd..cab2931dab9a 100644 --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c @@ -673,8 +673,8 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self, } if (HW_ATL_B0_RXD_WB_STAT2_EOP & rxd_wb->status) { - buff->len = (rxd_wb->pkt_len & - (AQ_CFG_RX_FRAME_MAX - 1U)); + buff->len = rxd_wb->pkt_len % + AQ_CFG_RX_FRAME_MAX; buff->len = buff->len ? buff->len : AQ_CFG_RX_FRAME_MAX; buff->next = 0U; |