DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: Frederico Cadete <Frederico.Cadete-ext@oneaccess-net.com>,
	"yuanhan.liu@linux.intel.com" <yuanhan.liu@linux.intel.com>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Cc: John Sucaet <John.Sucaet@oneaccess-net.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] bug: virtio PMD sends malformed packets for 32-bit processes on 64-bit kernel
Date: Wed, 28 Jun 2017 02:55:06 +0000	[thread overview]
Message-ID: <ED26CBA2FAD1BF48A8719AEF02201E365121ACB7@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1498570322.4049.73.camel@oneaccess-net.com>



> -----Original Message-----
> From: Frederico Cadete [mailto:Frederico.Cadete-ext@oneaccess-net.com]
> Sent: Tuesday, June 27, 2017 9:32 PM
> To: yuanhan.liu@linux.intel.com; maxime.coquelin@redhat.com; Tan,
> Jianfeng
> Cc: John Sucaet; dev@dpdk.org
> Subject: Re: bug: virtio PMD sends malformed packets for 32-bit processes
> on 64-bit kernel
...
> > >
> > > In that case I guess that the issue is that the conversion is
> > > assuming
> > > that on 32-bit apps only 4 bytes are necessary, even in the case of
> > > virtio-pci and 64-bit physaddr.
> > >
> > > Would you say that this is how vring_desc's addr should be filled?
> > >
> > >              |   32-bit app          | 64-bit app             |
> > > ------------+-----------------------+ -----------------------+
> > > virtio-pci  | buf_physaddr, 8 bytes | buf_physaddr, 8 bytes  |
> > > virtio-user | buf_addr, 4 bytes     | buf_addr, 8 bytes      |
> > >
> > > I believe that the issue is that after commit 260aae9a, for virtio-
> > > pci
> > > and 32-bit app it is taking 4 bytes instead of 8.
> > Aha, yes, that's the issue! Great analysis. After Bruce's commit
> > 586ec205bcbbb ("mbuf: fix 64-bit address alignment in 32-bit
> > builds"),
> > we can fix this issue by fetching 8 bytes at all cases. But
> > unfortunately, that commit is not back-ported to v17.02.1.
> 
> I don't see how changing the alignment of buf_physaddr allows fetching
> 8 bytes in all cases, even in the case of 32-bit virtio-user where what
> we need are 4 bytes from buf_addr. Am I missing something?

After that, | 4-byte buf_addr | 4-byte padding | 8-byte buf_physaddr| for 32-bit system, right?

I would expect 4-byte padding are all-zero. So we can just fetch all first 8-byte outside.


> 
> Besides, Bruce's patch changes the memory layout of rte_mbuf. A priori
> that's not the kind I would like to find in an update of a stable
> branch :)

Yes, you are right. Stable branches won't accept such change.

> 
> >
> > I wonder if we can back-port Bruce's patch with a new patch to fix
> > this
> > problem?
> >
> > Any opinions from others?
> >
> > Thanks,
> > Jianfeng
> >
> > >
> > >
> > > >
> > > > >
> > > > > Any suggestions on if and how this could be fixed?
> > > > >
> > > > > Meanwhile, the bug affects dpdk 17.05, 17.02.1 and master.
> > > > > Users
> > > > > not
> > > > > requiring virtio-user support can avoid it by setting
> > > > > CONFIG_VIRTIO_USER=n during compilation.
> > > > >
> > > > > Best regards,
> > > > > Frederico Cadete

      reply	other threads:[~2017-06-28  2:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22 14:58 Frederico Cadete
2017-06-23 15:36 ` Tan, Jianfeng
2017-06-26  8:14   ` Frederico Cadete
2017-06-26 10:15     ` Tan, Jianfeng
2017-06-27 13:32       ` Frederico Cadete
2017-06-28  2:55         ` Tan, Jianfeng [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=ED26CBA2FAD1BF48A8719AEF02201E365121ACB7@SHSMSX103.ccr.corp.intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=Frederico.Cadete-ext@oneaccess-net.com \
    --cc=John.Sucaet@oneaccess-net.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=yuanhan.liu@linux.intel.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).