All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: "Walukiewicz,
	Miroslaw"
	<Miroslaw.Walukiewicz-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH] pmd: Add generic support for TCP TSO (Transmit Segmentation Offload)
Date: Mon, 20 Oct 2014 15:51:09 +0200	[thread overview]
Message-ID: <2828270.80eTSv21yY@xps13> (raw)
In-Reply-To: <7C4248CAE043B144B1CD242D275626532FDE0709-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>

2014-10-20 12:45, Walukiewicz, Miroslaw:
> > >  	/* fields to support TX offloads */
> > > -	union {
> > > -		uint16_t l2_l3_len; /**< combined l2/l3 lengths as single var
> > */
> > > -		struct {
> > > -			uint16_t l3_len:9;      /**< L3 (IP) Header Length. */
> > > -			uint16_t l2_len:7;      /**< L2 (MAC) Header Length.
> > */
> > > +	/* two bytes - l2/l3 len for compatibility (endian issues)
> > > +	 * two bytes - reseved for alignment
> > > +	 * two bytes - l4 len (TCP/UDP) header len
> > > +	 * two bytes - TCP tso segment size
> > > + 	 */
> > > +	struct {
> > > +		union {
> > > +			uint16_t l2_l3_len; /**< combined l2/l3 len */
> > > +			struct {
> > > +				uint16_t l3_len:9; /**< L3 (IP) Header */
> > > +				uint16_t l2_len:7; /**< L2 (MAC) Header */
> > > +			};
> > >  		};
> > 
> > Why nesting these fields in an anonymous structure?
> 
> I want to keep a source compatibility with non-TSO applications using that
> field for example IP checksum computing by NIC. 
> Keeping this structure anonymous I do not require changes in old
> applications that do not need TSO support.
> 
> The second argument is that in original patch extending the rte_mbuf to 128
> bytes made by Bruce the author made this structure anonymous and I follow
> this assumption too.

Excuse me, maybe I missed something, but I still don't understand why you are
embedding the union into a struct?

-- 
Thomas

  parent reply	other threads:[~2014-10-20 13:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20  9:42 [PATCH] pmd: Add generic support for TCP TSO (Transmit Segmentation Offload) miroslaw.walukiewicz-ral2JQCrhuEAvxtiuMwx3w
     [not found] ` <20141020094252.14456.58891.stgit-tpi2AMbES9qir5R1eWH9hGt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2014-10-20 11:30   ` Thomas Monjalon
2014-10-20 12:45     ` Walukiewicz, Miroslaw
     [not found]       ` <7C4248CAE043B144B1CD242D275626532FDE0709-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-10-20 13:51         ` Thomas Monjalon [this message]
2014-10-20 14:03           ` Walukiewicz, Miroslaw

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=2828270.80eTSv21yY@xps13 \
    --to=thomas.monjalon-pdr9zngts4eavxtiumwx3w@public.gmane.org \
    --cc=Miroslaw.Walukiewicz-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.