From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D46AA8DA4 for ; Fri, 15 Jan 2016 15:50:06 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP; 15 Jan 2016 06:50:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,299,1449561600"; d="scan'208";a="633946929" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by FMSMGA003.fm.intel.com with ESMTP; 15 Jan 2016 06:50:05 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.104]) by IRSMSX104.ger.corp.intel.com ([163.33.3.159]) with mapi id 14.03.0248.002; Fri, 15 Jan 2016 14:50:03 +0000 From: "Ananyev, Konstantin" To: "Tan, Jianfeng" , "dev@dpdk.org" Thread-Topic: [PATCH v2 07/12] pmd/ixgbe: add dev_ptype_info_get implementation Thread-Index: AQHRT5LDh5CkE4I7okifIDF/qcTVpp78qFcA Date: Fri, 15 Jan 2016 14:50:02 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836AE6159@irsmsx105.ger.corp.intel.com> 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> In-Reply-To: <1452836759-63540-8-git-send-email-jianfeng.tan@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Fri, 15 Jan 2016 14:50:07 -0000 > -----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 implementatio= n >=20 > 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(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.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 r= te_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 pt= ypes[]); > 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 =3D= { > .xstats_reset =3D ixgbe_dev_xstats_reset, > .queue_stats_mapping_set =3D ixgbe_dev_queue_stats_mapping_set, > .dev_infos_get =3D ixgbe_dev_info_get, > + .dev_ptype_info_get =3D ixgbe_dev_ptype_info_get, > .mtu_set =3D ixgbe_dev_mtu_set, > .vlan_filter_set =3D ixgbe_vlan_filter_set, > .vlan_tpid_set =3D ixgbe_vlan_tpid_set, > @@ -512,6 +514,7 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = =3D { > .xstats_reset =3D ixgbevf_dev_stats_reset, > .dev_close =3D ixgbevf_dev_close, > .dev_infos_get =3D ixgbevf_dev_info_get, > + .dev_ptype_info_get =3D ixgbe_dev_ptype_info_get, > .mtu_set =3D ixgbevf_dev_set_mtu, > .vlan_filter_set =3D ixgbevf_vlan_filter_set, > .vlan_strip_queue_set =3D 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 =3D IXGBE_RSS_OFFLOAD_ALL; > } >=20 > +static int > +ixgbe_dev_ptype_info_get(struct rte_eth_dev *dev, uint32_t ptypes[]) > +{ > + int num =3D 0; > + > + if (dev->rx_pkt_burst =3D=3D ixgbe_recv_pkts || > + dev->rx_pkt_burst =3D=3D ixgbe_recv_pkts_lro_single_alloc || > + dev->rx_pkt_burst =3D=3D ixgbe_recv_pkts_lro_bulk_alloc || > + dev->rx_pkt_burst =3D=3D ixgbe_recv_pkts_bulk_alloc || > + dev->rx_pkt_burst =3D=3D ixgbe_recv_pkts_vec || > + dev->rx_pkt_burst =3D=3D 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 al= l? Same question for igb. Konstantin > + /* > + * for non-vec functions, > + * refers to ixgbe_rxd_pkt_info_to_pkt_type(); > + * for vec functions, > + * refers to _recv_raw_pkts_vec(). > + */ > + ptypes[num++] =3D RTE_PTYPE_L2_ETHER; > + ptypes[num++] =3D RTE_PTYPE_L3_IPV4; > + ptypes[num++] =3D RTE_PTYPE_L3_IPV4_EXT; > + ptypes[num++] =3D RTE_PTYPE_L3_IPV6; > + ptypes[num++] =3D RTE_PTYPE_L3_IPV6_EXT; > + ptypes[num++] =3D RTE_PTYPE_L4_SCTP; > + ptypes[num++] =3D RTE_PTYPE_L4_TCP; > + ptypes[num++] =3D RTE_PTYPE_L4_UDP; > + ptypes[num++] =3D RTE_PTYPE_TUNNEL_IP; > + ptypes[num++] =3D RTE_PTYPE_INNER_L3_IPV6; > + ptypes[num++] =3D RTE_PTYPE_INNER_L3_IPV6_EXT; > + ptypes[num++] =3D RTE_PTYPE_INNER_L4_TCP; > + ptypes[num++] =3D RTE_PTYPE_INNER_L4_UDP; > + } > + > + return num; > +} > + > static void > ixgbevf_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_e= thdev.h > index d26771a..2479830 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.h > +++ b/drivers/net/ixgbe/ixgbe_ethdev.h > @@ -379,6 +379,8 @@ void ixgbevf_dev_rxtx_start(struct rte_eth_dev *dev); > uint16_t ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, > uint16_t nb_pkts); >=20 > +uint16_t ixgbe_recv_pkts_bulk_alloc(void *rx_queue, struct rte_mbuf **rx= _pkts, > + uint16_t nb_pkts); > uint16_t ixgbe_recv_pkts_lro_single_alloc(void *rx_queue, > struct rte_mbuf **rx_pkts, uint16_t nb_pkts); > uint16_t ixgbe_recv_pkts_lro_bulk_alloc(void *rx_queue, > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxt= x.c > index 52a263c..d324099 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > @@ -899,6 +899,9 @@ end_of_tx: > #define IXGBE_PACKET_TYPE_MAX 0X80 > #define IXGBE_PACKET_TYPE_MASK 0X7F > #define IXGBE_PACKET_TYPE_SHIFT 0X04 > +/* > + * @note: fix ixgbe_dev_ptype_info_get() if any change here. > + */ > static inline uint32_t > ixgbe_rxd_pkt_info_to_pkt_type(uint16_t pkt_info) > { > @@ -1247,7 +1250,7 @@ rx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_p= kts, > } >=20 > /* split requests into chunks of size RTE_PMD_IXGBE_RX_MAX_BURST */ > -static uint16_t > +uint16_t > ixgbe_recv_pkts_bulk_alloc(void *rx_queue, struct rte_mbuf **rx_pkts, > uint16_t nb_pkts) > { > -- > 2.1.4