From: Tom Lendacky <thomas.lendacky@amd.com>
To: <netdev@vger.kernel.org>
Cc: David Miller <davem@davemloft.net>
Subject: [PATCH net v2 2/2] amd-xgbe: Associate Tx SKB with proper ring descriptor
Date: Wed, 3 Dec 2014 08:36:42 -0600 [thread overview]
Message-ID: <20141203143642.25084.29478.stgit@tlendack-t1.amdoffice.net> (raw)
In-Reply-To: <20141203143630.25084.91079.stgit@tlendack-t1.amdoffice.net>
The SKB for a Tx packet is associated with an xgbe_ring_data structure
in the xgbe_map_tx_skb function. However, it is being saved in the
structure after the last structure used when the SKB is mapped. Use
the last used structure to save the SKB value.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
drivers/net/ethernet/amd/xgbe/xgbe-desc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-desc.c b/drivers/net/ethernet/amd/xgbe/xgbe-desc.c
index 43b7d2e..b15551b 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-desc.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-desc.c
@@ -480,7 +480,11 @@ static int xgbe_map_tx_skb(struct xgbe_channel *channel, struct sk_buff *skb)
}
}
- /* Save the skb address in the last entry */
+ /* Save the skb address in the last entry. We always have some data
+ * that has been mapped so rdata is always advanced past the last
+ * piece of mapped data - use the entry pointed to by cur_index - 1.
+ */
+ rdata = XGBE_GET_DESC_DATA(ring, cur_index - 1);
rdata->skb = skb;
/* Save the number of descriptor entries used */
prev parent reply other threads:[~2014-12-03 14:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 14:36 [PATCH net v2 0/2] amd-xgbe: AMD XGBE driver fixes 2014-12-02 Tom Lendacky
2014-12-03 14:36 ` [PATCH net v2 1/2] amd-xgbe: Do not clear interrupt indicator Tom Lendacky
2014-12-03 14:36 ` Tom Lendacky [this message]
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=20141203143642.25084.29478.stgit@tlendack-t1.amdoffice.net \
--to=thomas.lendacky@amd.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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