DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chas Williams <3chas3@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [dpdk-dev] [RFC v2] net: fix rte_vlan_insert with shared mbuf
Date: Sat, 6 Apr 2019 19:11:43 -0400	[thread overview]
Message-ID: <c337e8d0-2708-9e39-14c7-dc734aa5d862@gmail.com> (raw)
Message-ID: <20190406231143.gOaqn-ot813VZ9AC2JVnT3hZg_FMnl71lxUuIgz_qTs@z> (raw)
In-Reply-To: <20190404165449.0f7ea879@shemminger-XPS-13-9360>



On 4/4/19 7:54 PM, Stephen Hemminger wrote:
> On Sat, 30 Mar 2019 08:41:33 -0400
> Chas Williams <3chas3@gmail.com> wrote:
> 
>> Unfortunately, I think the complete fix is more complicated than this.
>> Drivers that use rte_vlan_insert don't anticipate that the mbuf might
>> change and that (hardware) transmit can fail.
>>
>> They make a copy of the mbuf pointer from the incoming transmit list
>> and don't update the original if rte_vlan_insert creates a new mbuf.
>> If transmit fails, the application needs to be the given the new mbuf
>> for re-transmission or freeing.
>>
>> On 3/28/19 4:53 PM, Stephen Hemminger wrote:
>>> If mbuf is shared then rte_vlan_insert() would clobber the original
>>> Ethernet header. The changed version handles this by getting
>>> an mbuf that will hold the new Ethernet and VLAN header followed
>>> by another mbuf (cloned) for the data.
>>>
>>> Fixes: c974021a5949 ("ether: add soft vlan encap/decap")
>>> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> 
> The virtio driver is buggy, it saves original mbuf and doesn't handle
> rewrite. Dpaa2 is fine, should never happen since it checks refcnt etc.
> Netvsc PMD is using this on rx path and is safe.
> AF_packet PMD should work fine as well.

af_packet is broken as well. It needs to defer rte_vlan_insert until
after it gets the next incoming frame.  Otherwise the break can exit
the loop early.

> So virtio is the one that needs fixing

I agree with this.

  parent reply	other threads:[~2019-04-06 23:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-26 19:15 [dpdk-dev] [PATCH] " Stephen Hemminger
2019-03-26 19:15 ` Stephen Hemminger
2019-03-26 22:38 ` Chas Williams
2019-03-26 22:38   ` Chas Williams
2019-03-27 15:18   ` Stephen Hemminger
2019-03-27 15:18     ` Stephen Hemminger
2019-03-27 15:31     ` Chas Williams
2019-03-27 15:31       ` Chas Williams
2019-03-28 14:04       ` Ferruh Yigit
2019-03-28 14:04         ` Ferruh Yigit
2019-03-28 20:53         ` [dpdk-dev] [RFC v2] " Stephen Hemminger
2019-03-28 20:53           ` Stephen Hemminger
2019-03-30 12:41           ` Chas Williams
2019-03-30 12:41             ` Chas Williams
2019-04-04 23:54             ` Stephen Hemminger
2019-04-04 23:54               ` Stephen Hemminger
2019-04-06 23:11               ` Chas Williams [this message]
2019-04-06 23:11                 ` Chas Williams
2019-04-12 16:35           ` Ferruh Yigit
2019-04-12 16:35             ` Ferruh Yigit
2019-07-04 18:40             ` 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=c337e8d0-2708-9e39-14c7-dc734aa5d862@gmail.com \
    --to=3chas3@gmail.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.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).