From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 538EC4CA2 for ; Thu, 1 Mar 2018 03:00:05 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2018 18:00:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,407,1515484800"; d="scan'208";a="21125242" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga007.jf.intel.com with ESMTP; 28 Feb 2018 18:00:02 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Feb 2018 17:59:57 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Feb 2018 17:59:57 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by shsmsx102.ccr.corp.intel.com ([169.254.2.124]) with mapi id 14.03.0319.002; Thu, 1 Mar 2018 09:59:55 +0800 From: "Zhang, Qi Z" To: Stephen Hemminger CC: "dev@dpdk.org" , "magnus.karlsson@intei.com" , "Topel, Bjorn" Thread-Topic: [dpdk-dev] [RFC 1/7] net/af_xdp: new PMD driver Thread-Index: AQHTsO4y9LVRj1M4T06SuH3goBKu0qO6n5Hw Date: Thu, 1 Mar 2018 01:59:54 +0000 Message-ID: <039ED4275CED7440929022BC67E706115315D3D0@SHSMSX103.ccr.corp.intel.com> References: <20180227093306.23854-1-qi.z.zhang@intel.com> <20180227093306.23854-2-qi.z.zhang@intel.com> <20180228154522.2fa43379@xeon-e3> In-Reply-To: <20180228154522.2fa43379@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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] [RFC 1/7] net/af_xdp: new PMD driver 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: Thu, 01 Mar 2018 02:00:05 -0000 > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Thursday, March 1, 2018 7:45 AM > To: Zhang, Qi Z > Cc: dev@dpdk.org; magnus.karlsson@intei.com; Topel, Bjorn > > Subject: Re: [dpdk-dev] [RFC 1/7] net/af_xdp: new PMD driver >=20 > On Tue, 27 Feb 2018 17:33:00 +0800 > Qi Zhang wrote: >=20 > > + > > +static uint16_t > > +eth_af_xdp_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) > > +{ > > + struct pmd_internals *internals =3D queue; > > + struct xdp_queue *rxq =3D &internals->rx; > > + struct rte_mbuf *mbuf; > > + unsigned long dropped =3D 0; > > + unsigned long rx_bytes =3D 0; > > + uint16_t count =3D 0; > > + > > + nb_pkts =3D nb_pkts < ETH_AF_XDP_RX_BATCH_SIZE ? > > + nb_pkts : ETH_AF_XDP_RX_BATCH_SIZE; > > + >=20 > Put declarations first. > Why not iterate if nb_pkts is huge? Yes, it is not necessary to only read one batch, just for simple implementa= tion, will be fixed. >=20 > > + struct xdp_desc descs[ETH_AF_XDP_RX_BATCH_SIZE]; > > + void *indexes[ETH_AF_XDP_RX_BATCH_SIZE]; > > + int rcvd, i; > > + /* fill rx ring */ > > + if (rxq->num_free >=3D ETH_AF_XDP_RX_BATCH_SIZE) { >=20 > Blank line after declarations before code please.