netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, jallen@linux.vnet.ibm.com,
	nfont@linux.vnet.ibm.com,
	Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Subject: [PATCH net-next v2 2/4] ibmvnic: Account for VLAN header length in TX buffers
Date: Mon, 12 Mar 2018 11:51:03 -0500	[thread overview]
Message-ID: <1520873465-23312-3-git-send-email-tlfalcon@linux.vnet.ibm.com> (raw)
In-Reply-To: <1520873465-23312-1-git-send-email-tlfalcon@linux.vnet.ibm.com>

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>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index ea9f351..14f0081 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;
 	}
 
-- 
2.7.5

  parent reply	other threads:[~2018-03-12 16:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12 16:51 [PATCH net-next v2 0/4] ibmvnic: Fix VLAN and other device errata Thomas Falcon
2018-03-12 16:51 ` [PATCH net-next v2 1/4] ibmvnic: Account for VLAN tag in L2 Header descriptor Thomas Falcon
2018-03-12 16:51 ` Thomas Falcon [this message]
2018-03-12 16:51 ` [PATCH net-next v2 3/4] ibmvnic: Pad small packets to minimum MTU size Thomas Falcon
2018-03-13  7:15   ` kbuild test robot
2018-03-12 16:51 ` [PATCH net-next v2 4/4] ibmvnic: Handle TSO backing device errata Thomas Falcon
2018-03-12 16:56 ` [PATCH net-next v2 0/4] ibmvnic: Fix VLAN and other " David Miller
2018-03-12 22:07   ` Thomas Falcon
2018-03-13  0:59     ` David Miller
2018-03-13  1:00       ` Thomas Falcon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1520873465-23312-3-git-send-email-tlfalcon@linux.vnet.ibm.com \
    --to=tlfalcon@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=jallen@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=nfont@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).