From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CBE045A31 for ; Tue, 8 Sep 2015 01:22:15 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 07 Sep 2015 16:21:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,487,1437462000"; d="scan'208";a="764300923" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga001.jf.intel.com with ESMTP; 07 Sep 2015 16:21:50 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.51]) by IRSMSX152.ger.corp.intel.com ([169.254.6.220]) with mapi id 14.03.0224.002; Tue, 8 Sep 2015 00:21:49 +0100 From: "Ananyev, Konstantin" To: =?iso-8859-1?Q?Simon_K=E5gstr=F6m?= , "dev@dpdk.org" Thread-Topic: [PATCH v2] mbuf/ip_frag: Move mbuf chaining to common code Thread-Index: AQHQ6WJyu9dOoHLyNkKQrAkIM5z28J4w/MMA///0rICAAMKMAA== Date: Mon, 7 Sep 2015 23:21:49 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836A841A7@irsmsx105.ger.corp.intel.com> References: <20150831144110.4a7afa27@miho> <55ED3D9A.7070607@6wind.com> <2601191342CEEE43887BDE71AB97725836A83CBA@irsmsx105.ger.corp.intel.com> <55ED5A6A.1000803@6wind.com> <55ED69BA.4010803@netinsight.net> <20150907134324.2d418bd4@miho> <2601191342CEEE43887BDE71AB97725836A83E71@irsmsx105.ger.corp.intel.com> <55ED85EB.2030102@netinsight.net> In-Reply-To: <55ED85EB.2030102@netinsight.net> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] mbuf/ip_frag: Move mbuf chaining to common code 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, 07 Sep 2015 23:22:16 -0000 > -----Original Message----- > From: Simon K=E5gstr=F6m [mailto:simon.kagstrom@netinsight.net] > Sent: Monday, September 07, 2015 1:41 PM > To: Ananyev, Konstantin; dev@dpdk.org > Cc: Olivier MATZ; Zhang, Helin; Gonzalez Monroy, Sergio; Burakov, Anatoly > Subject: Re: [PATCH v2] mbuf/ip_frag: Move mbuf chaining to common code >=20 > On 2015-09-07 14:32, Ananyev, Konstantin wrote: > >> +static inline int rte_pktmbuf_chain(struct rte_mbuf *head, struct rte= _mbuf *tail) > >> +{ > >> + struct rte_mbuf *cur_tail; > >> + > >> + /* Check for number-of-segments-overflow */ > >> + if (head->nb_segs + tail->nb_segs >=3D sizeof(head->nb_segs) << 8) > >> + return -EOVERFLOW; > > > > Would probably be better 'sizeof(head->nb_segs) << CHAR_BIT', or even j= ust: ' > UINT8_MAX'. > > Konstantin >=20 > Thanks. I got it wrong anyway, what I wanted was to be able to handle > the day when nb_segs changes to a 16-bit number, but then it should Probably just me, but I can't foresee the situation when we would need to = increase nb_segs to 16 bits. Looks like an overkill to me. Konstantin > really be >=20 > ... >=3D 1 << (sizeof(head->nb_segs) * 8) >=20 > anyway. I'll fix that and also add a warning that the implementation > will do a linear search to find the tail entry. >=20 > // Simon