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 48EFA2BB5 for ; Tue, 16 Jan 2018 12:43:08 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2018 03:43:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,368,1511856000"; d="scan'208";a="10500738" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga008.jf.intel.com with ESMTP; 16 Jan 2018 03:43:06 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 16 Jan 2018 03:42:46 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 16 Jan 2018 03:42:45 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Tue, 16 Jan 2018 19:42:44 +0800 From: "Wang, Xiao W" To: Olivier Matz CC: "yliu@fridaylinux.org" , "thomas@monjalon.net" , "Bie, Tiwei" , "dev@dpdk.org" , "stephen@networkplumber.org" , "maxime.coquelin@redhat.com" Thread-Topic: [dpdk-dev] [PATCH v10 3/5] net: add a helper for making RARP packet Thread-Index: AQHTibHnzBQFt0UasEaReUsWAXIo76N1t6gAgACPExD//404AIAAiCYQgAAM7sA= Date: Tue, 16 Jan 2018 11:42:43 +0000 Message-ID: References: <20180109160918.29173-4-xiao.w.wang@intel.com> <20180110012356.57456-1-xiao.w.wang@intel.com> <20180110012356.57456-4-xiao.w.wang@intel.com> <20180116090122.fsvqrgzu5rjqcgre@platinum> <20180116104238.n4uzmby46zlyogjn@platinum> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2YxOTQ4MTAtNWVhZC00OTE1LTgzYTItZTMxYTJmYjM0YTFiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJ3RmxNdmZ1SnAwOEtweGhMWUlCejlmcjh4NDRnUGJObTlsUmhOb0VPTHg1MXVLaXB5TGxoa2M4Z1E2QTVSMGVtIn0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v10 3/5] net: add a helper for making RARP packet X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 11:43:08 -0000 > -----Original Message----- > From: Wang, Xiao W > Sent: Tuesday, January 16, 2018 7:03 PM > To: 'Olivier Matz' > Cc: yliu@fridaylinux.org; thomas@monjalon.net; Bie, Tiwei > ; dev@dpdk.org; stephen@networkplumber.org; > maxime.coquelin@redhat.com > Subject: RE: [dpdk-dev] [PATCH v10 3/5] net: add a helper for making RARP > packet >=20 > Hi Olivier, >=20 > > -----Original Message----- > > From: Olivier Matz [mailto:olivier.matz@6wind.com] > > Sent: Tuesday, January 16, 2018 6:43 PM > > To: Wang, Xiao W > > Cc: yliu@fridaylinux.org; thomas@monjalon.net; Bie, Tiwei > > ; dev@dpdk.org; stephen@networkplumber.org; > > maxime.coquelin@redhat.com > > Subject: Re: [dpdk-dev] [PATCH v10 3/5] net: add a helper for making RA= RP > > packet > > > > Hi Xiao, > > > > On Tue, Jan 16, 2018 at 09:43:43AM +0000, Wang, Xiao W wrote: > > > Hi Olivier, > > > > You can also use rte_pktmbuf_append() to check for the tailroom and > > > > update data_len/pkt_len: > > > > > > > > m =3D rte_pktmbuf_alloc(); >=20 > I just realized that if we let this function to allocate mbuf, it may res= trict this > api's applicability. > E.g. the caller just has a mbuf, without a mempool. > How do you think? >=20 > > > > if (m =3D=3D NULL) > > > > return NULL; > > > > eth_hdr =3D rte_pktmbuf_append(m, RARP_PKT_SIZE); > > > > > > When data_len is not enough, we need to rte_pktmbuf_append(m, > > RARP_PKT_SIZE - m->data_len); > > > > Sorry, I don't get your point here. >=20 > I mean we just need to extend the data_len by "RARP_PKT_SIZE - m- > >data_len" when the room is not big enough. OK, in your sample code, you rte_pktmbuf_alloc() a mbuf, it's reset already= , so we just append RARP_PKT_SIZE. I got you~ For the mbuf allocation, we can let this function do allocation and content= filling. If the app needs special need, e.g. chained mbuf, then let the app fill it by itself. >=20 > BRs, > Xiao