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 60E7C2952 for ; Thu, 3 Mar 2016 16:47:33 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 03 Mar 2016 07:47:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,532,1449561600"; d="scan'208";a="663243858" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by FMSMGA003.fm.intel.com with ESMTP; 03 Mar 2016 07:47:32 -0800 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by irsmsx110.ger.corp.intel.com (163.33.3.25) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 3 Mar 2016 15:47:27 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.35]) by irsmsx155.ger.corp.intel.com ([169.254.14.201]) with mapi id 14.03.0248.002; Thu, 3 Mar 2016 15:47:26 +0000 From: "Ananyev, Konstantin" To: "Tan, Jianfeng" , "Chen, Jing D" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 05/12] pmd/fm10k: add dev_ptype_info_get implementation Thread-Index: AQHRdRKhmpjSy4uWc0+ftjglgLvr459H3EPg Date: Thu, 3 Mar 2016 15:47:26 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B15DDA@irsmsx105.ger.corp.intel.com> References: <1451544799-70776-1-git-send-email-jianfeng.tan@intel.com> <1456445371-147264-1-git-send-email-jianfeng.tan@intel.com> <1456445371-147264-6-git-send-email-jianfeng.tan@intel.com> <4341B239C0EFF9468EE453F9E9F4604D04453611@shsmsx102.ccr.corp.intel.com> <56D7D3CB.5000004@intel.com> In-Reply-To: <56D7D3CB.5000004@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmY4OWQzNjctMmUyMi00OTQ1LTliMTAtZjY3ZDA2NDg0N2U5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkVIR2pYZlwvaEVqNWVSSHJiQkdJcFdhcmNTVEhLaTdzQVwvekZPS0ROT0RhWT0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 05/12] pmd/fm10k: add dev_ptype_info_get implementation 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: Thu, 03 Mar 2016 15:47:34 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tan, Jianfeng > Sent: Thursday, March 03, 2016 6:04 AM > To: Chen, Jing D; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 05/12] pmd/fm10k: add dev_ptype_info_ge= t implementation >=20 > Hi, >=20 > On 3/3/2016 4:11 AM, Chen, Jing D wrote: > > Hi, > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jianfeng Tan > > Sent: Thursday, February 25, 2016 6:09 PM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH v4 05/12] pmd/fm10k: add dev_ptype_info_get = implementation > > > > Signed-off-by: Jianfeng Tan > > --- > > drivers/net/fm10k/fm10k_ethdev.c | 50 +++++++++++++++++++++++++++++= +++++++++ > > drivers/net/fm10k/fm10k_rxtx.c | 3 +++ > > drivers/net/fm10k/fm10k_rxtx_vec.c | 3 +++ > > 3 files changed, 56 insertions(+) > > > > diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k= _ethdev.c > > index 421266b..429cbdd 100644 > > --- a/drivers/net/fm10k/fm10k_ethdev.c > > +++ b/drivers/net/fm10k/fm10k_ethdev.c > > @@ -1335,6 +1335,55 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev, > > }; > > } > > > > +#ifdef RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE > > +static const uint32_t * > > +fm10k_dev_ptype_info_get(struct rte_eth_dev *dev) { > > + if (dev->rx_pkt_burst =3D=3D fm10k_recv_pkts || > > + dev->rx_pkt_burst =3D=3D fm10k_recv_scattered_pkts) { > > + static uint32_t ptypes[] =3D { > > + /* refers to rx_desc_to_ol_flags() */ > > + RTE_PTYPE_L2_ETHER, > > + RTE_PTYPE_L3_IPV4, > > + RTE_PTYPE_L3_IPV4_EXT, > > + RTE_PTYPE_L3_IPV6, > > + RTE_PTYPE_L3_IPV6_EXT, > > + RTE_PTYPE_L4_TCP, > > + RTE_PTYPE_L4_UDP, > > + RTE_PTYPE_UNKNOWN > > + }; > > + > > + return ptypes; > > + } else if (dev->rx_pkt_burst =3D=3D fm10k_recv_pkts_vec || > > + dev->rx_pkt_burst =3D=3D fm10k_recv_scattered_pkts_vec) { > > + static uint32_t ptypes_vec[] =3D { > > + /* refers to fm10k_desc_to_pktype_v() */ > > + RTE_PTYPE_L3_IPV4, > > + RTE_PTYPE_L3_IPV4_EXT, > > + RTE_PTYPE_L3_IPV6, > > + RTE_PTYPE_L3_IPV6_EXT, > > + RTE_PTYPE_L4_TCP, > > + RTE_PTYPE_L4_UDP, > > + RTE_PTYPE_TUNNEL_GENEVE, > > + RTE_PTYPE_TUNNEL_NVGRE, > > + RTE_PTYPE_TUNNEL_VXLAN, > > + RTE_PTYPE_TUNNEL_GRE, > > + RTE_PTYPE_UNKNOWN > > + }; > > + > > + return ptypes_vec; > > + } > > + > > + return NULL; > > +} > > May I know when " fm10k_dev_ptype_info_get " will be called? In fm10k, = the actual > > Rx/tx func will be decided after port is started. >=20 > Thank you for pointing out this. It's indeed an issue here. And it makes > no difference when all rx functions fill the same ptypes, which, > unfortunately, does not apply to all PMDs. According to my analysis, > only in fm10k's case, we should call ptype_info_get after dev_start(), > and for other PMDs, it can called just after rx_queue_setup. So in all, > I need to add this as a caution in API declaration. Good catch Mark :) I think it should be called after dev_start() for all devices: dev_start() is the usual point where final decision what RX function should be used is made. At least for the PMDs I am aware about (ixgbe, i40e, igb). Konstantin >=20 > __details__ >=20 > eth_cxgbe_dev_init >=20 > eth_igb_dev_init > eth_igbvf_dev_init > eth_igb_rx_init <- eth_igb_start (makes no difference, rx functins fill > same ptypes) > eth_igbvf_rx_init <- igbvf_dev_start (makes no difference, rx functins > fill same ptypes) >=20 > eth_enicpmd_dev_init >=20 > fm10k_set_rx_function <- fm10k_dev_rx_init <- fm10k_dev_start >=20 > eth_i40e_dev_init > i40evf_dev_init > i40e_set_rx_function <- eth_i40e_dev_init > <- i40evf_dev_init > <- i40e_dev_rx_init <- > i40e_dev_rxtx_init <- i40e_dev_start (makes no difference, rx functins > fill same ptypes) > <- i40evf_rx_init <- > i40evf_dev_start (makes no difference, rx functins fill same ptypes) >=20 > ixgbe_set_rx_function <- eth_ixgbe_dev_init > <- ixgbe_dev_rx_init <- > ixgbe_dev_start (makes no difference, rx functions fill same ptypes) > <- ixgbevf_dev_rx_init >=20 > mlx4_rx_queue_setup > mlx4_dev_set_mtu (makes no difference, rx functions fill same ptypes) >=20 > mlx5_rx_queue_setup > mlx5_dev_set_mtu (makes no difference, rx functions fill same ptypes) >=20 > nfp_net_init >=20 > eth_vmxnet3_dev_init >=20 > Thanks, > Jianfeng >=20 >=20