From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1C4D32617 for ; Thu, 25 Feb 2016 07:43:07 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 24 Feb 2016 22:43:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,497,1449561600"; d="scan'208";a="658982017" Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.193]) ([10.239.67.193]) by FMSMGA003.fm.intel.com with ESMTP; 24 Feb 2016 22:43:07 -0800 To: "Ananyev, Konstantin" , "dev@dpdk.org" References: <1451544799-70776-1-git-send-email-jianfeng.tan@intel.com> <1452836759-63540-1-git-send-email-jianfeng.tan@intel.com> <1452836759-63540-8-git-send-email-jianfeng.tan@intel.com> <2601191342CEEE43887BDE71AB97725836AE6159@irsmsx105.ger.corp.intel.com> From: "Tan, Jianfeng" Message-ID: <56CEA278.30900@intel.com> Date: Thu, 25 Feb 2016 14:43:04 +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: <2601191342CEEE43887BDE71AB97725836AE6159@irsmsx105.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 07/12] pmd/ixgbe: 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, 25 Feb 2016 06:43:08 -0000 Hi Konstantin, On 1/15/2016 10:50 PM, Ananyev, Konstantin wrote: > >> -----Original Message----- >> From: Tan, Jianfeng >> Sent: Friday, January 15, 2016 5:46 AM >> To: dev@dpdk.org >> Cc: Zhang, Helin; Ananyev, Konstantin; Tan, Jianfeng >> Subject: [PATCH v2 07/12] pmd/ixgbe: add dev_ptype_info_get implementation >> >> Signed-off-by: Jianfeng Tan >> --- >> drivers/net/ixgbe/ixgbe_ethdev.c | 38 ++++++++++++++++++++++++++++++++++++++ >> drivers/net/ixgbe/ixgbe_ethdev.h | 2 ++ >> drivers/net/ixgbe/ixgbe_rxtx.c | 5 ++++- >> 3 files changed, 44 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c >> index 4c4c6df..b3ae7b2 100644 >> --- a/drivers/net/ixgbe/ixgbe_ethdev.c >> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c >> @@ -166,6 +166,7 @@ static int ixgbe_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev, >> uint8_t is_rx); >> static void ixgbe_dev_info_get(struct rte_eth_dev *dev, >> struct rte_eth_dev_info *dev_info); >> +static int ixgbe_dev_ptype_info_get(struct rte_eth_dev *dev, uint32_t ptypes[]); >> static void ixgbevf_dev_info_get(struct rte_eth_dev *dev, >> struct rte_eth_dev_info *dev_info); >> static int ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); >> @@ -428,6 +429,7 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = { >> .xstats_reset = ixgbe_dev_xstats_reset, >> .queue_stats_mapping_set = ixgbe_dev_queue_stats_mapping_set, >> .dev_infos_get = ixgbe_dev_info_get, >> + .dev_ptype_info_get = ixgbe_dev_ptype_info_get, >> .mtu_set = ixgbe_dev_mtu_set, >> .vlan_filter_set = ixgbe_vlan_filter_set, >> .vlan_tpid_set = ixgbe_vlan_tpid_set, >> @@ -512,6 +514,7 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = { >> .xstats_reset = ixgbevf_dev_stats_reset, >> .dev_close = ixgbevf_dev_close, >> .dev_infos_get = ixgbevf_dev_info_get, >> + .dev_ptype_info_get = ixgbe_dev_ptype_info_get, >> .mtu_set = ixgbevf_dev_set_mtu, >> .vlan_filter_set = ixgbevf_vlan_filter_set, >> .vlan_strip_queue_set = ixgbevf_vlan_strip_queue_set, >> @@ -2829,6 +2832,41 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) >> dev_info->flow_type_rss_offloads = IXGBE_RSS_OFFLOAD_ALL; >> } >> >> +static int >> +ixgbe_dev_ptype_info_get(struct rte_eth_dev *dev, uint32_t ptypes[]) >> +{ >> + int num = 0; >> + >> + if (dev->rx_pkt_burst == ixgbe_recv_pkts || >> + dev->rx_pkt_burst == ixgbe_recv_pkts_lro_single_alloc || >> + dev->rx_pkt_burst == ixgbe_recv_pkts_lro_bulk_alloc || >> + dev->rx_pkt_burst == ixgbe_recv_pkts_bulk_alloc || >> + dev->rx_pkt_burst == ixgbe_recv_pkts_vec || >> + dev->rx_pkt_burst == ixgbe_recv_scattered_pkts_vec) { > Is there any point in that big if above? > All ixgbe recv functions support ptype recognition, so why to have it at all? > Same question for igb. > Konstantin I'd like this code to put it explicitly instead of an "if (dev->rx_pkt_burst)" to indicate that all ixgbe recv functions supports these ptypes. Is it make sense? Thanks, Jianfeng