From: Chas Williams <3chas3@gmail.com>
To: dev@dpdk.org
Cc: sthemmin@microsoft.com, kys@microsoft.com,
haiyangz@microsoft.com, longli@microsoft.com,
Chas Williams <3chas3@gmail.com>,
stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/netvsc: fix seg fault during transmit
Date: Wed, 29 Jul 2020 09:58:44 -0400 [thread overview]
Message-ID: <20200729135844.16689-1-3chas3@gmail.com> (raw)
Commit cc0251813277 ("net/netvsc: split send buffers from Tx
descriptors") changed the way that transmit descriptors are
allocated. They come from a single pool instead of being
individually attached to each mbuf. To find the IOVA, you need
to calculate the offset from the base of the pool.
Fixes: cc0251813277 ("net/netvsc: split send buffers from Tx descriptors")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <3chas3@gmail.com>
---
drivers/net/netvsc/hn_rxtx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index 86a4c0d74..0428c586a 100644
--- a/drivers/net/netvsc/hn_rxtx.c
+++ b/drivers/net/netvsc/hn_rxtx.c
@@ -1421,11 +1421,12 @@ static int hn_xmit_sg(struct hn_tx_queue *txq,
hn_rndis_dump(txd->rndis_pkt);
/* pass IOVA of rndis header in first segment */
- addr = rte_malloc_virt2iova(txd->rndis_pkt);
+ addr = rte_malloc_virt2iova(txq->tx_rndis);
if (unlikely(addr == RTE_BAD_IOVA)) {
PMD_DRV_LOG(ERR, "RNDIS transmit can not get iova");
return -EINVAL;
}
+ addr = addr + ((char *)txd->rndis_pkt - (char *)txq->tx_rndis);
sg[0].page = addr / PAGE_SIZE;
sg[0].ofs = addr & PAGE_MASK;
--
2.21.3
next reply other threads:[~2020-07-29 13:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-29 13:58 Chas Williams [this message]
2020-07-30 15:13 ` Stephen Hemminger
2020-07-30 17:31 ` Ferruh Yigit
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=20200729135844.16689-1-3chas3@gmail.com \
--to=3chas3@gmail.com \
--cc=dev@dpdk.org \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=longli@microsoft.com \
--cc=stable@dpdk.org \
--cc=sthemmin@microsoft.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).