diff options
author | Thomas Falcon <tlfalcon@linux.vnet.ibm.com> | 2018-03-12 19:51:03 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-13 17:09:27 +0300 |
commit | 8dff66cc4195bfaeb8764e7e1b62f2d13f311773 (patch) | |
tree | 117cff0292344a8890a3209f98d87f092e1172c8 /drivers | |
parent | da75e3b6a0292fc926f4773f58c5ff6b8db5a179 (diff) | |
download | linux-8dff66cc4195bfaeb8764e7e1b62f2d13f311773.tar.xz |
ibmvnic: Account for VLAN header length in TX buffers
The extra four bytes of a VLAN packet was throwing off
TX buffer entry values used by the driver. Account for those
bytes when in buffer size and buffer entry calculations
Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/ibm/ibmvnic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index ea9f351eb343..14f00810db33 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -659,7 +659,7 @@ static int init_tx_pools(struct net_device *netdev) if (alloc_long_term_buff(adapter, &tx_pool->long_term_buff, adapter->req_tx_entries_per_subcrq * - adapter->req_mtu)) { + (adapter->req_mtu + VLAN_HLEN))) { release_tx_pools(adapter); return -1; } @@ -1394,9 +1394,9 @@ static int ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) if (tx_pool->tso_index == IBMVNIC_TSO_BUFS) tx_pool->tso_index = 0; } else { - offset = index * adapter->req_mtu; + offset = index * (adapter->req_mtu + VLAN_HLEN); dst = tx_pool->long_term_buff.buff + offset; - memset(dst, 0, adapter->req_mtu); + memset(dst, 0, adapter->req_mtu + VLAN_HLEN); data_dma_addr = tx_pool->long_term_buff.addr + offset; } |