From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 031885B3A for ; Thu, 6 Dec 2018 06:55:13 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Dec 2018 21:55:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,321,1539673200"; d="scan'208";a="281360252" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 05 Dec 2018 21:55:13 -0800 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 5 Dec 2018 21:55:12 -0800 Received: from bgsmsx154.gar.corp.intel.com (10.224.48.47) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 5 Dec 2018 21:55:12 -0800 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.20]) by BGSMSX154.gar.corp.intel.com ([169.254.7.12]) with mapi id 14.03.0415.000; Thu, 6 Dec 2018 11:25:09 +0530 From: "Varghese, Vipin" To: "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Yang, Qiming" , "Li, Xiaoyun" , "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH v2 16/20] net/ice: support basic RX/TX Thread-Index: AQHUitaaZLQCoCTd90O7JG2f+HtaV6VuEZIggALIxwCAAF/EYA== Date: Thu, 6 Dec 2018 05:55:08 +0000 Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2D41FD@BGSMSX101.gar.corp.intel.com> References: <1542956179-80951-1-git-send-email-wenzhuo.lu@intel.com> <1543820821-108122-1-git-send-email-wenzhuo.lu@intel.com> <1543820821-108122-17-git-send-email-wenzhuo.lu@intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C45D8@BGSMSX101.gar.corp.intel.com> <6A0DE07E22DDAD4C9103DF62FEBC09093FE1171D@shsmsx102.ccr.corp.intel.com> In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093FE1171D@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWQyMjQyYjgtODBjMS00MDgxLWI1ZTEtODU1N2ZlM2JmMDYxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQVB3MHFabGRRSVREdHdCZU1yV2pLc1ZzR0g5N2ZtUW1tU2lkRXB5eEVTSHRocW84MHpMQW1FUGpPWkVGRmpYYiJ9 dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 16/20] net/ice: support basic RX/TX 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, 06 Dec 2018 05:55:14 -0000 > > > > snipped > > > +uint16_t > > > +ice_recv_pkts(void *rx_queue, > > > + struct rte_mbuf **rx_pkts, > > > + uint16_t nb_pkts) > > > +{ > > > + struct ice_rx_queue *rxq =3D rx_queue; > > > + volatile union ice_rx_desc *rx_ring =3D rxq->rx_ring; > > > + volatile union ice_rx_desc *rxdp; > > > + union ice_rx_desc rxd; > > > + struct ice_rx_entry *sw_ring =3D rxq->sw_ring; > > > + struct ice_rx_entry *rxe; > > > + struct rte_mbuf *nmb; /* new allocated mbuf */ > > > + struct rte_mbuf *rxm; /* pointer to store old mbuf in SW ring */ > > > + uint16_t rx_id =3D rxq->rx_tail; > > > + uint16_t nb_rx =3D 0; > > > + uint16_t nb_hold =3D 0; > > > + uint16_t rx_packet_len; > > > + uint32_t rx_status; > > > + uint64_t qword1; > > > + uint64_t dma_addr; > > > + uint64_t pkt_flags =3D 0; > > > + uint32_t *ptype_tbl =3D rxq->vsi->adapter->ptype_tbl; > > > + struct rte_eth_dev *dev; > > > + > > > + while (nb_rx < nb_pkts) { > > > + rxdp =3D &rx_ring[rx_id]; > > > + qword1 =3D rte_le_to_cpu_64(rxdp- > > > >wb.qword1.status_error_len); > > > + rx_status =3D (qword1 & ICE_RXD_QW1_STATUS_M) >> > > > + ICE_RXD_QW1_STATUS_S; > > > + > > > + /* Check the DD bit first */ > > > + if (!(rx_status & (1 << ICE_RX_DESC_STATUS_DD_S))) > > > + break; > > > + > > > + /* allocate mbuf */ > > > + nmb =3D rte_mbuf_raw_alloc(rxq->mp); > > > + if (unlikely(!nmb)) { > > > + dev =3D ICE_VSI_TO_ETH_DEV(rxq->vsi); > > > + dev->data->rx_mbuf_alloc_failed++; > > > + break; > > > + } > > > > Should we check if the received packet length is greater than mbug > > pkt_len then we need bulk alloc with n_segs? > We cannot do it here. It's fast path. It hurts performance badly. So we d= o the > check before and choose the right RX function. > Normally by default the n_segs is supported. Maybe I am not clear with this approach, lets assume packet of length 6000 = bytes comes in. The mempool mbuf data size is 2000bytes, hence requires 3 s= egs for storing 6000bytes pkt_len where each data size is 2000bytes. As per your update, as performance is affected for a 6000byte packet you wi= ll pick only 1 segment which 2000bytes and rest are discarded. Is this corr= ect understanding? Snipped.