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 8899C2B94 for ; Thu, 3 Mar 2016 07:03:58 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 02 Mar 2016 22:03:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,531,1449561600"; d="scan'208";a="757205708" Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.193]) ([10.239.67.193]) by orsmga003.jf.intel.com with ESMTP; 02 Mar 2016 22:03:58 -0800 To: "Chen, Jing D" , "dev@dpdk.org" 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> From: "Tan, Jianfeng" Message-ID: <56D7D3CB.5000004@intel.com> Date: Thu, 3 Mar 2016 14:03:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <4341B239C0EFF9468EE453F9E9F4604D04453611@shsmsx102.ccr.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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 06:03:59 -0000 Hi, 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 == fm10k_recv_pkts || > + dev->rx_pkt_burst == fm10k_recv_scattered_pkts) { > + static uint32_t ptypes[] = { > + /* 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 == fm10k_recv_pkts_vec || > + dev->rx_pkt_burst == fm10k_recv_scattered_pkts_vec) { > + static uint32_t ptypes_vec[] = { > + /* 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. 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. __details__ eth_cxgbe_dev_init 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) eth_enicpmd_dev_init fm10k_set_rx_function <- fm10k_dev_rx_init <- fm10k_dev_start 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) 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 mlx4_rx_queue_setup mlx4_dev_set_mtu (makes no difference, rx functions fill same ptypes) mlx5_rx_queue_setup mlx5_dev_set_mtu (makes no difference, rx functions fill same ptypes) nfp_net_init eth_vmxnet3_dev_init Thanks, Jianfeng