* [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload @ 2019-08-06 8:02 pbhagavatula 2019-08-06 8:02 ` [dpdk-dev] [RFC 1/3] ethdev: add ptype as an " pbhagavatula ` (3 more replies) 0 siblings, 4 replies; 14+ messages in thread From: pbhagavatula @ 2019-08-06 8:02 UTC (permalink / raw) To: jerinj; +Cc: dev, Pavan Nikhilesh From: Pavan Nikhilesh <pbhagavatula@marvell.com> Add PTYPE to DEV_RX_OFFLOAD_* flags. Currently, most of the NICs already support PTYPE parsing and update the mbuf->packet_type through an internal lookup table, but there is no way to disable the lookup if the application is not intrested in ptypes returned by `rte_eth_dev_get_supported_ptypes`. Pavan Nikhilesh (3): ethdev: add ptype as an Rx offload net: update Rx offload capabilities examples: add Rx ptype offload doc/guides/nics/features.rst | 3 +++ drivers/net/atlantic/atl_ethdev.c | 3 ++- drivers/net/bnxt/bnxt_ethdev.c | 3 ++- drivers/net/cxgbe/cxgbe.h | 3 ++- drivers/net/dpaa/dpaa_ethdev.c | 3 ++- drivers/net/dpaa2/dpaa2_ethdev.c | 3 ++- drivers/net/e1000/em_rxtx.c | 3 ++- drivers/net/e1000/igb_rxtx.c | 3 ++- drivers/net/enetc/enetc_ethdev.c | 3 ++- drivers/net/enic/enic_res.c | 3 ++- drivers/net/failsafe/failsafe_ops.c | 6 ++++-- drivers/net/fm10k/fm10k_ethdev.c | 15 ++++++++------- drivers/net/i40e/i40e_ethdev.c | 3 ++- drivers/net/iavf/iavf_ethdev.c | 3 ++- drivers/net/ice/ice_ethdev.c | 3 ++- drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++- drivers/net/mlx4/mlx4_rxq.c | 3 ++- drivers/net/mlx5/mlx5_rxq.c | 3 ++- drivers/net/mvneta/mvneta_ethdev.h | 3 ++- drivers/net/mvpp2/mrvl_ethdev.c | 3 ++- drivers/net/netvsc/hn_rndis.c | 3 ++- drivers/net/nfp/nfp_net.c | 3 ++- drivers/net/octeontx/octeontx_ethdev.h | 3 ++- drivers/net/octeontx2/otx2_ethdev.c | 5 +++++ drivers/net/octeontx2/otx2_ethdev.h | 15 ++++++++------- drivers/net/qede/qede_ethdev.c | 3 ++- drivers/net/tap/rte_eth_tap.c | 3 ++- drivers/net/thunderx/nicvf_ethdev.h | 3 ++- drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++- examples/ip_fragmentation/main.c | 7 +++++++ examples/l3fwd-power/main.c | 8 ++++++++ examples/l3fwd/main.c | 9 +++++++++ examples/performance-thread/l3fwd-thread/main.c | 9 +++++++++ examples/tep_termination/vxlan_setup.c | 1 + lib/librte_ethdev/rte_ethdev.h | 1 + 35 files changed, 111 insertions(+), 40 deletions(-) -- 2.17.1 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [RFC 1/3] ethdev: add ptype as an Rx offload 2019-08-06 8:02 [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload pbhagavatula @ 2019-08-06 8:02 ` pbhagavatula 2019-08-06 9:00 ` Andrew Rybchenko 2019-08-06 8:02 ` [dpdk-dev] [RFC 2/3] net: update Rx offload capabilities pbhagavatula ` (2 subsequent siblings) 3 siblings, 1 reply; 14+ messages in thread From: pbhagavatula @ 2019-08-06 8:02 UTC (permalink / raw) To: jerinj, John McNamara, Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko Cc: dev, Pavan Nikhilesh From: Pavan Nikhilesh <pbhagavatula@marvell.com> Add ptype to DEV_RX_OFFLOAD_* flags which can be used to enable/disable packet type parsing. Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> --- doc/guides/nics/features.rst | 3 +++ lib/librte_ethdev/rte_ethdev.h | 1 + 2 files changed, 4 insertions(+) diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index 6f8cac2c8..6b222b270 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -662,6 +662,9 @@ Packet type parsing Supports packet type parsing and returns a list of supported types. +* **[uses] rte_eth_rxconf,rte_eth_rxmpde**: ``offloads:DEV_RX_OFFLOAD_PTYPE``. +* **[provides] mbuf**: ``mbuf.packet_type``. +* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_PTYPE``. * **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``. * **[related] API**: ``rte_eth_dev_get_supported_ptypes()``. diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index dc6596bc9..888b766d4 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1013,6 +1013,7 @@ struct rte_eth_conf { #define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000 #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000 +#define DEV_RX_OFFLOAD_PTYPE 0x00080000 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ DEV_RX_OFFLOAD_UDP_CKSUM | \ -- 2.17.1 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [RFC 1/3] ethdev: add ptype as an Rx offload 2019-08-06 8:02 ` [dpdk-dev] [RFC 1/3] ethdev: add ptype as an " pbhagavatula @ 2019-08-06 9:00 ` Andrew Rybchenko 2019-08-06 14:31 ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula 0 siblings, 1 reply; 14+ messages in thread From: Andrew Rybchenko @ 2019-08-06 9:00 UTC (permalink / raw) To: pbhagavatula, jerinj, John McNamara, Marko Kovacevic, Thomas Monjalon, Ferruh Yigit Cc: dev On 8/6/19 11:02 AM, pbhagavatula@marvell.com wrote: > From: Pavan Nikhilesh <pbhagavatula@marvell.com> > > Add ptype to DEV_RX_OFFLOAD_* flags which can be used to enable/disable > packet type parsing. > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> I like the idea. I think there are few more Rx features which lack Rx offload bit: - delivery of RSS hash in mbuf (it is not always required when RSS is used to distribute packets across Rx queues) - maybe Rx mark, since it is an extra information which could be passed by NIC to CPU and it is better to know in advance at Rx queue setup if it should be requested and processed API breakage should be considered here. I think it is OK to introduce it in the next release cycle in a dummy way which does not affect packet type delivery for existing PMDs (i.e. add offload capability and advertise in PMD, but do not take it into account when Rx mbuf is filled in) and submit deprecation notice that it may be taken into account by PMDs in 20.02 to avoid packet type delivery if the offload is not requested. It will allow applications to make transition smoother. Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [EXT] Re: [RFC 1/3] ethdev: add ptype as an Rx offload 2019-08-06 9:00 ` Andrew Rybchenko @ 2019-08-06 14:31 ` Pavan Nikhilesh Bhagavatula 2019-08-06 15:45 ` Stephen Hemminger 0 siblings, 1 reply; 14+ messages in thread From: Pavan Nikhilesh Bhagavatula @ 2019-08-06 14:31 UTC (permalink / raw) To: Andrew Rybchenko, Jerin Jacob Kollanukkaran, John McNamara, Marko Kovacevic, Thomas Monjalon, Ferruh Yigit Cc: dev >-----Original Message----- >From: Andrew Rybchenko <arybchenko@solarflare.com> >Sent: Tuesday, August 6, 2019 2:30 PM >To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin >Jacob Kollanukkaran <jerinj@marvell.com>; John McNamara ><john.mcnamara@intel.com>; Marko Kovacevic ><marko.kovacevic@intel.com>; Thomas Monjalon ><thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@intel.com> >Cc: dev@dpdk.org >Subject: [EXT] Re: [dpdk-dev] [RFC 1/3] ethdev: add ptype as an Rx >offload > >External Email > >---------------------------------------------------------------------- >On 8/6/19 11:02 AM, pbhagavatula@marvell.com wrote: >> From: Pavan Nikhilesh <pbhagavatula@marvell.com> >> >> Add ptype to DEV_RX_OFFLOAD_* flags which can be used to >enable/disable >> packet type parsing. >> >> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> > >I like the idea. I think there are few more Rx features which >lack Rx offload bit: > - delivery of RSS hash in mbuf (it is not always required when > RSS is used to distribute packets across Rx queues) Especially when applications use custom hash functions to store flows. > - maybe Rx mark, since it is an extra information which could > be passed by NIC to CPU and it is better to know in advance > at Rx queue setup if it should be requested and processed Are you referring to RTE_FLOW_ACTION_TYPE_MARK? > >API breakage should be considered here. I think it is OK to >introduce it in the next release cycle in a dummy way which >does not affect packet type delivery for existing PMDs >(i.e. add offload capability and advertise in PMD, but do not >take it into account when Rx mbuf is filled in) and >submit deprecation notice that it may be taken into account >by PMDs in 20.02 to avoid packet type delivery if the offload >is not requested. It will allow applications to make transition >smoother. Couldn’t agree with you more. I could extend the current RFC to include RSS and RX mark as we would be modifying the same offload fields across all drivers. Easier for PMD maintainers too. > >Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [EXT] Re: [RFC 1/3] ethdev: add ptype as an Rx offload 2019-08-06 14:31 ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula @ 2019-08-06 15:45 ` Stephen Hemminger 2019-08-06 18:03 ` Andrew Rybchenko 0 siblings, 1 reply; 14+ messages in thread From: Stephen Hemminger @ 2019-08-06 15:45 UTC (permalink / raw) To: Pavan Nikhilesh Bhagavatula Cc: Andrew Rybchenko, Jerin Jacob Kollanukkaran, John McNamara, Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, dev On Tue, 6 Aug 2019 14:31:43 +0000 Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com> wrote: > >-----Original Message----- > >From: Andrew Rybchenko <arybchenko@solarflare.com> > >Sent: Tuesday, August 6, 2019 2:30 PM > >To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin > >Jacob Kollanukkaran <jerinj@marvell.com>; John McNamara > ><john.mcnamara@intel.com>; Marko Kovacevic > ><marko.kovacevic@intel.com>; Thomas Monjalon > ><thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@intel.com> > >Cc: dev@dpdk.org > >Subject: [EXT] Re: [dpdk-dev] [RFC 1/3] ethdev: add ptype as an Rx > >offload > > > >External Email > > > >---------------------------------------------------------------------- > >On 8/6/19 11:02 AM, pbhagavatula@marvell.com wrote: > >> From: Pavan Nikhilesh <pbhagavatula@marvell.com> > >> > >> Add ptype to DEV_RX_OFFLOAD_* flags which can be used to > >enable/disable > >> packet type parsing. > >> > >> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> > > > >I like the idea. I think there are few more Rx features which > >lack Rx offload bit: > > - delivery of RSS hash in mbuf (it is not always required when > > RSS is used to distribute packets across Rx queues) > > Especially when applications use custom hash functions to store flows. > > > - maybe Rx mark, since it is an extra information which could > > be passed by NIC to CPU and it is better to know in advance > > at Rx queue setup if it should be requested and processed > > Are you referring to RTE_FLOW_ACTION_TYPE_MARK? > > > > >API breakage should be considered here. I think it is OK to > >introduce it in the next release cycle in a dummy way which > >does not affect packet type delivery for existing PMDs > >(i.e. add offload capability and advertise in PMD, but do not > >take it into account when Rx mbuf is filled in) and > >submit deprecation notice that it may be taken into account > >by PMDs in 20.02 to avoid packet type delivery if the offload > >is not requested. It will allow applications to make transition > >smoother. > > Couldn’t agree with you more. I could extend the current RFC to include > RSS and RX mark as we would be modifying the same offload fields across > all drivers. Easier for PMD maintainers too. > > > > >Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> > I would rather the ptype offload be always on and handled in software for drivers that don't do it. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [EXT] Re: [RFC 1/3] ethdev: add ptype as an Rx offload 2019-08-06 15:45 ` Stephen Hemminger @ 2019-08-06 18:03 ` Andrew Rybchenko 0 siblings, 0 replies; 14+ messages in thread From: Andrew Rybchenko @ 2019-08-06 18:03 UTC (permalink / raw) To: Stephen Hemminger, Pavan Nikhilesh Bhagavatula Cc: Jerin Jacob Kollanukkaran, John McNamara, Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, dev On 8/6/19 6:45 PM, Stephen Hemminger wrote: > On Tue, 6 Aug 2019 14:31:43 +0000 > Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com> wrote: > >>> -----Original Message----- >>> From: Andrew Rybchenko <arybchenko@solarflare.com> >>> Sent: Tuesday, August 6, 2019 2:30 PM >>> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin >>> Jacob Kollanukkaran <jerinj@marvell.com>; John McNamara >>> <john.mcnamara@intel.com>; Marko Kovacevic >>> <marko.kovacevic@intel.com>; Thomas Monjalon >>> <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@intel.com> >>> Cc: dev@dpdk.org >>> Subject: [EXT] Re: [dpdk-dev] [RFC 1/3] ethdev: add ptype as an Rx >>> offload >>> >>> External Email >>> >>> ---------------------------------------------------------------------- >>> On 8/6/19 11:02 AM, pbhagavatula@marvell.com wrote: >>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com> >>>> >>>> Add ptype to DEV_RX_OFFLOAD_* flags which can be used to >>> enable/disable >>>> packet type parsing. >>>> >>>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> >>> I like the idea. I think there are few more Rx features which >>> lack Rx offload bit: >>> - delivery of RSS hash in mbuf (it is not always required when >>> RSS is used to distribute packets across Rx queues) >> Especially when applications use custom hash functions to store flows. >> >>> - maybe Rx mark, since it is an extra information which could >>> be passed by NIC to CPU and it is better to know in advance >>> at Rx queue setup if it should be requested and processed >> Are you referring to RTE_FLOW_ACTION_TYPE_MARK? >> >>> API breakage should be considered here. I think it is OK to >>> introduce it in the next release cycle in a dummy way which >>> does not affect packet type delivery for existing PMDs >>> (i.e. add offload capability and advertise in PMD, but do not >>> take it into account when Rx mbuf is filled in) and >>> submit deprecation notice that it may be taken into account >>> by PMDs in 20.02 to avoid packet type delivery if the offload >>> is not requested. It will allow applications to make transition >>> smoother. >> Couldn’t agree with you more. I could extend the current RFC to include >> RSS and RX mark as we would be modifying the same offload fields across >> all drivers. Easier for PMD maintainers too. >> >>> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> > I would rather the ptype offload be always on and handled in software > for drivers that don't do it. It sounds like wasting of CPU cycle for nothing in some cases. Also where should software stop? There are various tunnels etc. If application is unhappy with supported classification provided by the driver, it can always use software parser if really required. ^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [RFC 2/3] net: update Rx offload capabilities 2019-08-06 8:02 [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload pbhagavatula 2019-08-06 8:02 ` [dpdk-dev] [RFC 1/3] ethdev: add ptype as an " pbhagavatula @ 2019-08-06 8:02 ` pbhagavatula 2019-08-06 8:02 ` [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload pbhagavatula 2019-08-06 8:19 ` [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload Hemant Agrawal 3 siblings, 0 replies; 14+ messages in thread From: pbhagavatula @ 2019-08-06 8:02 UTC (permalink / raw) To: jerinj, Igor Russkikh, Pavel Belous, Ajit Khaparde, Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu, Gagandeep Singh, John Daley, Hyong Youb Kim, Gaetan Rivet, Qi Zhang, Xiao Wang, Beilei Xing, Jingjing Wu, Qiming Yang, Konstantin Ananyev, Matan Azrad, Shahaf Shuler, Yongseok Koh, Viacheslav Ovsiienko, Zyta Szpak, Liron Himi, Tomasz Duszynski, Stephen Hemminger, K. Y. Srinivasan, Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram, Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Keith Wiles, Maciej Czekaj, Yong Wang Cc: dev, Pavan Nikhilesh From: Pavan Nikhilesh <pbhagavatula@marvell.com> Add DEV_RX_OFFLOAD_PTYPE flag for all supported NICs. Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> --- drivers/net/atlantic/atl_ethdev.c | 3 ++- drivers/net/bnxt/bnxt_ethdev.c | 3 ++- drivers/net/cxgbe/cxgbe.h | 3 ++- drivers/net/dpaa/dpaa_ethdev.c | 3 ++- drivers/net/dpaa2/dpaa2_ethdev.c | 3 ++- drivers/net/e1000/em_rxtx.c | 3 ++- drivers/net/e1000/igb_rxtx.c | 3 ++- drivers/net/enetc/enetc_ethdev.c | 3 ++- drivers/net/enic/enic_res.c | 3 ++- drivers/net/failsafe/failsafe_ops.c | 6 ++++-- drivers/net/fm10k/fm10k_ethdev.c | 15 ++++++++------- drivers/net/i40e/i40e_ethdev.c | 3 ++- drivers/net/iavf/iavf_ethdev.c | 3 ++- drivers/net/ice/ice_ethdev.c | 3 ++- drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++- drivers/net/mlx4/mlx4_rxq.c | 3 ++- drivers/net/mlx5/mlx5_rxq.c | 3 ++- drivers/net/mvneta/mvneta_ethdev.h | 3 ++- drivers/net/mvpp2/mrvl_ethdev.c | 3 ++- drivers/net/netvsc/hn_rndis.c | 3 ++- drivers/net/nfp/nfp_net.c | 3 ++- drivers/net/octeontx/octeontx_ethdev.h | 3 ++- drivers/net/octeontx2/otx2_ethdev.c | 5 +++++ drivers/net/octeontx2/otx2_ethdev.h | 15 ++++++++------- drivers/net/qede/qede_ethdev.c | 3 ++- drivers/net/tap/rte_eth_tap.c | 3 ++- drivers/net/thunderx/nicvf_ethdev.h | 3 ++- drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++- 28 files changed, 73 insertions(+), 40 deletions(-) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 3c1b349df..d3ae1fb1e 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -168,7 +168,8 @@ static struct rte_pci_driver rte_atl_pmd = { | DEV_RX_OFFLOAD_TCP_CKSUM \ | DEV_RX_OFFLOAD_JUMBO_FRAME \ | DEV_RX_OFFLOAD_MACSEC_STRIP \ - | DEV_RX_OFFLOAD_VLAN_FILTER) + | DEV_RX_OFFLOAD_VLAN_FILTER \ + | DEV_RX_OFFLOAD_PTYPE) #define ATL_TX_OFFLOADS (DEV_TX_OFFLOAD_VLAN_INSERT \ | DEV_TX_OFFLOAD_IPV4_CKSUM \ diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 25a345cd4..fda0bf176 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -160,7 +160,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = { DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \ DEV_RX_OFFLOAD_JUMBO_FRAME | \ DEV_RX_OFFLOAD_KEEP_CRC | \ - DEV_RX_OFFLOAD_TCP_LRO) + DEV_RX_OFFLOAD_TCP_LRO | \ + DEV_RX_OFFLOAD_PTYPE) static int bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask); static void bnxt_print_link_info(struct rte_eth_dev *eth_dev); diff --git a/drivers/net/cxgbe/cxgbe.h b/drivers/net/cxgbe/cxgbe.h index 3f97fa58b..6315192ab 100644 --- a/drivers/net/cxgbe/cxgbe.h +++ b/drivers/net/cxgbe/cxgbe.h @@ -47,7 +47,8 @@ DEV_RX_OFFLOAD_UDP_CKSUM | \ DEV_RX_OFFLOAD_TCP_CKSUM | \ DEV_RX_OFFLOAD_JUMBO_FRAME | \ - DEV_RX_OFFLOAD_SCATTER) + DEV_RX_OFFLOAD_SCATTER | \ + DEV_RX_OFFLOAD_PTYPE) #define CXGBE_DEVARG_KEEP_OVLAN "keep_ovlan" diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 7154fb9b4..960783116 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -49,7 +49,8 @@ /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_SCATTER; + DEV_RX_OFFLOAD_SCATTER | + DEV_RX_OFFLOAD_PTYPE; /* Rx offloads which cannot be disabled */ static uint64_t dev_rx_offloads_nodis = diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index dd6a78f9f..a1c8ad95c 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -38,7 +38,8 @@ static uint64_t dev_rx_offloads_sup = DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_JUMBO_FRAME; + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_PTYPE; /* Rx offloads which cannot be disabled */ static uint64_t dev_rx_offloads_nodis = diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index 6f40b45a3..c556e11af 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -1373,7 +1373,8 @@ em_get_rx_port_offloads_capa(struct rte_eth_dev *dev) DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_KEEP_CRC | - DEV_RX_OFFLOAD_SCATTER; + DEV_RX_OFFLOAD_SCATTER | + DEV_RX_OFFLOAD_PTYPE; if (max_rx_pktlen > RTE_ETHER_MAX_LEN) rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME; diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index c5606de5d..f082bb9f1 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -1646,7 +1646,8 @@ igb_get_rx_port_offloads_capa(struct rte_eth_dev *dev) DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_KEEP_CRC | - DEV_RX_OFFLOAD_SCATTER; + DEV_RX_OFFLOAD_SCATTER | + DEV_RX_OFFLOAD_PTYPE; return rx_offload_capa; } diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c index 6c5501acb..b6613922b 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -167,7 +167,8 @@ enetc_dev_infos_get(struct rte_eth_dev *dev __rte_unused, DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_KEEP_CRC | - DEV_RX_OFFLOAD_JUMBO_FRAME); + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_PTYPE); } static int diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c index 9405e1933..395dccb5d 100644 --- a/drivers/net/enic/enic_res.c +++ b/drivers/net/enic/enic_res.c @@ -198,7 +198,8 @@ int enic_get_vnic_config(struct enic *enic) DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_IPV4_CKSUM | DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM; + DEV_RX_OFFLOAD_TCP_CKSUM | + DEV_RX_OFFLOAD_PTYPE; enic->tx_offload_mask = PKT_TX_IPV6 | PKT_TX_IPV4 | diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index 96e05d4dc..b6f73a5fb 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -895,7 +895,8 @@ fs_dev_infos_get(struct rte_eth_dev *dev, DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_TIMESTAMP | - DEV_RX_OFFLOAD_SECURITY; + DEV_RX_OFFLOAD_SECURITY | + DEV_RX_OFFLOAD_PTYPE; infos->rx_queue_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP | @@ -912,7 +913,8 @@ fs_dev_infos_get(struct rte_eth_dev *dev, DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_TIMESTAMP | - DEV_RX_OFFLOAD_SECURITY; + DEV_RX_OFFLOAD_SECURITY | + DEV_RX_OFFLOAD_PTYPE; infos->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS | diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index db4d72129..ed07dae2a 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -1791,13 +1791,14 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev) { RTE_SET_USED(dev); - return (uint64_t)(DEV_RX_OFFLOAD_VLAN_STRIP | - DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_IPV4_CKSUM | - DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM | - DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_HEADER_SPLIT); + return (uint64_t)(DEV_RX_OFFLOAD_VLAN_STRIP | + DEV_RX_OFFLOAD_VLAN_FILTER | + DEV_RX_OFFLOAD_IPV4_CKSUM | + DEV_RX_OFFLOAD_UDP_CKSUM | + DEV_RX_OFFLOAD_TCP_CKSUM | + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_HEADER_SPLIT | + DEV_RX_OFFLOAD_PTYPE); } static int diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 4e40b7ab5..75f219b17 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -3511,7 +3511,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_VLAN_EXTEND | DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_JUMBO_FRAME; + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_PTYPE; dev_info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE; dev_info->tx_offload_capa = diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 8f3907378..7cf71ecd4 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -517,7 +517,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_VLAN_FILTER; + DEV_RX_OFFLOAD_VLAN_FILTER | + DEV_RX_OFFLOAD_PTYPE; dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | DEV_TX_OFFLOAD_QINQ_INSERT | diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 8c60a988a..28e3c6f8f 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2118,7 +2118,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_KEEP_CRC | DEV_RX_OFFLOAD_SCATTER | - DEV_RX_OFFLOAD_VLAN_FILTER; + DEV_RX_OFFLOAD_VLAN_FILTER | + DEV_RX_OFFLOAD_PTYPE; dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | DEV_TX_OFFLOAD_TCP_TSO | diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index edcfa60ce..942454cb4 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -2872,7 +2872,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev) DEV_RX_OFFLOAD_KEEP_CRC | DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_SCATTER; + DEV_RX_OFFLOAD_SCATTER | + DEV_RX_OFFLOAD_PTYPE; if (hw->mac.type == ixgbe_mac_82598EB) offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c index f45c1ff85..e915a7c6f 100644 --- a/drivers/net/mlx4/mlx4_rxq.c +++ b/drivers/net/mlx4/mlx4_rxq.c @@ -685,7 +685,8 @@ mlx4_get_rx_queue_offloads(struct mlx4_priv *priv) { uint64_t offloads = DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_KEEP_CRC | - DEV_RX_OFFLOAD_JUMBO_FRAME; + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_PTYPE; if (priv->hw_csum) offloads |= DEV_RX_OFFLOAD_CHECKSUM; diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index a1fdeef2a..c3c35a7c1 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -368,7 +368,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev) struct mlx5_dev_config *config = &priv->config; uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_TIMESTAMP | - DEV_RX_OFFLOAD_JUMBO_FRAME); + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_PTYPE); if (config->hw_fcs_strip) offloads |= DEV_RX_OFFLOAD_KEEP_CRC; diff --git a/drivers/net/mvneta/mvneta_ethdev.h b/drivers/net/mvneta/mvneta_ethdev.h index ef8067790..cee859679 100644 --- a/drivers/net/mvneta/mvneta_ethdev.h +++ b/drivers/net/mvneta/mvneta_ethdev.h @@ -55,7 +55,8 @@ /** Rx offloads capabilities */ #define MVNETA_RX_OFFLOADS (DEV_RX_OFFLOAD_JUMBO_FRAME | \ - DEV_RX_OFFLOAD_CHECKSUM) + DEV_RX_OFFLOAD_CHECKSUM | \ + DEV_RX_OFFLOAD_PTYPE) /** Tx offloads capabilities */ #define MVNETA_TX_OFFLOAD_CHECKSUM (DEV_TX_OFFLOAD_IPV4_CKSUM | \ diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 810a703fc..e5dd96fa6 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -60,7 +60,8 @@ /** Port Rx offload capabilities */ #define MRVL_RX_OFFLOADS (DEV_RX_OFFLOAD_VLAN_FILTER | \ DEV_RX_OFFLOAD_JUMBO_FRAME | \ - DEV_RX_OFFLOAD_CHECKSUM) + DEV_RX_OFFLOAD_CHECKSUM | \ + DEV_RX_OFFLOAD_PTYPE) /** Port Tx offloads capabilities */ #define MRVL_TX_OFFLOADS (DEV_TX_OFFLOAD_IPV4_CKSUM | \ diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c index a67bc7a79..13a9da90f 100644 --- a/drivers/net/netvsc/hn_rndis.c +++ b/drivers/net/netvsc/hn_rndis.c @@ -897,7 +897,8 @@ int hn_rndis_get_offload(struct hn_data *hv, == HN_NDIS_LSOV2_CAP_IP6) dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO; - dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP; + dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP | + DEV_RX_OFFLOAD_PTYPE; if (hwcaps.ndis_csum.ndis_ip4_rxcsum & NDIS_RXCSUM_CAP_IP4) dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_IPV4_CKSUM; diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index f1a3ef2f9..ce27ac763 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1226,7 +1226,8 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM; - dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME; + dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_PTYPE; if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN) dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT; diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h index fd2e99edf..20703977e 100644 --- a/drivers/net/octeontx/octeontx_ethdev.h +++ b/drivers/net/octeontx/octeontx_ethdev.h @@ -29,7 +29,8 @@ #define OCTEONTX_MAX_BGX_PORTS 4 #define OCTEONTX_MAX_LMAC_PER_BGX 4 -#define OCTEONTX_RX_OFFLOADS DEV_RX_OFFLOAD_CHECKSUM +#define OCTEONTX_RX_OFFLOADS (DEV_RX_OFFLOAD_CHECKSUM | \ + DEV_RX_OFFLOAD_PTYPE) #define OCTEONTX_TX_OFFLOADS DEV_TX_OFFLOAD_MT_LOCKFREE static inline struct octeontx_nic * diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index b84128fef..ca01bf081 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -590,6 +590,11 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev) if ((dev->rx_offloads & DEV_RX_OFFLOAD_TIMESTAMP)) flags |= NIX_RX_OFFLOAD_TSTAMP_F; + if ((dev->rx_offloads & DEV_RX_OFFLOAD_PTYPE)) + flags |= NIX_RX_OFFLOAD_PTYPE_F; + else + flags &= ~NIX_RX_OFFLOAD_PTYPE_F; + return flags; } diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 7b15d6bc8..2eeb07c9c 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -122,8 +122,8 @@ DEV_TX_OFFLOAD_MT_LOCKFREE | \ DEV_TX_OFFLOAD_VLAN_INSERT | \ DEV_TX_OFFLOAD_QINQ_INSERT | \ - DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | \ - DEV_TX_OFFLOAD_OUTER_UDP_CKSUM | \ + DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | \ + DEV_TX_OFFLOAD_OUTER_UDP_CKSUM | \ DEV_TX_OFFLOAD_TCP_CKSUM | \ DEV_TX_OFFLOAD_UDP_CKSUM | \ DEV_TX_OFFLOAD_SCTP_CKSUM | \ @@ -136,11 +136,12 @@ DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \ DEV_RX_OFFLOAD_SCATTER | \ DEV_RX_OFFLOAD_JUMBO_FRAME | \ - DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | \ - DEV_RX_OFFLOAD_VLAN_STRIP | \ - DEV_RX_OFFLOAD_VLAN_FILTER | \ - DEV_RX_OFFLOAD_QINQ_STRIP | \ - DEV_RX_OFFLOAD_TIMESTAMP) + DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | \ + DEV_RX_OFFLOAD_VLAN_STRIP | \ + DEV_RX_OFFLOAD_VLAN_FILTER | \ + DEV_RX_OFFLOAD_QINQ_STRIP | \ + DEV_RX_OFFLOAD_TIMESTAMP | \ + DEV_RX_OFFLOAD_PTYPE) #define NIX_DEFAULT_RSS_CTX_GROUP 0 #define NIX_DEFAULT_RSS_MCAM_IDX -1 diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 528b33e8c..2af69416b 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1291,7 +1291,8 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev, DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_VLAN_STRIP); + DEV_RX_OFFLOAD_VLAN_STRIP | + DEV_RX_OFFLOAD_PTYPE); dev_info->rx_queue_offload_capa = 0; /* TX offloads are on a per-packet basis, so it is applicable diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 64bd04911..21307d9b9 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -336,7 +336,8 @@ tap_rx_offload_get_queue_capa(void) return DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_IPV4_CKSUM | DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM; + DEV_RX_OFFLOAD_TCP_CKSUM | + DEV_RX_OFFLOAD_PTYPE; } /* Callback to handle the rx burst of packets to the correct interface and diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h index c0bfbf848..6b1e433d2 100644 --- a/drivers/net/thunderx/nicvf_ethdev.h +++ b/drivers/net/thunderx/nicvf_ethdev.h @@ -41,7 +41,8 @@ DEV_RX_OFFLOAD_CHECKSUM | \ DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_JUMBO_FRAME | \ - DEV_RX_OFFLOAD_SCATTER) + DEV_RX_OFFLOAD_SCATTER | \ + DEV_RX_OFFLOAD_PTYPE) #define NICVF_DEFAULT_RX_FREE_THRESH 224 #define NICVF_DEFAULT_TX_FREE_THRESH 224 diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 57feb3773..2276c811a 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -58,7 +58,8 @@ DEV_RX_OFFLOAD_UDP_CKSUM | \ DEV_RX_OFFLOAD_TCP_CKSUM | \ DEV_RX_OFFLOAD_TCP_LRO | \ - DEV_RX_OFFLOAD_JUMBO_FRAME) + DEV_RX_OFFLOAD_JUMBO_FRAME | \ + DEV_RX_OFFLOAD_PTYPE) static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev); static int eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev); -- 2.17.1 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload 2019-08-06 8:02 [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload pbhagavatula 2019-08-06 8:02 ` [dpdk-dev] [RFC 1/3] ethdev: add ptype as an " pbhagavatula 2019-08-06 8:02 ` [dpdk-dev] [RFC 2/3] net: update Rx offload capabilities pbhagavatula @ 2019-08-06 8:02 ` pbhagavatula 2019-08-06 9:20 ` Ananyev, Konstantin 2019-08-06 8:19 ` [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload Hemant Agrawal 3 siblings, 1 reply; 14+ messages in thread From: pbhagavatula @ 2019-08-06 8:02 UTC (permalink / raw) To: jerinj, Konstantin Ananyev, David Hunt, Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara, Radu Nicolau, Akhil Goyal, Tomasz Kantecki, John McNamara, Harry van Haaren, Xiaoyun Li Cc: dev, Pavan Nikhilesh From: Pavan Nikhilesh <pbhagavatula@marvell.com> Add DEV_RX_OFFLOAD_PTYPE as a offload requirement for applicable examples. Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> --- examples/ip_fragmentation/main.c | 7 +++++++ examples/l3fwd-power/main.c | 8 ++++++++ examples/l3fwd/main.c | 9 +++++++++ examples/performance-thread/l3fwd-thread/main.c | 9 +++++++++ examples/tep_termination/vxlan_setup.c | 1 + 5 files changed, 34 insertions(+) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 324d60773..2a9895542 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -904,6 +904,13 @@ main(int argc, char **argv) /* limit the frame size to the maximum supported by NIC */ rte_eth_dev_info_get(portid, &dev_info); + + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) + local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_PTYPE; + + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + local_port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN( dev_info.max_rx_pktlen, local_port_conf.rxmode.max_rx_pkt_len); diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index fd8d9528f..875d60c06 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -2261,6 +2261,14 @@ main(int argc, char **argv) dev_rxq_num = dev_info.max_rx_queues; dev_txq_num = dev_info.max_tx_queues; + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) { + if (!parse_ptype) + port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_PTYPE; + } else { + parse_ptype = 1; + } + nb_rx_queue = get_port_n_rx_queues(portid); if (nb_rx_queue > dev_rxq_num) rte_exit(EXIT_FAILURE, diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 3800bad19..dfee880a0 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -875,6 +875,15 @@ main(int argc, char **argv) nb_rx_queue, (unsigned)n_tx_queue ); rte_eth_dev_info_get(portid, &dev_info); + + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) { + if (!parse_ptype) + local_port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_PTYPE; + } else { + parse_ptype = 1; + } + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) local_port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 49d942407..f033326be 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -3560,6 +3560,15 @@ main(int argc, char **argv) printf("Creating queues: nb_rxq=%d nb_txq=%u... ", nb_rx_queue, (unsigned)n_tx_queue); rte_eth_dev_info_get(portid, &dev_info); + + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) { + if (!parse_ptype_on) + port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_PTYPE; + } else { + parse_ptype_on = 1; + } + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) local_port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c index 9a0880002..3d2acecd5 100644 --- a/examples/tep_termination/vxlan_setup.c +++ b/examples/tep_termination/vxlan_setup.c @@ -69,6 +69,7 @@ uint8_t tep_filter_type[] = {RTE_TUNNEL_FILTER_IMAC_TENID, static struct rte_eth_conf port_conf = { .rxmode = { .split_hdr_size = 0, + .offloads = DEV_RX_OFFLOAD_PTYPE, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, -- 2.17.1 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload 2019-08-06 8:02 ` [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload pbhagavatula @ 2019-08-06 9:20 ` Ananyev, Konstantin 2019-08-06 13:57 ` Pavan Nikhilesh Bhagavatula 0 siblings, 1 reply; 14+ messages in thread From: Ananyev, Konstantin @ 2019-08-06 9:20 UTC (permalink / raw) To: pbhagavatula, jerinj, Hunt, David, Kovacevic, Marko, Ori Kam, Richardson, Bruce, De Lara Guarch, Pablo, Nicolau, Radu, Akhil Goyal, Kantecki, Tomasz, Mcnamara, John, Van Haaren, Harry, Li, Xiaoyun Cc: dev > -----Original Message----- > From: pbhagavatula@marvell.com [mailto:pbhagavatula@marvell.com] > Sent: Tuesday, August 6, 2019 9:02 AM > To: jerinj@marvell.com; Ananyev, Konstantin <konstantin.ananyev@intel.com>; Hunt, David <david.hunt@intel.com>; Kovacevic, Marko > <marko.kovacevic@intel.com>; Ori Kam <orika@mellanox.com>; Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch, Pablo > <pablo.de.lara.guarch@intel.com>; Nicolau, Radu <radu.nicolau@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>; Kantecki, Tomasz > <tomasz.kantecki@intel.com>; Mcnamara, John <john.mcnamara@intel.com>; Van Haaren, Harry <harry.van.haaren@intel.com>; Li, > Xiaoyun <xiaoyun.li@intel.com> > Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@marvell.com> > Subject: [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload > > From: Pavan Nikhilesh <pbhagavatula@marvell.com> > > Add DEV_RX_OFFLOAD_PTYPE as a offload requirement for applicable > examples. > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> > --- > examples/ip_fragmentation/main.c | 7 +++++++ > examples/l3fwd-power/main.c | 8 ++++++++ > examples/l3fwd/main.c | 9 +++++++++ > examples/performance-thread/l3fwd-thread/main.c | 9 +++++++++ > examples/tep_termination/vxlan_setup.c | 1 + > 5 files changed, 34 insertions(+) > > diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c > index 324d60773..2a9895542 100644 > --- a/examples/ip_fragmentation/main.c > +++ b/examples/ip_fragmentation/main.c > @@ -904,6 +904,13 @@ main(int argc, char **argv) > > /* limit the frame size to the maximum supported by NIC */ > rte_eth_dev_info_get(portid, &dev_info); > + > + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) > + local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_PTYPE; > + > + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) > + local_port_conf.txmode.offloads |= > + DEV_TX_OFFLOAD_MBUF_FAST_FREE; I didn't look at the rest of the patch series yet, but these 3 lines above seems wrong. and not related to that subject. Probably something wrong with your merge process. Check commit ed553e3db4a84af0ddac0d898476333d61adb93a Author: Sunil Kumar Kori <skori@marvell.com> Date: Thu Jul 25 13:54:10 2019 +0530 examples/ip_frag: remove Tx fast free offload flag > local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN( > dev_info.max_rx_pktlen, > local_port_conf.rxmode.max_rx_pkt_len); > diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c > index fd8d9528f..875d60c06 100644 > --- a/examples/l3fwd-power/main.c > +++ b/examples/l3fwd-power/main.c > @@ -2261,6 +2261,14 @@ main(int argc, char **argv) > dev_rxq_num = dev_info.max_rx_queues; > dev_txq_num = dev_info.max_tx_queues; > > + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) { > + if (!parse_ptype) > + port_conf.rxmode.offloads |= > + DEV_RX_OFFLOAD_PTYPE; > + } else { > + parse_ptype = 1; > + } > + > nb_rx_queue = get_port_n_rx_queues(portid); > if (nb_rx_queue > dev_rxq_num) > rte_exit(EXIT_FAILURE, > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c > index 3800bad19..dfee880a0 100644 > --- a/examples/l3fwd/main.c > +++ b/examples/l3fwd/main.c > @@ -875,6 +875,15 @@ main(int argc, char **argv) > nb_rx_queue, (unsigned)n_tx_queue ); > > rte_eth_dev_info_get(portid, &dev_info); > + > + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) { > + if (!parse_ptype) > + local_port_conf.rxmode.offloads |= > + DEV_RX_OFFLOAD_PTYPE; > + } else { > + parse_ptype = 1; > + } > + > if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) > local_port_conf.txmode.offloads |= > DEV_TX_OFFLOAD_MBUF_FAST_FREE; > diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c > index 49d942407..f033326be 100644 > --- a/examples/performance-thread/l3fwd-thread/main.c > +++ b/examples/performance-thread/l3fwd-thread/main.c > @@ -3560,6 +3560,15 @@ main(int argc, char **argv) > printf("Creating queues: nb_rxq=%d nb_txq=%u... ", > nb_rx_queue, (unsigned)n_tx_queue); > rte_eth_dev_info_get(portid, &dev_info); > + > + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) { > + if (!parse_ptype_on) > + port_conf.rxmode.offloads |= > + DEV_RX_OFFLOAD_PTYPE; > + } else { > + parse_ptype_on = 1; > + } > + > if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) > local_port_conf.txmode.offloads |= > DEV_TX_OFFLOAD_MBUF_FAST_FREE; > diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c > index 9a0880002..3d2acecd5 100644 > --- a/examples/tep_termination/vxlan_setup.c > +++ b/examples/tep_termination/vxlan_setup.c > @@ -69,6 +69,7 @@ uint8_t tep_filter_type[] = {RTE_TUNNEL_FILTER_IMAC_TENID, > static struct rte_eth_conf port_conf = { > .rxmode = { > .split_hdr_size = 0, > + .offloads = DEV_RX_OFFLOAD_PTYPE, > }, > .txmode = { > .mq_mode = ETH_MQ_TX_NONE, > -- > 2.17.1 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload 2019-08-06 9:20 ` Ananyev, Konstantin @ 2019-08-06 13:57 ` Pavan Nikhilesh Bhagavatula 0 siblings, 0 replies; 14+ messages in thread From: Pavan Nikhilesh Bhagavatula @ 2019-08-06 13:57 UTC (permalink / raw) To: Ananyev, Konstantin, Jerin Jacob Kollanukkaran, Hunt, David, Kovacevic, Marko, Ori Kam, Richardson, Bruce, De Lara Guarch, Pablo, Nicolau, Radu, Akhil Goyal, Kantecki, Tomasz, Mcnamara, John, Van Haaren, Harry, Li, Xiaoyun Cc: dev >-----Original Message----- >From: Ananyev, Konstantin <konstantin.ananyev@intel.com> >Sent: Tuesday, August 6, 2019 2:50 PM >To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin >Jacob Kollanukkaran <jerinj@marvell.com>; Hunt, David ><david.hunt@intel.com>; Kovacevic, Marko ><marko.kovacevic@intel.com>; Ori Kam <orika@mellanox.com>; >Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch, >Pablo <pablo.de.lara.guarch@intel.com>; Nicolau, Radu ><radu.nicolau@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>; >Kantecki, Tomasz <tomasz.kantecki@intel.com>; Mcnamara, John ><john.mcnamara@intel.com>; Van Haaren, Harry ><harry.van.haaren@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com> >Cc: dev@dpdk.org >Subject: RE: [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload >> -----Original Message----- >> From: pbhagavatula@marvell.com >[mailto:pbhagavatula@marvell.com] >> Sent: Tuesday, August 6, 2019 9:02 AM >> To: jerinj@marvell.com; Ananyev, Konstantin ><konstantin.ananyev@intel.com>; Hunt, David ><david.hunt@intel.com>; Kovacevic, Marko >> <marko.kovacevic@intel.com>; Ori Kam <orika@mellanox.com>; >Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch, >Pablo >> <pablo.de.lara.guarch@intel.com>; Nicolau, Radu ><radu.nicolau@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>; >Kantecki, Tomasz >> <tomasz.kantecki@intel.com>; Mcnamara, John ><john.mcnamara@intel.com>; Van Haaren, Harry ><harry.van.haaren@intel.com>; Li, >> Xiaoyun <xiaoyun.li@intel.com> >> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@marvell.com> >> Subject: [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload >> >> From: Pavan Nikhilesh <pbhagavatula@marvell.com> >> >> Add DEV_RX_OFFLOAD_PTYPE as a offload requirement for applicable >> examples. >> >> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> >> --- >> examples/ip_fragmentation/main.c | 7 +++++++ >> examples/l3fwd-power/main.c | 8 ++++++++ >> examples/l3fwd/main.c | 9 +++++++++ >> examples/performance-thread/l3fwd-thread/main.c | 9 +++++++++ >> examples/tep_termination/vxlan_setup.c | 1 + >> 5 files changed, 34 insertions(+) >> >> diff --git a/examples/ip_fragmentation/main.c >b/examples/ip_fragmentation/main.c >> index 324d60773..2a9895542 100644 >> --- a/examples/ip_fragmentation/main.c >> +++ b/examples/ip_fragmentation/main.c >> @@ -904,6 +904,13 @@ main(int argc, char **argv) >> >> /* limit the frame size to the maximum supported by >NIC */ >> rte_eth_dev_info_get(portid, &dev_info); >> + >> + if (dev_info.rx_offload_capa & >DEV_RX_OFFLOAD_PTYPE) >> + local_port_conf.rxmode.offloads |= >DEV_RX_OFFLOAD_PTYPE; >> + >> + if (dev_info.tx_offload_capa & >DEV_TX_OFFLOAD_MBUF_FAST_FREE) >> + local_port_conf.txmode.offloads |= >> + DEV_TX_OFFLOAD_MBUF_FAST_FREE; > >I didn't look at the rest of the patch series yet, but these 3 lines above >seems wrong. >and not related to that subject. >Probably something wrong with your merge process. Ack. I will remove it in the next version. >Check >commit ed553e3db4a84af0ddac0d898476333d61adb93a >Author: Sunil Kumar Kori <skori@marvell.com> >Date: Thu Jul 25 13:54:10 2019 +0530 > > examples/ip_frag: remove Tx fast free offload flag > > >> local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN( >> dev_info.max_rx_pktlen, >> local_port_conf.rxmode.max_rx_pkt_len); >> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd- >power/main.c >> index fd8d9528f..875d60c06 100644 >> --- a/examples/l3fwd-power/main.c >> +++ b/examples/l3fwd-power/main.c >> @@ -2261,6 +2261,14 @@ main(int argc, char **argv) >> dev_rxq_num = dev_info.max_rx_queues; >> dev_txq_num = dev_info.max_tx_queues; >> >> + if (dev_info.rx_offload_capa & >DEV_RX_OFFLOAD_PTYPE) { >> + if (!parse_ptype) >> + port_conf.rxmode.offloads |= >> + DEV_RX_OFFLOAD_PTYPE; >> + } else { >> + parse_ptype = 1; >> + } >> + >> nb_rx_queue = get_port_n_rx_queues(portid); >> if (nb_rx_queue > dev_rxq_num) >> rte_exit(EXIT_FAILURE, >> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c >> index 3800bad19..dfee880a0 100644 >> --- a/examples/l3fwd/main.c >> +++ b/examples/l3fwd/main.c >> @@ -875,6 +875,15 @@ main(int argc, char **argv) >> nb_rx_queue, (unsigned)n_tx_queue ); >> >> rte_eth_dev_info_get(portid, &dev_info); >> + >> + if (dev_info.rx_offload_capa & >DEV_RX_OFFLOAD_PTYPE) { >> + if (!parse_ptype) >> + local_port_conf.rxmode.offloads |= >> + DEV_RX_OFFLOAD_PTYPE; >> + } else { >> + parse_ptype = 1; >> + } >> + >> if (dev_info.tx_offload_capa & >DEV_TX_OFFLOAD_MBUF_FAST_FREE) >> local_port_conf.txmode.offloads |= >> DEV_TX_OFFLOAD_MBUF_FAST_FREE; >> diff --git a/examples/performance-thread/l3fwd-thread/main.c >b/examples/performance-thread/l3fwd-thread/main.c >> index 49d942407..f033326be 100644 >> --- a/examples/performance-thread/l3fwd-thread/main.c >> +++ b/examples/performance-thread/l3fwd-thread/main.c >> @@ -3560,6 +3560,15 @@ main(int argc, char **argv) >> printf("Creating queues: nb_rxq=%d nb_txq=%u... ", >> nb_rx_queue, (unsigned)n_tx_queue); >> rte_eth_dev_info_get(portid, &dev_info); >> + >> + if (dev_info.rx_offload_capa & >DEV_RX_OFFLOAD_PTYPE) { >> + if (!parse_ptype_on) >> + port_conf.rxmode.offloads |= >> + DEV_RX_OFFLOAD_PTYPE; >> + } else { >> + parse_ptype_on = 1; >> + } >> + >> if (dev_info.tx_offload_capa & >DEV_TX_OFFLOAD_MBUF_FAST_FREE) >> local_port_conf.txmode.offloads |= >> DEV_TX_OFFLOAD_MBUF_FAST_FREE; >> diff --git a/examples/tep_termination/vxlan_setup.c >b/examples/tep_termination/vxlan_setup.c >> index 9a0880002..3d2acecd5 100644 >> --- a/examples/tep_termination/vxlan_setup.c >> +++ b/examples/tep_termination/vxlan_setup.c >> @@ -69,6 +69,7 @@ uint8_t tep_filter_type[] = >{RTE_TUNNEL_FILTER_IMAC_TENID, >> static struct rte_eth_conf port_conf = { >> .rxmode = { >> .split_hdr_size = 0, >> + .offloads = DEV_RX_OFFLOAD_PTYPE, >> }, >> .txmode = { >> .mq_mode = ETH_MQ_TX_NONE, >> -- >> 2.17.1 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload 2019-08-06 8:02 [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload pbhagavatula ` (2 preceding siblings ...) 2019-08-06 8:02 ` [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload pbhagavatula @ 2019-08-06 8:19 ` Hemant Agrawal 2019-08-06 8:47 ` Pavan Nikhilesh Bhagavatula 3 siblings, 1 reply; 14+ messages in thread From: Hemant Agrawal @ 2019-08-06 8:19 UTC (permalink / raw) To: pbhagavatula, jerinj; +Cc: dev > > Add PTYPE to DEV_RX_OFFLOAD_* flags. > > Currently, most of the NICs already support PTYPE parsing and update the > mbuf->packet_type through an internal lookup table, but there is no way to > disable the lookup if the application is not intrested in ptypes returned by > `rte_eth_dev_get_supported_ptypes`. > [Hemant] it will also mean introducing another check in datapath, if the application has asked for PTYPE offload - copy the results to mbuf->packet_type otherwise don't do it. Your second patch is incomplete in the sense that it only adds the capability. But it does not disable the lookups? ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload 2019-08-06 8:19 ` [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload Hemant Agrawal @ 2019-08-06 8:47 ` Pavan Nikhilesh Bhagavatula 2019-08-06 9:06 ` Andrew Rybchenko 0 siblings, 1 reply; 14+ messages in thread From: Pavan Nikhilesh Bhagavatula @ 2019-08-06 8:47 UTC (permalink / raw) To: Hemant Agrawal, Jerin Jacob Kollanukkaran; +Cc: dev >-----Original Message----- >From: Hemant Agrawal <hemant.agrawal@nxp.com> >Sent: Tuesday, August 6, 2019 1:49 PM >To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin >Jacob Kollanukkaran <jerinj@marvell.com> >Cc: dev@dpdk.org >Subject: RE: [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload >> >> Add PTYPE to DEV_RX_OFFLOAD_* flags. >> >> Currently, most of the NICs already support PTYPE parsing and update >the >> mbuf->packet_type through an internal lookup table, but there is no >way to >> disable the lookup if the application is not intrested in ptypes >returned by >> `rte_eth_dev_get_supported_ptypes`. >> >[Hemant] it will also mean introducing another check in datapath, if the >application has asked for PTYPE offload - copy the results to mbuf- >>packet_type otherwise don't do it. > I think that having the check would give better performance than loading ptype table to L1 doing a lookup and copying it to mbuf when the application doesn't need it. >Your second patch is incomplete in the sense that it only adds the >capability. But it does not disable the lookups? It is upto the maintainer of the PMD to disable the lookup in data path. If there is a scope of optimization then they could do it. There is no harm in exposing PTYPE even RX_OFFLOAD_PTYPE is not enabled. I was hesitant to touch data path as it would be impossible to verify performance effect on all NICs. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload 2019-08-06 8:47 ` Pavan Nikhilesh Bhagavatula @ 2019-08-06 9:06 ` Andrew Rybchenko 2019-08-06 23:15 ` Stephen Hemminger 0 siblings, 1 reply; 14+ messages in thread From: Andrew Rybchenko @ 2019-08-06 9:06 UTC (permalink / raw) To: Pavan Nikhilesh Bhagavatula, Hemant Agrawal, Jerin Jacob Kollanukkaran Cc: dev On 8/6/19 11:47 AM, Pavan Nikhilesh Bhagavatula wrote: > >> -----Original Message----- >> From: Hemant Agrawal <hemant.agrawal@nxp.com> >> Sent: Tuesday, August 6, 2019 1:49 PM >> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin >> Jacob Kollanukkaran <jerinj@marvell.com> >> Cc: dev@dpdk.org >> Subject: RE: [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload >>> Add PTYPE to DEV_RX_OFFLOAD_* flags. >>> >>> Currently, most of the NICs already support PTYPE parsing and update >> the >>> mbuf->packet_type through an internal lookup table, but there is no >> way to >>> disable the lookup if the application is not intrested in ptypes >> returned by >>> `rte_eth_dev_get_supported_ptypes`. >>> >> [Hemant] it will also mean introducing another check in datapath, if the >> application has asked for PTYPE offload - copy the results to mbuf- >>> packet_type otherwise don't do it. > I think that having the check would give better performance than loading ptype table to L1 > doing a lookup and copying it to mbuf when the application doesn't need it. Anyway, if PMD decides that it is better to always provide packet type information - there is no harm. Basically if the offload is not requested it makes packet_type undefined in mbuf. >> Your second patch is incomplete in the sense that it only adds the >> capability. But it does not disable the lookups? > It is upto the maintainer of the PMD to disable the lookup in data path. If there is a scope of optimization > then they could do it. There is no harm in exposing PTYPE even RX_OFFLOAD_PTYPE is not enabled. > I was hesitant to touch data path as it would be impossible to verify performance effect on all NICs. I think it is the right way to approach it especially taking transition into account. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload 2019-08-06 9:06 ` Andrew Rybchenko @ 2019-08-06 23:15 ` Stephen Hemminger 0 siblings, 0 replies; 14+ messages in thread From: Stephen Hemminger @ 2019-08-06 23:15 UTC (permalink / raw) To: Andrew Rybchenko Cc: Pavan Nikhilesh Bhagavatula, Hemant Agrawal, Jerin Jacob Kollanukkaran, dev On Tue, 6 Aug 2019 12:06:35 +0300 Andrew Rybchenko <arybchenko@solarflare.com> wrote: > On 8/6/19 11:47 AM, Pavan Nikhilesh Bhagavatula wrote: > > > >> -----Original Message----- > >> From: Hemant Agrawal <hemant.agrawal@nxp.com> > >> Sent: Tuesday, August 6, 2019 1:49 PM > >> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin > >> Jacob Kollanukkaran <jerinj@marvell.com> > >> Cc: dev@dpdk.org > >> Subject: RE: [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload > >>> Add PTYPE to DEV_RX_OFFLOAD_* flags. > >>> > >>> Currently, most of the NICs already support PTYPE parsing and update > >> the > >>> mbuf->packet_type through an internal lookup table, but there is no > >> way to > >>> disable the lookup if the application is not intrested in ptypes > >> returned by > >>> `rte_eth_dev_get_supported_ptypes`. > >>> > >> [Hemant] it will also mean introducing another check in datapath, if the > >> application has asked for PTYPE offload - copy the results to mbuf- > >>> packet_type otherwise don't do it. > > I think that having the check would give better performance than loading ptype table to L1 > > doing a lookup and copying it to mbuf when the application doesn't need it. > > Anyway, if PMD decides that it is better to always provide packet type > information - there is no harm. Basically if the offload is not requested > it makes packet_type undefined in mbuf. > > >> Your second patch is incomplete in the sense that it only adds the > >> capability. But it does not disable the lookups? > > It is upto the maintainer of the PMD to disable the lookup in data path. If there is a scope of optimization > > then they could do it. There is no harm in exposing PTYPE even RX_OFFLOAD_PTYPE is not enabled. > > I was hesitant to touch data path as it would be impossible to verify performance effect on all NICs. > > I think it is the right way to approach it especially taking transition > into account. > With hardline API policy, this has to fail on compile for old applications. You can't magically assume that applications using ptype will set new feature. ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-08-06 23:15 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-08-06 8:02 [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload pbhagavatula 2019-08-06 8:02 ` [dpdk-dev] [RFC 1/3] ethdev: add ptype as an " pbhagavatula 2019-08-06 9:00 ` Andrew Rybchenko 2019-08-06 14:31 ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula 2019-08-06 15:45 ` Stephen Hemminger 2019-08-06 18:03 ` Andrew Rybchenko 2019-08-06 8:02 ` [dpdk-dev] [RFC 2/3] net: update Rx offload capabilities pbhagavatula 2019-08-06 8:02 ` [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload pbhagavatula 2019-08-06 9:20 ` Ananyev, Konstantin 2019-08-06 13:57 ` Pavan Nikhilesh Bhagavatula 2019-08-06 8:19 ` [dpdk-dev] [RFC 0/3] ethdev: add ptype as Rx offload Hemant Agrawal 2019-08-06 8:47 ` Pavan Nikhilesh Bhagavatula 2019-08-06 9:06 ` Andrew Rybchenko 2019-08-06 23:15 ` Stephen Hemminger
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).