From: "Zhang, Yuying" <yuying.zhang@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, Maxime Coquelin <maxime.coquelin@redhat.com>,
"Xia, Chenbo" <chenbo.xia@intel.com>,
dpdk stable <stable@dpdk.org>,
"stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: RE: [PATCH v1] net/vhost: clear data of packet mbuf after sending pkts
Date: Wed, 2 Mar 2022 08:58:49 +0000 [thread overview]
Message-ID: <DM6PR11MB351692D09534DFDC90F84E928E039@DM6PR11MB3516.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAJFAV8y5so5ML0_E7e1npc8jD=_P+83t4inXk53aVxhAkim9_g@mail.gmail.com>
Hi Marchand,
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Tuesday, March 1, 2022 5:48 PM
> To: Zhang, Yuying <yuying.zhang@intel.com>
> Cc: dev <dev@dpdk.org>; Maxime Coquelin <maxime.coquelin@redhat.com>;
> Xia, Chenbo <chenbo.xia@intel.com>; dpdk stable <stable@dpdk.org>
> Subject: Re: [PATCH v1] net/vhost: clear data of packet mbuf after sending pkts
>
> On Tue, Mar 1, 2022 at 10:02 AM Zhang, Yuying <yuying.zhang@intel.com>
> wrote:
...
> >
> > eth_vhost_tx() frees the packet mbuf back into its original mempool every
> time after a packet sent without clearing the data field.
> > Then packet transmit function will get bulk directly without reset. New
> generated packet contains old data of previous packet. This is wrong.
>
> With the proposed patch, if the mbuf refcnt is != 0, you are shooting the data
> while some other part of the application might be needing it.
>
> Plus, there should be no expectation about a mbuf data content when retrieving
> one from a mempool.
> The only bytes that are guaranteed to be initialised by the mbuf API are its
> metadata.
>
>
> If there is an issue somewhere in dpdk where the mbuf data content is expected
> to be 0 on allocation, please point at it.
> Or share the full test that failed.
According to the test_plan guide of dpdk (https://doc.dpdk.org/dts/test_plans/loopback_virtio_user_server_mode_test_plan.html),
Test Case 13 (loopback packed ring all path payload check test using server mode and multi-queues), the payload of each packet must be the same.
The packet of first stream is initialized value 0. Then this packet is put back into mempool(actually, the local cache of the core).
The packet of rest stream is got from local_cache directly and contains the first packet's header data in the payload. Therefore, the payload of the packets
are different.
>
>
> --
> David Marchand
next prev parent reply other threads:[~2022-03-02 8:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 7:28 Yuying Zhang
2022-03-01 8:38 ` Ling, WeiX
2022-03-01 8:43 ` David Marchand
2022-03-01 9:02 ` Zhang, Yuying
2022-03-01 9:47 ` David Marchand
2022-03-01 17:05 ` Stephen Hemminger
2022-03-02 8:58 ` Zhang, Yuying [this message]
2022-03-03 6:49 ` Xia, Chenbo
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=DM6PR11MB351692D09534DFDC90F84E928E039@DM6PR11MB3516.namprd11.prod.outlook.com \
--to=yuying.zhang@intel.com \
--cc=chenbo.xia@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).