From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
"Azarewicz, PiotrX T" <piotrx.t.azarewicz@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/1] ip_frag: fix creating ipv6 fragment extension header
Date: Mon, 7 Sep 2015 11:24:49 +0000 [thread overview]
Message-ID: <3EB4FA525960D640B5BDFFD6A3D89126478B8203@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB97725836A83DF0@irsmsx105.ger.corp.intel.com>
> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Monday, September 7, 2015 2:23 PM
> To: Dumitrescu, Cristian; Azarewicz, PiotrX T; dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH 1/1] ip_frag: fix creating ipv6 fragment
> extension header
>
>
>
> > -----Original Message-----
> > From: Dumitrescu, Cristian
> > Sent: Monday, September 07, 2015 12:22 PM
> > To: Ananyev, Konstantin; Azarewicz, PiotrX T; dev@dpdk.org
> > Subject: RE: [dpdk-dev] [PATCH 1/1] ip_frag: fix creating ipv6 fragment
> extension header
> >
> >
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ananyev,
> > > Konstantin
> > > Sent: Friday, September 4, 2015 6:51 PM
> > > To: Azarewicz, PiotrX T; dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH 1/1] ip_frag: fix creating ipv6 fragment
> > > extension header
> > >
> > > Hi Piotr,
> > >
> > > > -----Original Message-----
> > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Piotr
> > > > Sent: Wednesday, September 02, 2015 3:13 PM
> > > > To: dev@dpdk.org
> > > > Subject: [dpdk-dev] [PATCH 1/1] ip_frag: fix creating ipv6 fragment
> > > extension header
> > > >
> > > > From: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> > > >
> > > > Previous implementation won't work on every environment. The order
> of
> > > > allocation of bit-fields within a unit (high-order to low-order or
> > > > low-order to high-order) is implementation-defined.
> > > > Solution: used bytes instead of bit fields.
> > >
> > > Seems like right thing to do to me.
> > > Though I think we also should replace:
> > > union {
> > > struct {
> > > uint16_t frag_offset:13; /**< Offset from the start of the
> packet
> > > */
> > > uint16_t reserved2:2; /**< Reserved */
> > > uint16_t more_frags:1;
> > > /**< 1 if more fragments left, 0 if last fragment */
> > > };
> > > uint16_t frag_data;
> > > /**< union of all fragmentation data */
> > > };
> > >
> > > With just:
> > > uint16_t frag_data;
> > > and probably provide macros to read/set fragment_offset and
> more_flags
> > > values.
> > > Otherwise people might keep using the wrong layout.
> > > Konstantin
> > >
> >
> > I agree with your proposal, but wouldn't this be an ABI change? To avoid an
> ABI change, we should probably leave the union?
>
>
> No I don't think it would - the size of the field will remain the same: uint16_t.
> Also if the bit-field is invalid what for to keep it?
> Konstantin
>
Excellent then.
> >
> > > >
> > > > Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> > > > ---
> > > > lib/librte_ip_frag/rte_ipv6_fragmentation.c | 6 ++----
> > > > 1 file changed, 2 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/lib/librte_ip_frag/rte_ipv6_fragmentation.c
> > > b/lib/librte_ip_frag/rte_ipv6_fragmentation.c
> > > > index 0e32aa8..7342421 100644
> > > > --- a/lib/librte_ip_frag/rte_ipv6_fragmentation.c
> > > > +++ b/lib/librte_ip_frag/rte_ipv6_fragmentation.c
> > > > @@ -65,10 +65,8 @@ __fill_ipv6hdr_frag(struct ipv6_hdr *dst,
> > > >
> > > > fh = (struct ipv6_extension_fragment *) ++dst;
> > > > fh->next_header = src->proto;
> > > > - fh->reserved1 = 0;
> > > > - fh->frag_offset = rte_cpu_to_be_16(fofs);
> > > > - fh->reserved2 = 0;
> > > > - fh->more_frags = rte_cpu_to_be_16(mf);
> > > > + fh->reserved1 = 0;
> > > > + fh->frag_data = rte_cpu_to_be_16((fofs & ~IPV6_HDR_FO_MASK) |
> > > mf);
> > > > fh->id = 0;
> > > > }
> > > >
> > > > --
> > > > 1.7.9.5
next prev parent reply other threads:[~2015-09-07 11:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 14:13 Piotr
2015-09-03 15:23 ` Dumitrescu, Cristian
2015-09-04 15:51 ` Ananyev, Konstantin
2015-09-07 11:21 ` Dumitrescu, Cristian
2015-09-07 11:23 ` Ananyev, Konstantin
2015-09-07 11:24 ` Dumitrescu, Cristian [this message]
2015-09-08 14:07 ` [dpdk-dev] [PATCH v2 " Piotr Azarewicz
2015-09-09 10:40 ` Dumitrescu, Cristian
2015-09-09 10:47 ` [dpdk-dev] FW: " Ananyev, Konstantin
2015-09-09 13:39 ` [dpdk-dev] [PATCH v3 " Piotr Azarewicz
2015-09-10 7:09 ` [dpdk-dev] [PATCH v4 " Piotr Azarewicz
2015-09-10 8:35 ` Ananyev, Konstantin
2015-09-10 12:24 ` Dumitrescu, Cristian
2015-10-08 11:24 ` Thomas Monjalon
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=3EB4FA525960D640B5BDFFD6A3D89126478B8203@IRSMSX108.ger.corp.intel.com \
--to=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=piotrx.t.azarewicz@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).