DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/netvsc: fix seg fault during transmit
@ 2020-07-29 13:58 Chas Williams
  2020-07-30 15:13 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Chas Williams @ 2020-07-29 13:58 UTC (permalink / raw)
  To: dev; +Cc: sthemmin, kys, haiyangz, longli, Chas Williams, stable

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/netvsc: fix seg fault during transmit
  2020-07-29 13:58 [dpdk-dev] [PATCH] net/netvsc: fix seg fault during transmit Chas Williams
@ 2020-07-30 15:13 ` Stephen Hemminger
  2020-07-30 17:31   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2020-07-30 15:13 UTC (permalink / raw)
  To: Chas Williams; +Cc: dev, sthemmin, kys, haiyangz, longli, stable

On Wed, 29 Jul 2020 09:58:44 -0400
Chas Williams <3chas3@gmail.com> wrote:

> 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>

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/netvsc: fix seg fault during transmit
  2020-07-30 15:13 ` Stephen Hemminger
@ 2020-07-30 17:31   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2020-07-30 17:31 UTC (permalink / raw)
  To: Stephen Hemminger, Chas Williams
  Cc: dev, sthemmin, kys, haiyangz, longli, stable

On 7/30/2020 4:13 PM, Stephen Hemminger wrote:
> On Wed, 29 Jul 2020 09:58:44 -0400
> Chas Williams <3chas3@gmail.com> wrote:
> 
>> 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>
> 
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> 

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-30 17:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 13:58 [dpdk-dev] [PATCH] net/netvsc: fix seg fault during transmit Chas Williams
2020-07-30 15:13 ` Stephen Hemminger
2020-07-30 17:31   ` Ferruh Yigit

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).