From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 4FE107E80 for ; Mon, 20 Oct 2014 15:43:14 +0200 (CEST) Received: by mail-wg0-f51.google.com with SMTP id b13so5430349wgh.34 for ; Mon, 20 Oct 2014 06:51:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=eVa4SBlm6x269rywTtZ4E3MOJ0h2JeCAwUJoecEfdyI=; b=lcywLjGQMMXVqBnA/aeSg66n0V+bkgp/3T0mJiDwzvljORdgBfR7xSqced6D5zCKbw Fy75iERlxkvrwcldWMnIxyugiNPWJNZ6X4p6wrESAtq1Mn85OlNzRaxEGklD0fzjNHaV mWzGPARbXTSeScOc5GFbz9coeEs2pYYncyCL+JyZDcTx7iZ6iZng2DsFspc90qxQJw5M Kg7HMUzd5FSBFG1g46+sm6qp62pi0FQfZPqObvPzqZ3vLhgSBBzdyE1QjYZncoU703x8 etGbtIV8VP/mvNp/nLKHoGvtLRaz/23vL8436wIrRIGLURKCwt8OPwadEPhRZKiqhDoO tBUw== X-Gm-Message-State: ALoCoQkro9KS6xagfwXRZ/gZmpyTPeLvk5feIqSQawY39nUpgQzDaVvSYRJ1QL+5/c3faUAT5+nj X-Received: by 10.180.221.36 with SMTP id qb4mr20236305wic.46.1413813085552; Mon, 20 Oct 2014 06:51:25 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id w10sm11980386wje.10.2014.10.20.06.51.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Oct 2014 06:51:24 -0700 (PDT) From: Thomas Monjalon To: "Walukiewicz, Miroslaw" Date: Mon, 20 Oct 2014 15:51:09 +0200 Message-ID: <2828270.80eTSv21yY@xps13> Organization: 6WIND User-Agent: KMail/4.14.1 (Linux/3.16.4-1-ARCH; KDE/4.14.1; x86_64; ; ) In-Reply-To: <7C4248CAE043B144B1CD242D275626532FDE0709@IRSMSX104.ger.corp.intel.com> References: <20141020094252.14456.58891.stgit@gklab-18-011.igk.intel.com> <1675767.ObibVazTHA@xps13> <7C4248CAE043B144B1CD242D275626532FDE0709@IRSMSX104.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] pmd: Add generic support for TCP TSO (Transmit Segmentation Offload) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2014 13:43:14 -0000 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