DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH v2 0/7] ethdev: add new Rx offload flags
@ 2019-08-21 20:47 pbhagavatula
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 1/7] ethdev: add set ptype function pbhagavatula
                   ` (7 more replies)
  0 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-08-21 20:47 UTC (permalink / raw)
  To: arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
`DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested in.
Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
	[1] rte_eth_dev_set_supported_ptypes(*port_id*, 0);

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library layer,
  interested PMD can add it in.


Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add flow action type update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  drivers/net: update Rx flow flag and mark offload capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples: disable Rx packet type parsing

 doc/guides/nics/features.rst                  |  24 +++-
 doc/guides/rel_notes/release_19_11.rst        |   7 ++
 drivers/net/bnxt/bnxt_ethdev.c                |   4 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   3 +-
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_res.c                   |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   3 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   3 +-
 drivers/net/i40e/i40e_ethdev.c                |   4 +-
 drivers/net/iavf/iavf_ethdev.c                |   4 +-
 drivers/net/ice/ice_ethdev.c                  |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |   4 +-
 drivers/net/liquidio/lio_ethdev.c             |   3 +-
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   4 +-
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   3 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  16 +--
 drivers/net/octeontx2/otx2_flow_parse.c       |   3 +-
 drivers/net/qede/qede_ethdev.c                |   3 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   4 +-
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   3 +-
 examples/bbdev_app/main.c                     |   1 +
 examples/bond/main.c                          |   2 +
 examples/distributor/Makefile                 |   1 +
 examples/distributor/main.c                   |   1 +
 examples/eventdev_pipeline/main.c             | 114 +----------------
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 examples/exception_path/Makefile              |   1 +
 examples/exception_path/main.c                |   1 +
 examples/flow_classify/flow_classify.c        |   1 +
 examples/flow_filtering/Makefile              |   1 +
 examples/flow_filtering/main.c                |   1 +
 examples/ip_pipeline/link.c                   |   1 +
 examples/ip_reassembly/Makefile               |   1 +
 examples/ip_reassembly/main.c                 |   1 +
 examples/ipsec-secgw/ipsec-secgw.c            |   1 +
 examples/ipv4_multicast/Makefile              |   1 +
 examples/ipv4_multicast/main.c                |   1 +
 examples/kni/main.c                           |   1 +
 examples/l2fwd-cat/Makefile                   |   1 +
 examples/l2fwd-cat/l2fwd-cat.c                |   1 +
 examples/l2fwd-crypto/main.c                  |   1 +
 examples/l2fwd-jobstats/Makefile              |   1 +
 examples/l2fwd-jobstats/main.c                |   1 +
 examples/l2fwd-keepalive/Makefile             |   1 +
 examples/l2fwd-keepalive/main.c               |   1 +
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   1 +
 examples/l3fwd-acl/Makefile                   |   1 +
 examples/l3fwd-acl/main.c                     |   1 +
 examples/l3fwd-power/main.c                   |   1 +
 examples/l3fwd-vf/Makefile                    |   1 +
 examples/l3fwd-vf/main.c                      |   1 +
 examples/link_status_interrupt/Makefile       |   1 +
 examples/link_status_interrupt/main.c         |   1 +
 examples/load_balancer/Makefile               |   1 +
 examples/load_balancer/init.c                 |   1 +
 examples/packet_ordering/Makefile             |   1 +
 examples/packet_ordering/main.c               |   1 +
 examples/ptpclient/Makefile                   |   1 +
 examples/ptpclient/ptpclient.c                |   1 +
 examples/qos_meter/Makefile                   |   1 +
 examples/qos_meter/main.c                     |   2 +
 examples/qos_sched/Makefile                   |   1 +
 examples/qos_sched/init.c                     |   1 +
 examples/quota_watermark/qw/Makefile          |   1 +
 examples/quota_watermark/qw/init.c            |   1 +
 examples/rxtx_callbacks/main.c                |   1 +
 examples/server_node_efd/server/Makefile      |   1 +
 examples/server_node_efd/server/init.c        |   1 +
 examples/skeleton/Makefile                    |   1 +
 examples/skeleton/basicfwd.c                  |   1 +
 examples/tep_termination/Makefile             |   1 +
 examples/tep_termination/vxlan_setup.c        |   1 +
 examples/vhost/Makefile                       |   1 +
 examples/vhost/main.c                         |   1 +
 examples/vm_power_manager/Makefile            |   1 +
 examples/vm_power_manager/main.c              |   1 +
 examples/vmdq/Makefile                        |   1 +
 examples/vmdq/main.c                          |   1 +
 examples/vmdq_dcb/Makefile                    |   1 +
 examples/vmdq_dcb/main.c                      |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  34 +++++
 lib/librte_ethdev/rte_ethdev.h                |  17 +++
 lib/librte_ethdev/rte_ethdev_core.h           |   6 +
 lib/librte_ethdev/rte_ethdev_version.map      |   3 +
 lib/librte_ethdev/rte_flow.h                  |   6 +-
 95 files changed, 453 insertions(+), 150 deletions(-)

--
2.22.0


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v2 1/7] ethdev: add set ptype function
  2019-08-21 20:47 [dpdk-dev] [PATCH v2 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-08-21 20:47 ` pbhagavatula
  2019-08-23  9:44   ` Andrew Rybchenko
  2019-10-01 14:54   ` Jerin Jacob
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 246+ messages in thread
From: pbhagavatula @ 2019-08-21 20:47 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN)` and PMD
will set rte_mbuf::packet_type to 0.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 doc/guides/nics/features.rst             | 12 ++++++---
 doc/guides/rel_notes/release_19_11.rst   |  7 ++++++
 lib/librte_ethdev/rte_ethdev.c           | 32 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 16 ++++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      |  6 +++++
 lib/librte_ethdev/rte_ethdev_version.map |  3 +++
 6 files changed, 72 insertions(+), 4 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index c4e128d2f..d4d55f721 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -582,10 +582,14 @@ Supports inner packet L4 checksum.
 Packet type parsing
 -------------------
 
-Supports packet type parsing and returns a list of supported types.
-
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+Supports packet type parsing and returns a list of supported types. Allows
+application to set ptypes it is interested in.
+
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+  ``dev_supported_ptypes_set``.
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 8490d897c..a7cec1fe8 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -56,6 +56,13 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Added API in ethdev to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to request PMD to set specific ptypes defined
+     through ``rte_eth_dev_set_supported_ptypes`` in ``rte_mbuf::packet_type``.
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e1f..f529cbe9f 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2602,6 +2602,38 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+uint32_t
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask)
+{
+	int i;
+	struct rte_eth_dev *dev;
+	const uint32_t *all_ptypes;
+	uint32_t all_ptype_mask = 0;
+	uint32_t supp_ptype_mask = 0;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);
+
+	if (ptype_mask == 0) {
+		RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set,
+					0);
+		return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL)
+		return 0;
+
+	for (i = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i)
+		all_ptype_mask |= all_ptypes[i];
+
+	supp_ptype_mask = all_ptype_mask & ptype_mask;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, supp_ptype_mask);
+}
+
 void
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index dc6596bc9..1ab0af4d8 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2431,6 +2431,22 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * Request Ethernet device to set only specific packet types in the packet.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in.
+ * @return
+ *   - (>=0) Ptype mask that has been set successfully.
+ */
+__rte_experimental
+uint32_t rte_eth_dev_set_supported_ptypes(uint16_t port_id,
+					  uint32_t ptype_mask);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 2922d5b7c..e65ae983d 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+/**< @internal Set required ptypes of an Ethernet device. */
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -421,6 +425,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform device about the interested ptypes. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6df42a47b..e14745b9c 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -283,4 +283,7 @@ EXPERIMENTAL {
 
 	# added in 19.08
 	rte_eth_read_clock;
+
+	# added in 19.11
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.22.0


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v2 2/7] ethdev: add mbuf RSS update as an offload
  2019-08-21 20:47 [dpdk-dev] [PATCH v2 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-08-21 20:47 ` pbhagavatula
  2019-08-23  1:19   ` Stephen Hemminger
  2019-08-23  9:49   ` Andrew Rybchenko
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 3/7] ethdev: add flow action type " pbhagavatula
                   ` (5 subsequent siblings)
  7 siblings, 2 replies; 246+ messages in thread
From: pbhagavatula @ 2019-08-21 20:47 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst   | 2 ++
 lib/librte_ethdev/rte_ethdev.c | 1 +
 lib/librte_ethdev/rte_ethdev.h | 1 +
 3 files changed, 4 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index d4d55f721..f79b69b38 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index f529cbe9f..9c5517d5f 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 1ab0af4d8..836b30074 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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.22.0


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v2 3/7] ethdev: add flow action type update as an offload
  2019-08-21 20:47 [dpdk-dev] [PATCH v2 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 1/7] ethdev: add set ptype function pbhagavatula
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-08-21 20:47 ` pbhagavatula
  2019-08-23 10:00   ` Andrew Rybchenko
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-08-21 20:47 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, Adrien Mazarguil
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 doc/guides/nics/features.rst   | 12 ++++++++++++
 lib/librte_ethdev/rte_ethdev.c |  1 +
 lib/librte_ethdev/rte_ethdev.h |  1 +
 lib/librte_ethdev/rte_flow.h   |  6 ++++--
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f79b69b38..338b19e03 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@ application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 9c5517d5f..bcbe06c5c 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 836b30074..44686ec21 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1014,6 +1014,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index b66bf1495..5d9d88d76 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1316,7 +1316,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is set.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1324,7 +1325,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is set
 	 *
 	 * No associated configuration structure.
 	 */
-- 
2.22.0


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v2 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-08-21 20:47 [dpdk-dev] [PATCH v2 0/7] ethdev: add new Rx offload flags pbhagavatula
                   ` (2 preceding siblings ...)
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-08-21 20:47 ` pbhagavatula
  2019-10-01 14:43   ` Jerin Jacob
  2019-10-01 15:40   ` Ajit Khaparde
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 246+ messages in thread
From: pbhagavatula @ 2019-08-21 20:47 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Yongseok Koh, Viacheslav Ovsiienko, Stephen Hemminger,
	K. Y. Srinivasan, Haiyang Zhang, Alejandro Lucero,
	Nithin Dabilpuram, Kiran Kumar K, Rasesh Mody, Shahed Shaikh,
	Maciej Czekaj, Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 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/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
 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/liquidio/lio_ethdev.c    |  3 ++-
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
 25 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7d9..6c106baf7 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_RSS_HASH)
 
 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..22e61a55c 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_RSS_HASH)
 
 
 #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..18c7bd0d5 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_RSS_HASH;
 
 /* 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..55a1c4455 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_RSS_HASH;
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 9405e1933..607a085f8 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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d72129..ba9b174cf 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1797,7 +1797,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af9053..53bd2b9ae 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->rx_offload_capa = 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_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7ab5..7058e0213 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_RSS_HASH;
 
 	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..aef91a79b 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_RSS_HASH;
 	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 44a14cb8a..fc0f0003f 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2133,7 +2133,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index c25dab00c..ff118586e 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -406,7 +406,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	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..b5fd57693 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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..230d64c8a 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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index b84128fef..2e88d1844 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 7b15d6bc8..0cca6746d 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_RSS_HASH)
 
 #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..da25b26df 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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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..a1bdf3482 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_RSS_HASH)
 
 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.22.0


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v2 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-08-21 20:47 [dpdk-dev] [PATCH v2 0/7] ethdev: add new Rx offload flags pbhagavatula
                   ` (3 preceding siblings ...)
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-08-21 20:47 ` pbhagavatula
  2019-08-23 10:03   ` Andrew Rybchenko
  2019-10-01 14:48   ` Jerin Jacob
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                   ` (2 subsequent siblings)
  7 siblings, 2 replies; 246+ messages in thread
From: pbhagavatula @ 2019-08-21 20:47 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Shahaf Shuler, Yongseok Koh,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
flag and mark.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 3 ++-
 drivers/net/enic/enic_res.c             | 3 ++-
 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/mlx5/mlx5_rxq.c             | 3 ++-
 drivers/net/octeontx2/otx2_ethdev.h     | 3 ++-
 drivers/net/octeontx2/otx2_flow_parse.c | 3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c      | 3 ++-
 drivers/net/sfc/sfc_rx.c                | 3 ++-
 11 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6c106baf7..fd1fb7eda 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -161,7 +161,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_JUMBO_FRAME | \
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_RSS_HASH)
+				     DEV_RX_OFFLOAD_RSS_HASH | \
+				     DEV_RX_OFFLOAD_FLOW_MARK)
 
 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/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 607a085f8..3503d5d7e 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -199,7 +199,8 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7058e0213..6311943be 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3512,7 +3512,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_VLAN_EXTEND |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 
 	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 aef91a79b..7bdaa87b1 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -518,7 +518,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_SCATTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	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 fc0f0003f..8b8d55e4a 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2134,7 +2134,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 			DEV_RX_OFFLOAD_VLAN_EXTEND |
-			DEV_RX_OFFLOAD_RSS_HASH;
+			DEV_RX_OFFLOAD_RSS_HASH |
+			DEV_RX_OFFLOAD_FLOW_MARK;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index fa572d184..1481e2426 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
 		   DEV_RX_OFFLOAD_VLAN_FILTER |
 		   DEV_RX_OFFLOAD_SCATTER |
-		   DEV_RX_OFFLOAD_RSS_HASH;
+		   DEV_RX_OFFLOAD_RSS_HASH |
+		   DEV_RX_OFFLOAD_FLOW_MARK;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index b5fd57693..1bf01bda3 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
 	uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
 			     DEV_RX_OFFLOAD_TIMESTAMP |
 			     DEV_RX_OFFLOAD_JUMBO_FRAME |
-			     DEV_RX_OFFLOAD_RSS_HASH);
+			     DEV_RX_OFFLOAD_RSS_HASH |
+			     DEV_RX_OFFLOAD_FLOW_MARK);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 0cca6746d..97c1a636a 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -141,7 +141,8 @@
 	DEV_RX_OFFLOAD_VLAN_FILTER	| \
 	DEV_RX_OFFLOAD_QINQ_STRIP	| \
 	DEV_RX_OFFLOAD_TIMESTAMP	| \
-	DEV_RX_OFFLOAD_RSS_HASH)
+	DEV_RX_OFFLOAD_RSS_HASH		| \
+	DEV_RX_OFFLOAD_FLOW_MARK)
 
 #define NIX_DEFAULT_RSS_CTX_GROUP  0
 #define NIX_DEFAULT_RSS_MCAM_IDX  -1
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a70..6eb69a8b2 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -979,7 +979,8 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 	if (mark)
 		flow->npc_action |= (uint64_t)mark << 40;
 
-	if (rte_atomic32_read(&npc->mark_actions) == 1) {
+	if (rte_atomic32_read(&npc->mark_actions) == 1 &&
+			(hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK)) {
 		hw->rx_offload_flags |=
 			NIX_RX_OFFLOAD_MARK_UPDATE_F;
 		otx2_eth_set_rx_function(dev);
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 220ef0e47..1887731e2 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index 695580b22..0f842e9e9 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -619,7 +619,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
 	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
-				  DEV_RX_OFFLOAD_RSS_HASH,
+				  DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
-- 
2.22.0


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v2 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-08-21 20:47 [dpdk-dev] [PATCH v2 0/7] ethdev: add new Rx offload flags pbhagavatula
                   ` (4 preceding siblings ...)
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-08-21 20:47 ` pbhagavatula
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 7/7] examples: disable Rx packet type parsing pbhagavatula
  2019-09-29 21:19 ` [dpdk-dev] [PATCH v3 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-08-21 20:47 UTC (permalink / raw)
  To: arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 Currently, there is no means to retrieve set configuration from an ethdev
 without touching the internal structures of `rte_ethdev`. So, moving port
 configuration into specific pipeline models is the only way.

 examples/eventdev_pipeline/main.c             | 113 -----------------
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 3 files changed, 232 insertions(+), 113 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f541..a73b61d59 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,118 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }

-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	rte_eth_dev_info_get(port, &dev_info);
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	rte_eth_macaddr_get(port, &addr);
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}

 static void
 do_capability_setup(uint8_t eventdev_id)
@@ -501,7 +389,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");

-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);

 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..aa1678fe7 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,123 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }

+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +414,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;

+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 8961cd656..52a1b4174 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,119 @@ service_rx_adapter(void *arg)
 	return 0;
 }

+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +734,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};

+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
--
2.22.0


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v2 7/7] examples: disable Rx packet type parsing
  2019-08-21 20:47 [dpdk-dev] [PATCH v2 0/7] ethdev: add new Rx offload flags pbhagavatula
                   ` (5 preceding siblings ...)
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-08-21 20:47 ` pbhagavatula
  2019-08-23 10:10   ` Andrew Rybchenko
  2019-09-29 21:19 ` [dpdk-dev] [PATCH v3 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-08-21 20:47 UTC (permalink / raw)
  To: arybchenko, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Pablo de Lara, Radu Nicolau, Akhil Goyal, Tomasz Kantecki,
	Bernard Iremonger, Cristian Dumitrescu, Konstantin Ananyev,
	Ferruh Yigit, Declan Doherty, Reshma Pattan, John McNamara,
	Xiaoyun Li, Jasvinder Singh, Byron Marohn, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing in examples that don't use
`rte_mbuf::packet_type` by setting ptype_mask as 0 in
`rte_eth_dev_set_supported_ptypes`

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/bbdev_app/main.c                  | 1 +
 examples/bond/main.c                       | 2 ++
 examples/distributor/Makefile              | 1 +
 examples/distributor/main.c                | 1 +
 examples/distributor/meson.build           | 1 +
 examples/eventdev_pipeline/main.c          | 1 +
 examples/eventdev_pipeline/meson.build     | 1 +
 examples/exception_path/Makefile           | 1 +
 examples/exception_path/main.c             | 1 +
 examples/exception_path/meson.build        | 1 +
 examples/flow_classify/flow_classify.c     | 1 +
 examples/flow_filtering/Makefile           | 1 +
 examples/flow_filtering/main.c             | 1 +
 examples/flow_filtering/meson.build        | 1 +
 examples/ip_pipeline/link.c                | 1 +
 examples/ip_reassembly/Makefile            | 1 +
 examples/ip_reassembly/main.c              | 1 +
 examples/ip_reassembly/meson.build         | 1 +
 examples/ipsec-secgw/ipsec-secgw.c         | 1 +
 examples/ipv4_multicast/Makefile           | 1 +
 examples/ipv4_multicast/main.c             | 1 +
 examples/ipv4_multicast/meson.build        | 1 +
 examples/kni/main.c                        | 1 +
 examples/l2fwd-cat/Makefile                | 1 +
 examples/l2fwd-cat/l2fwd-cat.c             | 1 +
 examples/l2fwd-cat/meson.build             | 1 +
 examples/l2fwd-crypto/main.c               | 1 +
 examples/l2fwd-jobstats/Makefile           | 1 +
 examples/l2fwd-jobstats/main.c             | 1 +
 examples/l2fwd-jobstats/meson.build        | 1 +
 examples/l2fwd-keepalive/Makefile          | 1 +
 examples/l2fwd-keepalive/main.c            | 1 +
 examples/l2fwd-keepalive/meson.build       | 1 +
 examples/l2fwd/Makefile                    | 1 +
 examples/l2fwd/main.c                      | 1 +
 examples/l2fwd/meson.build                 | 1 +
 examples/l3fwd-acl/Makefile                | 1 +
 examples/l3fwd-acl/main.c                  | 1 +
 examples/l3fwd-acl/meson.build             | 1 +
 examples/l3fwd-power/main.c                | 1 +
 examples/l3fwd-vf/Makefile                 | 1 +
 examples/l3fwd-vf/main.c                   | 1 +
 examples/l3fwd-vf/meson.build              | 1 +
 examples/link_status_interrupt/Makefile    | 1 +
 examples/link_status_interrupt/main.c      | 1 +
 examples/link_status_interrupt/meson.build | 1 +
 examples/load_balancer/Makefile            | 1 +
 examples/load_balancer/init.c              | 1 +
 examples/load_balancer/meson.build         | 1 +
 examples/packet_ordering/Makefile          | 1 +
 examples/packet_ordering/main.c            | 1 +
 examples/packet_ordering/meson.build       | 1 +
 examples/ptpclient/Makefile                | 1 +
 examples/ptpclient/meson.build             | 1 +
 examples/ptpclient/ptpclient.c             | 1 +
 examples/qos_meter/Makefile                | 1 +
 examples/qos_meter/main.c                  | 2 ++
 examples/qos_meter/meson.build             | 1 +
 examples/qos_sched/Makefile                | 1 +
 examples/qos_sched/init.c                  | 1 +
 examples/qos_sched/meson.build             | 1 +
 examples/quota_watermark/qw/Makefile       | 1 +
 examples/quota_watermark/qw/init.c         | 1 +
 examples/rxtx_callbacks/main.c             | 1 +
 examples/server_node_efd/server/Makefile   | 1 +
 examples/server_node_efd/server/init.c     | 1 +
 examples/skeleton/Makefile                 | 1 +
 examples/skeleton/basicfwd.c               | 1 +
 examples/skeleton/meson.build              | 1 +
 examples/tep_termination/Makefile          | 1 +
 examples/tep_termination/meson.build       | 1 +
 examples/tep_termination/vxlan_setup.c     | 1 +
 examples/vhost/Makefile                    | 1 +
 examples/vhost/main.c                      | 1 +
 examples/vm_power_manager/Makefile         | 1 +
 examples/vm_power_manager/main.c           | 1 +
 examples/vm_power_manager/meson.build      | 1 +
 examples/vmdq/Makefile                     | 1 +
 examples/vmdq/main.c                       | 1 +
 examples/vmdq/meson.build                  | 1 +
 examples/vmdq_dcb/Makefile                 | 1 +
 examples/vmdq_dcb/main.c                   | 1 +
 examples/vmdq_dcb/meson.build              | 1 +
 83 files changed, 85 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 9acf666dc..8ae6e4972 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, 0);
 
 	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
 	print_mac(port_id, &bbdev_port_eth_addr);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 1c0df9d46..ffb911fc5 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -195,6 +195,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				portid, retval);
 
+	rte_eth_dev_set_supported_ptypes(portid, 0);
 	retval  = rte_eth_dev_start(portid);
 	if (retval < 0)
 		rte_exit(retval,
@@ -271,6 +272,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
+	rte_eth_dev_set_supported_ptypes(BOND_PORT, 0);
 	retval  = rte_eth_dev_start(BOND_PORT);
 	if (retval < 0)
 		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d5578..a2a477279 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 81d7ca61d..173e0a8b5 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -162,6 +162,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 26f108d65..c2976f6bd 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -10,6 +10,7 @@
 build = dpdk_conf.has('RTE_LIBRTE_POWER')
 
 deps += ['distributor', 'power']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index a73b61d59..6e8fd8006 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -393,6 +393,7 @@ main(int argc, char **argv)
 
 	/* Start the Ethernet port. */
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		err = rte_eth_dev_start(portid);
 		if (err < 0)
 			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
index a54c35aa7..0fc916b05 100644
--- a/examples/eventdev_pipeline/meson.build
+++ b/examples/eventdev_pipeline/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'eventdev'
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 	'pipeline_worker_generic.c',
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 90c7f133a..a7c961276 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0d79e5a24..1b190509a 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -464,6 +464,7 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		FATAL_ERROR("Could not start port%u (%d)", port, ret);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index bc7f43ea9..5140b0fed 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -231,6 +231,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	}
 
 	/* Start the Ethernet port. */
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a75555..793a08fae 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a0487be77..9802c8fe2 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -176,6 +176,7 @@ init_port(void)
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
 		rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index 407795c42..6f5d1b08a 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 )
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 787eb866a..15a5a5715 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -205,6 +205,7 @@ link_create(const char *name, struct link_params *params)
 			return NULL;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, 0);
 	/* Port start */
 	status = rte_eth_dev_start(port_id);
 	if (status < 0)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904e0..19c462388 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 38b39be6b..08b710cf6 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1158,6 +1158,7 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0d1fd6af6..3de98d96c 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2448,6 +2448,7 @@ main(int32_t argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		/*
 		 * Start device
 		 * note: device must be started before a flow rule
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67dd4..5171f7ab2 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 72eaadc51..69f88f066 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -765,6 +765,7 @@ main(int argc, char **argv)
 			qconf->tx_queue_id[portid] = queueid;
 			queueid++;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		rte_eth_allmulticast_enable(portid);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'hash'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d7176..c415dbc01 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -625,6 +625,7 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6d3..d6a25e42a 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -66,6 +66,7 @@ endif
 EXTRA_CFLAGS += -O3 -g -Wfatal-errors
 
 CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
 LDLIBS += -lpqos
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index b34b40a00..dfffbbe38 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 4e2777a03..37c96040d 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
 ext_deps += pqos
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
+allow_experimental_apis = true
 sources = files(
 	'cat.c', 'l2fwd-cat.c'
 )
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 3fe2ba725..2fb059073 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2559,6 +2559,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			return -1;
 		}
 
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		/* Start device */
 		retval = rte_eth_dev_start(portid);
 		if (retval < 0) {
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e93..09834e979 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 77e44dc82..34088982f 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -902,6 +902,7 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['jobstats', 'timer']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a6f..584257ae2 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS += -lrt
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 9831a4323..40bef617f 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -696,6 +696,7 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
 
 ext_deps += cc.find_library('rt')
 deps += 'timer'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'shm.c'
 )
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1e2b14297..1adda3f9e 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -694,6 +694,7 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f71..df590f8e9 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 0c44df767..d666176e2 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2056,6 +2056,7 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd8d9528f..76c6a55cd 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -2426,6 +2426,7 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index 7b186a23c..db7f51f2f 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 572e74cf5..eace6c953 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1051,6 +1051,7 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14a8..6ddedd4de 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7a6..ef3e3126a 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -676,6 +676,7 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
 					"tx buffer on port %u\n", (unsigned) portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/link_status_interrupt/meson.build
+++ b/examples/link_status_interrupt/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index caae8a107..dcba9194c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3ab7d0211..1fade7ccd 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -496,6 +496,7 @@ app_init_nics(void)
 			}
 		}
 
+		rte_eth_dev_set_supported_ptypes(port, 0);
 		/* Start port */
 		ret = rte_eth_dev_start(port);
 		if (ret < 0) {
diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
index 4f7ac3999..19708974c 100644
--- a/examples/load_balancer/meson.build
+++ b/examples/load_balancer/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'lpm'
+allow_experimental_apis = true
 sources = files(
 	'config.c', 'init.c', 'main.c', 'runtime.c'
 )
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7eb..9ba3fa9e8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e92299..efc5ef196 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -312,6 +312,7 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
 		return ret;
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'reorder'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bacbd..f158d96b9 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'ptpclient.c'
 )
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 31778fd95..0c14ac763 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -227,6 +227,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf7c..a1533d08f 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8be..f73b48772 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -419,10 +419,12 @@ main(int argc, char **argv)
 
 	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
 
+	rte_eth_dev_set_supported_ptypes(port_rx, 0);
 	ret = rte_eth_dev_start(port_rx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_tx, 0);
 	ret = rte_eth_dev_start(port_tx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
index ef7779f2f..10cd4bc79 100644
--- a/examples/qos_meter/meson.build
+++ b/examples/qos_meter/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'meter'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'rte_policer.c'
 )
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d25371..7d3d3019f 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -58,6 +58,7 @@ else
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index b05206d5a..d9b7030d0 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -138,6 +138,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
 			 ret, portid, 0);
 
+	rte_eth_dev_set_supported_ptypes(portid, 0);
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81ce8..5101652af 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
 sources = files(
 	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
 	'init.c', 'main.c', 'stats.c'
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
index 3f10f01c3..e06f4482b 100644
--- a/examples/quota_watermark/qw/Makefile
+++ b/examples/quota_watermark/qw/Makefile
@@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
 
 CFLAGS += -O3 -DQW_SOFTWARE_FC
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 5a0f64f45..4f4e38fff 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
 				"Failed to setup hardware flow control on port %u (error %d)\n",
 				(unsigned int) port_id, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_id, 0);
 	/* Start the port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index dbcd9f4fc..ec550d4e4 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -152,6 +152,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 4837bd3ea..acbd12ae2 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
 
 CFLAGS += $(WERROR_FLAGS) -O3
 CFLAGS += -I$(SRCDIR)/../shared
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e28..a584d6750 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -149,6 +149,7 @@ init_port(uint16_t port_num)
 
 	rte_eth_promiscuous_enable(port_num);
 
+	rte_eth_dev_set_supported_ptypes(port_num, 0);
 	retval = rte_eth_dev_start(port_num);
 	if (retval < 0)
 		return retval;
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac26029..0037d6b25 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98f0..0d3d397f0 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -76,6 +76,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'basicfwd.c'
 )
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd92..586838676 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -61,6 +61,7 @@ endif
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index f65d68980..f40b1c0b8 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -11,6 +11,7 @@ if not is_linux
 endif
 deps += ['hash', 'vhost']
 cflags += '-Wno-deprecated-declarations'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'vxlan.c', 'vxlan_setup.c'
 )
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a0880002..fc8c2d5fa 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -167,6 +167,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f017..7722e81c7 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -62,6 +62,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0961db080..fce61d9ed 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -321,6 +321,7 @@ port_init(uint16_t port)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..65c2ad179 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -28,6 +28,7 @@ endif
 
 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lvirt
 
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 54c704610..b5ad0d96b 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -99,6 +99,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
index 20a4a05b3..54e2b584f 100644
--- a/examples/vm_power_manager/meson.build
+++ b/examples/vm_power_manager/meson.build
@@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
 	deps += ['pmd_ixgbe']
 endif
 
+allow_experimental_apis = true
 sources = files(
 	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
 )
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee86b..2168747cc 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 EXTRA_CFLAGS += -O3
 
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd7f..675faaf17 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -258,6 +258,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096cfb..ea1574d91 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 389000327..3300e0a1f 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -313,6 +313,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.22.0


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/7] ethdev: add mbuf RSS update as an offload
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-08-23  1:19   ` Stephen Hemminger
  2019-08-27 13:44     ` Andrew Rybchenko
  2019-08-23  9:49   ` Andrew Rybchenko
  1 sibling, 1 reply; 246+ messages in thread
From: Stephen Hemminger @ 2019-08-23  1:19 UTC (permalink / raw)
  To: pbhagavatula
  Cc: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, dev

On Thu, 22 Aug 2019 02:17:50 +0530
<pbhagavatula@marvell.com> wrote:

> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
> enable/disable PMDs write to `rte_mbuf::hash::rss`.
> PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
> by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

Is this really a good idea?
Every bit of hardware that works on Windows with RSS is required to
supply the hash (for software steering).  So if adding an additional
capability, just adds another bit of complexity, code coverage, and one
more thing that won't be tested by everyone.

If hardware has it why not set it? Adding a branch is more expensive than
an unused assignment.


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/7] ethdev: add set ptype function
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-08-23  9:44   ` Andrew Rybchenko
  2019-10-01 14:54   ` Jerin Jacob
  1 sibling, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-08-23  9:44 UTC (permalink / raw)
  To: pbhagavatula, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev

On 8/21/19 11:47 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add `rte_eth_dev_set_supported_ptypes` function that will allow the
> application to inform the PMD the packet types it is interested in.
> Based on the ptypes set PMDs can optimize their Rx path.
>
> -If application doesn’t want any ptype information it can call
> `rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN)` and PMD
> will set rte_mbuf::packet_type to 0.

I would say that "... and PMD may skip packet type processing and just set
rte_mbuf::packet_type to RTE_PTYPE_UNKNOWN."

I.e. PMD is not obligated to skip packet type processing, it just has
permission to do it.

> -If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
> return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>
> -If application is interested only in L2/L3 layer, it can inform the PMD
> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
> `rte_eth_dev_set_supported_ptypes(ethdev_id,
> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK)`.
>
> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>   doc/guides/nics/features.rst             | 12 ++++++---
>   doc/guides/rel_notes/release_19_11.rst   |  7 ++++++
>   lib/librte_ethdev/rte_ethdev.c           | 32 ++++++++++++++++++++++++
>   lib/librte_ethdev/rte_ethdev.h           | 16 ++++++++++++
>   lib/librte_ethdev/rte_ethdev_core.h      |  6 +++++
>   lib/librte_ethdev/rte_ethdev_version.map |  3 +++
>   6 files changed, 72 insertions(+), 4 deletions(-)
>
> diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
> index c4e128d2f..d4d55f721 100644
> --- a/doc/guides/nics/features.rst
> +++ b/doc/guides/nics/features.rst
> @@ -582,10 +582,14 @@ Supports inner packet L4 checksum.
>   Packet type parsing
>   -------------------
>   
> -Supports packet type parsing and returns a list of supported types.
> -
> -* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
> -* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
> +Supports packet type parsing and returns a list of supported types. Allows
> +application to set ptypes it is interested in.

It is better to start new sentence from new line. It will keep the first 
line
untouched.

> +
> +* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
> +  ``dev_supported_ptypes_set``.
> +* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
> +  ``rte_eth_dev_set_supported_ptypes()``.
> +* **[provides]   mbuf**: ``mbuf.packet_type``.
>   
>   
>   .. _nic_features_timesync:
> diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
> index 8490d897c..a7cec1fe8 100644
> --- a/doc/guides/rel_notes/release_19_11.rst
> +++ b/doc/guides/rel_notes/release_19_11.rst
> @@ -56,6 +56,13 @@ New Features
>        Also, make sure to start the actual text at the margin.
>        =========================================================
>   
> +* **Added API in ethdev to set supported packet types**

May I suggest:
Added ethdev API to set supported packet types.

> +
> +  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
> +     application to request PMD to set specific ptypes defined
> +     through ``rte_eth_dev_set_supported_ptypes`` in ``rte_mbuf::packet_type``.

Consider:
Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
application to inform PMD about packet types classification the application
is interested in.

> +  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
> +     and thereby improve Rx performance if application wishes do so.
>   
>   Removed Items
>   -------------
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 17d183e1f..f529cbe9f 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -2602,6 +2602,38 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>   	return j;
>   }
>   
> +uint32_t
> +rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask)
> +{
> +	int i;
> +	struct rte_eth_dev *dev;
> +	const uint32_t *all_ptypes;
> +	uint32_t all_ptype_mask = 0;
> +	uint32_t supp_ptype_mask = 0;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);

We should either return 0 or change prototype to return successfully
set ptypes in optional (may be NULL) output parameter.
I would change the prototype.

> +	dev = &rte_eth_devices[port_id];
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);

Since API is not mandatory and provides just hits for optimizations, I think
it should return error in really unexpected cases only. It looks like 
invalid
port_id is the only case.

> +	if (ptype_mask == 0) {
> +		RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set,
> +					0);
> +		return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
> +				ptype_mask);
> +	}
> +
> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
> +	if (all_ptypes == NULL)
> +		return 0;
> +
> +	for (i = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i)
> +		all_ptype_mask |= all_ptypes[i];
> +
> +	supp_ptype_mask = all_ptype_mask & ptype_mask;

I think it is not that useful to do here. Moreover, it is invalid in a 
way how
it is implemented right now. E.g. if get returns:
RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_TCP
RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP
RTE_PTYPE_L2_ARP
and mask is RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK | RTE_PTYPE_L4_MASK
the result will be:
RTE_PTYPE_L2_ARP | RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_FRAG


> +	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, supp_ptype_mask);

It is not checked that  dev_supported_ptypes_set is not NULL.

> +}
> +
>   void
>   rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>   {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index dc6596bc9..1ab0af4d8 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -2431,6 +2431,22 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
>    */
>   int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>   				     uint32_t *ptypes, int num);
> +/**

Missing:
  * @warning
  * @b EXPERIMENTAL: this API may change without prior notice.

> + * Request Ethernet device to set only specific packet types in the packet.

Request sounds mandatory. Consider:
Inform Ethernet device of the packet types classification in which
the recipient is interested.

> + *
> + * Application can use this function to set only specific ptypes that it's
> + * interested. This information can be used by the PMD to optimize Rx path.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param ptype_mask
> + *   The ptype family that application is interested in.

It should be highligted that for each layer it should be either
full mask (e.g. RTE_PTYPE_L4_MASK) or only one specific type
(e.g. RTE_PTYPE_L4_TCP) since otherwise caller may try
RTE_PTYPE_L4_TCP|RTE_PTYPE_L4_UDP which is RTE_PTYPE_L4_FRAG
in fact.

> + * @return
> + *   - (>=0) Ptype mask that has been set successfully.

uint32_t is always >=0, so I think (>=0) should be removed.
However, in fact I think it should be:
Negative errno value on error, 0 on success.

I think that "Ptype mask that has been set successfully" could be
misleading since for each layer it is not a bit mark, but enum.
The output should be supported_ptype_get-slyle. I.e. an array
which is terminated by RTE_PTYPE_UNKNOWN entry.

> + */
> +__rte_experimental
> +uint32_t rte_eth_dev_set_supported_ptypes(uint16_t port_id,
> +					  uint32_t ptype_mask);
>   
>   /**
>    * Retrieve the MTU of an Ethernet device.
> diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
> index 2922d5b7c..e65ae983d 100644
> --- a/lib/librte_ethdev/rte_ethdev_core.h
> +++ b/lib/librte_ethdev/rte_ethdev_core.h
> @@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
>   typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
>   /**< @internal Get supported ptypes of an Ethernet device. */
>   
> +typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
> +					      uint32_t ptype_mask);
> +/**< @internal Set required ptypes of an Ethernet device. */

Consider:
Inform device about packet types in which the recipient is interested.

> +
>   typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
>   				    uint16_t queue_id);
>   /**< @internal Start rx and tx of a queue of an Ethernet device. */
> @@ -421,6 +425,8 @@ struct eth_dev_ops {
>   	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
>   	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
>   	/**< Get packet types supported and identified by device. */
> +	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
> +	/**< Inform device about the interested ptypes. */

Consider
Inform device about packet types in which the recipient is interested.

>   
>   	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
>   	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */

<snip>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/7] ethdev: add mbuf RSS update as an offload
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
  2019-08-23  1:19   ` Stephen Hemminger
@ 2019-08-23  9:49   ` Andrew Rybchenko
  1 sibling, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-08-23  9:49 UTC (permalink / raw)
  To: pbhagavatula, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev

On 8/21/19 11:47 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
> enable/disable PMDs write to `rte_mbuf::hash::rss`.
> PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
> by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

LGTM, but release notes are missing.


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v2 3/7] ethdev: add flow action type update as an offload
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-08-23 10:00   ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-08-23 10:00 UTC (permalink / raw)
  To: pbhagavatula, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, Adrien Mazarguil
  Cc: dev

On 8/21/19 11:47 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
> enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
> `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
> `RTE_FLOW_ACTION_FLAG` are enabled.
>
> PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
> by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

LGTM, few minor notes below, otherwise

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

However, it is a long discussion of it in v1 which should be taken into 
account.

<snip>

> diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
> index b66bf1495..5d9d88d76 100644
> --- a/lib/librte_ethdev/rte_flow.h
> +++ b/lib/librte_ethdev/rte_flow.h
> @@ -1316,7 +1316,8 @@ enum rte_flow_action_type {
>   
>   	/**
>   	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
> -	 * PKT_RX_FDIR_ID mbuf flags.
> +	 * PKT_RX_FDIR_ID mbuf flags when
> +	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is set.

I'd not concentrate on rx_mode offloads here. I'd say:
when Rx offload DEV_RX_OFFLOAD_FLOW_MARK is enabled.

>   	 *
>   	 * See struct rte_flow_action_mark.
>   	 */
> @@ -1324,7 +1325,8 @@ enum rte_flow_action_type {
>   
>   	/**
>   	 * Flags packets. Similar to MARK without a specific value; only
> -	 * sets the PKT_RX_FDIR mbuf flag.
> +	 * sets the PKT_RX_FDIR mbuf flag when
> +	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is set

Same as above.

>   	 *
>   	 * No associated configuration structure.
>   	 */


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v2 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-08-23 10:03   ` Andrew Rybchenko
  2019-10-01 14:48   ` Jerin Jacob
  1 sibling, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-08-23 10:03 UTC (permalink / raw)
  To: pbhagavatula, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Shahaf Shuler, Yongseok Koh,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev

On 8/21/19 11:47 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
> flag and mark.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

<snip>

> diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
> index 695580b22..0f842e9e9 100644
> --- a/drivers/net/sfc/sfc_rx.c
> +++ b/drivers/net/sfc/sfc_rx.c
> @@ -619,7 +619,8 @@ struct sfc_dp_rx sfc_efx_rx = {
>   	.features		= SFC_DP_RX_FEAT_INTR,
>   	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
>   	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
> -				  DEV_RX_OFFLOAD_RSS_HASH,
> +				  DEV_RX_OFFLOAD_RSS_HASH |
> +				  DEV_RX_OFFLOAD_FLOW_MARK,
>   	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
>   	.qcreate		= sfc_efx_rx_qcreate,
>   	.qdestroy		= sfc_efx_rx_qdestroy,

The change should be dropped since libefx-datapath does not
support flow mark.

Also when flow rule with MARK/FLAG is validated it is required
to check that the offload is enabled, but don't worry about it,
it is not trivial and we'll care about it and provide the patch.

Thanks.


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v2 7/7] examples: disable Rx packet type parsing
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-08-23 10:10   ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-08-23 10:10 UTC (permalink / raw)
  To: pbhagavatula, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Pablo de Lara, Radu Nicolau, Akhil Goyal, Tomasz Kantecki,
	Bernard Iremonger, Cristian Dumitrescu, Konstantin Ananyev,
	Ferruh Yigit, Declan Doherty, Reshma Pattan, John McNamara,
	Xiaoyun Li, Jasvinder Singh, Byron Marohn, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev

On 8/21/19 11:47 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Disable packet type parsing in examples that don't use
> `rte_mbuf::packet_type` by setting ptype_mask as 0 in
> `rte_eth_dev_set_supported_ptypes`
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

<snip>

> diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
> index 9acf666dc..8ae6e4972 100644
> --- a/examples/bbdev_app/main.c
> +++ b/examples/bbdev_app/main.c
> @@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
>   	}
>   
>   	rte_eth_promiscuous_enable(port_id);
> +	rte_eth_dev_set_supported_ptypes(port_id, 0);

Release notes and 1/7 patch description say that RTE_PTYPE_UNKNOWN
may be set in this case and may be it is even better vs 0.

>   
>   	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
>   	print_mac(port_id, &bbdev_port_eth_addr);
>

<snip>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/7] ethdev: add mbuf RSS update as an offload
  2019-08-23  1:19   ` Stephen Hemminger
@ 2019-08-27 13:44     ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-08-27 13:44 UTC (permalink / raw)
  To: Stephen Hemminger, pbhagavatula
  Cc: jerinj, John McNamara, Marko Kovacevic, Thomas Monjalon,
	Ferruh Yigit, dev

On 8/23/19 4:19 AM, Stephen Hemminger wrote:
> On Thu, 22 Aug 2019 02:17:50 +0530
> <pbhagavatula@marvell.com> wrote:
>
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
>> enable/disable PMDs write to `rte_mbuf::hash::rss`.
>> PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
>> by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
>>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Is this really a good idea?
> Every bit of hardware that works on Windows with RSS is required to
> supply the hash (for software steering).  So if adding an additional
> capability, just adds another bit of complexity, code coverage, and one
> more thing that won't be tested by everyone.
>
> If hardware has it why not set it? Adding a branch is more expensive than
> an unused assignment.

If a PMD sees no gain in disabling the offload and addition branches,
nothing obligates PMD to do. Just keep as is - no problem.
However, it opens the door to skip delivery of the RSS hash
from NIC HW to host CPU if the hash is not required.
Why should it be delivered to CPU and eat PCIe bandwidth if
the information is not required?


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v3 0/7] ethdev: add new Rx offload flags
  2019-08-21 20:47 [dpdk-dev] [PATCH v2 0/7] ethdev: add new Rx offload flags pbhagavatula
                   ` (6 preceding siblings ...)
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-09-29 21:19 ` pbhagavatula
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 1/7] ethdev: add set ptype function pbhagavatula
                     ` (7 more replies)
  7 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-09-29 21:19 UTC (permalink / raw)
  To: arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
`DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN);

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.


Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add flow action type update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  drivers/net: update Rx flow flag and mark capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples: disable Rx packet type parsing

 doc/guides/nics/features.rst                  |  22 +++-
 doc/guides/rel_notes/release_19_11.rst        |  23 ++++
 drivers/net/bnxt/bnxt_ethdev.c                |   4 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   3 +-
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_res.c                   |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   3 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   3 +-
 drivers/net/i40e/i40e_ethdev.c                |   4 +-
 drivers/net/iavf/iavf_ethdev.c                |   4 +-
 drivers/net/ice/ice_ethdev.c                  |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |   4 +-
 drivers/net/liquidio/lio_ethdev.c             |   3 +-
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   4 +-
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   3 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  16 +--
 drivers/net/octeontx2/otx2_flow_parse.c       |   3 +-
 drivers/net/qede/qede_ethdev.c                |   3 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   3 +-
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   3 +-
 examples/bbdev_app/main.c                     |   1 +
 examples/bond/main.c                          |   2 +
 examples/distributor/Makefile                 |   1 +
 examples/distributor/main.c                   |   1 +
 examples/distributor/meson.build              |   1 +
 examples/eventdev_pipeline/main.c             | 114 +----------------
 examples/eventdev_pipeline/meson.build        |   1 +
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 examples/exception_path/Makefile              |   1 +
 examples/exception_path/main.c                |   1 +
 examples/exception_path/meson.build           |   1 +
 examples/flow_classify/flow_classify.c        |   1 +
 examples/flow_filtering/Makefile              |   1 +
 examples/flow_filtering/main.c                |   1 +
 examples/flow_filtering/meson.build           |   1 +
 examples/ip_pipeline/link.c                   |   1 +
 examples/ip_reassembly/Makefile               |   1 +
 examples/ip_reassembly/main.c                 |   1 +
 examples/ip_reassembly/meson.build            |   1 +
 examples/ipsec-secgw/ipsec-secgw.c            |   1 +
 examples/ipv4_multicast/Makefile              |   1 +
 examples/ipv4_multicast/main.c                |   1 +
 examples/ipv4_multicast/meson.build           |   1 +
 examples/kni/main.c                           |   1 +
 examples/l2fwd-cat/Makefile                   |   1 +
 examples/l2fwd-cat/l2fwd-cat.c                |   1 +
 examples/l2fwd-cat/meson.build                |   1 +
 examples/l2fwd-crypto/main.c                  |   1 +
 examples/l2fwd-jobstats/Makefile              |   1 +
 examples/l2fwd-jobstats/main.c                |   1 +
 examples/l2fwd-jobstats/meson.build           |   1 +
 examples/l2fwd-keepalive/Makefile             |   1 +
 examples/l2fwd-keepalive/main.c               |   1 +
 examples/l2fwd-keepalive/meson.build          |   1 +
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   1 +
 examples/l2fwd/meson.build                    |   1 +
 examples/l3fwd-acl/Makefile                   |   1 +
 examples/l3fwd-acl/main.c                     |   1 +
 examples/l3fwd-acl/meson.build                |   1 +
 examples/l3fwd-power/main.c                   |   1 +
 examples/l3fwd-vf/Makefile                    |   1 +
 examples/l3fwd-vf/main.c                      |   1 +
 examples/l3fwd-vf/meson.build                 |   1 +
 examples/link_status_interrupt/Makefile       |   1 +
 examples/link_status_interrupt/main.c         |   1 +
 examples/link_status_interrupt/meson.build    |   1 +
 examples/load_balancer/Makefile               |   1 +
 examples/load_balancer/init.c                 |   1 +
 examples/load_balancer/meson.build            |   1 +
 examples/packet_ordering/Makefile             |   1 +
 examples/packet_ordering/main.c               |   1 +
 examples/packet_ordering/meson.build          |   1 +
 examples/ptpclient/Makefile                   |   1 +
 examples/ptpclient/meson.build                |   1 +
 examples/ptpclient/ptpclient.c                |   1 +
 examples/qos_meter/Makefile                   |   1 +
 examples/qos_meter/main.c                     |   2 +
 examples/qos_meter/meson.build                |   1 +
 examples/qos_sched/Makefile                   |   1 +
 examples/qos_sched/init.c                     |   1 +
 examples/qos_sched/meson.build                |   1 +
 examples/quota_watermark/qw/Makefile          |   1 +
 examples/quota_watermark/qw/init.c            |   1 +
 examples/rxtx_callbacks/main.c                |   1 +
 examples/server_node_efd/server/Makefile      |   1 +
 examples/server_node_efd/server/init.c        |   1 +
 examples/skeleton/Makefile                    |   1 +
 examples/skeleton/basicfwd.c                  |   1 +
 examples/skeleton/meson.build                 |   1 +
 examples/tep_termination/Makefile             |   1 +
 examples/tep_termination/meson.build          |   1 +
 examples/tep_termination/vxlan_setup.c        |   1 +
 examples/vhost/Makefile                       |   1 +
 examples/vhost/main.c                         |   1 +
 examples/vm_power_manager/Makefile            |   1 +
 examples/vm_power_manager/main.c              |   1 +
 examples/vm_power_manager/meson.build         |   1 +
 examples/vmdq/Makefile                        |   1 +
 examples/vmdq/main.c                          |   1 +
 examples/vmdq/meson.build                     |   1 +
 examples/vmdq_dcb/Makefile                    |   1 +
 examples/vmdq_dcb/main.c                      |   1 +
 examples/vmdq_dcb/meson.build                 |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  37 ++++++
 lib/librte_ethdev/rte_ethdev.h                |  23 ++++
 lib/librte_ethdev/rte_ethdev_core.h           |   8 ++
 lib/librte_ethdev/rte_ethdev_version.map      |   3 +
 lib/librte_ethdev/rte_flow.h                  |   6 +-
 118 files changed, 501 insertions(+), 149 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v3 1/7] ethdev: add set ptype function
  2019-09-29 21:19 ` [dpdk-dev] [PATCH v3 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-09-29 21:19   ` pbhagavatula
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-09-29 21:19 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN)` and PMD
may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 doc/guides/nics/features.rst             |  8 ++++--
 doc/guides/rel_notes/release_19_11.rst   |  7 +++++
 lib/librte_ethdev/rte_ethdev.c           | 33 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 26 +++++++++++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      |  6 +++++
 lib/librte_ethdev/rte_ethdev_version.map |  3 +++
 6 files changed, 81 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index c4e128d2f..1756fa73a 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,13 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+  ``dev_supported_ptypes_set``.
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 27cfbd9e3..7e31b9401 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -56,6 +56,13 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e1f..7bd937b62 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2602,6 +2602,39 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, int num)
+{
+	int i, j;
+	struct rte_eth_dev *dev;
+	const uint32_t *all_ptypes;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set, 0);
+
+	if (ptype_mask == 0)
+		return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL)
+		return 0;
+
+	for (i = 0, j = 0; set_ptypes && (all_ptypes[i] != RTE_PTYPE_UNKNOWN);
+									++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num)
+				set_ptypes[j] = all_ptypes[i];
+			j++;
+		}
+	}
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+}
+
 void
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d9871782e..d5f4c1170 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2431,6 +2431,32 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification in which
+ * the recipient is interested.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ * @return
+ *   - (0) if Success
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 2922d5b7c..93bc34480 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+/**< @internal Inform device about packet types in which the recipient is interested. */
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -421,6 +425,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform device about packet types in which the recipient is interested. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6df42a47b..e14745b9c 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -283,4 +283,7 @@ EXPERIMENTAL {
 
 	# added in 19.08
 	rte_eth_read_clock;
+
+	# added in 19.11
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v3 2/7] ethdev: add mbuf RSS update as an offload
  2019-09-29 21:19 ` [dpdk-dev] [PATCH v3 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-09-29 21:19   ` pbhagavatula
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 3/7] ethdev: add flow action type " pbhagavatula
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-09-29 21:19 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 2 ++
 doc/guides/rel_notes/release_19_11.rst | 7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 1 +
 lib/librte_ethdev/rte_ethdev.h         | 1 +
 4 files changed, 11 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 1756fa73a..f7c6d918f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 7e31b9401..78ce0bc0e 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -64,6 +64,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 Removed Items
 -------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 7bd937b62..d99060845 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d5f4c1170..08e72e39f 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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v3 3/7] ethdev: add flow action type update as an offload
  2019-09-29 21:19 ` [dpdk-dev] [PATCH v3 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 1/7] ethdev: add set ptype function pbhagavatula
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-09-29 21:19   ` pbhagavatula
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-09-29 21:19 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, Adrien Mazarguil
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 12 ++++++++++++
 doc/guides/rel_notes/release_19_11.rst |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.c         |  1 +
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 lib/librte_ethdev/rte_flow.h           |  6 ++++--
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f7c6d918f..9737ff7a1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@ Allows application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 78ce0bc0e..2ec521165 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -71,6 +71,15 @@ New Features
   *  PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
      by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
 
+* **Added Rx offload flag to enable or diable flow action type update**
+
+  *  Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
+     `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
+     `RTE_FLOW_ACTION_FLAG` are enabled.
+  *  PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
+     by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
+
 Removed Items
 -------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index d99060845..907174186 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 08e72e39f..73f2df119 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1014,6 +1014,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index 354cb1dd0..5d62686c0 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1316,7 +1316,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1324,7 +1325,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * No associated configuration structure.
 	 */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v3 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-09-29 21:19 ` [dpdk-dev] [PATCH v3 0/7] ethdev: add new Rx offload flags pbhagavatula
                     ` (2 preceding siblings ...)
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-09-29 21:19   ` pbhagavatula
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-09-29 21:19 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 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/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
 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/liquidio/lio_ethdev.c    |  3 ++-
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
 25 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7d9..6c106baf7 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_RSS_HASH)
 
 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..22e61a55c 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_RSS_HASH)
 
 
 #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..18c7bd0d5 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_RSS_HASH;
 
 /* 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..55a1c4455 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_RSS_HASH;
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 9405e1933..607a085f8 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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d72129..ba9b174cf 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1797,7 +1797,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af9053..53bd2b9ae 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->rx_offload_capa = 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_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7ab5..7058e0213 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_RSS_HASH;
 
 	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..aef91a79b 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_RSS_HASH;
 	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 63997fdfb..2e2a6b2af 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2145,7 +2145,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index c25dab00c..ff118586e 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -406,7 +406,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	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..b5fd57693 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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..230d64c8a 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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index b84128fef..2e88d1844 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 7b15d6bc8..0cca6746d 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_RSS_HASH)
 
 #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..da25b26df 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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 9cd5eb65b..da768ced7 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 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] 246+ messages in thread

* [dpdk-dev] [PATCH v3 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-09-29 21:19 ` [dpdk-dev] [PATCH v3 0/7] ethdev: add new Rx offload flags pbhagavatula
                     ` (3 preceding siblings ...)
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-09-29 21:19   ` pbhagavatula
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-09-29 21:19 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
flag and mark.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 3 ++-
 drivers/net/enic/enic_res.c             | 3 ++-
 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/mlx5/mlx5_rxq.c             | 3 ++-
 drivers/net/octeontx2/otx2_ethdev.h     | 3 ++-
 drivers/net/octeontx2/otx2_flow_parse.c | 3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c      | 3 ++-
 10 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6c106baf7..fd1fb7eda 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -161,7 +161,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_JUMBO_FRAME | \
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_RSS_HASH)
+				     DEV_RX_OFFLOAD_RSS_HASH | \
+				     DEV_RX_OFFLOAD_FLOW_MARK)
 
 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/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 607a085f8..3503d5d7e 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -199,7 +199,8 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7058e0213..6311943be 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3512,7 +3512,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_VLAN_EXTEND |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 
 	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 aef91a79b..7bdaa87b1 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -518,7 +518,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_SCATTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	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 2e2a6b2af..984af659f 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2146,7 +2146,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 			DEV_RX_OFFLOAD_VLAN_EXTEND |
-			DEV_RX_OFFLOAD_RSS_HASH;
+			DEV_RX_OFFLOAD_RSS_HASH |
+			DEV_RX_OFFLOAD_FLOW_MARK;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index fa572d184..1481e2426 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
 		   DEV_RX_OFFLOAD_VLAN_FILTER |
 		   DEV_RX_OFFLOAD_SCATTER |
-		   DEV_RX_OFFLOAD_RSS_HASH;
+		   DEV_RX_OFFLOAD_RSS_HASH |
+		   DEV_RX_OFFLOAD_FLOW_MARK;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index b5fd57693..1bf01bda3 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
 	uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
 			     DEV_RX_OFFLOAD_TIMESTAMP |
 			     DEV_RX_OFFLOAD_JUMBO_FRAME |
-			     DEV_RX_OFFLOAD_RSS_HASH);
+			     DEV_RX_OFFLOAD_RSS_HASH |
+			     DEV_RX_OFFLOAD_FLOW_MARK);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 0cca6746d..97c1a636a 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -141,7 +141,8 @@
 	DEV_RX_OFFLOAD_VLAN_FILTER	| \
 	DEV_RX_OFFLOAD_QINQ_STRIP	| \
 	DEV_RX_OFFLOAD_TIMESTAMP	| \
-	DEV_RX_OFFLOAD_RSS_HASH)
+	DEV_RX_OFFLOAD_RSS_HASH		| \
+	DEV_RX_OFFLOAD_FLOW_MARK)
 
 #define NIX_DEFAULT_RSS_CTX_GROUP  0
 #define NIX_DEFAULT_RSS_MCAM_IDX  -1
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a70..6eb69a8b2 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -979,7 +979,8 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 	if (mark)
 		flow->npc_action |= (uint64_t)mark << 40;
 
-	if (rte_atomic32_read(&npc->mark_actions) == 1) {
+	if (rte_atomic32_read(&npc->mark_actions) == 1 &&
+			(hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK)) {
 		hw->rx_offload_flags |=
 			NIX_RX_OFFLOAD_MARK_UPDATE_F;
 		otx2_eth_set_rx_function(dev);
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 220ef0e47..1887731e2 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v3 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-09-29 21:19 ` [dpdk-dev] [PATCH v3 0/7] ethdev: add new Rx offload flags pbhagavatula
                     ` (4 preceding siblings ...)
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-09-29 21:19   ` pbhagavatula
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 7/7] examples: disable Rx packet type parsing pbhagavatula
  2019-10-01  6:34   ` [dpdk-dev] [PATCH v4 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-09-29 21:19 UTC (permalink / raw)
  To: arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 113 -----------------
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 3 files changed, 232 insertions(+), 113 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f541..a73b61d59 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,118 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	rte_eth_dev_info_get(port, &dev_info);
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	rte_eth_macaddr_get(port, &addr);
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
 
 static void
 do_capability_setup(uint8_t eventdev_id)
@@ -501,7 +389,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..aa1678fe7 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,123 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +414,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 8961cd656..52a1b4174 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,119 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +734,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v3 7/7] examples: disable Rx packet type parsing
  2019-09-29 21:19 ` [dpdk-dev] [PATCH v3 0/7] ethdev: add new Rx offload flags pbhagavatula
                     ` (5 preceding siblings ...)
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-09-29 21:19   ` pbhagavatula
  2019-09-30 17:47     ` Aaron Conole
  2019-10-01  6:34   ` [dpdk-dev] [PATCH v4 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-09-29 21:19 UTC (permalink / raw)
  To: arybchenko, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki, Bernard Iremonger,
	Cristian Dumitrescu, Konstantin Ananyev, Ferruh Yigit,
	Declan Doherty, Reshma Pattan, John McNamara, Xiaoyun Li,
	Jasvinder Singh, Byron Marohn, Yipeng Wang, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing in examples that don't use
`rte_mbuf::packet_type` by setting ptype_mask as 0 in
`rte_eth_dev_set_supported_ptypes`

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/bbdev_app/main.c                  | 1 +
 examples/bond/main.c                       | 2 ++
 examples/distributor/Makefile              | 1 +
 examples/distributor/main.c                | 1 +
 examples/distributor/meson.build           | 1 +
 examples/eventdev_pipeline/main.c          | 1 +
 examples/eventdev_pipeline/meson.build     | 1 +
 examples/exception_path/Makefile           | 1 +
 examples/exception_path/main.c             | 1 +
 examples/exception_path/meson.build        | 1 +
 examples/flow_classify/flow_classify.c     | 1 +
 examples/flow_filtering/Makefile           | 1 +
 examples/flow_filtering/main.c             | 1 +
 examples/flow_filtering/meson.build        | 1 +
 examples/ip_pipeline/link.c                | 1 +
 examples/ip_reassembly/Makefile            | 1 +
 examples/ip_reassembly/main.c              | 1 +
 examples/ip_reassembly/meson.build         | 1 +
 examples/ipsec-secgw/ipsec-secgw.c         | 1 +
 examples/ipv4_multicast/Makefile           | 1 +
 examples/ipv4_multicast/main.c             | 1 +
 examples/ipv4_multicast/meson.build        | 1 +
 examples/kni/main.c                        | 1 +
 examples/l2fwd-cat/Makefile                | 1 +
 examples/l2fwd-cat/l2fwd-cat.c             | 1 +
 examples/l2fwd-cat/meson.build             | 1 +
 examples/l2fwd-crypto/main.c               | 1 +
 examples/l2fwd-jobstats/Makefile           | 1 +
 examples/l2fwd-jobstats/main.c             | 1 +
 examples/l2fwd-jobstats/meson.build        | 1 +
 examples/l2fwd-keepalive/Makefile          | 1 +
 examples/l2fwd-keepalive/main.c            | 1 +
 examples/l2fwd-keepalive/meson.build       | 1 +
 examples/l2fwd/Makefile                    | 1 +
 examples/l2fwd/main.c                      | 1 +
 examples/l2fwd/meson.build                 | 1 +
 examples/l3fwd-acl/Makefile                | 1 +
 examples/l3fwd-acl/main.c                  | 1 +
 examples/l3fwd-acl/meson.build             | 1 +
 examples/l3fwd-power/main.c                | 1 +
 examples/l3fwd-vf/Makefile                 | 1 +
 examples/l3fwd-vf/main.c                   | 1 +
 examples/l3fwd-vf/meson.build              | 1 +
 examples/link_status_interrupt/Makefile    | 1 +
 examples/link_status_interrupt/main.c      | 1 +
 examples/link_status_interrupt/meson.build | 1 +
 examples/load_balancer/Makefile            | 1 +
 examples/load_balancer/init.c              | 1 +
 examples/load_balancer/meson.build         | 1 +
 examples/packet_ordering/Makefile          | 1 +
 examples/packet_ordering/main.c            | 1 +
 examples/packet_ordering/meson.build       | 1 +
 examples/ptpclient/Makefile                | 1 +
 examples/ptpclient/meson.build             | 1 +
 examples/ptpclient/ptpclient.c             | 1 +
 examples/qos_meter/Makefile                | 1 +
 examples/qos_meter/main.c                  | 2 ++
 examples/qos_meter/meson.build             | 1 +
 examples/qos_sched/Makefile                | 1 +
 examples/qos_sched/init.c                  | 1 +
 examples/qos_sched/meson.build             | 1 +
 examples/quota_watermark/qw/Makefile       | 1 +
 examples/quota_watermark/qw/init.c         | 1 +
 examples/rxtx_callbacks/main.c             | 1 +
 examples/server_node_efd/server/Makefile   | 1 +
 examples/server_node_efd/server/init.c     | 1 +
 examples/skeleton/Makefile                 | 1 +
 examples/skeleton/basicfwd.c               | 1 +
 examples/skeleton/meson.build              | 1 +
 examples/tep_termination/Makefile          | 1 +
 examples/tep_termination/meson.build       | 1 +
 examples/tep_termination/vxlan_setup.c     | 1 +
 examples/vhost/Makefile                    | 1 +
 examples/vhost/main.c                      | 1 +
 examples/vm_power_manager/Makefile         | 1 +
 examples/vm_power_manager/main.c           | 1 +
 examples/vm_power_manager/meson.build      | 1 +
 examples/vmdq/Makefile                     | 1 +
 examples/vmdq/main.c                       | 1 +
 examples/vmdq/meson.build                  | 1 +
 examples/vmdq_dcb/Makefile                 | 1 +
 examples/vmdq_dcb/main.c                   | 1 +
 examples/vmdq_dcb/meson.build              | 1 +
 83 files changed, 85 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 9acf666dc..a32f63187 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN);
 
 	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
 	print_mac(port_id, &bbdev_port_eth_addr);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 1c0df9d46..8beb1dc14 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -195,6 +195,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				portid, retval);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 	retval  = rte_eth_dev_start(portid);
 	if (retval < 0)
 		rte_exit(retval,
@@ -271,6 +272,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
+	rte_eth_dev_set_supported_ptypes(BOND_PORT, RTE_PTYPE_UNKNOWN);
 	retval  = rte_eth_dev_start(BOND_PORT);
 	if (retval < 0)
 		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d5578..a2a477279 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 81d7ca61d..bc945d862 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -162,6 +162,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 26f108d65..c2976f6bd 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -10,6 +10,7 @@
 build = dpdk_conf.has('RTE_LIBRTE_POWER')
 
 deps += ['distributor', 'power']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index a73b61d59..9f9968cf8 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -393,6 +393,7 @@ main(int argc, char **argv)
 
 	/* Start the Ethernet port. */
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		err = rte_eth_dev_start(portid);
 		if (err < 0)
 			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
index a54c35aa7..0fc916b05 100644
--- a/examples/eventdev_pipeline/meson.build
+++ b/examples/eventdev_pipeline/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'eventdev'
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 	'pipeline_worker_generic.c',
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 90c7f133a..a7c961276 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0d79e5a24..7dbc0970a 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -464,6 +464,7 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		FATAL_ERROR("Could not start port%u (%d)", port, ret);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index bc7f43ea9..aa25218a3 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -231,6 +231,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	}
 
 	/* Start the Ethernet port. */
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a75555..793a08fae 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a0487be77..fbd1b6cc2 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -176,6 +176,7 @@ init_port(void)
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
 		rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index 407795c42..6f5d1b08a 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 )
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 787eb866a..9f8b5b2ae 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -205,6 +205,7 @@ link_create(const char *name, struct link_params *params)
 			return NULL;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN);
 	/* Port start */
 	status = rte_eth_dev_start(port_id);
 	if (status < 0)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904e0..19c462388 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 38b39be6b..ff5407892 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1158,6 +1158,7 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0d1fd6af6..619d248c8 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2448,6 +2448,7 @@ main(int32_t argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		/*
 		 * Start device
 		 * note: device must be started before a flow rule
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67dd4..5171f7ab2 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 72eaadc51..29b3fed9c 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -765,6 +765,7 @@ main(int argc, char **argv)
 			qconf->tx_queue_id[portid] = queueid;
 			queueid++;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		rte_eth_allmulticast_enable(portid);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'hash'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d7176..3163087ff 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -625,6 +625,7 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6d3..d6a25e42a 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -66,6 +66,7 @@ endif
 EXTRA_CFLAGS += -O3 -g -Wfatal-errors
 
 CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
 LDLIBS += -lpqos
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index b34b40a00..ddd9888b1 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 4e2777a03..37c96040d 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
 ext_deps += pqos
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
+allow_experimental_apis = true
 sources = files(
 	'cat.c', 'l2fwd-cat.c'
 )
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 3fe2ba725..6aad08b06 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2559,6 +2559,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			return -1;
 		}
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		/* Start device */
 		retval = rte_eth_dev_start(portid);
 		if (retval < 0) {
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e93..09834e979 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 77e44dc82..61ad8e759 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -902,6 +902,7 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['jobstats', 'timer']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a6f..584257ae2 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS += -lrt
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 9831a4323..bf662bd37 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -696,6 +696,7 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
 
 ext_deps += cc.find_library('rt')
 deps += 'timer'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'shm.c'
 )
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1e2b14297..1b940038f 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -694,6 +694,7 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f71..df590f8e9 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 0c44df767..1a0c09c1d 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2056,6 +2056,7 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd8d9528f..136f446b3 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -2426,6 +2426,7 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index 7b186a23c..db7f51f2f 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 572e74cf5..387d2426c 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1051,6 +1051,7 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14a8..6ddedd4de 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7a6..abd84b862 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -676,6 +676,7 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
 					"tx buffer on port %u\n", (unsigned) portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/link_status_interrupt/meson.build
+++ b/examples/link_status_interrupt/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index caae8a107..dcba9194c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3ab7d0211..52f677fd4 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -496,6 +496,7 @@ app_init_nics(void)
 			}
 		}
 
+		rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 		/* Start port */
 		ret = rte_eth_dev_start(port);
 		if (ret < 0) {
diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
index 4f7ac3999..19708974c 100644
--- a/examples/load_balancer/meson.build
+++ b/examples/load_balancer/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'lpm'
+allow_experimental_apis = true
 sources = files(
 	'config.c', 'init.c', 'main.c', 'runtime.c'
 )
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7eb..9ba3fa9e8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e92299..41295690d 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -312,6 +312,7 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
 		return ret;
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'reorder'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bacbd..f158d96b9 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'ptpclient.c'
 )
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 31778fd95..351596fc3 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -227,6 +227,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf7c..a1533d08f 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8be..2accbc9b6 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -419,10 +419,12 @@ main(int argc, char **argv)
 
 	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
 
+	rte_eth_dev_set_supported_ptypes(port_rx, RTE_PTYPE_UNKNOWN);
 	ret = rte_eth_dev_start(port_rx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_tx, RTE_PTYPE_UNKNOWN);
 	ret = rte_eth_dev_start(port_tx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
index ef7779f2f..10cd4bc79 100644
--- a/examples/qos_meter/meson.build
+++ b/examples/qos_meter/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'meter'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'rte_policer.c'
 )
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d25371..7d3d3019f 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -58,6 +58,7 @@ else
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index b05206d5a..35e4c90a2 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -138,6 +138,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
 			 ret, portid, 0);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81ce8..5101652af 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
 sources = files(
 	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
 	'init.c', 'main.c', 'stats.c'
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
index 3f10f01c3..e06f4482b 100644
--- a/examples/quota_watermark/qw/Makefile
+++ b/examples/quota_watermark/qw/Makefile
@@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
 
 CFLAGS += -O3 -DQW_SOFTWARE_FC
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 5a0f64f45..098e3c16e 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
 				"Failed to setup hardware flow control on port %u (error %d)\n",
 				(unsigned int) port_id, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN);
 	/* Start the port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index dbcd9f4fc..c4acac585 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -152,6 +152,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 4837bd3ea..acbd12ae2 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
 
 CFLAGS += $(WERROR_FLAGS) -O3
 CFLAGS += -I$(SRCDIR)/../shared
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e28..b4ff9dd57 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -149,6 +149,7 @@ init_port(uint16_t port_num)
 
 	rte_eth_promiscuous_enable(port_num);
 
+	rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN);
 	retval = rte_eth_dev_start(port_num);
 	if (retval < 0)
 		return retval;
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac26029..0037d6b25 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98f0..6c10a06ef 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -76,6 +76,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'basicfwd.c'
 )
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd92..586838676 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -61,6 +61,7 @@ endif
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index f65d68980..f40b1c0b8 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -11,6 +11,7 @@ if not is_linux
 endif
 deps += ['hash', 'vhost']
 cflags += '-Wno-deprecated-declarations'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'vxlan.c', 'vxlan_setup.c'
 )
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a0880002..538a54b3a 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -167,6 +167,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f017..7722e81c7 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -62,6 +62,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0961db080..57438b22c 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -321,6 +321,7 @@ port_init(uint16_t port)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..65c2ad179 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -28,6 +28,7 @@ endif
 
 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lvirt
 
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 54c704610..190a7a9ea 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -99,6 +99,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
index 20a4a05b3..54e2b584f 100644
--- a/examples/vm_power_manager/meson.build
+++ b/examples/vm_power_manager/meson.build
@@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
 	deps += ['pmd_ixgbe']
 endif
 
+allow_experimental_apis = true
 sources = files(
 	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
 )
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee86b..2168747cc 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 EXTRA_CFLAGS += -O3
 
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd7f..87cf230f4 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -258,6 +258,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096cfb..ea1574d91 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 389000327..bace88e47 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -313,6 +313,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v3 7/7] examples: disable Rx packet type parsing
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-09-30 17:47     ` Aaron Conole
  2019-10-01  5:02       ` Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 246+ messages in thread
From: Aaron Conole @ 2019-09-30 17:47 UTC (permalink / raw)
  To: pbhagavatula
  Cc: arybchenko, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki, Bernard Iremonger,
	Cristian Dumitrescu, Konstantin Ananyev, Ferruh Yigit,
	Declan Doherty, Reshma Pattan, John McNamara, Xiaoyun Li,
	Jasvinder Singh, Byron Marohn, Yipeng Wang, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang, dev

<pbhagavatula@marvell.com> writes:

> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Disable packet type parsing in examples that don't use
> `rte_mbuf::packet_type` by setting ptype_mask as 0 in
> `rte_eth_dev_set_supported_ptypes`
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  examples/bbdev_app/main.c                  | 1 +
>  examples/bond/main.c                       | 2 ++
>  examples/distributor/Makefile              | 1 +
>  examples/distributor/main.c                | 1 +
>  examples/distributor/meson.build           | 1 +
>  examples/eventdev_pipeline/main.c          | 1 +
>  examples/eventdev_pipeline/meson.build     | 1 +
>  examples/exception_path/Makefile           | 1 +
>  examples/exception_path/main.c             | 1 +
>  examples/exception_path/meson.build        | 1 +
>  examples/flow_classify/flow_classify.c     | 1 +
>  examples/flow_filtering/Makefile           | 1 +
>  examples/flow_filtering/main.c             | 1 +
>  examples/flow_filtering/meson.build        | 1 +
>  examples/ip_pipeline/link.c                | 1 +
>  examples/ip_reassembly/Makefile            | 1 +
>  examples/ip_reassembly/main.c              | 1 +
>  examples/ip_reassembly/meson.build         | 1 +
>  examples/ipsec-secgw/ipsec-secgw.c         | 1 +
>  examples/ipv4_multicast/Makefile           | 1 +
>  examples/ipv4_multicast/main.c             | 1 +
>  examples/ipv4_multicast/meson.build        | 1 +
>  examples/kni/main.c                        | 1 +
>  examples/l2fwd-cat/Makefile                | 1 +
>  examples/l2fwd-cat/l2fwd-cat.c             | 1 +
>  examples/l2fwd-cat/meson.build             | 1 +
>  examples/l2fwd-crypto/main.c               | 1 +
>  examples/l2fwd-jobstats/Makefile           | 1 +
>  examples/l2fwd-jobstats/main.c             | 1 +
>  examples/l2fwd-jobstats/meson.build        | 1 +
>  examples/l2fwd-keepalive/Makefile          | 1 +
>  examples/l2fwd-keepalive/main.c            | 1 +
>  examples/l2fwd-keepalive/meson.build       | 1 +
>  examples/l2fwd/Makefile                    | 1 +
>  examples/l2fwd/main.c                      | 1 +
>  examples/l2fwd/meson.build                 | 1 +
>  examples/l3fwd-acl/Makefile                | 1 +
>  examples/l3fwd-acl/main.c                  | 1 +
>  examples/l3fwd-acl/meson.build             | 1 +
>  examples/l3fwd-power/main.c                | 1 +
>  examples/l3fwd-vf/Makefile                 | 1 +
>  examples/l3fwd-vf/main.c                   | 1 +
>  examples/l3fwd-vf/meson.build              | 1 +
>  examples/link_status_interrupt/Makefile    | 1 +
>  examples/link_status_interrupt/main.c      | 1 +
>  examples/link_status_interrupt/meson.build | 1 +
>  examples/load_balancer/Makefile            | 1 +
>  examples/load_balancer/init.c              | 1 +
>  examples/load_balancer/meson.build         | 1 +
>  examples/packet_ordering/Makefile          | 1 +
>  examples/packet_ordering/main.c            | 1 +
>  examples/packet_ordering/meson.build       | 1 +
>  examples/ptpclient/Makefile                | 1 +
>  examples/ptpclient/meson.build             | 1 +
>  examples/ptpclient/ptpclient.c             | 1 +
>  examples/qos_meter/Makefile                | 1 +
>  examples/qos_meter/main.c                  | 2 ++
>  examples/qos_meter/meson.build             | 1 +
>  examples/qos_sched/Makefile                | 1 +
>  examples/qos_sched/init.c                  | 1 +
>  examples/qos_sched/meson.build             | 1 +
>  examples/quota_watermark/qw/Makefile       | 1 +
>  examples/quota_watermark/qw/init.c         | 1 +
>  examples/rxtx_callbacks/main.c             | 1 +
>  examples/server_node_efd/server/Makefile   | 1 +
>  examples/server_node_efd/server/init.c     | 1 +
>  examples/skeleton/Makefile                 | 1 +
>  examples/skeleton/basicfwd.c               | 1 +
>  examples/skeleton/meson.build              | 1 +
>  examples/tep_termination/Makefile          | 1 +
>  examples/tep_termination/meson.build       | 1 +
>  examples/tep_termination/vxlan_setup.c     | 1 +
>  examples/vhost/Makefile                    | 1 +
>  examples/vhost/main.c                      | 1 +
>  examples/vm_power_manager/Makefile         | 1 +
>  examples/vm_power_manager/main.c           | 1 +
>  examples/vm_power_manager/meson.build      | 1 +
>  examples/vmdq/Makefile                     | 1 +
>  examples/vmdq/main.c                       | 1 +
>  examples/vmdq/meson.build                  | 1 +
>  examples/vmdq_dcb/Makefile                 | 1 +
>  examples/vmdq_dcb/main.c                   | 1 +
>  examples/vmdq_dcb/meson.build              | 1 +
>  83 files changed, 85 insertions(+)
>
> diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
> index 9acf666dc..a32f63187 100644
> --- a/examples/bbdev_app/main.c
> +++ b/examples/bbdev_app/main.c
> @@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
>  	}
>  
>  	rte_eth_promiscuous_enable(port_id);
> +	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN);

This is strange, since the function signature is defined (in 1/7) as:

  int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
				       uint32_t *set_ptypes, int num);

Did you mean to add more args?

>  	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
>  	print_mac(port_id, &bbdev_port_eth_addr);
> diff --git a/examples/bond/main.c b/examples/bond/main.c
> index 1c0df9d46..8beb1dc14 100644
> --- a/examples/bond/main.c
> +++ b/examples/bond/main.c
> @@ -195,6 +195,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
>  		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
>  				portid, retval);
>  
> +	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  	retval  = rte_eth_dev_start(portid);
>  	if (retval < 0)
>  		rte_exit(retval,
> @@ -271,6 +272,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
>  		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
>  				BOND_PORT, retval);
>  
> +	rte_eth_dev_set_supported_ptypes(BOND_PORT, RTE_PTYPE_UNKNOWN);
>  	retval  = rte_eth_dev_start(BOND_PORT);
>  	if (retval < 0)
>  		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
> diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
> index bac8d5578..a2a477279 100644
> --- a/examples/distributor/Makefile
> +++ b/examples/distributor/Makefile
> @@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
>  include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  # workaround for a gcc bug with noreturn attribute
>  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
> diff --git a/examples/distributor/main.c b/examples/distributor/main.c
> index 81d7ca61d..bc945d862 100644
> --- a/examples/distributor/main.c
> +++ b/examples/distributor/main.c
> @@ -162,6 +162,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
>  			return retval;
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	retval = rte_eth_dev_start(port);
>  	if (retval < 0)
>  		return retval;
> diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
> index 26f108d65..c2976f6bd 100644
> --- a/examples/distributor/meson.build
> +++ b/examples/distributor/meson.build
> @@ -10,6 +10,7 @@
>  build = dpdk_conf.has('RTE_LIBRTE_POWER')
>  
>  deps += ['distributor', 'power']
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )
> diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
> index a73b61d59..9f9968cf8 100644
> --- a/examples/eventdev_pipeline/main.c
> +++ b/examples/eventdev_pipeline/main.c
> @@ -393,6 +393,7 @@ main(int argc, char **argv)
>  
>  	/* Start the Ethernet port. */
>  	RTE_ETH_FOREACH_DEV(portid) {
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		err = rte_eth_dev_start(portid);
>  		if (err < 0)
>  			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
> diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
> index a54c35aa7..0fc916b05 100644
> --- a/examples/eventdev_pipeline/meson.build
> +++ b/examples/eventdev_pipeline/meson.build
> @@ -7,6 +7,7 @@
>  # DPDK instance, use 'make'
>  
>  deps += 'eventdev'
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c',
>  	'pipeline_worker_generic.c',
> diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
> index 90c7f133a..a7c961276 100644
> --- a/examples/exception_path/Makefile
> +++ b/examples/exception_path/Makefile
> @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
>  
> diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
> index 0d79e5a24..7dbc0970a 100644
> --- a/examples/exception_path/main.c
> +++ b/examples/exception_path/main.c
> @@ -464,6 +464,7 @@ init_port(uint16_t port)
>  		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
>  				port, ret);
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	ret = rte_eth_dev_start(port);
>  	if (ret < 0)
>  		FATAL_ERROR("Could not start port%u (%d)", port, ret);
> diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
> index c34e11e36..2b0a25036 100644
> --- a/examples/exception_path/meson.build
> +++ b/examples/exception_path/meson.build
> @@ -6,6 +6,7 @@
>  # To build this example as a standalone application with an already-installed
>  # DPDK instance, use 'make'
>  
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )
> diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
> index bc7f43ea9..aa25218a3 100644
> --- a/examples/flow_classify/flow_classify.c
> +++ b/examples/flow_classify/flow_classify.c
> @@ -231,6 +231,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
>  	}
>  
>  	/* Start the Ethernet port. */
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	retval = rte_eth_dev_start(port);
>  	if (retval < 0)
>  		return retval;
> diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
> index a63a75555..793a08fae 100644
> --- a/examples/flow_filtering/Makefile
> +++ b/examples/flow_filtering/Makefile
> @@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
>  
> diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
> index a0487be77..fbd1b6cc2 100644
> --- a/examples/flow_filtering/main.c
> +++ b/examples/flow_filtering/main.c
> @@ -176,6 +176,7 @@ init_port(void)
>  	}
>  
>  	rte_eth_promiscuous_enable(port_id);
> +	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN);
>  	ret = rte_eth_dev_start(port_id);
>  	if (ret < 0) {
>  		rte_exit(EXIT_FAILURE,
> diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
> index 407795c42..6f5d1b08a 100644
> --- a/examples/flow_filtering/meson.build
> +++ b/examples/flow_filtering/meson.build
> @@ -6,6 +6,7 @@
>  # To build this example as a standalone application with an already-installed
>  # DPDK instance, use 'make'
>  
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c',
>  )
> diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
> index 787eb866a..9f8b5b2ae 100644
> --- a/examples/ip_pipeline/link.c
> +++ b/examples/ip_pipeline/link.c
> @@ -205,6 +205,7 @@ link_create(const char *name, struct link_params *params)
>  			return NULL;
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN);
>  	/* Port start */
>  	status = rte_eth_dev_start(port_id);
>  	if (status < 0)
> diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
> index 0b1a904e0..19c462388 100644
> --- a/examples/ip_reassembly/Makefile
> +++ b/examples/ip_reassembly/Makefile
> @@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  # workaround for a gcc bug with noreturn attribute
>  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
> diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
> index 38b39be6b..ff5407892 100644
> --- a/examples/ip_reassembly/main.c
> +++ b/examples/ip_reassembly/main.c
> @@ -1158,6 +1158,7 @@ main(int argc, char **argv)
>  		if ((enabled_port_mask & (1 << portid)) == 0) {
>  			continue;
>  		}
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		/* Start device */
>  		ret = rte_eth_dev_start(portid);
>  		if (ret < 0)
> diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
> index 8ebd48291..8a667c265 100644
> --- a/examples/ip_reassembly/meson.build
> +++ b/examples/ip_reassembly/meson.build
> @@ -7,6 +7,7 @@
>  # DPDK instance, use 'make'
>  
>  deps += ['lpm', 'ip_frag']
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )
> diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
> index 0d1fd6af6..619d248c8 100644
> --- a/examples/ipsec-secgw/ipsec-secgw.c
> +++ b/examples/ipsec-secgw/ipsec-secgw.c
> @@ -2448,6 +2448,7 @@ main(int32_t argc, char **argv)
>  		if ((enabled_port_mask & (1 << portid)) == 0)
>  			continue;
>  
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		/*
>  		 * Start device
>  		 * note: device must be started before a flow rule
> diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
> index 5f8a67dd4..5171f7ab2 100644
> --- a/examples/ipv4_multicast/Makefile
> +++ b/examples/ipv4_multicast/Makefile
> @@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  # workaround for a gcc bug with noreturn attribute
>  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
> diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
> index 72eaadc51..29b3fed9c 100644
> --- a/examples/ipv4_multicast/main.c
> +++ b/examples/ipv4_multicast/main.c
> @@ -765,6 +765,7 @@ main(int argc, char **argv)
>  			qconf->tx_queue_id[portid] = queueid;
>  			queueid++;
>  		}
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		rte_eth_allmulticast_enable(portid);
>  		/* Start device */
>  		ret = rte_eth_dev_start(portid);
> diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
> index d9e4c7c21..6969e2c54 100644
> --- a/examples/ipv4_multicast/meson.build
> +++ b/examples/ipv4_multicast/meson.build
> @@ -7,6 +7,7 @@
>  # DPDK instance, use 'make'
>  
>  deps += 'hash'
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )
> diff --git a/examples/kni/main.c b/examples/kni/main.c
> index 4710d7176..3163087ff 100644
> --- a/examples/kni/main.c
> +++ b/examples/kni/main.c
> @@ -625,6 +625,7 @@ init_port(uint16_t port)
>  		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
>  				"port%u (%d)\n", (unsigned)port, ret);
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	ret = rte_eth_dev_start(port);
>  	if (ret < 0)
>  		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
> diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
> index c1960d6d3..d6a25e42a 100644
> --- a/examples/l2fwd-cat/Makefile
> +++ b/examples/l2fwd-cat/Makefile
> @@ -66,6 +66,7 @@ endif
>  EXTRA_CFLAGS += -O3 -g -Wfatal-errors
>  
>  CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  LDLIBS += -L$(PQOS_INSTALL_PATH)
>  LDLIBS += -lpqos
> diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
> index b34b40a00..ddd9888b1 100644
> --- a/examples/l2fwd-cat/l2fwd-cat.c
> +++ b/examples/l2fwd-cat/l2fwd-cat.c
> @@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
>  			return retval;
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	/* Start the Ethernet port. */
>  	retval = rte_eth_dev_start(port);
>  	if (retval < 0)
> diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
> index 4e2777a03..37c96040d 100644
> --- a/examples/l2fwd-cat/meson.build
> +++ b/examples/l2fwd-cat/meson.build
> @@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
>  build = pqos.found()
>  ext_deps += pqos
>  cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
> +allow_experimental_apis = true
>  sources = files(
>  	'cat.c', 'l2fwd-cat.c'
>  )
> diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
> index 3fe2ba725..6aad08b06 100644
> --- a/examples/l2fwd-crypto/main.c
> +++ b/examples/l2fwd-crypto/main.c
> @@ -2559,6 +2559,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
>  			return -1;
>  		}
>  
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		/* Start device */
>  		retval = rte_eth_dev_start(portid);
>  		if (retval < 0) {
> diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
> index 729a39e93..09834e979 100644
> --- a/examples/l2fwd-jobstats/Makefile
> +++ b/examples/l2fwd-jobstats/Makefile
> @@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
>  endif
> diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
> index 77e44dc82..61ad8e759 100644
> --- a/examples/l2fwd-jobstats/main.c
> +++ b/examples/l2fwd-jobstats/main.c
> @@ -902,6 +902,7 @@ main(int argc, char **argv)
>  			"Cannot set error callback for tx buffer on port %u\n",
>  				 portid);
>  
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		/* Start device */
>  		ret = rte_eth_dev_start(portid);
>  		if (ret < 0)
> diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
> index 1ffd484e2..3653aa7ec 100644
> --- a/examples/l2fwd-jobstats/meson.build
> +++ b/examples/l2fwd-jobstats/meson.build
> @@ -7,6 +7,7 @@
>  # DPDK instance, use 'make'
>  
>  deps += ['jobstats', 'timer']
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )
> diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
> index 37de27a6f..584257ae2 100644
> --- a/examples/l2fwd-keepalive/Makefile
> +++ b/examples/l2fwd-keepalive/Makefile
> @@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  LDFLAGS += -lrt
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
> diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
> index 9831a4323..bf662bd37 100644
> --- a/examples/l2fwd-keepalive/main.c
> +++ b/examples/l2fwd-keepalive/main.c
> @@ -696,6 +696,7 @@ main(int argc, char **argv)
>  			"Cannot set error callback for tx buffer on port %u\n",
>  				 portid);
>  
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		/* Start device */
>  		ret = rte_eth_dev_start(portid);
>  		if (ret < 0)
> diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
> index 6f7b007e1..2dffffaaa 100644
> --- a/examples/l2fwd-keepalive/meson.build
> +++ b/examples/l2fwd-keepalive/meson.build
> @@ -8,6 +8,7 @@
>  
>  ext_deps += cc.find_library('rt')
>  deps += 'timer'
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c', 'shm.c'
>  )
> diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
> index 230352093..123e6161c 100644
> --- a/examples/l2fwd/Makefile
> +++ b/examples/l2fwd/Makefile
> @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
>  endif
> diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
> index 1e2b14297..1b940038f 100644
> --- a/examples/l2fwd/main.c
> +++ b/examples/l2fwd/main.c
> @@ -694,6 +694,7 @@ main(int argc, char **argv)
>  			"Cannot set error callback for tx buffer on port %u\n",
>  				 portid);
>  
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		/* Start device */
>  		ret = rte_eth_dev_start(portid);
>  		if (ret < 0)
> diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
> index c34e11e36..2b0a25036 100644
> --- a/examples/l2fwd/meson.build
> +++ b/examples/l2fwd/meson.build
> @@ -6,6 +6,7 @@
>  # To build this example as a standalone application with an already-installed
>  # DPDK instance, use 'make'
>  
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )
> diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
> index e2c989f71..df590f8e9 100644
> --- a/examples/l3fwd-acl/Makefile
> +++ b/examples/l3fwd-acl/Makefile
> @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  # workaround for a gcc bug with noreturn attribute
>  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
> diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
> index 0c44df767..1a0c09c1d 100644
> --- a/examples/l3fwd-acl/main.c
> +++ b/examples/l3fwd-acl/main.c
> @@ -2056,6 +2056,7 @@ main(int argc, char **argv)
>  		if ((enabled_port_mask & (1 << portid)) == 0)
>  			continue;
>  
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		/* Start device */
>  		ret = rte_eth_dev_start(portid);
>  		if (ret < 0)
> diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
> index 7096e00c1..68cebd6ce 100644
> --- a/examples/l3fwd-acl/meson.build
> +++ b/examples/l3fwd-acl/meson.build
> @@ -7,6 +7,7 @@
>  # DPDK instance, use 'make'
>  
>  deps += ['acl', 'lpm', 'hash']
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )
> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
> index fd8d9528f..136f446b3 100644
> --- a/examples/l3fwd-power/main.c
> +++ b/examples/l3fwd-power/main.c
> @@ -2426,6 +2426,7 @@ main(int argc, char **argv)
>  		if ((enabled_port_mask & (1 << portid)) == 0) {
>  			continue;
>  		}
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		/* Start device */
>  		ret = rte_eth_dev_start(portid);
>  		if (ret < 0)
> diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
> index 7b186a23c..db7f51f2f 100644
> --- a/examples/l3fwd-vf/Makefile
> +++ b/examples/l3fwd-vf/Makefile
> @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3 $(USER_FLAGS)
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  # workaround for a gcc bug with noreturn attribute
>  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
> diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
> index 572e74cf5..387d2426c 100644
> --- a/examples/l3fwd-vf/main.c
> +++ b/examples/l3fwd-vf/main.c
> @@ -1051,6 +1051,7 @@ main(int argc, char **argv)
>  		if ((enabled_port_mask & (1 << portid)) == 0) {
>  			continue;
>  		}
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		/* Start device */
>  		ret = rte_eth_dev_start(portid);
>  		if (ret < 0)
> diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
> index 226286e74..00f3c38f4 100644
> --- a/examples/l3fwd-vf/meson.build
> +++ b/examples/l3fwd-vf/meson.build
> @@ -7,6 +7,7 @@
>  # DPDK instance, use 'make'
>  
>  deps += ['lpm', 'hash']
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )
> diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
> index 97e5a14a8..6ddedd4de 100644
> --- a/examples/link_status_interrupt/Makefile
> +++ b/examples/link_status_interrupt/Makefile
> @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
>  endif
> diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
> index 9cd4dc7a6..abd84b862 100644
> --- a/examples/link_status_interrupt/main.c
> +++ b/examples/link_status_interrupt/main.c
> @@ -676,6 +676,7 @@ main(int argc, char **argv)
>  			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
>  					"tx buffer on port %u\n", (unsigned) portid);
>  
> +		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  		/* Start device */
>  		ret = rte_eth_dev_start(portid);
>  		if (ret < 0)
> diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
> index c34e11e36..2b0a25036 100644
> --- a/examples/link_status_interrupt/meson.build
> +++ b/examples/link_status_interrupt/meson.build
> @@ -6,6 +6,7 @@
>  # To build this example as a standalone application with an already-installed
>  # DPDK instance, use 'make'
>  
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )
> diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
> index caae8a107..dcba9194c 100644
> --- a/examples/load_balancer/Makefile
> +++ b/examples/load_balancer/Makefile
> @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3 -g
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  # workaround for a gcc bug with noreturn attribute
>  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
> diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
> index 3ab7d0211..52f677fd4 100644
> --- a/examples/load_balancer/init.c
> +++ b/examples/load_balancer/init.c
> @@ -496,6 +496,7 @@ app_init_nics(void)
>  			}
>  		}
>  
> +		rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  		/* Start port */
>  		ret = rte_eth_dev_start(port);
>  		if (ret < 0) {
> diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
> index 4f7ac3999..19708974c 100644
> --- a/examples/load_balancer/meson.build
> +++ b/examples/load_balancer/meson.build
> @@ -7,6 +7,7 @@
>  # DPDK instance, use 'make'
>  
>  deps += 'lpm'
> +allow_experimental_apis = true
>  sources = files(
>  	'config.c', 'init.c', 'main.c', 'runtime.c'
>  )
> diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
> index 51acaf7eb..9ba3fa9e8 100644
> --- a/examples/packet_ordering/Makefile
> +++ b/examples/packet_ordering/Makefile
> @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
>  endif
> diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
> index 030e92299..41295690d 100644
> --- a/examples/packet_ordering/main.c
> +++ b/examples/packet_ordering/main.c
> @@ -312,6 +312,7 @@ configure_eth_port(uint16_t port_id)
>  			return ret;
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN);
>  	ret = rte_eth_dev_start(port_id);
>  	if (ret < 0)
>  		return ret;
> diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
> index 6c2fccdcb..a3776946f 100644
> --- a/examples/packet_ordering/meson.build
> +++ b/examples/packet_ordering/meson.build
> @@ -7,6 +7,7 @@
>  # DPDK instance, use 'make'
>  
>  deps += 'reorder'
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )
> diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
> index 89e2bacbd..f158d96b9 100644
> --- a/examples/ptpclient/Makefile
> +++ b/examples/ptpclient/Makefile
> @@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
>  include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  CFLAGS += $(WERROR_FLAGS)
>  
>  # workaround for a gcc bug with noreturn attribute
> diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
> index fa0cbe93c..d4171a218 100644
> --- a/examples/ptpclient/meson.build
> +++ b/examples/ptpclient/meson.build
> @@ -6,6 +6,7 @@
>  # To build this example as a standalone application with an already-installed
>  # DPDK instance, use 'make'
>  
> +allow_experimental_apis = true
>  sources = files(
>  	'ptpclient.c'
>  )
> diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
> index 31778fd95..351596fc3 100644
> --- a/examples/ptpclient/ptpclient.c
> +++ b/examples/ptpclient/ptpclient.c
> @@ -227,6 +227,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
>  			return retval;
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	/* Start the Ethernet port. */
>  	retval = rte_eth_dev_start(port);
>  	if (retval < 0)
> diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
> index e5217cf7c..a1533d08f 100644
> --- a/examples/qos_meter/Makefile
> +++ b/examples/qos_meter/Makefile
> @@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
>  include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  CFLAGS += $(WERROR_FLAGS)
>  
>  # workaround for a gcc bug with noreturn attribute
> diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
> index da7afe8be..2accbc9b6 100644
> --- a/examples/qos_meter/main.c
> +++ b/examples/qos_meter/main.c
> @@ -419,10 +419,12 @@ main(int argc, char **argv)
>  
>  	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
>  
> +	rte_eth_dev_set_supported_ptypes(port_rx, RTE_PTYPE_UNKNOWN);
>  	ret = rte_eth_dev_start(port_rx);
>  	if (ret < 0)
>  		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
>  
> +	rte_eth_dev_set_supported_ptypes(port_tx, RTE_PTYPE_UNKNOWN);
>  	ret = rte_eth_dev_start(port_tx);
>  	if (ret < 0)
>  		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
> diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
> index ef7779f2f..10cd4bc79 100644
> --- a/examples/qos_meter/meson.build
> +++ b/examples/qos_meter/meson.build
> @@ -7,6 +7,7 @@
>  # DPDK instance, use 'make'
>  
>  deps += 'meter'
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c', 'rte_policer.c'
>  )
> diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
> index ce2d25371..7d3d3019f 100644
> --- a/examples/qos_sched/Makefile
> +++ b/examples/qos_sched/Makefile
> @@ -58,6 +58,7 @@ else
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
>  
> diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
> index b05206d5a..35e4c90a2 100644
> --- a/examples/qos_sched/init.c
> +++ b/examples/qos_sched/init.c
> @@ -138,6 +138,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
>  			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
>  			 ret, portid, 0);
>  
> +	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN);
>  	/* Start device */
>  	ret = rte_eth_dev_start(portid);
>  	if (ret < 0)
> diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
> index 289b81ce8..5101652af 100644
> --- a/examples/qos_sched/meson.build
> +++ b/examples/qos_sched/meson.build
> @@ -7,6 +7,7 @@
>  # DPDK instance, use 'make'
>  
>  deps += ['sched', 'cfgfile']
> +allow_experimental_apis = true
>  sources = files(
>  	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
>  	'init.c', 'main.c', 'stats.c'
> diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
> index 3f10f01c3..e06f4482b 100644
> --- a/examples/quota_watermark/qw/Makefile
> +++ b/examples/quota_watermark/qw/Makefile
> @@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
>  
>  CFLAGS += -O3 -DQW_SOFTWARE_FC
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
> diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
> index 5a0f64f45..098e3c16e 100644
> --- a/examples/quota_watermark/qw/init.c
> +++ b/examples/quota_watermark/qw/init.c
> @@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
>  				"Failed to setup hardware flow control on port %u (error %d)\n",
>  				(unsigned int) port_id, ret);
>  
> +	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN);
>  	/* Start the port */
>  	ret = rte_eth_dev_start(port_id);
>  	if (ret < 0)
> diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
> index dbcd9f4fc..c4acac585 100644
> --- a/examples/rxtx_callbacks/main.c
> +++ b/examples/rxtx_callbacks/main.c
> @@ -152,6 +152,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
>  			return retval;
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	retval  = rte_eth_dev_start(port);
>  	if (retval < 0)
>  		return retval;
> diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
> index 4837bd3ea..acbd12ae2 100644
> --- a/examples/server_node_efd/server/Makefile
> +++ b/examples/server_node_efd/server/Makefile
> @@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
>  
>  CFLAGS += $(WERROR_FLAGS) -O3
>  CFLAGS += -I$(SRCDIR)/../shared
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
> diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
> index af5a18e28..b4ff9dd57 100644
> --- a/examples/server_node_efd/server/init.c
> +++ b/examples/server_node_efd/server/init.c
> @@ -149,6 +149,7 @@ init_port(uint16_t port_num)
>  
>  	rte_eth_promiscuous_enable(port_num);
>  
> +	rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN);
>  	retval = rte_eth_dev_start(port_num);
>  	if (retval < 0)
>  		return retval;
> diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
> index c5ac26029..0037d6b25 100644
> --- a/examples/skeleton/Makefile
> +++ b/examples/skeleton/Makefile
> @@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
>  include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  # workaround for a gcc bug with noreturn attribute
>  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
> diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
> index a8a8e98f0..6c10a06ef 100644
> --- a/examples/skeleton/basicfwd.c
> +++ b/examples/skeleton/basicfwd.c
> @@ -76,6 +76,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
>  			return retval;
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	/* Start the Ethernet port. */
>  	retval = rte_eth_dev_start(port);
>  	if (retval < 0)
> diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
> index 9bb9ec329..ef46b187e 100644
> --- a/examples/skeleton/meson.build
> +++ b/examples/skeleton/meson.build
> @@ -6,6 +6,7 @@
>  # To build this example as a standalone application with an already-installed
>  # DPDK instance, use 'make'
>  
> +allow_experimental_apis = true
>  sources = files(
>  	'basicfwd.c'
>  )
> diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
> index 31165bd92..586838676 100644
> --- a/examples/tep_termination/Makefile
> +++ b/examples/tep_termination/Makefile
> @@ -61,6 +61,7 @@ endif
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
>  CFLAGS += -Wno-deprecated-declarations
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
>  endif
> diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
> index f65d68980..f40b1c0b8 100644
> --- a/examples/tep_termination/meson.build
> +++ b/examples/tep_termination/meson.build
> @@ -11,6 +11,7 @@ if not is_linux
>  endif
>  deps += ['hash', 'vhost']
>  cflags += '-Wno-deprecated-declarations'
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c', 'vxlan.c', 'vxlan_setup.c'
>  )
> diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
> index 9a0880002..538a54b3a 100644
> --- a/examples/tep_termination/vxlan_setup.c
> +++ b/examples/tep_termination/vxlan_setup.c
> @@ -167,6 +167,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
>  			return retval;
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	/* Start the device. */
>  	retval  = rte_eth_dev_start(port);
>  	if (retval < 0)
> diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
> index f84b7f017..7722e81c7 100644
> --- a/examples/vhost/Makefile
> +++ b/examples/vhost/Makefile
> @@ -62,6 +62,7 @@ else
>  CFLAGS += -DALLOW_EXPERIMENTAL_API
>  CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
>  
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index 0961db080..57438b22c 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -321,6 +321,7 @@ port_init(uint16_t port)
>  		}
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	/* Start the device. */
>  	retval  = rte_eth_dev_start(port);
>  	if (retval < 0) {
> diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
> index 2fdb991d7..65c2ad179 100644
> --- a/examples/vm_power_manager/Makefile
> +++ b/examples/vm_power_manager/Makefile
> @@ -28,6 +28,7 @@ endif
>  
>  CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  LDLIBS += -lvirt
>  
> diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
> index 54c704610..190a7a9ea 100644
> --- a/examples/vm_power_manager/main.c
> +++ b/examples/vm_power_manager/main.c
> @@ -99,6 +99,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
>  			return retval;
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	/* Start the Ethernet port. */
>  	retval = rte_eth_dev_start(port);
>  	if (retval < 0)
> diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
> index 20a4a05b3..54e2b584f 100644
> --- a/examples/vm_power_manager/meson.build
> +++ b/examples/vm_power_manager/meson.build
> @@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
>  	deps += ['pmd_ixgbe']
>  endif
>  
> +allow_experimental_apis = true
>  sources = files(
>  	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
>  )
> diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
> index 1557ee86b..2168747cc 100644
> --- a/examples/vmdq/Makefile
> +++ b/examples/vmdq/Makefile
> @@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
>  include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  EXTRA_CFLAGS += -O3
>  
> diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
> index 7281ffd7f..87cf230f4 100644
> --- a/examples/vmdq/main.c
> +++ b/examples/vmdq/main.c
> @@ -258,6 +258,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
>  		}
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	retval  = rte_eth_dev_start(port);
>  	if (retval < 0) {
>  		printf("port %d start failed\n", port);
> diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
> index c34e11e36..2b0a25036 100644
> --- a/examples/vmdq/meson.build
> +++ b/examples/vmdq/meson.build
> @@ -6,6 +6,7 @@
>  # To build this example as a standalone application with an already-installed
>  # DPDK instance, use 'make'
>  
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )
> diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
> index 391096cfb..ea1574d91 100644
> --- a/examples/vmdq_dcb/Makefile
> +++ b/examples/vmdq_dcb/Makefile
> @@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
>  include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  # workaround for a gcc bug with noreturn attribute
>  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
> diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
> index 389000327..bace88e47 100644
> --- a/examples/vmdq_dcb/main.c
> +++ b/examples/vmdq_dcb/main.c
> @@ -313,6 +313,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
>  		}
>  	}
>  
> +	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN);
>  	retval  = rte_eth_dev_start(port);
>  	if (retval < 0) {
>  		printf("port %d start failed\n", port);
> diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
> index c34e11e36..2b0a25036 100644
> --- a/examples/vmdq_dcb/meson.build
> +++ b/examples/vmdq_dcb/meson.build
> @@ -6,6 +6,7 @@
>  # To build this example as a standalone application with an already-installed
>  # DPDK instance, use 'make'
>  
> +allow_experimental_apis = true
>  sources = files(
>  	'main.c'
>  )

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v3 7/7] examples: disable Rx packet type parsing
  2019-09-30 17:47     ` Aaron Conole
@ 2019-10-01  5:02       ` Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-10-01  5:02 UTC (permalink / raw)
  To: Aaron Conole
  Cc: arybchenko, Jerin Jacob Kollanukkaran, Nicolas Chautru,
	Chas Williams, David Hunt, Harry van Haaren, Marko Kovacevic,
	Ori Kam, Bruce Richardson, Radu Nicolau, Akhil Goyal,
	Tomasz Kantecki, Bernard Iremonger, Cristian Dumitrescu,
	Konstantin Ananyev, Ferruh Yigit, Declan Doherty, Reshma Pattan,
	John McNamara, Xiaoyun Li, Jasvinder Singh, Byron Marohn,
	Yipeng Wang, Maxime Coquelin, Tiwei Bie, Zhihong Wang, dev

<snip>
>*app_params,
>>  	}
>>
>>  	rte_eth_promiscuous_enable(port_id);
>> +	rte_eth_dev_set_supported_ptypes(port_id,
>RTE_PTYPE_UNKNOWN);
>
>This is strange, since the function signature is defined (in 1/7) as:
>
>  int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t
>ptype_mask,
>				       uint32_t *set_ptypes, int num);
>
>Did you mean to add more args?

Ah yes, my bad. I will send v4.

Thanks,
Pavan.

>
>>  	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);

<snip>

^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v4 0/7] ethdev: add new Rx offload flags
  2019-09-29 21:19 ` [dpdk-dev] [PATCH v3 0/7] ethdev: add new Rx offload flags pbhagavatula
                     ` (6 preceding siblings ...)
  2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-10-01  6:34   ` pbhagavatula
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 1/7] ethdev: add set ptype function pbhagavatula
                       ` (7 more replies)
  7 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:34 UTC (permalink / raw)
  To: arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
`DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN, NULL,
					  0);

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.


Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add flow action type update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  drivers/net: update Rx flow flag and mark capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples: disable Rx packet type parsing

 doc/guides/nics/features.rst                  |  22 +++-
 doc/guides/rel_notes/release_19_11.rst        |  23 ++++
 drivers/net/bnxt/bnxt_ethdev.c                |   4 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   3 +-
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_res.c                   |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   3 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   3 +-
 drivers/net/i40e/i40e_ethdev.c                |   4 +-
 drivers/net/iavf/iavf_ethdev.c                |   4 +-
 drivers/net/ice/ice_ethdev.c                  |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |   4 +-
 drivers/net/liquidio/lio_ethdev.c             |   3 +-
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   4 +-
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   3 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  16 +--
 drivers/net/octeontx2/otx2_flow_parse.c       |   3 +-
 drivers/net/qede/qede_ethdev.c                |   3 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   3 +-
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   3 +-
 examples/bbdev_app/main.c                     |   1 +
 examples/bond/main.c                          |   2 +
 examples/distributor/Makefile                 |   1 +
 examples/distributor/main.c                   |   1 +
 examples/distributor/meson.build              |   1 +
 examples/eventdev_pipeline/main.c             | 115 +----------------
 examples/eventdev_pipeline/meson.build        |   1 +
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 examples/exception_path/Makefile              |   1 +
 examples/exception_path/main.c                |   1 +
 examples/exception_path/meson.build           |   1 +
 examples/flow_classify/flow_classify.c        |   1 +
 examples/flow_filtering/Makefile              |   1 +
 examples/flow_filtering/main.c                |   1 +
 examples/flow_filtering/meson.build           |   1 +
 examples/ip_pipeline/link.c                   |   1 +
 examples/ip_reassembly/Makefile               |   1 +
 examples/ip_reassembly/main.c                 |   2 +
 examples/ip_reassembly/meson.build            |   1 +
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +
 examples/ipv4_multicast/Makefile              |   1 +
 examples/ipv4_multicast/main.c                |   2 +
 examples/ipv4_multicast/meson.build           |   1 +
 examples/kni/main.c                           |   1 +
 examples/l2fwd-cat/Makefile                   |   1 +
 examples/l2fwd-cat/l2fwd-cat.c                |   1 +
 examples/l2fwd-cat/meson.build                |   1 +
 examples/l2fwd-crypto/main.c                  |   2 +
 examples/l2fwd-jobstats/Makefile              |   1 +
 examples/l2fwd-jobstats/main.c                |   2 +
 examples/l2fwd-jobstats/meson.build           |   1 +
 examples/l2fwd-keepalive/Makefile             |   1 +
 examples/l2fwd-keepalive/main.c               |   2 +
 examples/l2fwd-keepalive/meson.build          |   1 +
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 examples/l3fwd-acl/Makefile                   |   1 +
 examples/l3fwd-acl/main.c                     |   2 +
 examples/l3fwd-acl/meson.build                |   1 +
 examples/l3fwd-power/Makefile                 |   1 -
 examples/l3fwd-vf/Makefile                    |   1 +
 examples/l3fwd-vf/main.c                      |   2 +
 examples/l3fwd-vf/meson.build                 |   1 +
 examples/link_status_interrupt/Makefile       |   1 +
 examples/link_status_interrupt/main.c         |   2 +
 examples/link_status_interrupt/meson.build    |   1 +
 examples/load_balancer/Makefile               |   1 +
 examples/load_balancer/init.c                 |   2 +
 examples/load_balancer/meson.build            |   1 +
 examples/packet_ordering/Makefile             |   1 +
 examples/packet_ordering/main.c               |   1 +
 examples/packet_ordering/meson.build          |   1 +
 examples/ptpclient/Makefile                   |   1 +
 examples/ptpclient/meson.build                |   1 +
 examples/ptpclient/ptpclient.c                |   1 +
 examples/qos_meter/Makefile                   |   1 +
 examples/qos_meter/main.c                     |   2 +
 examples/qos_meter/meson.build                |   1 +
 examples/qos_sched/Makefile                   |   1 +
 examples/qos_sched/init.c                     |   1 +
 examples/qos_sched/meson.build                |   1 +
 examples/quota_watermark/qw/Makefile          |   1 +
 examples/quota_watermark/qw/init.c            |   1 +
 examples/rxtx_callbacks/main.c                |   1 +
 examples/server_node_efd/server/Makefile      |   1 +
 examples/server_node_efd/server/init.c        |   1 +
 examples/skeleton/Makefile                    |   1 +
 examples/skeleton/basicfwd.c                  |   1 +
 examples/skeleton/meson.build                 |   1 +
 examples/tep_termination/Makefile             |   1 +
 examples/tep_termination/meson.build          |   1 +
 examples/tep_termination/vxlan_setup.c        |   1 +
 examples/vhost/Makefile                       |   1 +
 examples/vhost/main.c                         |   1 +
 examples/vm_power_manager/Makefile            |   1 +
 examples/vm_power_manager/main.c              |   1 +
 examples/vm_power_manager/meson.build         |   1 +
 examples/vmdq/Makefile                        |   1 +
 examples/vmdq/main.c                          |   1 +
 examples/vmdq/meson.build                     |   1 +
 examples/vmdq_dcb/Makefile                    |   1 +
 examples/vmdq_dcb/main.c                      |   1 +
 examples/vmdq_dcb/meson.build                 |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  40 ++++++
 lib/librte_ethdev/rte_ethdev.h                |  31 +++++
 lib/librte_ethdev/rte_ethdev_core.h           |   6 +
 lib/librte_ethdev/rte_ethdev_version.map      |   3 +
 lib/librte_ethdev/rte_flow.h                  |   6 +-
 118 files changed, 521 insertions(+), 150 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v4 1/7] ethdev: add set ptype function
  2019-10-01  6:34   ` [dpdk-dev] [PATCH v4 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-10-01  6:34     ` pbhagavatula
  2019-10-01  7:04       ` Andrew Rybchenko
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                       ` (6 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:34 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 doc/guides/nics/features.rst             |  8 +++--
 doc/guides/rel_notes/release_19_11.rst   |  7 +++++
 lib/librte_ethdev/rte_ethdev.c           | 38 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 29 ++++++++++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      |  6 ++++
 lib/librte_ethdev/rte_ethdev_version.map |  3 ++
 6 files changed, 89 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index c4e128d2f..1756fa73a 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,13 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+  ``dev_supported_ptypes_set``.
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 27cfbd9e3..7e31b9401 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -56,6 +56,13 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e1f..061de7ac5 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2602,6 +2602,44 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, int num)
+{
+	int i, j;
+	struct rte_eth_dev *dev;
+	const uint32_t *all_ptypes;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set, 0);
+
+	if (ptype_mask == 0)
+		return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL)
+		return 0;
+
+	for (i = 0, j = 0; set_ptypes && (all_ptypes[i] != RTE_PTYPE_UNKNOWN);
+									++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+}
+
 void
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d9871782e..6c5fd789a 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2431,6 +2431,35 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification in which
+ * the recipient is interested.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accomodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 2922d5b7c..93bc34480 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+/**< @internal Inform device about packet types in which the recipient is interested. */
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -421,6 +425,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform device about packet types in which the recipient is interested. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6df42a47b..e14745b9c 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -283,4 +283,7 @@ EXPERIMENTAL {
 
 	# added in 19.08
 	rte_eth_read_clock;
+
+	# added in 19.11
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v4 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-01  6:34   ` [dpdk-dev] [PATCH v4 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-01  6:34     ` pbhagavatula
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 3/7] ethdev: add flow action type " pbhagavatula
                       ` (5 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:34 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 2 ++
 doc/guides/rel_notes/release_19_11.rst | 7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 1 +
 lib/librte_ethdev/rte_ethdev.h         | 1 +
 4 files changed, 11 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 1756fa73a..f7c6d918f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 7e31b9401..78ce0bc0e 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -64,6 +64,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 Removed Items
 -------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 061de7ac5..6df2af6a6 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 6c5fd789a..2bd7c27fc 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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v4 3/7] ethdev: add flow action type update as an offload
  2019-10-01  6:34   ` [dpdk-dev] [PATCH v4 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 1/7] ethdev: add set ptype function pbhagavatula
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-01  6:34     ` pbhagavatula
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                       ` (4 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:34 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, Adrien Mazarguil
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 12 ++++++++++++
 doc/guides/rel_notes/release_19_11.rst |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.c         |  1 +
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 lib/librte_ethdev/rte_flow.h           |  6 ++++--
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f7c6d918f..9737ff7a1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@ Allows application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 78ce0bc0e..2ec521165 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -71,6 +71,15 @@ New Features
   *  PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
      by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
 
+* **Added Rx offload flag to enable or diable flow action type update**
+
+  *  Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
+     `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
+     `RTE_FLOW_ACTION_FLAG` are enabled.
+  *  PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
+     by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
+
 Removed Items
 -------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 6df2af6a6..2d1c2a2c0 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 2bd7c27fc..b536c3b8b 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1014,6 +1014,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index 354cb1dd0..5d62686c0 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1316,7 +1316,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1324,7 +1325,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * No associated configuration structure.
 	 */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v4 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-01  6:34   ` [dpdk-dev] [PATCH v4 0/7] ethdev: add new Rx offload flags pbhagavatula
                       ` (2 preceding siblings ...)
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-10-01  6:34     ` pbhagavatula
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
                       ` (3 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:34 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 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/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
 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/liquidio/lio_ethdev.c    |  3 ++-
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
 25 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7d9..6c106baf7 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_RSS_HASH)
 
 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..22e61a55c 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_RSS_HASH)
 
 
 #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..18c7bd0d5 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_RSS_HASH;
 
 /* 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..55a1c4455 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_RSS_HASH;
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 9405e1933..607a085f8 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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d72129..ba9b174cf 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1797,7 +1797,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af9053..53bd2b9ae 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->rx_offload_capa = 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_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7ab5..7058e0213 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_RSS_HASH;
 
 	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..aef91a79b 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_RSS_HASH;
 	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 63997fdfb..2e2a6b2af 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2145,7 +2145,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index c25dab00c..ff118586e 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -406,7 +406,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	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..b5fd57693 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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..230d64c8a 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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index b84128fef..2e88d1844 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 7b15d6bc8..0cca6746d 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_RSS_HASH)
 
 #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..da25b26df 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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 9cd5eb65b..da768ced7 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 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] 246+ messages in thread

* [dpdk-dev] [PATCH v4 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-10-01  6:34   ` [dpdk-dev] [PATCH v4 0/7] ethdev: add new Rx offload flags pbhagavatula
                       ` (3 preceding siblings ...)
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-01  6:34     ` pbhagavatula
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                       ` (2 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:34 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
flag and mark.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 3 ++-
 drivers/net/enic/enic_res.c             | 3 ++-
 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/mlx5/mlx5_rxq.c             | 3 ++-
 drivers/net/octeontx2/otx2_ethdev.h     | 3 ++-
 drivers/net/octeontx2/otx2_flow_parse.c | 3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c      | 3 ++-
 10 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6c106baf7..fd1fb7eda 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -161,7 +161,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_JUMBO_FRAME | \
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_RSS_HASH)
+				     DEV_RX_OFFLOAD_RSS_HASH | \
+				     DEV_RX_OFFLOAD_FLOW_MARK)
 
 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/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 607a085f8..3503d5d7e 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -199,7 +199,8 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7058e0213..6311943be 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3512,7 +3512,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_VLAN_EXTEND |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 
 	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 aef91a79b..7bdaa87b1 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -518,7 +518,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_SCATTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	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 2e2a6b2af..984af659f 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2146,7 +2146,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 			DEV_RX_OFFLOAD_VLAN_EXTEND |
-			DEV_RX_OFFLOAD_RSS_HASH;
+			DEV_RX_OFFLOAD_RSS_HASH |
+			DEV_RX_OFFLOAD_FLOW_MARK;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index fa572d184..1481e2426 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
 		   DEV_RX_OFFLOAD_VLAN_FILTER |
 		   DEV_RX_OFFLOAD_SCATTER |
-		   DEV_RX_OFFLOAD_RSS_HASH;
+		   DEV_RX_OFFLOAD_RSS_HASH |
+		   DEV_RX_OFFLOAD_FLOW_MARK;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index b5fd57693..1bf01bda3 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
 	uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
 			     DEV_RX_OFFLOAD_TIMESTAMP |
 			     DEV_RX_OFFLOAD_JUMBO_FRAME |
-			     DEV_RX_OFFLOAD_RSS_HASH);
+			     DEV_RX_OFFLOAD_RSS_HASH |
+			     DEV_RX_OFFLOAD_FLOW_MARK);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 0cca6746d..97c1a636a 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -141,7 +141,8 @@
 	DEV_RX_OFFLOAD_VLAN_FILTER	| \
 	DEV_RX_OFFLOAD_QINQ_STRIP	| \
 	DEV_RX_OFFLOAD_TIMESTAMP	| \
-	DEV_RX_OFFLOAD_RSS_HASH)
+	DEV_RX_OFFLOAD_RSS_HASH		| \
+	DEV_RX_OFFLOAD_FLOW_MARK)
 
 #define NIX_DEFAULT_RSS_CTX_GROUP  0
 #define NIX_DEFAULT_RSS_MCAM_IDX  -1
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a70..6eb69a8b2 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -979,7 +979,8 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 	if (mark)
 		flow->npc_action |= (uint64_t)mark << 40;
 
-	if (rte_atomic32_read(&npc->mark_actions) == 1) {
+	if (rte_atomic32_read(&npc->mark_actions) == 1 &&
+			(hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK)) {
 		hw->rx_offload_flags |=
 			NIX_RX_OFFLOAD_MARK_UPDATE_F;
 		otx2_eth_set_rx_function(dev);
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 220ef0e47..1887731e2 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v4 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-01  6:34   ` [dpdk-dev] [PATCH v4 0/7] ethdev: add new Rx offload flags pbhagavatula
                       ` (4 preceding siblings ...)
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-10-01  6:34     ` pbhagavatula
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 7/7] examples: disable Rx packet type parsing pbhagavatula
  2019-10-01  6:41     ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:34 UTC (permalink / raw)
  To: arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 113 -----------------
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 3 files changed, 232 insertions(+), 113 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f541..a73b61d59 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,118 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	rte_eth_dev_info_get(port, &dev_info);
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	rte_eth_macaddr_get(port, &addr);
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
 
 static void
 do_capability_setup(uint8_t eventdev_id)
@@ -501,7 +389,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..aa1678fe7 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,123 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +414,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 8961cd656..52a1b4174 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,119 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +734,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v4 7/7] examples: disable Rx packet type parsing
  2019-10-01  6:34   ` [dpdk-dev] [PATCH v4 0/7] ethdev: add new Rx offload flags pbhagavatula
                       ` (5 preceding siblings ...)
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-01  6:34     ` pbhagavatula
  2019-10-01  6:41     ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:34 UTC (permalink / raw)
  To: arybchenko, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki, Bernard Iremonger,
	Cristian Dumitrescu, Konstantin Ananyev, Ferruh Yigit,
	Declan Doherty, Reshma Pattan, John McNamara, Xiaoyun Li,
	Jasvinder Singh, Byron Marohn, Yipeng Wang, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing in examples that don't use
`rte_mbuf::packet_type` by setting ptype_mask as 0 in
`rte_eth_dev_set_supported_ptypes`

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/bbdev_app/main.c                  | 1 +
 examples/bond/main.c                       | 2 ++
 examples/distributor/Makefile              | 1 +
 examples/distributor/main.c                | 1 +
 examples/distributor/meson.build           | 1 +
 examples/eventdev_pipeline/main.c          | 2 ++
 examples/eventdev_pipeline/meson.build     | 1 +
 examples/exception_path/Makefile           | 1 +
 examples/exception_path/main.c             | 1 +
 examples/exception_path/meson.build        | 1 +
 examples/flow_classify/flow_classify.c     | 1 +
 examples/flow_filtering/Makefile           | 1 +
 examples/flow_filtering/main.c             | 1 +
 examples/flow_filtering/meson.build        | 1 +
 examples/ip_pipeline/link.c                | 1 +
 examples/ip_reassembly/Makefile            | 1 +
 examples/ip_reassembly/main.c              | 2 ++
 examples/ip_reassembly/meson.build         | 1 +
 examples/ipsec-secgw/ipsec-secgw.c         | 2 ++
 examples/ipv4_multicast/Makefile           | 1 +
 examples/ipv4_multicast/main.c             | 2 ++
 examples/ipv4_multicast/meson.build        | 1 +
 examples/kni/main.c                        | 1 +
 examples/l2fwd-cat/Makefile                | 1 +
 examples/l2fwd-cat/l2fwd-cat.c             | 1 +
 examples/l2fwd-cat/meson.build             | 1 +
 examples/l2fwd-crypto/main.c               | 2 ++
 examples/l2fwd-jobstats/Makefile           | 1 +
 examples/l2fwd-jobstats/main.c             | 2 ++
 examples/l2fwd-jobstats/meson.build        | 1 +
 examples/l2fwd-keepalive/Makefile          | 1 +
 examples/l2fwd-keepalive/main.c            | 2 ++
 examples/l2fwd-keepalive/meson.build       | 1 +
 examples/l2fwd/Makefile                    | 1 +
 examples/l2fwd/main.c                      | 2 ++
 examples/l2fwd/meson.build                 | 1 +
 examples/l3fwd-acl/Makefile                | 1 +
 examples/l3fwd-acl/main.c                  | 2 ++
 examples/l3fwd-acl/meson.build             | 1 +
 examples/l3fwd-vf/Makefile                 | 1 +
 examples/l3fwd-vf/main.c                   | 2 ++
 examples/l3fwd-vf/meson.build              | 1 +
 examples/link_status_interrupt/Makefile    | 1 +
 examples/link_status_interrupt/main.c      | 2 ++
 examples/link_status_interrupt/meson.build | 1 +
 examples/load_balancer/Makefile            | 1 +
 examples/load_balancer/init.c              | 2 ++
 examples/load_balancer/meson.build         | 1 +
 examples/packet_ordering/Makefile          | 1 +
 examples/packet_ordering/main.c            | 1 +
 examples/packet_ordering/meson.build       | 1 +
 examples/ptpclient/Makefile                | 1 +
 examples/ptpclient/meson.build             | 1 +
 examples/ptpclient/ptpclient.c             | 1 +
 examples/qos_meter/Makefile                | 1 +
 examples/qos_meter/main.c                  | 2 ++
 examples/qos_meter/meson.build             | 1 +
 examples/qos_sched/Makefile                | 1 +
 examples/qos_sched/init.c                  | 1 +
 examples/qos_sched/meson.build             | 1 +
 examples/quota_watermark/qw/Makefile       | 1 +
 examples/quota_watermark/qw/init.c         | 1 +
 examples/rxtx_callbacks/main.c             | 1 +
 examples/server_node_efd/server/Makefile   | 1 +
 examples/server_node_efd/server/init.c     | 1 +
 examples/skeleton/Makefile                 | 1 +
 examples/skeleton/basicfwd.c               | 1 +
 examples/skeleton/meson.build              | 1 +
 examples/tep_termination/Makefile          | 1 +
 examples/tep_termination/meson.build       | 1 +
 examples/tep_termination/vxlan_setup.c     | 1 +
 examples/vhost/Makefile                    | 1 +
 examples/vhost/main.c                      | 1 +
 examples/vm_power_manager/Makefile         | 1 +
 examples/vm_power_manager/main.c           | 1 +
 examples/vm_power_manager/meson.build      | 1 +
 examples/vmdq/Makefile                     | 1 +
 examples/vmdq/main.c                       | 1 +
 examples/vmdq/meson.build                  | 1 +
 examples/vmdq_dcb/Makefile                 | 1 +
 examples/vmdq_dcb/main.c                   | 1 +
 examples/vmdq_dcb/meson.build              | 1 +
 82 files changed, 96 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 9acf666dc..277725a6b 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 
 	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
 	print_mac(port_id, &bbdev_port_eth_addr);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 1c0df9d46..f92104908 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -195,6 +195,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				portid, retval);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(portid);
 	if (retval < 0)
 		rte_exit(retval,
@@ -271,6 +272,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
+	rte_eth_dev_set_supported_ptypes(BOND_PORT, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(BOND_PORT);
 	if (retval < 0)
 		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d5578..a2a477279 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 81d7ca61d..35930d8a3 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -162,6 +162,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 26f108d65..c2976f6bd 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -10,6 +10,7 @@
 build = dpdk_conf.has('RTE_LIBRTE_POWER')
 
 deps += ['distributor', 'power']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index a73b61d59..66b6420f9 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -393,6 +393,8 @@ main(int argc, char **argv)
 
 	/* Start the Ethernet port. */
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		err = rte_eth_dev_start(portid);
 		if (err < 0)
 			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
index a54c35aa7..0fc916b05 100644
--- a/examples/eventdev_pipeline/meson.build
+++ b/examples/eventdev_pipeline/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'eventdev'
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 	'pipeline_worker_generic.c',
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 90c7f133a..a7c961276 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0d79e5a24..0165e4553 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -464,6 +464,7 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		FATAL_ERROR("Could not start port%u (%d)", port, ret);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index bc7f43ea9..f34d27428 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -231,6 +231,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	}
 
 	/* Start the Ethernet port. */
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a75555..793a08fae 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a0487be77..4b8712324 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -176,6 +176,7 @@ init_port(void)
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
 		rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index 407795c42..6f5d1b08a 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 )
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 787eb866a..7d02962e3 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -205,6 +205,7 @@ link_create(const char *name, struct link_params *params)
 			return NULL;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Port start */
 	status = rte_eth_dev_start(port_id);
 	if (status < 0)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904e0..19c462388 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 38b39be6b..f2c28ef76 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1158,6 +1158,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0d1fd6af6..2aceaf549 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2448,6 +2448,8 @@ main(int32_t argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/*
 		 * Start device
 		 * note: device must be started before a flow rule
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67dd4..5171f7ab2 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 72eaadc51..3d327a00b 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -765,6 +765,8 @@ main(int argc, char **argv)
 			qconf->tx_queue_id[portid] = queueid;
 			queueid++;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		rte_eth_allmulticast_enable(portid);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'hash'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d7176..99f500e25 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -625,6 +625,7 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6d3..d6a25e42a 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -66,6 +66,7 @@ endif
 EXTRA_CFLAGS += -O3 -g -Wfatal-errors
 
 CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
 LDLIBS += -lpqos
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index b34b40a00..a54a1ed25 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 4e2777a03..37c96040d 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
 ext_deps += pqos
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
+allow_experimental_apis = true
 sources = files(
 	'cat.c', 'l2fwd-cat.c'
 )
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 3fe2ba725..5071ef389 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2559,6 +2559,8 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			return -1;
 		}
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		retval = rte_eth_dev_start(portid);
 		if (retval < 0) {
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e93..09834e979 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 77e44dc82..03d986a68 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -902,6 +902,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['jobstats', 'timer']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a6f..584257ae2 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS += -lrt
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 9831a4323..8d3e5eadd 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -696,6 +696,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
 
 ext_deps += cc.find_library('rt')
 deps += 'timer'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'shm.c'
 )
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1e2b14297..b7d6ee2ff 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -694,6 +694,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f71..df590f8e9 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 0c44df767..e113b1a4d 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2056,6 +2056,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index 7b186a23c..db7f51f2f 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 572e74cf5..5bf70f52d 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1051,6 +1051,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14a8..6ddedd4de 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7a6..04da4732b 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -676,6 +676,8 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
 					"tx buffer on port %u\n", (unsigned) portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/link_status_interrupt/meson.build
+++ b/examples/link_status_interrupt/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index caae8a107..dcba9194c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3ab7d0211..d49d61474 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -496,6 +496,8 @@ app_init_nics(void)
 			}
 		}
 
+		rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start port */
 		ret = rte_eth_dev_start(port);
 		if (ret < 0) {
diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
index 4f7ac3999..19708974c 100644
--- a/examples/load_balancer/meson.build
+++ b/examples/load_balancer/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'lpm'
+allow_experimental_apis = true
 sources = files(
 	'config.c', 'init.c', 'main.c', 'runtime.c'
 )
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7eb..9ba3fa9e8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e92299..59354fad5 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -312,6 +312,7 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
 		return ret;
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'reorder'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bacbd..f158d96b9 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'ptpclient.c'
 )
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 31778fd95..e2cf4b136 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -227,6 +227,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf7c..a1533d08f 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8be..ade8e49c3 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -419,10 +419,12 @@ main(int argc, char **argv)
 
 	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
 
+	rte_eth_dev_set_supported_ptypes(port_rx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_rx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_tx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_tx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
index ef7779f2f..10cd4bc79 100644
--- a/examples/qos_meter/meson.build
+++ b/examples/qos_meter/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'meter'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'rte_policer.c'
 )
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d25371..7d3d3019f 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -58,6 +58,7 @@ else
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index b05206d5a..d165b3dd4 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -138,6 +138,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
 			 ret, portid, 0);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81ce8..5101652af 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
 sources = files(
 	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
 	'init.c', 'main.c', 'stats.c'
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
index 3f10f01c3..e06f4482b 100644
--- a/examples/quota_watermark/qw/Makefile
+++ b/examples/quota_watermark/qw/Makefile
@@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
 
 CFLAGS += -O3 -DQW_SOFTWARE_FC
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 5a0f64f45..4753eb900 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
 				"Failed to setup hardware flow control on port %u (error %d)\n",
 				(unsigned int) port_id, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index dbcd9f4fc..8949f0d93 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -152,6 +152,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 4837bd3ea..acbd12ae2 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
 
 CFLAGS += $(WERROR_FLAGS) -O3
 CFLAGS += -I$(SRCDIR)/../shared
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e28..bbea0c4c9 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -149,6 +149,7 @@ init_port(uint16_t port_num)
 
 	rte_eth_promiscuous_enable(port_num);
 
+	rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port_num);
 	if (retval < 0)
 		return retval;
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac26029..0037d6b25 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98f0..423ce05f8 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -76,6 +76,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'basicfwd.c'
 )
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd92..586838676 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -61,6 +61,7 @@ endif
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index f65d68980..f40b1c0b8 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -11,6 +11,7 @@ if not is_linux
 endif
 deps += ['hash', 'vhost']
 cflags += '-Wno-deprecated-declarations'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'vxlan.c', 'vxlan_setup.c'
 )
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a0880002..219d3e215 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -167,6 +167,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f017..7722e81c7 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -62,6 +62,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0961db080..3d9f125e5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -321,6 +321,7 @@ port_init(uint16_t port)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..65c2ad179 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -28,6 +28,7 @@ endif
 
 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lvirt
 
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 54c704610..4cb4ccecf 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -99,6 +99,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
index 20a4a05b3..54e2b584f 100644
--- a/examples/vm_power_manager/meson.build
+++ b/examples/vm_power_manager/meson.build
@@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
 	deps += ['pmd_ixgbe']
 endif
 
+allow_experimental_apis = true
 sources = files(
 	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
 )
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee86b..2168747cc 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 EXTRA_CFLAGS += -O3
 
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd7f..65431f95e 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -258,6 +258,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096cfb..ea1574d91 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 389000327..44fe63482 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -313,6 +313,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v5 0/7] ethdev: add new Rx offload flags
  2019-10-01  6:34   ` [dpdk-dev] [PATCH v4 0/7] ethdev: add new Rx offload flags pbhagavatula
                       ` (6 preceding siblings ...)
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-10-01  6:41     ` pbhagavatula
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 1/7] ethdev: add set ptype function pbhagavatula
                         ` (7 more replies)
  7 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:41 UTC (permalink / raw)
  To: arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
`DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN, NULL,
					  0);

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.


Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add flow action type update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  drivers/net: update Rx flow flag and mark capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples: disable Rx packet type parsing

 doc/guides/nics/features.rst                  |  22 +++-
 doc/guides/rel_notes/release_19_11.rst        |  23 ++++
 drivers/net/bnxt/bnxt_ethdev.c                |   4 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   3 +-
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_res.c                   |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   3 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   3 +-
 drivers/net/i40e/i40e_ethdev.c                |   4 +-
 drivers/net/iavf/iavf_ethdev.c                |   4 +-
 drivers/net/ice/ice_ethdev.c                  |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |   4 +-
 drivers/net/liquidio/lio_ethdev.c             |   3 +-
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   4 +-
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   3 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  16 +--
 drivers/net/octeontx2/otx2_flow_parse.c       |   3 +-
 drivers/net/qede/qede_ethdev.c                |   3 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   3 +-
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   3 +-
 examples/bbdev_app/main.c                     |   1 +
 examples/bond/main.c                          |   2 +
 examples/distributor/Makefile                 |   1 +
 examples/distributor/main.c                   |   1 +
 examples/distributor/meson.build              |   1 +
 examples/eventdev_pipeline/main.c             | 115 +----------------
 examples/eventdev_pipeline/meson.build        |   1 +
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 examples/exception_path/Makefile              |   1 +
 examples/exception_path/main.c                |   1 +
 examples/exception_path/meson.build           |   1 +
 examples/flow_classify/flow_classify.c        |   1 +
 examples/flow_filtering/Makefile              |   1 +
 examples/flow_filtering/main.c                |   1 +
 examples/flow_filtering/meson.build           |   1 +
 examples/ip_pipeline/link.c                   |   1 +
 examples/ip_reassembly/Makefile               |   1 +
 examples/ip_reassembly/main.c                 |   2 +
 examples/ip_reassembly/meson.build            |   1 +
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +
 examples/ipv4_multicast/Makefile              |   1 +
 examples/ipv4_multicast/main.c                |   2 +
 examples/ipv4_multicast/meson.build           |   1 +
 examples/kni/main.c                           |   1 +
 examples/l2fwd-cat/Makefile                   |   1 +
 examples/l2fwd-cat/l2fwd-cat.c                |   1 +
 examples/l2fwd-cat/meson.build                |   1 +
 examples/l2fwd-crypto/main.c                  |   2 +
 examples/l2fwd-jobstats/Makefile              |   1 +
 examples/l2fwd-jobstats/main.c                |   2 +
 examples/l2fwd-jobstats/meson.build           |   1 +
 examples/l2fwd-keepalive/Makefile             |   1 +
 examples/l2fwd-keepalive/main.c               |   2 +
 examples/l2fwd-keepalive/meson.build          |   1 +
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 examples/l3fwd-acl/Makefile                   |   1 +
 examples/l3fwd-acl/main.c                     |   2 +
 examples/l3fwd-acl/meson.build                |   1 +
 examples/l3fwd-vf/Makefile                    |   1 +
 examples/l3fwd-vf/main.c                      |   2 +
 examples/l3fwd-vf/meson.build                 |   1 +
 examples/link_status_interrupt/Makefile       |   1 +
 examples/link_status_interrupt/main.c         |   2 +
 examples/link_status_interrupt/meson.build    |   1 +
 examples/load_balancer/Makefile               |   1 +
 examples/load_balancer/init.c                 |   2 +
 examples/load_balancer/meson.build            |   1 +
 examples/packet_ordering/Makefile             |   1 +
 examples/packet_ordering/main.c               |   1 +
 examples/packet_ordering/meson.build          |   1 +
 examples/ptpclient/Makefile                   |   1 +
 examples/ptpclient/meson.build                |   1 +
 examples/ptpclient/ptpclient.c                |   1 +
 examples/qos_meter/Makefile                   |   1 +
 examples/qos_meter/main.c                     |   2 +
 examples/qos_meter/meson.build                |   1 +
 examples/qos_sched/Makefile                   |   1 +
 examples/qos_sched/init.c                     |   1 +
 examples/qos_sched/meson.build                |   1 +
 examples/quota_watermark/qw/Makefile          |   1 +
 examples/quota_watermark/qw/init.c            |   1 +
 examples/rxtx_callbacks/main.c                |   1 +
 examples/server_node_efd/server/Makefile      |   1 +
 examples/server_node_efd/server/init.c        |   1 +
 examples/skeleton/Makefile                    |   1 +
 examples/skeleton/basicfwd.c                  |   1 +
 examples/skeleton/meson.build                 |   1 +
 examples/tep_termination/Makefile             |   1 +
 examples/tep_termination/meson.build          |   1 +
 examples/tep_termination/vxlan_setup.c        |   1 +
 examples/vhost/Makefile                       |   1 +
 examples/vhost/main.c                         |   1 +
 examples/vm_power_manager/Makefile            |   1 +
 examples/vm_power_manager/main.c              |   1 +
 examples/vm_power_manager/meson.build         |   1 +
 examples/vmdq/Makefile                        |   1 +
 examples/vmdq/main.c                          |   1 +
 examples/vmdq/meson.build                     |   1 +
 examples/vmdq_dcb/Makefile                    |   1 +
 examples/vmdq_dcb/main.c                      |   1 +
 examples/vmdq_dcb/meson.build                 |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  40 ++++++
 lib/librte_ethdev/rte_ethdev.h                |  31 +++++
 lib/librte_ethdev/rte_ethdev_core.h           |   6 +
 lib/librte_ethdev/rte_ethdev_version.map      |   3 +
 lib/librte_ethdev/rte_flow.h                  |   6 +-
 117 files changed, 521 insertions(+), 149 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v5 1/7] ethdev: add set ptype function
  2019-10-01  6:41     ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-10-01  6:41       ` pbhagavatula
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                         ` (6 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:41 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 doc/guides/nics/features.rst             |  8 +++--
 doc/guides/rel_notes/release_19_11.rst   |  7 +++++
 lib/librte_ethdev/rte_ethdev.c           | 38 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 29 ++++++++++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      |  6 ++++
 lib/librte_ethdev/rte_ethdev_version.map |  3 ++
 6 files changed, 89 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index c4e128d2f..1756fa73a 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,13 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+  ``dev_supported_ptypes_set``.
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 27cfbd9e3..7e31b9401 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -56,6 +56,13 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e1f..061de7ac5 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2602,6 +2602,44 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, int num)
+{
+	int i, j;
+	struct rte_eth_dev *dev;
+	const uint32_t *all_ptypes;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set, 0);
+
+	if (ptype_mask == 0)
+		return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL)
+		return 0;
+
+	for (i = 0, j = 0; set_ptypes && (all_ptypes[i] != RTE_PTYPE_UNKNOWN);
+									++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+}
+
 void
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d9871782e..06c770055 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2431,6 +2431,35 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification in which
+ * the recipient is interested.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 2922d5b7c..93bc34480 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+/**< @internal Inform device about packet types in which the recipient is interested. */
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -421,6 +425,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform device about packet types in which the recipient is interested. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6df42a47b..e14745b9c 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -283,4 +283,7 @@ EXPERIMENTAL {
 
 	# added in 19.08
 	rte_eth_read_clock;
+
+	# added in 19.11
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v5 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-01  6:41     ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-01  6:41       ` pbhagavatula
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 3/7] ethdev: add flow action type " pbhagavatula
                         ` (5 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:41 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 2 ++
 doc/guides/rel_notes/release_19_11.rst | 7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 1 +
 lib/librte_ethdev/rte_ethdev.h         | 1 +
 4 files changed, 11 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 1756fa73a..f7c6d918f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 7e31b9401..cff44fe2b 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -64,6 +64,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 Removed Items
 -------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 061de7ac5..6df2af6a6 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 06c770055..69dbce646 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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v5 3/7] ethdev: add flow action type update as an offload
  2019-10-01  6:41     ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 1/7] ethdev: add set ptype function pbhagavatula
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-01  6:41       ` pbhagavatula
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                         ` (4 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:41 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, Adrien Mazarguil
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 12 ++++++++++++
 doc/guides/rel_notes/release_19_11.rst |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.c         |  1 +
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 lib/librte_ethdev/rte_flow.h           |  6 ++++--
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f7c6d918f..9737ff7a1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@ Allows application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index cff44fe2b..d4b3cdad5 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -71,6 +71,15 @@ New Features
   *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
      by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
 
+* **Added Rx offload flag to enable or disable flow action type update**
+
+  *  Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
+     `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
+     `RTE_FLOW_ACTION_FLAG` are enabled.
+  *  PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the application
+     by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
+
 Removed Items
 -------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 6df2af6a6..2d1c2a2c0 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 69dbce646..35e22e70c 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1014,6 +1014,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index 354cb1dd0..5d62686c0 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1316,7 +1316,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1324,7 +1325,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * No associated configuration structure.
 	 */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v5 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-01  6:41     ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
                         ` (2 preceding siblings ...)
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-10-01  6:41       ` pbhagavatula
  2019-10-01  7:10         ` Andrew Rybchenko
  2019-10-01 11:50         ` Hemant Agrawal
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
                         ` (3 subsequent siblings)
  7 siblings, 2 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:41 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 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/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
 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/liquidio/lio_ethdev.c    |  3 ++-
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
 25 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7d9..6c106baf7 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_RSS_HASH)
 
 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..22e61a55c 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_RSS_HASH)
 
 
 #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..18c7bd0d5 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_RSS_HASH;
 
 /* 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..55a1c4455 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_RSS_HASH;
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 9405e1933..607a085f8 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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d72129..ba9b174cf 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1797,7 +1797,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af9053..53bd2b9ae 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->rx_offload_capa = 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_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7ab5..7058e0213 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_RSS_HASH;
 
 	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..aef91a79b 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_RSS_HASH;
 	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 63997fdfb..2e2a6b2af 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2145,7 +2145,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index c25dab00c..ff118586e 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -406,7 +406,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	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..b5fd57693 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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..230d64c8a 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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index b84128fef..2e88d1844 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 7b15d6bc8..0cca6746d 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_RSS_HASH)
 
 #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..da25b26df 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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 9cd5eb65b..da768ced7 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 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] 246+ messages in thread

* [dpdk-dev] [PATCH v5 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-10-01  6:41     ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
                         ` (3 preceding siblings ...)
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-01  6:41       ` pbhagavatula
  2019-10-01  7:11         ` Andrew Rybchenko
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                         ` (2 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:41 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
flag and mark.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 3 ++-
 drivers/net/enic/enic_res.c             | 3 ++-
 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/mlx5/mlx5_rxq.c             | 3 ++-
 drivers/net/octeontx2/otx2_ethdev.h     | 3 ++-
 drivers/net/octeontx2/otx2_flow_parse.c | 3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c      | 3 ++-
 10 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6c106baf7..fd1fb7eda 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -161,7 +161,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_JUMBO_FRAME | \
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_RSS_HASH)
+				     DEV_RX_OFFLOAD_RSS_HASH | \
+				     DEV_RX_OFFLOAD_FLOW_MARK)
 
 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/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 607a085f8..3503d5d7e 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -199,7 +199,8 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7058e0213..6311943be 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3512,7 +3512,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_VLAN_EXTEND |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 
 	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 aef91a79b..7bdaa87b1 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -518,7 +518,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_SCATTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	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 2e2a6b2af..984af659f 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2146,7 +2146,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 			DEV_RX_OFFLOAD_VLAN_EXTEND |
-			DEV_RX_OFFLOAD_RSS_HASH;
+			DEV_RX_OFFLOAD_RSS_HASH |
+			DEV_RX_OFFLOAD_FLOW_MARK;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index fa572d184..1481e2426 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
 		   DEV_RX_OFFLOAD_VLAN_FILTER |
 		   DEV_RX_OFFLOAD_SCATTER |
-		   DEV_RX_OFFLOAD_RSS_HASH;
+		   DEV_RX_OFFLOAD_RSS_HASH |
+		   DEV_RX_OFFLOAD_FLOW_MARK;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index b5fd57693..1bf01bda3 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
 	uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
 			     DEV_RX_OFFLOAD_TIMESTAMP |
 			     DEV_RX_OFFLOAD_JUMBO_FRAME |
-			     DEV_RX_OFFLOAD_RSS_HASH);
+			     DEV_RX_OFFLOAD_RSS_HASH |
+			     DEV_RX_OFFLOAD_FLOW_MARK);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 0cca6746d..97c1a636a 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -141,7 +141,8 @@
 	DEV_RX_OFFLOAD_VLAN_FILTER	| \
 	DEV_RX_OFFLOAD_QINQ_STRIP	| \
 	DEV_RX_OFFLOAD_TIMESTAMP	| \
-	DEV_RX_OFFLOAD_RSS_HASH)
+	DEV_RX_OFFLOAD_RSS_HASH		| \
+	DEV_RX_OFFLOAD_FLOW_MARK)
 
 #define NIX_DEFAULT_RSS_CTX_GROUP  0
 #define NIX_DEFAULT_RSS_MCAM_IDX  -1
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a70..6eb69a8b2 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -979,7 +979,8 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 	if (mark)
 		flow->npc_action |= (uint64_t)mark << 40;
 
-	if (rte_atomic32_read(&npc->mark_actions) == 1) {
+	if (rte_atomic32_read(&npc->mark_actions) == 1 &&
+			(hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK)) {
 		hw->rx_offload_flags |=
 			NIX_RX_OFFLOAD_MARK_UPDATE_F;
 		otx2_eth_set_rx_function(dev);
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 220ef0e47..1887731e2 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v5 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-01  6:41     ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
                         ` (4 preceding siblings ...)
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-10-01  6:41       ` pbhagavatula
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 7/7] examples: disable Rx packet type parsing pbhagavatula
  2019-10-01 18:52       ` [dpdk-dev] [PATCH v6 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:41 UTC (permalink / raw)
  To: arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 113 -----------------
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 3 files changed, 232 insertions(+), 113 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f541..a73b61d59 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,118 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	rte_eth_dev_info_get(port, &dev_info);
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	rte_eth_macaddr_get(port, &addr);
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
 
 static void
 do_capability_setup(uint8_t eventdev_id)
@@ -501,7 +389,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..aa1678fe7 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,123 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +414,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 8961cd656..52a1b4174 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,119 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +734,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v5 7/7] examples: disable Rx packet type parsing
  2019-10-01  6:41     ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
                         ` (5 preceding siblings ...)
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-01  6:41       ` pbhagavatula
  2019-10-01 18:52       ` [dpdk-dev] [PATCH v6 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01  6:41 UTC (permalink / raw)
  To: arybchenko, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki, Bernard Iremonger,
	Cristian Dumitrescu, Konstantin Ananyev, Ferruh Yigit,
	Declan Doherty, Reshma Pattan, John McNamara, Xiaoyun Li,
	Jasvinder Singh, Byron Marohn, Yipeng Wang, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing in examples that don't use
`rte_mbuf::packet_type` by setting ptype_mask as 0 in
`rte_eth_dev_set_supported_ptypes`

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/bbdev_app/main.c                  | 1 +
 examples/bond/main.c                       | 2 ++
 examples/distributor/Makefile              | 1 +
 examples/distributor/main.c                | 1 +
 examples/distributor/meson.build           | 1 +
 examples/eventdev_pipeline/main.c          | 2 ++
 examples/eventdev_pipeline/meson.build     | 1 +
 examples/exception_path/Makefile           | 1 +
 examples/exception_path/main.c             | 1 +
 examples/exception_path/meson.build        | 1 +
 examples/flow_classify/flow_classify.c     | 1 +
 examples/flow_filtering/Makefile           | 1 +
 examples/flow_filtering/main.c             | 1 +
 examples/flow_filtering/meson.build        | 1 +
 examples/ip_pipeline/link.c                | 1 +
 examples/ip_reassembly/Makefile            | 1 +
 examples/ip_reassembly/main.c              | 2 ++
 examples/ip_reassembly/meson.build         | 1 +
 examples/ipsec-secgw/ipsec-secgw.c         | 2 ++
 examples/ipv4_multicast/Makefile           | 1 +
 examples/ipv4_multicast/main.c             | 2 ++
 examples/ipv4_multicast/meson.build        | 1 +
 examples/kni/main.c                        | 1 +
 examples/l2fwd-cat/Makefile                | 1 +
 examples/l2fwd-cat/l2fwd-cat.c             | 1 +
 examples/l2fwd-cat/meson.build             | 1 +
 examples/l2fwd-crypto/main.c               | 2 ++
 examples/l2fwd-jobstats/Makefile           | 1 +
 examples/l2fwd-jobstats/main.c             | 2 ++
 examples/l2fwd-jobstats/meson.build        | 1 +
 examples/l2fwd-keepalive/Makefile          | 1 +
 examples/l2fwd-keepalive/main.c            | 2 ++
 examples/l2fwd-keepalive/meson.build       | 1 +
 examples/l2fwd/Makefile                    | 1 +
 examples/l2fwd/main.c                      | 2 ++
 examples/l2fwd/meson.build                 | 1 +
 examples/l3fwd-acl/Makefile                | 1 +
 examples/l3fwd-acl/main.c                  | 2 ++
 examples/l3fwd-acl/meson.build             | 1 +
 examples/l3fwd-vf/Makefile                 | 1 +
 examples/l3fwd-vf/main.c                   | 2 ++
 examples/l3fwd-vf/meson.build              | 1 +
 examples/link_status_interrupt/Makefile    | 1 +
 examples/link_status_interrupt/main.c      | 2 ++
 examples/link_status_interrupt/meson.build | 1 +
 examples/load_balancer/Makefile            | 1 +
 examples/load_balancer/init.c              | 2 ++
 examples/load_balancer/meson.build         | 1 +
 examples/packet_ordering/Makefile          | 1 +
 examples/packet_ordering/main.c            | 1 +
 examples/packet_ordering/meson.build       | 1 +
 examples/ptpclient/Makefile                | 1 +
 examples/ptpclient/meson.build             | 1 +
 examples/ptpclient/ptpclient.c             | 1 +
 examples/qos_meter/Makefile                | 1 +
 examples/qos_meter/main.c                  | 2 ++
 examples/qos_meter/meson.build             | 1 +
 examples/qos_sched/Makefile                | 1 +
 examples/qos_sched/init.c                  | 1 +
 examples/qos_sched/meson.build             | 1 +
 examples/quota_watermark/qw/Makefile       | 1 +
 examples/quota_watermark/qw/init.c         | 1 +
 examples/rxtx_callbacks/main.c             | 1 +
 examples/server_node_efd/server/Makefile   | 1 +
 examples/server_node_efd/server/init.c     | 1 +
 examples/skeleton/Makefile                 | 1 +
 examples/skeleton/basicfwd.c               | 1 +
 examples/skeleton/meson.build              | 1 +
 examples/tep_termination/Makefile          | 1 +
 examples/tep_termination/meson.build       | 1 +
 examples/tep_termination/vxlan_setup.c     | 1 +
 examples/vhost/Makefile                    | 1 +
 examples/vhost/main.c                      | 1 +
 examples/vm_power_manager/Makefile         | 1 +
 examples/vm_power_manager/main.c           | 1 +
 examples/vm_power_manager/meson.build      | 1 +
 examples/vmdq/Makefile                     | 1 +
 examples/vmdq/main.c                       | 1 +
 examples/vmdq/meson.build                  | 1 +
 examples/vmdq_dcb/Makefile                 | 1 +
 examples/vmdq_dcb/main.c                   | 1 +
 examples/vmdq_dcb/meson.build              | 1 +
 82 files changed, 96 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 9acf666dc..277725a6b 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 
 	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
 	print_mac(port_id, &bbdev_port_eth_addr);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 1c0df9d46..f92104908 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -195,6 +195,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				portid, retval);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(portid);
 	if (retval < 0)
 		rte_exit(retval,
@@ -271,6 +272,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
+	rte_eth_dev_set_supported_ptypes(BOND_PORT, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(BOND_PORT);
 	if (retval < 0)
 		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d5578..a2a477279 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 81d7ca61d..35930d8a3 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -162,6 +162,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 26f108d65..c2976f6bd 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -10,6 +10,7 @@
 build = dpdk_conf.has('RTE_LIBRTE_POWER')
 
 deps += ['distributor', 'power']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index a73b61d59..66b6420f9 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -393,6 +393,8 @@ main(int argc, char **argv)
 
 	/* Start the Ethernet port. */
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		err = rte_eth_dev_start(portid);
 		if (err < 0)
 			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
index a54c35aa7..0fc916b05 100644
--- a/examples/eventdev_pipeline/meson.build
+++ b/examples/eventdev_pipeline/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'eventdev'
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 	'pipeline_worker_generic.c',
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 90c7f133a..a7c961276 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0d79e5a24..0165e4553 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -464,6 +464,7 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		FATAL_ERROR("Could not start port%u (%d)", port, ret);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index bc7f43ea9..f34d27428 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -231,6 +231,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	}
 
 	/* Start the Ethernet port. */
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a75555..793a08fae 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a0487be77..4b8712324 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -176,6 +176,7 @@ init_port(void)
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
 		rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index 407795c42..6f5d1b08a 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 )
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 787eb866a..7d02962e3 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -205,6 +205,7 @@ link_create(const char *name, struct link_params *params)
 			return NULL;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Port start */
 	status = rte_eth_dev_start(port_id);
 	if (status < 0)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904e0..19c462388 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 38b39be6b..f2c28ef76 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1158,6 +1158,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0d1fd6af6..2aceaf549 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2448,6 +2448,8 @@ main(int32_t argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/*
 		 * Start device
 		 * note: device must be started before a flow rule
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67dd4..5171f7ab2 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 72eaadc51..3d327a00b 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -765,6 +765,8 @@ main(int argc, char **argv)
 			qconf->tx_queue_id[portid] = queueid;
 			queueid++;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		rte_eth_allmulticast_enable(portid);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'hash'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d7176..99f500e25 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -625,6 +625,7 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6d3..d6a25e42a 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -66,6 +66,7 @@ endif
 EXTRA_CFLAGS += -O3 -g -Wfatal-errors
 
 CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
 LDLIBS += -lpqos
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index b34b40a00..a54a1ed25 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 4e2777a03..37c96040d 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
 ext_deps += pqos
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
+allow_experimental_apis = true
 sources = files(
 	'cat.c', 'l2fwd-cat.c'
 )
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 3fe2ba725..5071ef389 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2559,6 +2559,8 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			return -1;
 		}
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		retval = rte_eth_dev_start(portid);
 		if (retval < 0) {
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e93..09834e979 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 77e44dc82..03d986a68 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -902,6 +902,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['jobstats', 'timer']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a6f..584257ae2 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS += -lrt
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 9831a4323..8d3e5eadd 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -696,6 +696,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
 
 ext_deps += cc.find_library('rt')
 deps += 'timer'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'shm.c'
 )
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1e2b14297..b7d6ee2ff 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -694,6 +694,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f71..df590f8e9 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 0c44df767..e113b1a4d 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2056,6 +2056,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index 7b186a23c..db7f51f2f 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 572e74cf5..5bf70f52d 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1051,6 +1051,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14a8..6ddedd4de 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7a6..04da4732b 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -676,6 +676,8 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
 					"tx buffer on port %u\n", (unsigned) portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/link_status_interrupt/meson.build
+++ b/examples/link_status_interrupt/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index caae8a107..dcba9194c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3ab7d0211..d49d61474 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -496,6 +496,8 @@ app_init_nics(void)
 			}
 		}
 
+		rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start port */
 		ret = rte_eth_dev_start(port);
 		if (ret < 0) {
diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
index 4f7ac3999..19708974c 100644
--- a/examples/load_balancer/meson.build
+++ b/examples/load_balancer/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'lpm'
+allow_experimental_apis = true
 sources = files(
 	'config.c', 'init.c', 'main.c', 'runtime.c'
 )
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7eb..9ba3fa9e8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e92299..59354fad5 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -312,6 +312,7 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
 		return ret;
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'reorder'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bacbd..f158d96b9 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'ptpclient.c'
 )
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 31778fd95..e2cf4b136 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -227,6 +227,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf7c..a1533d08f 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8be..ade8e49c3 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -419,10 +419,12 @@ main(int argc, char **argv)
 
 	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
 
+	rte_eth_dev_set_supported_ptypes(port_rx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_rx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_tx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_tx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
index ef7779f2f..10cd4bc79 100644
--- a/examples/qos_meter/meson.build
+++ b/examples/qos_meter/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'meter'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'rte_policer.c'
 )
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d25371..7d3d3019f 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -58,6 +58,7 @@ else
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index b05206d5a..d165b3dd4 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -138,6 +138,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
 			 ret, portid, 0);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81ce8..5101652af 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
 sources = files(
 	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
 	'init.c', 'main.c', 'stats.c'
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
index 3f10f01c3..e06f4482b 100644
--- a/examples/quota_watermark/qw/Makefile
+++ b/examples/quota_watermark/qw/Makefile
@@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
 
 CFLAGS += -O3 -DQW_SOFTWARE_FC
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 5a0f64f45..4753eb900 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
 				"Failed to setup hardware flow control on port %u (error %d)\n",
 				(unsigned int) port_id, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index dbcd9f4fc..8949f0d93 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -152,6 +152,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 4837bd3ea..acbd12ae2 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
 
 CFLAGS += $(WERROR_FLAGS) -O3
 CFLAGS += -I$(SRCDIR)/../shared
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e28..bbea0c4c9 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -149,6 +149,7 @@ init_port(uint16_t port_num)
 
 	rte_eth_promiscuous_enable(port_num);
 
+	rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port_num);
 	if (retval < 0)
 		return retval;
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac26029..0037d6b25 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98f0..423ce05f8 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -76,6 +76,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'basicfwd.c'
 )
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd92..586838676 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -61,6 +61,7 @@ endif
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index f65d68980..f40b1c0b8 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -11,6 +11,7 @@ if not is_linux
 endif
 deps += ['hash', 'vhost']
 cflags += '-Wno-deprecated-declarations'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'vxlan.c', 'vxlan_setup.c'
 )
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a0880002..219d3e215 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -167,6 +167,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f017..7722e81c7 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -62,6 +62,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0961db080..3d9f125e5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -321,6 +321,7 @@ port_init(uint16_t port)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..65c2ad179 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -28,6 +28,7 @@ endif
 
 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lvirt
 
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 54c704610..4cb4ccecf 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -99,6 +99,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
index 20a4a05b3..54e2b584f 100644
--- a/examples/vm_power_manager/meson.build
+++ b/examples/vm_power_manager/meson.build
@@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
 	deps += ['pmd_ixgbe']
 endif
 
+allow_experimental_apis = true
 sources = files(
 	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
 )
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee86b..2168747cc 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 EXTRA_CFLAGS += -O3
 
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd7f..65431f95e 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -258,6 +258,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096cfb..ea1574d91 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 389000327..44fe63482 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -313,6 +313,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v4 1/7] ethdev: add set ptype function
  2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-01  7:04       ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-01  7:04 UTC (permalink / raw)
  To: pbhagavatula, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev

On 10/1/19 9:34 AM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add `rte_eth_dev_set_supported_ptypes` function that will allow the
> application to inform the PMD the packet types it is interested in.
> Based on the ptypes set PMDs can optimize their Rx path.
>
> -If application doesn’t want any ptype information it can call
> `rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
> and PMD may skip packet type processing and set rte_mbuf::packet_type to
> RTE_PTYPE_UNKNOWN.
>
> -If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
> return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>
> -If application is interested only in L2/L3 layer, it can inform the PMD
> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
> `rte_eth_dev_set_supported_ptypes(ethdev_id,
> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>
> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>



> diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
> index 27cfbd9e3..7e31b9401 100644
> --- a/doc/guides/rel_notes/release_19_11.rst
> +++ b/doc/guides/rel_notes/release_19_11.rst
> @@ -56,6 +56,13 @@ New Features
>        Also, make sure to start the actual text at the margin.
>        =========================================================
>   
> +* **Added ethdev API to set supported packet types**
> +
> +  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
> +     application to inform PMD about packet types classification the application
> +     is interested in
> +  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
> +     and thereby improve Rx performance if application wishes do so.

Extra empty line is required here in accordance with documentation 
guidelines.

>   Removed Items
>   -------------
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 17d183e1f..061de7ac5 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -2602,6 +2602,44 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>   	return j;
>   }
>   
> +int
> +rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
> +				 uint32_t *set_ptypes, int num)

May be num should be unsigned int?

> +{
> +	int i, j;
> +	struct rte_eth_dev *dev;
> +	const uint32_t *all_ptypes;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +	dev = &rte_eth_devices[port_id];
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set, 0);

if (num > 0 && set_ptypes == NULL)
     return -EINVAL;

> +
> +	if (ptype_mask == 0)

if (num > 0)
      set_ptypes[0] = RTE_PTYPE_UNKNOWN;

> +		return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
> +				ptype_mask);
> +
> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
> +	if (all_ptypes == NULL)

if (num > 0)
      set_ptypes[0] = RTE_PTYPE_UNKNOWN;

> +		return 0;
> +
> +	for (i = 0, j = 0; set_ptypes && (all_ptypes[i] != RTE_PTYPE_UNKNOWN);

set_ptypes != NULL in accordance with coding guidelines

> +									++i) {

Please, consider to put condition check and increment in its own lines.
IMHO, above it a bit hard to read.

> +		if (ptype_mask & all_ptypes[i]) {

Should it be done if all_ptypes[i] have some bits out of ptype_mask?
Should set_ptypes have bits out of ptype_mask when set below?

> +			if (j < num - 1) {
> +				set_ptypes[j] = all_ptypes[i];
> +				j++;
> +				continue;
> +			}
> +			break;

Do we need an indication if provided set_ptype is not enough
to return all ptypes? I think it should be explained/highlighted
in the function description with explanation why.

> +		}
> +	}
> +
> +	set_ptypes[j] = RTE_PTYPE_UNKNOWN;

I think we should allow set_ptypes == NULL if num == 0.
So, it should be set here if not NULL only.

> +
> +	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
> +}
> +
>   void
>   rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>   {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index d9871782e..6c5fd789a 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -2431,6 +2431,35 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
>    */
>   int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>   				     uint32_t *ptypes, int num);
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Inform Ethernet device of the packet types classification in which
> + * the recipient is interested.
> + *
> + * Application can use this function to set only specific ptypes that it's
> + * interested. This information can be used by the PMD to optimize Rx path.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param ptype_mask
> + *   The ptype family that application is interested in.
> + * @param set_ptypes
> + *   An array pointer to store set packet types, allocated by caller. The
> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
> + * @param num
> + *   Size of the array pointed by param ptypes.
> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accomodate the
> + *   set ptypes.
> + * @return
> + *   - (0) if Success.
> + *   - (-ENODEV) if *port_id* invalid.
> + *   - (-EINVAL) if *ptype_mask* is invalid.

or set_ptype is NULL when num is greater than zero.

> + */
> +__rte_experimental
> +int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
> +				     uint32_t *set_ptypes, int num);
>   
>   /**
>    * Retrieve the MTU of an Ethernet device.
> diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
> index 2922d5b7c..93bc34480 100644
> --- a/lib/librte_ethdev/rte_ethdev_core.h
> +++ b/lib/librte_ethdev/rte_ethdev_core.h
> @@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
>   typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
>   /**< @internal Get supported ptypes of an Ethernet device. */
>   
> +typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
> +					      uint32_t ptype_mask);
> +/**< @internal Inform device about packet types in which the recipient is interested. */
> +
>   typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
>   				    uint16_t queue_id);
>   /**< @internal Start rx and tx of a queue of an Ethernet device. */
> @@ -421,6 +425,8 @@ struct eth_dev_ops {
>   	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
>   	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
>   	/**< Get packet types supported and identified by device. */
> +	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
> +	/**< Inform device about packet types in which the recipient is interested. */
>   
>   	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
>   	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
> diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
> index 6df42a47b..e14745b9c 100644
> --- a/lib/librte_ethdev/rte_ethdev_version.map
> +++ b/lib/librte_ethdev/rte_ethdev_version.map
> @@ -283,4 +283,7 @@ EXPERIMENTAL {
>   
>   	# added in 19.08
>   	rte_eth_read_clock;
> +
> +	# added in 19.11
> +	rte_eth_dev_set_supported_ptypes;
>   };


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v5 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-01  7:10         ` Andrew Rybchenko
  2019-10-01 11:50         ` Hemant Agrawal
  1 sibling, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-01  7:10 UTC (permalink / raw)
  To: pbhagavatula, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev

On 10/1/19 9:41 AM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
> delivery.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

[snip]

> diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
> index 63da807ea..220ef0e47 100644
> --- a/drivers/net/sfc/sfc_ef10_essb_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
> @@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
>   	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
>   				  SFC_DP_RX_FEAT_FLOW_MARK,
>   	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
> -	.queue_offload_capa	= 0,
> +	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
>   	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
>   	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
>   	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
> diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
> index f2fc6e70a..85b5df466 100644
> --- a/drivers/net/sfc/sfc_ef10_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_rx.c
> @@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
>   				  SFC_DP_RX_FEAT_INTR,
>   	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
>   				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
> -	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
> +	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
> +				  DEV_RX_OFFLOAD_RSS_HASH,
>   	.get_dev_info		= sfc_ef10_rx_get_dev_info,
>   	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
>   	.qcreate		= sfc_ef10_rx_qcreate,
> diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
> index e6809bb64..695580b22 100644
> --- a/drivers/net/sfc/sfc_rx.c
> +++ b/drivers/net/sfc/sfc_rx.c
> @@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
>   	},
>   	.features		= SFC_DP_RX_FEAT_INTR,
>   	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
> -	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
> +	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
> +				  DEV_RX_OFFLOAD_RSS_HASH,
>   	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
>   	.qcreate		= sfc_efx_rx_qcreate,
>   	.qdestroy		= sfc_efx_rx_qdestroy,
> diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
> index c0bfbf848..391411799 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_RSS_HASH)
>   
>   #define NICVF_DEFAULT_RX_FREE_THRESH    224
>   #define NICVF_DEFAULT_TX_FREE_THRESH    224

For net/sfc:
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v5 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-10-01  7:11         ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-01  7:11 UTC (permalink / raw)
  To: pbhagavatula, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev

On 10/1/19 9:41 AM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
> flag and mark.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

[snip]

> diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
> index 220ef0e47..1887731e2 100644
> --- a/drivers/net/sfc/sfc_ef10_essb_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
> @@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
>   	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
>   				  SFC_DP_RX_FEAT_FLOW_MARK,
>   	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
> -	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
> +	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
> +				  DEV_RX_OFFLOAD_FLOW_MARK,
>   	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
>   	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
>   	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,

For net/sfc:
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v5 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
  2019-10-01  7:10         ` Andrew Rybchenko
@ 2019-10-01 11:50         ` Hemant Agrawal
  1 sibling, 0 replies; 246+ messages in thread
From: Hemant Agrawal @ 2019-10-01 11:50 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Sachin Saxena, Wenzhuo Lu, John Daley,
	Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan, Xiaoyun Wang,
	Guoyang Zhou, Beilei Xing, Jingjing Wu, Qiming Yang,
	Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev

> diff --git a/drivers/net/dpaa/dpaa_ethdev.c
> b/drivers/net/dpaa/dpaa_ethdev.c index 7154fb9b4..18c7bd0d5 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_RSS_HASH;
> 
>  /* 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..55a1c4455 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_RSS_HASH;
> 

[Hemant] This patch is currently conflicting with other NXP driver enhancement patch series.
Not sure, which one will get merged.  Anyway:

Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>



^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v2 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-01 14:43   ` Jerin Jacob
  2019-10-01 15:40   ` Ajit Khaparde
  1 sibling, 0 replies; 246+ messages in thread
From: Jerin Jacob @ 2019-10-01 14:43 UTC (permalink / raw)
  To: Pavan Nikhilesh
  Cc: arybchenko, Jerin Jacob, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Yongseok Koh, Viacheslav Ovsiienko, Stephen Hemminger,
	K. Y. Srinivasan, Haiyang Zhang, Alejandro Lucero,
	Nithin Dabilpuram, Kiran Kumar K, Rasesh Mody, Shahed Shaikh,
	Maciej Czekaj, Yong Wang, dpdk-dev

On Thu, Aug 22, 2019 at 2:18 AM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
> delivery.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

For net/octeontx2:

Acked-by: Jerin Jacob <jerinj@marvell.com>

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v2 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
  2019-08-23 10:03   ` Andrew Rybchenko
@ 2019-10-01 14:48   ` Jerin Jacob
  1 sibling, 0 replies; 246+ messages in thread
From: Jerin Jacob @ 2019-10-01 14:48 UTC (permalink / raw)
  To: Pavan Nikhilesh
  Cc: arybchenko, Jerin Jacob, Ajit Khaparde, Somnath Kotur,
	John Daley, Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu,
	Wenzhuo Lu, Qiming Yang, Konstantin Ananyev, Shahaf Shuler,
	Yongseok Koh, Viacheslav Ovsiienko, Nithin Dabilpuram,
	Kiran Kumar K, dpdk-dev

On Thu, Aug 22, 2019 at 2:18 AM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
> flag and mark.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
> diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
> index 6670c1a70..6eb69a8b2 100644
> --- a/drivers/net/octeontx2/otx2_flow_parse.c
> +++ b/drivers/net/octeontx2/otx2_flow_parse.c
> @@ -979,7 +979,8 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
>         if (mark)
>                 flow->npc_action |= (uint64_t)mark << 40;
>
> -       if (rte_atomic32_read(&npc->mark_actions) == 1) {
> +       if (rte_atomic32_read(&npc->mark_actions) == 1 &&

npc->mark_actions was kind of emulating the DEV_RX_OFFLOAD_FLOW_MARK.
Now that we have explicit DEV_RX_OFFLOAD_FLOW_MARK flag, We can remove
npc->mark_actions.

> +                       (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK)) {
>                 hw->rx_offload_flags |=
>                         NIX_RX_OFFLOAD_MARK_UPDATE_F;
>                 otx2_eth_set_rx_function(dev);

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/7] ethdev: add set ptype function
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 1/7] ethdev: add set ptype function pbhagavatula
  2019-08-23  9:44   ` Andrew Rybchenko
@ 2019-10-01 14:54   ` Jerin Jacob
  1 sibling, 0 replies; 246+ messages in thread
From: Jerin Jacob @ 2019-10-01 14:54 UTC (permalink / raw)
  To: Pavan Nikhilesh
  Cc: arybchenko, Jerin Jacob, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, dpdk-dev

On Thu, Aug 22, 2019 at 2:18 AM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add `rte_eth_dev_set_supported_ptypes` function that will allow the
> application to inform the PMD the packet types it is interested in.
> Based on the ptypes set PMDs can optimize their Rx path.
>
> -If application doesn’t want any ptype information it can call
> `rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN)` and PMD
> will set rte_mbuf::packet_type to 0.
>
> -If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
> return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>
> -If application is interested only in L2/L3 layer, it can inform the PMD
> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
> `rte_eth_dev_set_supported_ptypes(ethdev_id,
>                 RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK)`.
>
> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  doc/guides/nics/features.rst             | 12 ++++++---
>  doc/guides/rel_notes/release_19_11.rst   |  7 ++++++
>  lib/librte_ethdev/rte_ethdev.c           | 32 ++++++++++++++++++++++++
>  lib/librte_ethdev/rte_ethdev.h           | 16 ++++++++++++
>  lib/librte_ethdev/rte_ethdev_core.h      |  6 +++++
>  lib/librte_ethdev/rte_ethdev_version.map |  3 +++


For octeontx2, This feature was enabled through devargs as
"ptype_disable" argument.
Now that, We have public API, Could you remove the "ptype_disable"
devargs from octeontx2 driver
as a separate patch with devargs update in doc/guides/nics/octeontx2.rst.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v2 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
  2019-10-01 14:43   ` Jerin Jacob
@ 2019-10-01 15:40   ` Ajit Khaparde
  1 sibling, 0 replies; 246+ messages in thread
From: Ajit Khaparde @ 2019-10-01 15:40 UTC (permalink / raw)
  To: pbhagavatula
  Cc: Andrew Rybchenko, Jerin Jacob Kollanukkaran, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Yongseok Koh, Viacheslav Ovsiienko, Stephen Hemminger,
	K. Y. Srinivasan, Haiyang Zhang, Alejandro Lucero,
	Nithin Dabilpuram, Kiran Kumar K, Rasesh Mody, Shahed Shaikh,
	Maciej Czekaj, Yong Wang, dev

On Wed, Aug 21, 2019 at 1:48 PM <pbhagavatula@marvell.com> wrote:

> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
> delivery.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
For net/bnxt:

Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

> ---
>  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/igb_rxtx.c         |  3 ++-
>  drivers/net/enic/enic_res.c          |  3 ++-
>  drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
>  drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
>  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/liquidio/lio_ethdev.c    |  3 ++-
>  drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
>  drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
>  drivers/net/netvsc/hn_rndis.c        |  3 ++-
>  drivers/net/nfp/nfp_net.c            |  3 ++-
>  drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
>  drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
>  drivers/net/qede/qede_ethdev.c       |  3 ++-
>  drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
>  drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
>  drivers/net/sfc/sfc_rx.c             |  3 ++-
>  drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
>  drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
>  25 files changed, 55 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c
> b/drivers/net/bnxt/bnxt_ethdev.c
> index 6685ee7d9..6c106baf7 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_RSS_HASH)
>
>  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..22e61a55c 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_RSS_HASH)
>
>
>  #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..18c7bd0d5 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_RSS_HASH;
>
>  /* 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..55a1c4455 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_RSS_HASH;
>
>  /* Rx offloads which cannot be disabled */
>  static uint64_t dev_rx_offloads_nodis =
> diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
> index c5606de5d..684fa4ad8 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_RSS_HASH;
>
>         return rx_offload_capa;
>  }
> diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
> index 9405e1933..607a085f8 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_RSS_HASH;
>         enic->tx_offload_mask =
>                 PKT_TX_IPV6 |
>                 PKT_TX_IPV4 |
> diff --git a/drivers/net/fm10k/fm10k_ethdev.c
> b/drivers/net/fm10k/fm10k_ethdev.c
> index db4d72129..ba9b174cf 100644
> --- a/drivers/net/fm10k/fm10k_ethdev.c
> +++ b/drivers/net/fm10k/fm10k_ethdev.c
> @@ -1797,7 +1797,8 @@ static uint64_t
> fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
>                            DEV_RX_OFFLOAD_UDP_CKSUM   |
>                            DEV_RX_OFFLOAD_TCP_CKSUM   |
>                            DEV_RX_OFFLOAD_JUMBO_FRAME |
> -                          DEV_RX_OFFLOAD_HEADER_SPLIT);
> +                          DEV_RX_OFFLOAD_HEADER_SPLIT |
> +                          DEV_RX_OFFLOAD_RSS_HASH);
>  }
>
>  static int
> diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c
> b/drivers/net/hinic/hinic_pmd_ethdev.c
> index 044af9053..53bd2b9ae 100644
> --- a/drivers/net/hinic/hinic_pmd_ethdev.c
> +++ b/drivers/net/hinic/hinic_pmd_ethdev.c
> @@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct
> rte_eth_dev_info *info)
>         info->rx_offload_capa = 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_RSS_HASH;
>
>         info->tx_queue_offload_capa = 0;
>         info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
> diff --git a/drivers/net/i40e/i40e_ethdev.c
> b/drivers/net/i40e/i40e_ethdev.c
> index 4e40b7ab5..7058e0213 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_RSS_HASH;
>
>         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..aef91a79b 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_RSS_HASH;
>         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 44a14cb8a..fc0f0003f 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -2133,7 +2133,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct
> rte_eth_dev_info *dev_info)
>                         DEV_RX_OFFLOAD_TCP_CKSUM |
>                         DEV_RX_OFFLOAD_QINQ_STRIP |
>                         DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
> -                       DEV_RX_OFFLOAD_VLAN_EXTEND;
> +                       DEV_RX_OFFLOAD_VLAN_EXTEND |
> +                       DEV_RX_OFFLOAD_RSS_HASH;
>                 dev_info->tx_offload_capa |=
>                         DEV_TX_OFFLOAD_QINQ_INSERT |
>                         DEV_TX_OFFLOAD_IPV4_CKSUM |
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c
> b/drivers/net/ixgbe/ixgbe_rxtx.c
> index edcfa60ce..fa572d184 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_RSS_HASH;
>
>         if (hw->mac.type == ixgbe_mac_82598EB)
>                 offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
> diff --git a/drivers/net/liquidio/lio_ethdev.c
> b/drivers/net/liquidio/lio_ethdev.c
> index c25dab00c..ff118586e 100644
> --- a/drivers/net/liquidio/lio_ethdev.c
> +++ b/drivers/net/liquidio/lio_ethdev.c
> @@ -406,7 +406,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
>         devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM           |
>                                     DEV_RX_OFFLOAD_UDP_CKSUM            |
>                                     DEV_RX_OFFLOAD_TCP_CKSUM            |
> -                                   DEV_RX_OFFLOAD_VLAN_STRIP);
> +                                   DEV_RX_OFFLOAD_VLAN_STRIP           |
> +                                   DEV_RX_OFFLOAD_RSS_HASH);
>         devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM           |
>                                     DEV_TX_OFFLOAD_UDP_CKSUM            |
>                                     DEV_TX_OFFLOAD_TCP_CKSUM            |
> diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
> index f45c1ff85..4a6fbd922 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_RSS_HASH;
>
>         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..b5fd57693 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_RSS_HASH);
>
>         if (config->hw_fcs_strip)
>                 offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
> diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
> index a67bc7a79..2b4714042 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_RSS_HASH;
>
>         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..230d64c8a 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_RSS_HASH;
>
>         if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
>                 dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
> diff --git a/drivers/net/octeontx2/otx2_ethdev.c
> b/drivers/net/octeontx2/otx2_ethdev.c
> index b84128fef..2e88d1844 100644
> --- a/drivers/net/octeontx2/otx2_ethdev.c
> +++ b/drivers/net/octeontx2/otx2_ethdev.c
> @@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
>         struct rte_eth_rxmode *rxmode = &conf->rxmode;
>         uint16_t flags = 0;
>
> -       if (rxmode->mq_mode == ETH_MQ_RX_RSS)
> +       if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
> +                       (dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
>                 flags |= NIX_RX_OFFLOAD_RSS_F;
>
>         if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
> diff --git a/drivers/net/octeontx2/otx2_ethdev.h
> b/drivers/net/octeontx2/otx2_ethdev.h
> index 7b15d6bc8..0cca6746d 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_RSS_HASH)
>
>  #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..da25b26df 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_RSS_HASH);
>         dev_info->rx_queue_offload_capa = 0;
>
>         /* TX offloads are on a per-packet basis, so it is applicable
> diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c
> b/drivers/net/sfc/sfc_ef10_essb_rx.c
> index 63da807ea..220ef0e47 100644
> --- a/drivers/net/sfc/sfc_ef10_essb_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
> @@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
>         .features               = SFC_DP_RX_FEAT_FLOW_FLAG |
>                                   SFC_DP_RX_FEAT_FLOW_MARK,
>         .dev_offload_capa       = DEV_RX_OFFLOAD_CHECKSUM,
> -       .queue_offload_capa     = 0,
> +       .queue_offload_capa     = DEV_RX_OFFLOAD_RSS_HASH,
>         .get_dev_info           = sfc_ef10_essb_rx_get_dev_info,
>         .pool_ops_supported     = sfc_ef10_essb_rx_pool_ops_supported,
>         .qsize_up_rings         = sfc_ef10_essb_rx_qsize_up_rings,
> diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
> index f2fc6e70a..85b5df466 100644
> --- a/drivers/net/sfc/sfc_ef10_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_rx.c
> @@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
>                                   SFC_DP_RX_FEAT_INTR,
>         .dev_offload_capa       = DEV_RX_OFFLOAD_CHECKSUM |
>                                   DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
> -       .queue_offload_capa     = DEV_RX_OFFLOAD_SCATTER,
> +       .queue_offload_capa     = DEV_RX_OFFLOAD_SCATTER |
> +                                 DEV_RX_OFFLOAD_RSS_HASH,
>         .get_dev_info           = sfc_ef10_rx_get_dev_info,
>         .qsize_up_rings         = sfc_ef10_rx_qsize_up_rings,
>         .qcreate                = sfc_ef10_rx_qcreate,
> diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
> index e6809bb64..695580b22 100644
> --- a/drivers/net/sfc/sfc_rx.c
> +++ b/drivers/net/sfc/sfc_rx.c
> @@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
>         },
>         .features               = SFC_DP_RX_FEAT_INTR,
>         .dev_offload_capa       = DEV_RX_OFFLOAD_CHECKSUM,
> -       .queue_offload_capa     = DEV_RX_OFFLOAD_SCATTER,
> +       .queue_offload_capa     = DEV_RX_OFFLOAD_SCATTER |
> +                                 DEV_RX_OFFLOAD_RSS_HASH,
>         .qsize_up_rings         = sfc_efx_rx_qsize_up_rings,
>         .qcreate                = sfc_efx_rx_qcreate,
>         .qdestroy               = sfc_efx_rx_qdestroy,
> diff --git a/drivers/net/thunderx/nicvf_ethdev.h
> b/drivers/net/thunderx/nicvf_ethdev.h
> index c0bfbf848..391411799 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_RSS_HASH)
>
>  #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..a1bdf3482 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_RSS_HASH)
>
>  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.22.0
>
>

^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v6 0/7] ethdev: add new Rx offload flags
  2019-10-01  6:41     ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
                         ` (6 preceding siblings ...)
  2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-10-01 18:52       ` pbhagavatula
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 1/7] ethdev: add set ptype function pbhagavatula
                           ` (7 more replies)
  7 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01 18:52 UTC (permalink / raw)
  To: arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
`DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN, NULL,
					  0);

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.


Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add flow action type update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  drivers/net: update Rx flow flag and mark capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples: disable Rx packet type parsing

 doc/guides/nics/features.rst                  |  22 +++-
 doc/guides/rel_notes/release_19_11.rst        |  24 ++++
 drivers/net/bnxt/bnxt_ethdev.c                |   4 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   3 +-
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_res.c                   |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   3 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   3 +-
 drivers/net/i40e/i40e_ethdev.c                |   4 +-
 drivers/net/iavf/iavf_ethdev.c                |   4 +-
 drivers/net/ice/ice_ethdev.c                  |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |   4 +-
 drivers/net/liquidio/lio_ethdev.c             |   3 +-
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   4 +-
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   3 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  16 +--
 drivers/net/octeontx2/otx2_flow.c             |   9 +-
 drivers/net/octeontx2/otx2_flow.h             |   1 -
 drivers/net/octeontx2/otx2_flow_parse.c       |   4 +-
 drivers/net/qede/qede_ethdev.c                |   3 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   3 +-
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   3 +-
 examples/bbdev_app/main.c                     |   1 +
 examples/bond/main.c                          |   2 +
 examples/distributor/Makefile                 |   1 +
 examples/distributor/main.c                   |   1 +
 examples/distributor/meson.build              |   1 +
 examples/eventdev_pipeline/main.c             | 115 +----------------
 examples/eventdev_pipeline/meson.build        |   1 +
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 examples/exception_path/Makefile              |   1 +
 examples/exception_path/main.c                |   1 +
 examples/exception_path/meson.build           |   1 +
 examples/flow_classify/flow_classify.c        |   1 +
 examples/flow_filtering/Makefile              |   1 +
 examples/flow_filtering/main.c                |   1 +
 examples/flow_filtering/meson.build           |   1 +
 examples/ip_pipeline/link.c                   |   1 +
 examples/ip_reassembly/Makefile               |   1 +
 examples/ip_reassembly/main.c                 |   2 +
 examples/ip_reassembly/meson.build            |   1 +
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +
 examples/ipv4_multicast/Makefile              |   1 +
 examples/ipv4_multicast/main.c                |   2 +
 examples/ipv4_multicast/meson.build           |   1 +
 examples/kni/main.c                           |   1 +
 examples/l2fwd-cat/Makefile                   |   1 +
 examples/l2fwd-cat/l2fwd-cat.c                |   1 +
 examples/l2fwd-cat/meson.build                |   1 +
 examples/l2fwd-crypto/main.c                  |   2 +
 examples/l2fwd-jobstats/Makefile              |   1 +
 examples/l2fwd-jobstats/main.c                |   2 +
 examples/l2fwd-jobstats/meson.build           |   1 +
 examples/l2fwd-keepalive/Makefile             |   1 +
 examples/l2fwd-keepalive/main.c               |   2 +
 examples/l2fwd-keepalive/meson.build          |   1 +
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 examples/l3fwd-acl/Makefile                   |   1 +
 examples/l3fwd-acl/main.c                     |   2 +
 examples/l3fwd-acl/meson.build                |   1 +
 examples/l3fwd-vf/Makefile                    |   1 +
 examples/l3fwd-vf/main.c                      |   2 +
 examples/l3fwd-vf/meson.build                 |   1 +
 examples/link_status_interrupt/Makefile       |   1 +
 examples/link_status_interrupt/main.c         |   2 +
 examples/link_status_interrupt/meson.build    |   1 +
 examples/load_balancer/Makefile               |   1 +
 examples/load_balancer/init.c                 |   2 +
 examples/load_balancer/meson.build            |   1 +
 examples/packet_ordering/Makefile             |   1 +
 examples/packet_ordering/main.c               |   1 +
 examples/packet_ordering/meson.build          |   1 +
 examples/ptpclient/Makefile                   |   1 +
 examples/ptpclient/meson.build                |   1 +
 examples/ptpclient/ptpclient.c                |   1 +
 examples/qos_meter/Makefile                   |   1 +
 examples/qos_meter/main.c                     |   2 +
 examples/qos_meter/meson.build                |   1 +
 examples/qos_sched/Makefile                   |   1 +
 examples/qos_sched/init.c                     |   1 +
 examples/qos_sched/meson.build                |   1 +
 examples/quota_watermark/qw/Makefile          |   1 +
 examples/quota_watermark/qw/init.c            |   1 +
 examples/rxtx_callbacks/main.c                |   1 +
 examples/server_node_efd/server/Makefile      |   1 +
 examples/server_node_efd/server/init.c        |   1 +
 examples/skeleton/Makefile                    |   1 +
 examples/skeleton/basicfwd.c                  |   1 +
 examples/skeleton/meson.build                 |   1 +
 examples/tep_termination/Makefile             |   1 +
 examples/tep_termination/meson.build          |   1 +
 examples/tep_termination/vxlan_setup.c        |   1 +
 examples/vhost/Makefile                       |   1 +
 examples/vhost/main.c                         |   1 +
 examples/vm_power_manager/Makefile            |   1 +
 examples/vm_power_manager/main.c              |   1 +
 examples/vm_power_manager/meson.build         |   1 +
 examples/vmdq/Makefile                        |   1 +
 examples/vmdq/main.c                          |   1 +
 examples/vmdq/meson.build                     |   1 +
 examples/vmdq_dcb/Makefile                    |   1 +
 examples/vmdq_dcb/main.c                      |   1 +
 examples/vmdq_dcb/meson.build                 |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  52 ++++++++
 lib/librte_ethdev/rte_ethdev.h                |  38 ++++++
 lib/librte_ethdev/rte_ethdev_core.h           |   6 +
 lib/librte_ethdev/rte_ethdev_version.map      |   3 +
 lib/librte_ethdev/rte_flow.h                  |   6 +-
 119 files changed, 542 insertions(+), 159 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v6 1/7] ethdev: add set ptype function
  2019-10-01 18:52       ` [dpdk-dev] [PATCH v6 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-10-01 18:52         ` pbhagavatula
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                           ` (6 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01 18:52 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 doc/guides/nics/features.rst             |  8 +++-
 doc/guides/rel_notes/release_19_11.rst   |  8 ++++
 lib/librte_ethdev/rte_ethdev.c           | 50 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 36 +++++++++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      |  6 +++
 lib/librte_ethdev/rte_ethdev_version.map |  3 ++
 6 files changed, 109 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index c4e128d2f..1756fa73a 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,13 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+  ``dev_supported_ptypes_set``.
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 27cfbd9e3..abb7b6529 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -56,6 +56,14 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e1f..b1588fe7a 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2602,6 +2602,56 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	unsigned int i, j;
+	struct rte_eth_dev *dev;
+	const uint32_t *all_ptypes;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set, 0);
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (ptype_mask == 0) {
+		if (num > 0)
+			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+		return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		if (num > 0)
+			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+		return 0;
+	}
+
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+}
+
 void
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d9871782e..c577a9172 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2431,6 +2431,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification in which
+ * the recipient is interested.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, unsigned int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 2922d5b7c..93bc34480 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+/**< @internal Inform device about packet types in which the recipient is interested. */
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -421,6 +425,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform device about packet types in which the recipient is interested. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6df42a47b..e14745b9c 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -283,4 +283,7 @@ EXPERIMENTAL {
 
 	# added in 19.08
 	rte_eth_read_clock;
+
+	# added in 19.11
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v6 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-01 18:52       ` [dpdk-dev] [PATCH v6 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-01 18:52         ` pbhagavatula
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 3/7] ethdev: add flow action type " pbhagavatula
                           ` (5 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01 18:52 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 2 ++
 doc/guides/rel_notes/release_19_11.rst | 7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 1 +
 lib/librte_ethdev/rte_ethdev.h         | 1 +
 4 files changed, 11 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 1756fa73a..f7c6d918f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index abb7b6529..724228faa 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -64,6 +64,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index b1588fe7a..19bd4795e 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c577a9172..c3fa69412 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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v6 3/7] ethdev: add flow action type update as an offload
  2019-10-01 18:52       ` [dpdk-dev] [PATCH v6 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 1/7] ethdev: add set ptype function pbhagavatula
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-01 18:52         ` pbhagavatula
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                           ` (4 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01 18:52 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, Adrien Mazarguil
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 12 ++++++++++++
 doc/guides/rel_notes/release_19_11.rst |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.c         |  1 +
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 lib/librte_ethdev/rte_flow.h           |  6 ++++--
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f7c6d918f..9737ff7a1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@ Allows application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 724228faa..670fbfd36 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -71,6 +71,15 @@ New Features
   *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
      by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
 
+* **Added Rx offload flag to enable or disable flow action type update**
+
+  *  Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
+     `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
+     `RTE_FLOW_ACTION_FLAG` are enabled.
+  *  PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the application
+     by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 19bd4795e..08f8ba107 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c3fa69412..a2e86d155 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1014,6 +1014,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index 354cb1dd0..5d62686c0 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1316,7 +1316,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1324,7 +1325,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * No associated configuration structure.
 	 */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v6 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-01 18:52       ` [dpdk-dev] [PATCH v6 0/7] ethdev: add new Rx offload flags pbhagavatula
                           ` (2 preceding siblings ...)
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-10-01 18:52         ` pbhagavatula
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
                           ` (3 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01 18:52 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 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/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
 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/liquidio/lio_ethdev.c    |  3 ++-
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
 25 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7d9..6c106baf7 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_RSS_HASH)
 
 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..22e61a55c 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_RSS_HASH)
 
 
 #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..18c7bd0d5 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_RSS_HASH;
 
 /* 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..55a1c4455 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_RSS_HASH;
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 9405e1933..607a085f8 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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d72129..ba9b174cf 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1797,7 +1797,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af9053..53bd2b9ae 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->rx_offload_capa = 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_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7ab5..7058e0213 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_RSS_HASH;
 
 	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..aef91a79b 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_RSS_HASH;
 	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 63997fdfb..2e2a6b2af 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2145,7 +2145,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index c25dab00c..ff118586e 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -406,7 +406,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	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..b5fd57693 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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..230d64c8a 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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index b84128fef..2e88d1844 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 7b15d6bc8..0cca6746d 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_RSS_HASH)
 
 #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..da25b26df 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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 9cd5eb65b..da768ced7 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 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] 246+ messages in thread

* [dpdk-dev] [PATCH v6 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-10-01 18:52       ` [dpdk-dev] [PATCH v6 0/7] ethdev: add new Rx offload flags pbhagavatula
                           ` (3 preceding siblings ...)
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-01 18:52         ` pbhagavatula
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                           ` (2 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01 18:52 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
flag and mark.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 3 ++-
 drivers/net/enic/enic_res.c             | 3 ++-
 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/mlx5/mlx5_rxq.c             | 3 ++-
 drivers/net/octeontx2/otx2_ethdev.h     | 3 ++-
 drivers/net/octeontx2/otx2_flow.c       | 9 ++-------
 drivers/net/octeontx2/otx2_flow.h       | 1 -
 drivers/net/octeontx2/otx2_flow_parse.c | 4 +---
 drivers/net/sfc/sfc_ef10_essb_rx.c      | 3 ++-
 12 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6c106baf7..fd1fb7eda 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -161,7 +161,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_JUMBO_FRAME | \
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_RSS_HASH)
+				     DEV_RX_OFFLOAD_RSS_HASH | \
+				     DEV_RX_OFFLOAD_FLOW_MARK)
 
 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/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 607a085f8..3503d5d7e 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -199,7 +199,8 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7058e0213..6311943be 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3512,7 +3512,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_VLAN_EXTEND |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 
 	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 aef91a79b..7bdaa87b1 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -518,7 +518,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_SCATTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	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 2e2a6b2af..984af659f 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2146,7 +2146,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 			DEV_RX_OFFLOAD_VLAN_EXTEND |
-			DEV_RX_OFFLOAD_RSS_HASH;
+			DEV_RX_OFFLOAD_RSS_HASH |
+			DEV_RX_OFFLOAD_FLOW_MARK;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index fa572d184..1481e2426 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
 		   DEV_RX_OFFLOAD_VLAN_FILTER |
 		   DEV_RX_OFFLOAD_SCATTER |
-		   DEV_RX_OFFLOAD_RSS_HASH;
+		   DEV_RX_OFFLOAD_RSS_HASH |
+		   DEV_RX_OFFLOAD_FLOW_MARK;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index b5fd57693..1bf01bda3 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
 	uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
 			     DEV_RX_OFFLOAD_TIMESTAMP |
 			     DEV_RX_OFFLOAD_JUMBO_FRAME |
-			     DEV_RX_OFFLOAD_RSS_HASH);
+			     DEV_RX_OFFLOAD_RSS_HASH |
+			     DEV_RX_OFFLOAD_FLOW_MARK);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 0cca6746d..97c1a636a 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -141,7 +141,8 @@
 	DEV_RX_OFFLOAD_VLAN_FILTER	| \
 	DEV_RX_OFFLOAD_QINQ_STRIP	| \
 	DEV_RX_OFFLOAD_TIMESTAMP	| \
-	DEV_RX_OFFLOAD_RSS_HASH)
+	DEV_RX_OFFLOAD_RSS_HASH		| \
+	DEV_RX_OFFLOAD_FLOW_MARK)
 
 #define NIX_DEFAULT_RSS_CTX_GROUP  0
 #define NIX_DEFAULT_RSS_MCAM_IDX  -1
diff --git a/drivers/net/octeontx2/otx2_flow.c b/drivers/net/octeontx2/otx2_flow.c
index bdbf123a9..ea4e380b1 100644
--- a/drivers/net/octeontx2/otx2_flow.c
+++ b/drivers/net/octeontx2/otx2_flow.c
@@ -524,11 +524,8 @@ otx2_flow_destroy(struct rte_eth_dev *dev,
 		NIX_RX_ACT_MATCH_MASK;
 
 	if (match_id && match_id < OTX2_FLOW_ACTION_FLAG_DEFAULT) {
-		if (rte_atomic32_read(&npc->mark_actions) == 0)
-			return -EINVAL;
-
-		/* Clear mark offload flag if there are no more mark actions */
-		if (rte_atomic32_sub_return(&npc->mark_actions, 1) == 0) {
+		/* Clear mark offload flag if there is no more mark action */
+		if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 			hw->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F;
 			otx2_eth_set_rx_function(dev);
 		}
@@ -821,8 +818,6 @@ otx2_flow_init(struct otx2_eth_dev *hw)
 		return rc;
 	}
 
-	rte_atomic32_init(&npc->mark_actions);
-
 	npc->mcam_entries = NPC_MCAM_TOT_ENTRIES >> npc->keyw[NPC_MCAM_RX];
 	/* Free, free_rev, live and live_rev entries */
 	bmap_sz = rte_bitmap_get_memory_footprint(npc->mcam_entries);
diff --git a/drivers/net/octeontx2/otx2_flow.h b/drivers/net/octeontx2/otx2_flow.h
index ab068b088..85129cc9d 100644
--- a/drivers/net/octeontx2/otx2_flow.h
+++ b/drivers/net/octeontx2/otx2_flow.h
@@ -160,7 +160,6 @@ TAILQ_HEAD(otx2_flow_list, rte_flow);
 
 /* Accessed from ethdev private - otx2_eth_dev */
 struct otx2_npc_flow_info {
-	rte_atomic32_t mark_actions;
 	uint32_t keyx_supp_nmask[NPC_MAX_INTF];/* nibble mask */
 	uint32_t keyx_len[NPC_MAX_INTF];	/* per intf key len in bits */
 	uint32_t datax_len[NPC_MAX_INTF];	/* per intf data len in bits */
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a70..6312d9942 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -795,13 +795,11 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			}
 			mark = act_mark->id + 1;
 			req_act |= OTX2_FLOW_ACT_MARK;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_FLAG:
 			mark = OTX2_FLOW_FLAG_VAL;
 			req_act |= OTX2_FLOW_ACT_FLAG;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_COUNT:
@@ -979,7 +977,7 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 	if (mark)
 		flow->npc_action |= (uint64_t)mark << 40;
 
-	if (rte_atomic32_read(&npc->mark_actions) == 1) {
+	if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 		hw->rx_offload_flags |=
 			NIX_RX_OFFLOAD_MARK_UPDATE_F;
 		otx2_eth_set_rx_function(dev);
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 220ef0e47..1887731e2 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v6 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-01 18:52       ` [dpdk-dev] [PATCH v6 0/7] ethdev: add new Rx offload flags pbhagavatula
                           ` (4 preceding siblings ...)
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-10-01 18:52         ` pbhagavatula
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 7/7] examples: disable Rx packet type parsing pbhagavatula
  2019-10-02  3:47         ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01 18:52 UTC (permalink / raw)
  To: arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 113 -----------------
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 3 files changed, 232 insertions(+), 113 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f541..a73b61d59 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,118 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	rte_eth_dev_info_get(port, &dev_info);
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	rte_eth_macaddr_get(port, &addr);
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
 
 static void
 do_capability_setup(uint8_t eventdev_id)
@@ -501,7 +389,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..aa1678fe7 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,123 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +414,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 8961cd656..52a1b4174 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,119 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +734,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v6 7/7] examples: disable Rx packet type parsing
  2019-10-01 18:52       ` [dpdk-dev] [PATCH v6 0/7] ethdev: add new Rx offload flags pbhagavatula
                           ` (5 preceding siblings ...)
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-01 18:52         ` pbhagavatula
  2019-10-02  3:47         ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-01 18:52 UTC (permalink / raw)
  To: arybchenko, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki, Bernard Iremonger,
	Cristian Dumitrescu, Konstantin Ananyev, Ferruh Yigit,
	Declan Doherty, Reshma Pattan, John McNamara, Xiaoyun Li,
	Jasvinder Singh, Byron Marohn, Yipeng Wang, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing in examples that don't use
`rte_mbuf::packet_type` by setting ptype_mask as 0 in
`rte_eth_dev_set_supported_ptypes`

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/bbdev_app/main.c                  | 1 +
 examples/bond/main.c                       | 2 ++
 examples/distributor/Makefile              | 1 +
 examples/distributor/main.c                | 1 +
 examples/distributor/meson.build           | 1 +
 examples/eventdev_pipeline/main.c          | 2 ++
 examples/eventdev_pipeline/meson.build     | 1 +
 examples/exception_path/Makefile           | 1 +
 examples/exception_path/main.c             | 1 +
 examples/exception_path/meson.build        | 1 +
 examples/flow_classify/flow_classify.c     | 1 +
 examples/flow_filtering/Makefile           | 1 +
 examples/flow_filtering/main.c             | 1 +
 examples/flow_filtering/meson.build        | 1 +
 examples/ip_pipeline/link.c                | 1 +
 examples/ip_reassembly/Makefile            | 1 +
 examples/ip_reassembly/main.c              | 2 ++
 examples/ip_reassembly/meson.build         | 1 +
 examples/ipsec-secgw/ipsec-secgw.c         | 2 ++
 examples/ipv4_multicast/Makefile           | 1 +
 examples/ipv4_multicast/main.c             | 2 ++
 examples/ipv4_multicast/meson.build        | 1 +
 examples/kni/main.c                        | 1 +
 examples/l2fwd-cat/Makefile                | 1 +
 examples/l2fwd-cat/l2fwd-cat.c             | 1 +
 examples/l2fwd-cat/meson.build             | 1 +
 examples/l2fwd-crypto/main.c               | 2 ++
 examples/l2fwd-jobstats/Makefile           | 1 +
 examples/l2fwd-jobstats/main.c             | 2 ++
 examples/l2fwd-jobstats/meson.build        | 1 +
 examples/l2fwd-keepalive/Makefile          | 1 +
 examples/l2fwd-keepalive/main.c            | 2 ++
 examples/l2fwd-keepalive/meson.build       | 1 +
 examples/l2fwd/Makefile                    | 1 +
 examples/l2fwd/main.c                      | 2 ++
 examples/l2fwd/meson.build                 | 1 +
 examples/l3fwd-acl/Makefile                | 1 +
 examples/l3fwd-acl/main.c                  | 2 ++
 examples/l3fwd-acl/meson.build             | 1 +
 examples/l3fwd-vf/Makefile                 | 1 +
 examples/l3fwd-vf/main.c                   | 2 ++
 examples/l3fwd-vf/meson.build              | 1 +
 examples/link_status_interrupt/Makefile    | 1 +
 examples/link_status_interrupt/main.c      | 2 ++
 examples/link_status_interrupt/meson.build | 1 +
 examples/load_balancer/Makefile            | 1 +
 examples/load_balancer/init.c              | 2 ++
 examples/load_balancer/meson.build         | 1 +
 examples/packet_ordering/Makefile          | 1 +
 examples/packet_ordering/main.c            | 1 +
 examples/packet_ordering/meson.build       | 1 +
 examples/ptpclient/Makefile                | 1 +
 examples/ptpclient/meson.build             | 1 +
 examples/ptpclient/ptpclient.c             | 1 +
 examples/qos_meter/Makefile                | 1 +
 examples/qos_meter/main.c                  | 2 ++
 examples/qos_meter/meson.build             | 1 +
 examples/qos_sched/Makefile                | 1 +
 examples/qos_sched/init.c                  | 1 +
 examples/qos_sched/meson.build             | 1 +
 examples/quota_watermark/qw/Makefile       | 1 +
 examples/quota_watermark/qw/init.c         | 1 +
 examples/rxtx_callbacks/main.c             | 1 +
 examples/server_node_efd/server/Makefile   | 1 +
 examples/server_node_efd/server/init.c     | 1 +
 examples/skeleton/Makefile                 | 1 +
 examples/skeleton/basicfwd.c               | 1 +
 examples/skeleton/meson.build              | 1 +
 examples/tep_termination/Makefile          | 1 +
 examples/tep_termination/meson.build       | 1 +
 examples/tep_termination/vxlan_setup.c     | 1 +
 examples/vhost/Makefile                    | 1 +
 examples/vhost/main.c                      | 1 +
 examples/vm_power_manager/Makefile         | 1 +
 examples/vm_power_manager/main.c           | 1 +
 examples/vm_power_manager/meson.build      | 1 +
 examples/vmdq/Makefile                     | 1 +
 examples/vmdq/main.c                       | 1 +
 examples/vmdq/meson.build                  | 1 +
 examples/vmdq_dcb/Makefile                 | 1 +
 examples/vmdq_dcb/main.c                   | 1 +
 examples/vmdq_dcb/meson.build              | 1 +
 82 files changed, 96 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 9acf666dc..277725a6b 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 
 	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
 	print_mac(port_id, &bbdev_port_eth_addr);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 1c0df9d46..f92104908 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -195,6 +195,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				portid, retval);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(portid);
 	if (retval < 0)
 		rte_exit(retval,
@@ -271,6 +272,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
+	rte_eth_dev_set_supported_ptypes(BOND_PORT, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(BOND_PORT);
 	if (retval < 0)
 		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d5578..a2a477279 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 81d7ca61d..35930d8a3 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -162,6 +162,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 26f108d65..c2976f6bd 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -10,6 +10,7 @@
 build = dpdk_conf.has('RTE_LIBRTE_POWER')
 
 deps += ['distributor', 'power']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index a73b61d59..66b6420f9 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -393,6 +393,8 @@ main(int argc, char **argv)
 
 	/* Start the Ethernet port. */
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		err = rte_eth_dev_start(portid);
 		if (err < 0)
 			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
index a54c35aa7..0fc916b05 100644
--- a/examples/eventdev_pipeline/meson.build
+++ b/examples/eventdev_pipeline/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'eventdev'
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 	'pipeline_worker_generic.c',
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 90c7f133a..a7c961276 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0d79e5a24..0165e4553 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -464,6 +464,7 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		FATAL_ERROR("Could not start port%u (%d)", port, ret);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index bc7f43ea9..f34d27428 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -231,6 +231,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	}
 
 	/* Start the Ethernet port. */
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a75555..793a08fae 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a0487be77..4b8712324 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -176,6 +176,7 @@ init_port(void)
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
 		rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index 407795c42..6f5d1b08a 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 )
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 787eb866a..7d02962e3 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -205,6 +205,7 @@ link_create(const char *name, struct link_params *params)
 			return NULL;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Port start */
 	status = rte_eth_dev_start(port_id);
 	if (status < 0)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904e0..19c462388 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 38b39be6b..f2c28ef76 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1158,6 +1158,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0d1fd6af6..2aceaf549 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2448,6 +2448,8 @@ main(int32_t argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/*
 		 * Start device
 		 * note: device must be started before a flow rule
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67dd4..5171f7ab2 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 72eaadc51..3d327a00b 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -765,6 +765,8 @@ main(int argc, char **argv)
 			qconf->tx_queue_id[portid] = queueid;
 			queueid++;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		rte_eth_allmulticast_enable(portid);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'hash'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d7176..99f500e25 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -625,6 +625,7 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6d3..d6a25e42a 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -66,6 +66,7 @@ endif
 EXTRA_CFLAGS += -O3 -g -Wfatal-errors
 
 CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
 LDLIBS += -lpqos
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index b34b40a00..a54a1ed25 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 4e2777a03..37c96040d 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
 ext_deps += pqos
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
+allow_experimental_apis = true
 sources = files(
 	'cat.c', 'l2fwd-cat.c'
 )
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 3fe2ba725..5071ef389 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2559,6 +2559,8 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			return -1;
 		}
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		retval = rte_eth_dev_start(portid);
 		if (retval < 0) {
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e93..09834e979 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 77e44dc82..03d986a68 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -902,6 +902,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['jobstats', 'timer']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a6f..584257ae2 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS += -lrt
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 9831a4323..8d3e5eadd 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -696,6 +696,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
 
 ext_deps += cc.find_library('rt')
 deps += 'timer'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'shm.c'
 )
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1e2b14297..b7d6ee2ff 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -694,6 +694,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f71..df590f8e9 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 0c44df767..e113b1a4d 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2056,6 +2056,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index 7b186a23c..db7f51f2f 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 572e74cf5..5bf70f52d 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1051,6 +1051,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14a8..6ddedd4de 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7a6..04da4732b 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -676,6 +676,8 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
 					"tx buffer on port %u\n", (unsigned) portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/link_status_interrupt/meson.build
+++ b/examples/link_status_interrupt/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index caae8a107..dcba9194c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3ab7d0211..d49d61474 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -496,6 +496,8 @@ app_init_nics(void)
 			}
 		}
 
+		rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start port */
 		ret = rte_eth_dev_start(port);
 		if (ret < 0) {
diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
index 4f7ac3999..19708974c 100644
--- a/examples/load_balancer/meson.build
+++ b/examples/load_balancer/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'lpm'
+allow_experimental_apis = true
 sources = files(
 	'config.c', 'init.c', 'main.c', 'runtime.c'
 )
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7eb..9ba3fa9e8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e92299..59354fad5 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -312,6 +312,7 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
 		return ret;
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'reorder'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bacbd..f158d96b9 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'ptpclient.c'
 )
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 31778fd95..e2cf4b136 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -227,6 +227,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf7c..a1533d08f 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8be..ade8e49c3 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -419,10 +419,12 @@ main(int argc, char **argv)
 
 	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
 
+	rte_eth_dev_set_supported_ptypes(port_rx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_rx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_tx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_tx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
index ef7779f2f..10cd4bc79 100644
--- a/examples/qos_meter/meson.build
+++ b/examples/qos_meter/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'meter'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'rte_policer.c'
 )
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d25371..7d3d3019f 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -58,6 +58,7 @@ else
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index b05206d5a..d165b3dd4 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -138,6 +138,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
 			 ret, portid, 0);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81ce8..5101652af 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
 sources = files(
 	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
 	'init.c', 'main.c', 'stats.c'
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
index 3f10f01c3..e06f4482b 100644
--- a/examples/quota_watermark/qw/Makefile
+++ b/examples/quota_watermark/qw/Makefile
@@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
 
 CFLAGS += -O3 -DQW_SOFTWARE_FC
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 5a0f64f45..4753eb900 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
 				"Failed to setup hardware flow control on port %u (error %d)\n",
 				(unsigned int) port_id, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index dbcd9f4fc..8949f0d93 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -152,6 +152,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 4837bd3ea..acbd12ae2 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
 
 CFLAGS += $(WERROR_FLAGS) -O3
 CFLAGS += -I$(SRCDIR)/../shared
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e28..bbea0c4c9 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -149,6 +149,7 @@ init_port(uint16_t port_num)
 
 	rte_eth_promiscuous_enable(port_num);
 
+	rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port_num);
 	if (retval < 0)
 		return retval;
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac26029..0037d6b25 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98f0..423ce05f8 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -76,6 +76,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'basicfwd.c'
 )
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd92..586838676 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -61,6 +61,7 @@ endif
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index f65d68980..f40b1c0b8 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -11,6 +11,7 @@ if not is_linux
 endif
 deps += ['hash', 'vhost']
 cflags += '-Wno-deprecated-declarations'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'vxlan.c', 'vxlan_setup.c'
 )
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a0880002..219d3e215 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -167,6 +167,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f017..7722e81c7 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -62,6 +62,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0961db080..3d9f125e5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -321,6 +321,7 @@ port_init(uint16_t port)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..65c2ad179 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -28,6 +28,7 @@ endif
 
 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lvirt
 
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 54c704610..4cb4ccecf 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -99,6 +99,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
index 20a4a05b3..54e2b584f 100644
--- a/examples/vm_power_manager/meson.build
+++ b/examples/vm_power_manager/meson.build
@@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
 	deps += ['pmd_ixgbe']
 endif
 
+allow_experimental_apis = true
 sources = files(
 	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
 )
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee86b..2168747cc 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 EXTRA_CFLAGS += -O3
 
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd7f..65431f95e 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -258,6 +258,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096cfb..ea1574d91 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 389000327..44fe63482 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -313,6 +313,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v5 0/7] ethdev: add new Rx offload flags
  2019-10-01 18:52       ` [dpdk-dev] [PATCH v6 0/7] ethdev: add new Rx offload flags pbhagavatula
                           ` (6 preceding siblings ...)
  2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-10-02  3:47         ` pbhagavatula
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 1/7] ethdev: add set ptype function pbhagavatula
                             ` (7 more replies)
  7 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02  3:47 UTC (permalink / raw)
  To: arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
`DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN, NULL,
					  0);
v7 Changes:
----------
- Fix unused variable in net/octeontx2

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.


Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add flow action type update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  drivers/net: update Rx flow flag and mark capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples: disable Rx packet type parsing

 doc/guides/nics/features.rst                  |  22 +++-
 doc/guides/rel_notes/release_19_11.rst        |  24 ++++
 drivers/net/bnxt/bnxt_ethdev.c                |   4 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   3 +-
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_res.c                   |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   3 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   3 +-
 drivers/net/i40e/i40e_ethdev.c                |   4 +-
 drivers/net/iavf/iavf_ethdev.c                |   4 +-
 drivers/net/ice/ice_ethdev.c                  |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |   4 +-
 drivers/net/liquidio/lio_ethdev.c             |   3 +-
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   4 +-
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   3 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  16 +--
 drivers/net/octeontx2/otx2_flow.c             |   9 +-
 drivers/net/octeontx2/otx2_flow.h             |   1 -
 drivers/net/octeontx2/otx2_flow_parse.c       |   5 +-
 drivers/net/qede/qede_ethdev.c                |   3 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   3 +-
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   3 +-
 examples/bbdev_app/main.c                     |   1 +
 examples/bond/main.c                          |   2 +
 examples/distributor/Makefile                 |   1 +
 examples/distributor/main.c                   |   1 +
 examples/distributor/meson.build              |   1 +
 examples/eventdev_pipeline/main.c             | 115 +----------------
 examples/eventdev_pipeline/meson.build        |   1 +
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 examples/exception_path/Makefile              |   1 +
 examples/exception_path/main.c                |   1 +
 examples/exception_path/meson.build           |   1 +
 examples/flow_classify/flow_classify.c        |   1 +
 examples/flow_filtering/Makefile              |   1 +
 examples/flow_filtering/main.c                |   1 +
 examples/flow_filtering/meson.build           |   1 +
 examples/ip_pipeline/link.c                   |   1 +
 examples/ip_reassembly/Makefile               |   1 +
 examples/ip_reassembly/main.c                 |   2 +
 examples/ip_reassembly/meson.build            |   1 +
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +
 examples/ipv4_multicast/Makefile              |   1 +
 examples/ipv4_multicast/main.c                |   2 +
 examples/ipv4_multicast/meson.build           |   1 +
 examples/kni/main.c                           |   1 +
 examples/l2fwd-cat/Makefile                   |   1 +
 examples/l2fwd-cat/l2fwd-cat.c                |   1 +
 examples/l2fwd-cat/meson.build                |   1 +
 examples/l2fwd-crypto/main.c                  |   2 +
 examples/l2fwd-jobstats/Makefile              |   1 +
 examples/l2fwd-jobstats/main.c                |   2 +
 examples/l2fwd-jobstats/meson.build           |   1 +
 examples/l2fwd-keepalive/Makefile             |   1 +
 examples/l2fwd-keepalive/main.c               |   2 +
 examples/l2fwd-keepalive/meson.build          |   1 +
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 examples/l3fwd-acl/Makefile                   |   1 +
 examples/l3fwd-acl/main.c                     |   2 +
 examples/l3fwd-acl/meson.build                |   1 +
 examples/l3fwd-vf/Makefile                    |   1 +
 examples/l3fwd-vf/main.c                      |   2 +
 examples/l3fwd-vf/meson.build                 |   1 +
 examples/link_status_interrupt/Makefile       |   1 +
 examples/link_status_interrupt/main.c         |   2 +
 examples/link_status_interrupt/meson.build    |   1 +
 examples/load_balancer/Makefile               |   1 +
 examples/load_balancer/init.c                 |   2 +
 examples/load_balancer/meson.build            |   1 +
 examples/packet_ordering/Makefile             |   1 +
 examples/packet_ordering/main.c               |   1 +
 examples/packet_ordering/meson.build          |   1 +
 examples/ptpclient/Makefile                   |   1 +
 examples/ptpclient/meson.build                |   1 +
 examples/ptpclient/ptpclient.c                |   1 +
 examples/qos_meter/Makefile                   |   1 +
 examples/qos_meter/main.c                     |   2 +
 examples/qos_meter/meson.build                |   1 +
 examples/qos_sched/Makefile                   |   1 +
 examples/qos_sched/init.c                     |   1 +
 examples/qos_sched/meson.build                |   1 +
 examples/quota_watermark/qw/Makefile          |   1 +
 examples/quota_watermark/qw/init.c            |   1 +
 examples/rxtx_callbacks/main.c                |   1 +
 examples/server_node_efd/server/Makefile      |   1 +
 examples/server_node_efd/server/init.c        |   1 +
 examples/skeleton/Makefile                    |   1 +
 examples/skeleton/basicfwd.c                  |   1 +
 examples/skeleton/meson.build                 |   1 +
 examples/tep_termination/Makefile             |   1 +
 examples/tep_termination/meson.build          |   1 +
 examples/tep_termination/vxlan_setup.c        |   1 +
 examples/vhost/Makefile                       |   1 +
 examples/vhost/main.c                         |   1 +
 examples/vm_power_manager/Makefile            |   1 +
 examples/vm_power_manager/main.c              |   1 +
 examples/vm_power_manager/meson.build         |   1 +
 examples/vmdq/Makefile                        |   1 +
 examples/vmdq/main.c                          |   1 +
 examples/vmdq/meson.build                     |   1 +
 examples/vmdq_dcb/Makefile                    |   1 +
 examples/vmdq_dcb/main.c                      |   1 +
 examples/vmdq_dcb/meson.build                 |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  52 ++++++++
 lib/librte_ethdev/rte_ethdev.h                |  38 ++++++
 lib/librte_ethdev/rte_ethdev_core.h           |   6 +
 lib/librte_ethdev/rte_ethdev_version.map      |   3 +
 lib/librte_ethdev/rte_flow.h                  |   6 +-
 119 files changed, 542 insertions(+), 160 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v7 1/7] ethdev: add set ptype function
  2019-10-02  3:47         ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-10-02  3:47           ` pbhagavatula
  2019-10-02 13:37             ` Andrew Rybchenko
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                             ` (6 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-02  3:47 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 doc/guides/nics/features.rst             |  8 +++-
 doc/guides/rel_notes/release_19_11.rst   |  8 ++++
 lib/librte_ethdev/rte_ethdev.c           | 50 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 36 +++++++++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      |  6 +++
 lib/librte_ethdev/rte_ethdev_version.map |  3 ++
 6 files changed, 109 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index c4e128d2f..1756fa73a 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,13 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+  ``dev_supported_ptypes_set``.
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 27cfbd9e3..abb7b6529 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -56,6 +56,14 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e1f..b1588fe7a 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2602,6 +2602,56 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	unsigned int i, j;
+	struct rte_eth_dev *dev;
+	const uint32_t *all_ptypes;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set, 0);
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (ptype_mask == 0) {
+		if (num > 0)
+			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+		return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		if (num > 0)
+			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+		return 0;
+	}
+
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+}
+
 void
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d9871782e..c577a9172 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2431,6 +2431,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification in which
+ * the recipient is interested.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, unsigned int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 2922d5b7c..93bc34480 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+/**< @internal Inform device about packet types in which the recipient is interested. */
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -421,6 +425,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform device about packet types in which the recipient is interested. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6df42a47b..e14745b9c 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -283,4 +283,7 @@ EXPERIMENTAL {
 
 	# added in 19.08
 	rte_eth_read_clock;
+
+	# added in 19.11
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v7 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-02  3:47         ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-02  3:47           ` pbhagavatula
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 3/7] ethdev: add flow action type " pbhagavatula
                             ` (5 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02  3:47 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 2 ++
 doc/guides/rel_notes/release_19_11.rst | 7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 1 +
 lib/librte_ethdev/rte_ethdev.h         | 1 +
 4 files changed, 11 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 1756fa73a..f7c6d918f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index abb7b6529..724228faa 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -64,6 +64,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index b1588fe7a..19bd4795e 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c577a9172..c3fa69412 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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v7 3/7] ethdev: add flow action type update as an offload
  2019-10-02  3:47         ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 1/7] ethdev: add set ptype function pbhagavatula
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-02  3:47           ` pbhagavatula
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                             ` (4 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02  3:47 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, Adrien Mazarguil
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 12 ++++++++++++
 doc/guides/rel_notes/release_19_11.rst |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.c         |  1 +
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 lib/librte_ethdev/rte_flow.h           |  6 ++++--
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f7c6d918f..9737ff7a1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@ Allows application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 724228faa..670fbfd36 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -71,6 +71,15 @@ New Features
   *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
      by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
 
+* **Added Rx offload flag to enable or disable flow action type update**
+
+  *  Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
+     `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
+     `RTE_FLOW_ACTION_FLAG` are enabled.
+  *  PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the application
+     by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 19bd4795e..08f8ba107 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c3fa69412..a2e86d155 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1014,6 +1014,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index 354cb1dd0..5d62686c0 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1316,7 +1316,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1324,7 +1325,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * No associated configuration structure.
 	 */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v7 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-02  3:47         ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
                             ` (2 preceding siblings ...)
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-10-02  3:47           ` pbhagavatula
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
                             ` (3 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02  3:47 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 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/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
 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/liquidio/lio_ethdev.c    |  3 ++-
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
 25 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7d9..6c106baf7 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_RSS_HASH)
 
 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..22e61a55c 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_RSS_HASH)
 
 
 #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..18c7bd0d5 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_RSS_HASH;
 
 /* 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..55a1c4455 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_RSS_HASH;
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 9405e1933..607a085f8 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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d72129..ba9b174cf 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1797,7 +1797,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af9053..53bd2b9ae 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->rx_offload_capa = 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_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7ab5..7058e0213 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_RSS_HASH;
 
 	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..aef91a79b 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_RSS_HASH;
 	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 63997fdfb..2e2a6b2af 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2145,7 +2145,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index c25dab00c..ff118586e 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -406,7 +406,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	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..b5fd57693 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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..230d64c8a 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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index b84128fef..2e88d1844 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 7b15d6bc8..0cca6746d 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_RSS_HASH)
 
 #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..da25b26df 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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 9cd5eb65b..da768ced7 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 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] 246+ messages in thread

* [dpdk-dev] [PATCH v7 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-10-02  3:47         ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
                             ` (3 preceding siblings ...)
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-02  3:47           ` pbhagavatula
  2019-10-02  9:52             ` Jerin Jacob
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                             ` (2 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-02  3:47 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
flag and mark.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 3 ++-
 drivers/net/enic/enic_res.c             | 3 ++-
 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/mlx5/mlx5_rxq.c             | 3 ++-
 drivers/net/octeontx2/otx2_ethdev.h     | 3 ++-
 drivers/net/octeontx2/otx2_flow.c       | 9 ++-------
 drivers/net/octeontx2/otx2_flow.h       | 1 -
 drivers/net/octeontx2/otx2_flow_parse.c | 5 +----
 drivers/net/sfc/sfc_ef10_essb_rx.c      | 3 ++-
 12 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6c106baf7..fd1fb7eda 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -161,7 +161,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_JUMBO_FRAME | \
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_RSS_HASH)
+				     DEV_RX_OFFLOAD_RSS_HASH | \
+				     DEV_RX_OFFLOAD_FLOW_MARK)
 
 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/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 607a085f8..3503d5d7e 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -199,7 +199,8 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7058e0213..6311943be 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3512,7 +3512,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_VLAN_EXTEND |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 
 	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 aef91a79b..7bdaa87b1 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -518,7 +518,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_SCATTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	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 2e2a6b2af..984af659f 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2146,7 +2146,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 			DEV_RX_OFFLOAD_VLAN_EXTEND |
-			DEV_RX_OFFLOAD_RSS_HASH;
+			DEV_RX_OFFLOAD_RSS_HASH |
+			DEV_RX_OFFLOAD_FLOW_MARK;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index fa572d184..1481e2426 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
 		   DEV_RX_OFFLOAD_VLAN_FILTER |
 		   DEV_RX_OFFLOAD_SCATTER |
-		   DEV_RX_OFFLOAD_RSS_HASH;
+		   DEV_RX_OFFLOAD_RSS_HASH |
+		   DEV_RX_OFFLOAD_FLOW_MARK;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index b5fd57693..1bf01bda3 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
 	uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
 			     DEV_RX_OFFLOAD_TIMESTAMP |
 			     DEV_RX_OFFLOAD_JUMBO_FRAME |
-			     DEV_RX_OFFLOAD_RSS_HASH);
+			     DEV_RX_OFFLOAD_RSS_HASH |
+			     DEV_RX_OFFLOAD_FLOW_MARK);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 0cca6746d..97c1a636a 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -141,7 +141,8 @@
 	DEV_RX_OFFLOAD_VLAN_FILTER	| \
 	DEV_RX_OFFLOAD_QINQ_STRIP	| \
 	DEV_RX_OFFLOAD_TIMESTAMP	| \
-	DEV_RX_OFFLOAD_RSS_HASH)
+	DEV_RX_OFFLOAD_RSS_HASH		| \
+	DEV_RX_OFFLOAD_FLOW_MARK)
 
 #define NIX_DEFAULT_RSS_CTX_GROUP  0
 #define NIX_DEFAULT_RSS_MCAM_IDX  -1
diff --git a/drivers/net/octeontx2/otx2_flow.c b/drivers/net/octeontx2/otx2_flow.c
index bdbf123a9..ea4e380b1 100644
--- a/drivers/net/octeontx2/otx2_flow.c
+++ b/drivers/net/octeontx2/otx2_flow.c
@@ -524,11 +524,8 @@ otx2_flow_destroy(struct rte_eth_dev *dev,
 		NIX_RX_ACT_MATCH_MASK;
 
 	if (match_id && match_id < OTX2_FLOW_ACTION_FLAG_DEFAULT) {
-		if (rte_atomic32_read(&npc->mark_actions) == 0)
-			return -EINVAL;
-
-		/* Clear mark offload flag if there are no more mark actions */
-		if (rte_atomic32_sub_return(&npc->mark_actions, 1) == 0) {
+		/* Clear mark offload flag if there is no more mark action */
+		if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 			hw->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F;
 			otx2_eth_set_rx_function(dev);
 		}
@@ -821,8 +818,6 @@ otx2_flow_init(struct otx2_eth_dev *hw)
 		return rc;
 	}
 
-	rte_atomic32_init(&npc->mark_actions);
-
 	npc->mcam_entries = NPC_MCAM_TOT_ENTRIES >> npc->keyw[NPC_MCAM_RX];
 	/* Free, free_rev, live and live_rev entries */
 	bmap_sz = rte_bitmap_get_memory_footprint(npc->mcam_entries);
diff --git a/drivers/net/octeontx2/otx2_flow.h b/drivers/net/octeontx2/otx2_flow.h
index ab068b088..85129cc9d 100644
--- a/drivers/net/octeontx2/otx2_flow.h
+++ b/drivers/net/octeontx2/otx2_flow.h
@@ -160,7 +160,6 @@ TAILQ_HEAD(otx2_flow_list, rte_flow);
 
 /* Accessed from ethdev private - otx2_eth_dev */
 struct otx2_npc_flow_info {
-	rte_atomic32_t mark_actions;
 	uint32_t keyx_supp_nmask[NPC_MAX_INTF];/* nibble mask */
 	uint32_t keyx_len[NPC_MAX_INTF];	/* per intf key len in bits */
 	uint32_t datax_len[NPC_MAX_INTF];	/* per intf data len in bits */
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a70..541479445 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -761,7 +761,6 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			struct rte_flow *flow)
 {
 	struct otx2_eth_dev *hw = dev->data->dev_private;
-	struct otx2_npc_flow_info *npc = &hw->npc_flow;
 	const struct rte_flow_action_count *act_count;
 	const struct rte_flow_action_mark *act_mark;
 	const struct rte_flow_action_queue *act_q;
@@ -795,13 +794,11 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			}
 			mark = act_mark->id + 1;
 			req_act |= OTX2_FLOW_ACT_MARK;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_FLAG:
 			mark = OTX2_FLOW_FLAG_VAL;
 			req_act |= OTX2_FLOW_ACT_FLAG;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_COUNT:
@@ -979,7 +976,7 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 	if (mark)
 		flow->npc_action |= (uint64_t)mark << 40;
 
-	if (rte_atomic32_read(&npc->mark_actions) == 1) {
+	if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 		hw->rx_offload_flags |=
 			NIX_RX_OFFLOAD_MARK_UPDATE_F;
 		otx2_eth_set_rx_function(dev);
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 220ef0e47..1887731e2 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v7 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-02  3:47         ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
                             ` (4 preceding siblings ...)
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-10-02  3:47           ` pbhagavatula
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 7/7] examples: disable Rx packet type parsing pbhagavatula
  2019-10-02 21:36           ` [dpdk-dev] [PATCH v8 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02  3:47 UTC (permalink / raw)
  To: arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 113 -----------------
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 3 files changed, 232 insertions(+), 113 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f541..a73b61d59 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,118 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	rte_eth_dev_info_get(port, &dev_info);
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	rte_eth_macaddr_get(port, &addr);
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
 
 static void
 do_capability_setup(uint8_t eventdev_id)
@@ -501,7 +389,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..aa1678fe7 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,123 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +414,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 8961cd656..52a1b4174 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,119 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +734,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v7 7/7] examples: disable Rx packet type parsing
  2019-10-02  3:47         ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
                             ` (5 preceding siblings ...)
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-02  3:47           ` pbhagavatula
  2019-10-02 21:36           ` [dpdk-dev] [PATCH v8 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02  3:47 UTC (permalink / raw)
  To: arybchenko, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki, Bernard Iremonger,
	Cristian Dumitrescu, Konstantin Ananyev, Ferruh Yigit,
	Declan Doherty, Reshma Pattan, John McNamara, Xiaoyun Li,
	Jasvinder Singh, Byron Marohn, Yipeng Wang, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing in examples that don't use
`rte_mbuf::packet_type` by setting ptype_mask as 0 in
`rte_eth_dev_set_supported_ptypes`

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/bbdev_app/main.c                  | 1 +
 examples/bond/main.c                       | 2 ++
 examples/distributor/Makefile              | 1 +
 examples/distributor/main.c                | 1 +
 examples/distributor/meson.build           | 1 +
 examples/eventdev_pipeline/main.c          | 2 ++
 examples/eventdev_pipeline/meson.build     | 1 +
 examples/exception_path/Makefile           | 1 +
 examples/exception_path/main.c             | 1 +
 examples/exception_path/meson.build        | 1 +
 examples/flow_classify/flow_classify.c     | 1 +
 examples/flow_filtering/Makefile           | 1 +
 examples/flow_filtering/main.c             | 1 +
 examples/flow_filtering/meson.build        | 1 +
 examples/ip_pipeline/link.c                | 1 +
 examples/ip_reassembly/Makefile            | 1 +
 examples/ip_reassembly/main.c              | 2 ++
 examples/ip_reassembly/meson.build         | 1 +
 examples/ipsec-secgw/ipsec-secgw.c         | 2 ++
 examples/ipv4_multicast/Makefile           | 1 +
 examples/ipv4_multicast/main.c             | 2 ++
 examples/ipv4_multicast/meson.build        | 1 +
 examples/kni/main.c                        | 1 +
 examples/l2fwd-cat/Makefile                | 1 +
 examples/l2fwd-cat/l2fwd-cat.c             | 1 +
 examples/l2fwd-cat/meson.build             | 1 +
 examples/l2fwd-crypto/main.c               | 2 ++
 examples/l2fwd-jobstats/Makefile           | 1 +
 examples/l2fwd-jobstats/main.c             | 2 ++
 examples/l2fwd-jobstats/meson.build        | 1 +
 examples/l2fwd-keepalive/Makefile          | 1 +
 examples/l2fwd-keepalive/main.c            | 2 ++
 examples/l2fwd-keepalive/meson.build       | 1 +
 examples/l2fwd/Makefile                    | 1 +
 examples/l2fwd/main.c                      | 2 ++
 examples/l2fwd/meson.build                 | 1 +
 examples/l3fwd-acl/Makefile                | 1 +
 examples/l3fwd-acl/main.c                  | 2 ++
 examples/l3fwd-acl/meson.build             | 1 +
 examples/l3fwd-vf/Makefile                 | 1 +
 examples/l3fwd-vf/main.c                   | 2 ++
 examples/l3fwd-vf/meson.build              | 1 +
 examples/link_status_interrupt/Makefile    | 1 +
 examples/link_status_interrupt/main.c      | 2 ++
 examples/link_status_interrupt/meson.build | 1 +
 examples/load_balancer/Makefile            | 1 +
 examples/load_balancer/init.c              | 2 ++
 examples/load_balancer/meson.build         | 1 +
 examples/packet_ordering/Makefile          | 1 +
 examples/packet_ordering/main.c            | 1 +
 examples/packet_ordering/meson.build       | 1 +
 examples/ptpclient/Makefile                | 1 +
 examples/ptpclient/meson.build             | 1 +
 examples/ptpclient/ptpclient.c             | 1 +
 examples/qos_meter/Makefile                | 1 +
 examples/qos_meter/main.c                  | 2 ++
 examples/qos_meter/meson.build             | 1 +
 examples/qos_sched/Makefile                | 1 +
 examples/qos_sched/init.c                  | 1 +
 examples/qos_sched/meson.build             | 1 +
 examples/quota_watermark/qw/Makefile       | 1 +
 examples/quota_watermark/qw/init.c         | 1 +
 examples/rxtx_callbacks/main.c             | 1 +
 examples/server_node_efd/server/Makefile   | 1 +
 examples/server_node_efd/server/init.c     | 1 +
 examples/skeleton/Makefile                 | 1 +
 examples/skeleton/basicfwd.c               | 1 +
 examples/skeleton/meson.build              | 1 +
 examples/tep_termination/Makefile          | 1 +
 examples/tep_termination/meson.build       | 1 +
 examples/tep_termination/vxlan_setup.c     | 1 +
 examples/vhost/Makefile                    | 1 +
 examples/vhost/main.c                      | 1 +
 examples/vm_power_manager/Makefile         | 1 +
 examples/vm_power_manager/main.c           | 1 +
 examples/vm_power_manager/meson.build      | 1 +
 examples/vmdq/Makefile                     | 1 +
 examples/vmdq/main.c                       | 1 +
 examples/vmdq/meson.build                  | 1 +
 examples/vmdq_dcb/Makefile                 | 1 +
 examples/vmdq_dcb/main.c                   | 1 +
 examples/vmdq_dcb/meson.build              | 1 +
 82 files changed, 96 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 9acf666dc..277725a6b 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 
 	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
 	print_mac(port_id, &bbdev_port_eth_addr);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 1c0df9d46..f92104908 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -195,6 +195,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				portid, retval);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(portid);
 	if (retval < 0)
 		rte_exit(retval,
@@ -271,6 +272,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
+	rte_eth_dev_set_supported_ptypes(BOND_PORT, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(BOND_PORT);
 	if (retval < 0)
 		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d5578..a2a477279 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 81d7ca61d..35930d8a3 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -162,6 +162,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 26f108d65..c2976f6bd 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -10,6 +10,7 @@
 build = dpdk_conf.has('RTE_LIBRTE_POWER')
 
 deps += ['distributor', 'power']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index a73b61d59..66b6420f9 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -393,6 +393,8 @@ main(int argc, char **argv)
 
 	/* Start the Ethernet port. */
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		err = rte_eth_dev_start(portid);
 		if (err < 0)
 			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
index a54c35aa7..0fc916b05 100644
--- a/examples/eventdev_pipeline/meson.build
+++ b/examples/eventdev_pipeline/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'eventdev'
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 	'pipeline_worker_generic.c',
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 90c7f133a..a7c961276 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0d79e5a24..0165e4553 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -464,6 +464,7 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		FATAL_ERROR("Could not start port%u (%d)", port, ret);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index bc7f43ea9..f34d27428 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -231,6 +231,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	}
 
 	/* Start the Ethernet port. */
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a75555..793a08fae 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a0487be77..4b8712324 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -176,6 +176,7 @@ init_port(void)
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
 		rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index 407795c42..6f5d1b08a 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 )
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 787eb866a..7d02962e3 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -205,6 +205,7 @@ link_create(const char *name, struct link_params *params)
 			return NULL;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Port start */
 	status = rte_eth_dev_start(port_id);
 	if (status < 0)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904e0..19c462388 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 38b39be6b..f2c28ef76 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1158,6 +1158,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0d1fd6af6..2aceaf549 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2448,6 +2448,8 @@ main(int32_t argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/*
 		 * Start device
 		 * note: device must be started before a flow rule
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67dd4..5171f7ab2 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 72eaadc51..3d327a00b 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -765,6 +765,8 @@ main(int argc, char **argv)
 			qconf->tx_queue_id[portid] = queueid;
 			queueid++;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		rte_eth_allmulticast_enable(portid);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'hash'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d7176..99f500e25 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -625,6 +625,7 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6d3..d6a25e42a 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -66,6 +66,7 @@ endif
 EXTRA_CFLAGS += -O3 -g -Wfatal-errors
 
 CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
 LDLIBS += -lpqos
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index b34b40a00..a54a1ed25 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 4e2777a03..37c96040d 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
 ext_deps += pqos
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
+allow_experimental_apis = true
 sources = files(
 	'cat.c', 'l2fwd-cat.c'
 )
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 3fe2ba725..5071ef389 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2559,6 +2559,8 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			return -1;
 		}
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		retval = rte_eth_dev_start(portid);
 		if (retval < 0) {
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e93..09834e979 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 77e44dc82..03d986a68 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -902,6 +902,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['jobstats', 'timer']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a6f..584257ae2 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS += -lrt
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 9831a4323..8d3e5eadd 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -696,6 +696,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
 
 ext_deps += cc.find_library('rt')
 deps += 'timer'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'shm.c'
 )
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1e2b14297..b7d6ee2ff 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -694,6 +694,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f71..df590f8e9 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 0c44df767..e113b1a4d 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2056,6 +2056,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index 7b186a23c..db7f51f2f 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 572e74cf5..5bf70f52d 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1051,6 +1051,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14a8..6ddedd4de 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7a6..04da4732b 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -676,6 +676,8 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
 					"tx buffer on port %u\n", (unsigned) portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/link_status_interrupt/meson.build
+++ b/examples/link_status_interrupt/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index caae8a107..dcba9194c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3ab7d0211..d49d61474 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -496,6 +496,8 @@ app_init_nics(void)
 			}
 		}
 
+		rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start port */
 		ret = rte_eth_dev_start(port);
 		if (ret < 0) {
diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
index 4f7ac3999..19708974c 100644
--- a/examples/load_balancer/meson.build
+++ b/examples/load_balancer/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'lpm'
+allow_experimental_apis = true
 sources = files(
 	'config.c', 'init.c', 'main.c', 'runtime.c'
 )
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7eb..9ba3fa9e8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e92299..59354fad5 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -312,6 +312,7 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
 		return ret;
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'reorder'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bacbd..f158d96b9 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'ptpclient.c'
 )
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 31778fd95..e2cf4b136 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -227,6 +227,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf7c..a1533d08f 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8be..ade8e49c3 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -419,10 +419,12 @@ main(int argc, char **argv)
 
 	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
 
+	rte_eth_dev_set_supported_ptypes(port_rx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_rx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_tx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_tx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
index ef7779f2f..10cd4bc79 100644
--- a/examples/qos_meter/meson.build
+++ b/examples/qos_meter/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'meter'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'rte_policer.c'
 )
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d25371..7d3d3019f 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -58,6 +58,7 @@ else
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index b05206d5a..d165b3dd4 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -138,6 +138,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
 			 ret, portid, 0);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81ce8..5101652af 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
 sources = files(
 	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
 	'init.c', 'main.c', 'stats.c'
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
index 3f10f01c3..e06f4482b 100644
--- a/examples/quota_watermark/qw/Makefile
+++ b/examples/quota_watermark/qw/Makefile
@@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
 
 CFLAGS += -O3 -DQW_SOFTWARE_FC
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 5a0f64f45..4753eb900 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
 				"Failed to setup hardware flow control on port %u (error %d)\n",
 				(unsigned int) port_id, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index dbcd9f4fc..8949f0d93 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -152,6 +152,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 4837bd3ea..acbd12ae2 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
 
 CFLAGS += $(WERROR_FLAGS) -O3
 CFLAGS += -I$(SRCDIR)/../shared
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e28..bbea0c4c9 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -149,6 +149,7 @@ init_port(uint16_t port_num)
 
 	rte_eth_promiscuous_enable(port_num);
 
+	rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port_num);
 	if (retval < 0)
 		return retval;
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac26029..0037d6b25 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98f0..423ce05f8 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -76,6 +76,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'basicfwd.c'
 )
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd92..586838676 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -61,6 +61,7 @@ endif
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index f65d68980..f40b1c0b8 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -11,6 +11,7 @@ if not is_linux
 endif
 deps += ['hash', 'vhost']
 cflags += '-Wno-deprecated-declarations'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'vxlan.c', 'vxlan_setup.c'
 )
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a0880002..219d3e215 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -167,6 +167,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f017..7722e81c7 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -62,6 +62,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0961db080..3d9f125e5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -321,6 +321,7 @@ port_init(uint16_t port)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..65c2ad179 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -28,6 +28,7 @@ endif
 
 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lvirt
 
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 54c704610..4cb4ccecf 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -99,6 +99,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
index 20a4a05b3..54e2b584f 100644
--- a/examples/vm_power_manager/meson.build
+++ b/examples/vm_power_manager/meson.build
@@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
 	deps += ['pmd_ixgbe']
 endif
 
+allow_experimental_apis = true
 sources = files(
 	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
 )
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee86b..2168747cc 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 EXTRA_CFLAGS += -O3
 
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd7f..65431f95e 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -258,6 +258,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096cfb..ea1574d91 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 389000327..44fe63482 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -313,6 +313,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v7 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-10-02  9:52             ` Jerin Jacob
  0 siblings, 0 replies; 246+ messages in thread
From: Jerin Jacob @ 2019-10-02  9:52 UTC (permalink / raw)
  To: Pavan Nikhilesh
  Cc: arybchenko, Jerin Jacob, Ajit Khaparde, Somnath Kotur,
	John Daley, Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu,
	Wenzhuo Lu, Qiming Yang, Konstantin Ananyev, Matan Azrad,
	Shahaf Shuler, Viacheslav Ovsiienko, Nithin Dabilpuram,
	Kiran Kumar K, dpdk-dev

On Wed, Oct 2, 2019 at 9:18 AM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
> flag and mark.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

For net/octeontx2:
Acked-by: Jerin Jacob <jerinj@marvell.com>

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v7 1/7] ethdev: add set ptype function
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-02 13:37             ` Andrew Rybchenko
  2019-10-02 13:41               ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-02 13:37 UTC (permalink / raw)
  To: pbhagavatula, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev

Hi,

looks good, just few comments below.

Many thanks for working on it,
Andrew.

On 10/2/19 6:47 AM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add `rte_eth_dev_set_supported_ptypes` function that will allow the
> application to inform the PMD the packet types it is interested in.
> Based on the ptypes set PMDs can optimize their Rx path.
>
> -If application doesn’t want any ptype information it can call
> `rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
> and PMD may skip packet type processing and set rte_mbuf::packet_type to
> RTE_PTYPE_UNKNOWN.
>
> -If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
> return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>
> -If application is interested only in L2/L3 layer, it can inform the PMD
> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
> `rte_eth_dev_set_supported_ptypes(ethdev_id,
> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>
> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

[snip]

> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 17d183e1f..b1588fe7a 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -2602,6 +2602,56 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>   	return j;
>   }
>   
> +int
> +rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
> +				 uint32_t *set_ptypes, unsigned int num)
> +{
> +	unsigned int i, j;
> +	struct rte_eth_dev *dev;
> +	const uint32_t *all_ptypes;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +	dev = &rte_eth_devices[port_id];
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set, 0);

When 0 is returned above, we should set set_ptypes. So, below
check num vs set_types should be done before callbacks check and
I think it is OK to do
       set_ptypes[0] = RTE_PTYPE_UNKNOWN;
just after the check. It will allow to simplify code below and will
make it set correctly even if 0 returned because of no callbacks.

> +
> +	if (num > 0 && set_ptypes == NULL)
> +		return -EINVAL;
> +
> +	if (ptype_mask == 0) {
> +		if (num > 0)
> +			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
> +
> +		return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
> +				ptype_mask);
> +	}
> +
> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
> +	if (all_ptypes == NULL) {
> +		if (num > 0)
> +			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
> +
> +		return 0;
> +	}
> +
> +	for (i = 0, j = 0; set_ptypes != NULL &&
> +				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
> +		if (ptype_mask & all_ptypes[i]) {
> +			if (j < num - 1) {
> +				set_ptypes[j] = all_ptypes[i];
> +				j++;
> +				continue;
> +			}
> +			break;

I'd like to repeat my question about insufficient space to return
set_ptypes. Do we need to signal it somehow? If no, it should be
explained why in the comments here.

> +		}
> +	}
> +
> +	if (set_ptypes != NULL)
> +		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
> +
> +	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
> +}
> +
>   void
>   rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>   {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index d9871782e..c577a9172 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -2431,6 +2431,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
>    */
>   int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>   				     uint32_t *ptypes, int num);
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Inform Ethernet device of the packet types classification in which
> + * the recipient is interested.
> + *
> + * Application can use this function to set only specific ptypes that it's
> + * interested. This information can be used by the PMD to optimize Rx path.
> + *
> + * The function accepts an array `set_ptypes` allocated by the caller to
> + * store the packet types set by the driver, the last element of the array
> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
> + * partially.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param ptype_mask
> + *   The ptype family that application is interested in.
> + * @param set_ptypes
> + *   An array pointer to store set packet types, allocated by caller. The
> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
> + * @param num
> + *   Size of the array pointed by param ptypes.
> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
> + *   set ptypes.
> + * @return
> + *   - (0) if Success.
> + *   - (-ENODEV) if *port_id* invalid.
> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
> + *     num > 0.
> + */
> +__rte_experimental
> +int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
> +				     uint32_t *set_ptypes, unsigned int num);
>   
>   /**
>    * Retrieve the MTU of an Ethernet device.
> diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
> index 2922d5b7c..93bc34480 100644
> --- a/lib/librte_ethdev/rte_ethdev_core.h
> +++ b/lib/librte_ethdev/rte_ethdev_core.h
> @@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
>   typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
>   /**< @internal Get supported ptypes of an Ethernet device. */
>   
> +typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
> +					      uint32_t ptype_mask);
> +/**< @internal Inform device about packet types in which the recipient is interested. */
> +

Please, take a look at promiscuous mode callback and let's put
more verbose description here which better document interface
to drivers. I think ptyep_mask description should refer to corresponding
defines to be used.

[snip]


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v7 1/7] ethdev: add set ptype function
  2019-10-02 13:37             ` Andrew Rybchenko
@ 2019-10-02 13:41               ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-02 13:41 UTC (permalink / raw)
  To: pbhagavatula, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev

On 10/2/19 4:37 PM, Andrew Rybchenko wrote:
> Hi,
>
> looks good, just few comments below.
>
> Many thanks for working on it,
> Andrew.
>
> On 10/2/19 6:47 AM, pbhagavatula@marvell.com wrote:
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> Add `rte_eth_dev_set_supported_ptypes` function that will allow the
>> application to inform the PMD the packet types it is interested in.
>> Based on the ptypes set PMDs can optimize their Rx path.
>>
>> -If application doesn’t want any ptype information it can call
>> `rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 
>> 0)`
>> and PMD may skip packet type processing and set rte_mbuf::packet_type to
>> RTE_PTYPE_UNKNOWN.
>>
>> -If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
>> return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>>
>> -If application is interested only in L2/L3 layer, it can inform the PMD
>> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
>> `rte_eth_dev_set_supported_ptypes(ethdev_id,
>>         RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>>
>> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> [snip]
>
>> diff --git a/lib/librte_ethdev/rte_ethdev.c 
>> b/lib/librte_ethdev/rte_ethdev.c
>> index 17d183e1f..b1588fe7a 100644
>> --- a/lib/librte_ethdev/rte_ethdev.c
>> +++ b/lib/librte_ethdev/rte_ethdev.c
>> @@ -2602,6 +2602,56 @@ rte_eth_dev_get_supported_ptypes(uint16_t 
>> port_id, uint32_t ptype_mask,
>>       return j;
>>   }
>>   +int
>> +rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>> +                 uint32_t *set_ptypes, unsigned int num)
>> +{
>> +    unsigned int i, j;
>> +    struct rte_eth_dev *dev;
>> +    const uint32_t *all_ptypes;
>> +
>> +    RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>> +    dev = &rte_eth_devices[port_id];
>> + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);
>> + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set, 0);
>
> When 0 is returned above, we should set set_ptypes. So, below
> check num vs set_types should be done before callbacks check and
> I think it is OK to do
>       set_ptypes[0] = RTE_PTYPE_UNKNOWN;

of course if num > 0

> just after the check. It will allow to simplify code below and will
> make it set correctly even if 0 returned because of no callbacks.
>
>> +
>> +    if (num > 0 && set_ptypes == NULL)
>> +        return -EINVAL;
>> +
>> +    if (ptype_mask == 0) {
>> +        if (num > 0)
>> +            set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>> +
>> +        return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
>> +                ptype_mask);
>> +    }
>> +
>> +    all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
>> +    if (all_ptypes == NULL) {
>> +        if (num > 0)
>> +            set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>> +
>> +        return 0;
>> +    }
>> +
>> +    for (i = 0, j = 0; set_ptypes != NULL &&
>> +                (all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
>> +        if (ptype_mask & all_ptypes[i]) {
>> +            if (j < num - 1) {
>> +                set_ptypes[j] = all_ptypes[i];
>> +                j++;
>> +                continue;
>> +            }
>> +            break;
>
> I'd like to repeat my question about insufficient space to return
> set_ptypes. Do we need to signal it somehow? If no, it should be
> explained why in the comments here.
>
>> +        }
>> +    }
>> +
>> +    if (set_ptypes != NULL)
>> +        set_ptypes[j] = RTE_PTYPE_UNKNOWN;
>> +
>> +    return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
>> +}
>> +
>>   void
>>   rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>>   {
>> diff --git a/lib/librte_ethdev/rte_ethdev.h 
>> b/lib/librte_ethdev/rte_ethdev.h
>> index d9871782e..c577a9172 100644
>> --- a/lib/librte_ethdev/rte_ethdev.h
>> +++ b/lib/librte_ethdev/rte_ethdev.h
>> @@ -2431,6 +2431,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
>>    */
>>   int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t 
>> ptype_mask,
>>                        uint32_t *ptypes, int num);
>> +/**
>> + * @warning
>> + * @b EXPERIMENTAL: this API may change without prior notice.
>> + *
>> + * Inform Ethernet device of the packet types classification in which
>> + * the recipient is interested.
>> + *
>> + * Application can use this function to set only specific ptypes 
>> that it's
>> + * interested. This information can be used by the PMD to optimize 
>> Rx path.
>> + *
>> + * The function accepts an array `set_ptypes` allocated by the 
>> caller to
>> + * store the packet types set by the driver, the last element of the 
>> array
>> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array 
>> should be
>> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be 
>> filled
>> + * partially.
>> + *
>> + * @param port_id
>> + *   The port identifier of the Ethernet device.
>> + * @param ptype_mask
>> + *   The ptype family that application is interested in.
>> + * @param set_ptypes
>> + *   An array pointer to store set packet types, allocated by 
>> caller. The
>> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
>> + * @param num
>> + *   Size of the array pointed by param ptypes.
>> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate 
>> the
>> + *   set ptypes.
>> + * @return
>> + *   - (0) if Success.
>> + *   - (-ENODEV) if *port_id* invalid.
>> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
>> + *     num > 0.
>> + */
>> +__rte_experimental
>> +int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t 
>> ptype_mask,
>> +                     uint32_t *set_ptypes, unsigned int num);
>>     /**
>>    * Retrieve the MTU of an Ethernet device.
>> diff --git a/lib/librte_ethdev/rte_ethdev_core.h 
>> b/lib/librte_ethdev/rte_ethdev_core.h
>> index 2922d5b7c..93bc34480 100644
>> --- a/lib/librte_ethdev/rte_ethdev_core.h
>> +++ b/lib/librte_ethdev/rte_ethdev_core.h
>> @@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct 
>> rte_eth_dev *dev,
>>   typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct 
>> rte_eth_dev *dev);
>>   /**< @internal Get supported ptypes of an Ethernet device. */
>>   +typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct 
>> rte_eth_dev *dev,
>> +                          uint32_t ptype_mask);
>> +/**< @internal Inform device about packet types in which the 
>> recipient is interested. */
>> +
>
> Please, take a look at promiscuous mode callback and let's put
> more verbose description here which better document interface
> to drivers. I think ptyep_mask description should refer to corresponding
> defines to be used.
>
> [snip]
>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v8 0/7] ethdev: add new Rx offload flags
  2019-10-02  3:47         ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
                             ` (6 preceding siblings ...)
  2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-10-02 21:36           ` pbhagavatula
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 1/7] ethdev: add set ptype function pbhagavatula
                               ` (7 more replies)
  7 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02 21:36 UTC (permalink / raw)
  To: arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
`DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN, NULL,
                                          0);

v8 Changes:
----------
- Make description more verbose.
- Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
  is not supported by ethernet device.

v7 Changes:
----------
- Fix unused variable in net/octeontx2

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.


Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add flow action type update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  drivers/net: update Rx flow flag and mark capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples: disable Rx packet type parsing

 doc/guides/nics/features.rst                  |  22 +++-
 doc/guides/rel_notes/release_19_11.rst        |  24 ++++
 drivers/net/bnxt/bnxt_ethdev.c                |   4 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   3 +-
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_res.c                   |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   3 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   3 +-
 drivers/net/i40e/i40e_ethdev.c                |   4 +-
 drivers/net/iavf/iavf_ethdev.c                |   4 +-
 drivers/net/ice/ice_ethdev.c                  |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |   4 +-
 drivers/net/liquidio/lio_ethdev.c             |   3 +-
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   4 +-
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   3 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  16 +--
 drivers/net/octeontx2/otx2_flow.c             |   9 +-
 drivers/net/octeontx2/otx2_flow.h             |   1 -
 drivers/net/octeontx2/otx2_flow_parse.c       |   5 +-
 drivers/net/qede/qede_ethdev.c                |   3 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   3 +-
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   3 +-
 examples/bbdev_app/main.c                     |   1 +
 examples/bond/main.c                          |   2 +
 examples/distributor/Makefile                 |   1 +
 examples/distributor/main.c                   |   1 +
 examples/distributor/meson.build              |   1 +
 examples/eventdev_pipeline/main.c             | 115 +----------------
 examples/eventdev_pipeline/meson.build        |   1 +
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 examples/exception_path/Makefile              |   1 +
 examples/exception_path/main.c                |   1 +
 examples/exception_path/meson.build           |   1 +
 examples/flow_classify/flow_classify.c        |   1 +
 examples/flow_filtering/Makefile              |   1 +
 examples/flow_filtering/main.c                |   1 +
 examples/flow_filtering/meson.build           |   1 +
 examples/ip_pipeline/link.c                   |   1 +
 examples/ip_reassembly/Makefile               |   1 +
 examples/ip_reassembly/main.c                 |   2 +
 examples/ip_reassembly/meson.build            |   1 +
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +
 examples/ipv4_multicast/Makefile              |   1 +
 examples/ipv4_multicast/main.c                |   2 +
 examples/ipv4_multicast/meson.build           |   1 +
 examples/kni/main.c                           |   1 +
 examples/l2fwd-cat/Makefile                   |   1 +
 examples/l2fwd-cat/l2fwd-cat.c                |   1 +
 examples/l2fwd-cat/meson.build                |   1 +
 examples/l2fwd-crypto/main.c                  |   2 +
 examples/l2fwd-jobstats/Makefile              |   1 +
 examples/l2fwd-jobstats/main.c                |   2 +
 examples/l2fwd-jobstats/meson.build           |   1 +
 examples/l2fwd-keepalive/Makefile             |   1 +
 examples/l2fwd-keepalive/main.c               |   2 +
 examples/l2fwd-keepalive/meson.build          |   1 +
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 examples/l3fwd-acl/Makefile                   |   1 +
 examples/l3fwd-acl/main.c                     |   2 +
 examples/l3fwd-acl/meson.build                |   1 +
 examples/l3fwd-vf/Makefile                    |   1 +
 examples/l3fwd-vf/main.c                      |   2 +
 examples/l3fwd-vf/meson.build                 |   1 +
 examples/link_status_interrupt/Makefile       |   1 +
 examples/link_status_interrupt/main.c         |   2 +
 examples/link_status_interrupt/meson.build    |   1 +
 examples/load_balancer/Makefile               |   1 +
 examples/load_balancer/init.c                 |   2 +
 examples/load_balancer/meson.build            |   1 +
 examples/packet_ordering/Makefile             |   1 +
 examples/packet_ordering/main.c               |   1 +
 examples/packet_ordering/meson.build          |   1 +
 examples/ptpclient/Makefile                   |   1 +
 examples/ptpclient/meson.build                |   1 +
 examples/ptpclient/ptpclient.c                |   1 +
 examples/qos_meter/Makefile                   |   1 +
 examples/qos_meter/main.c                     |   2 +
 examples/qos_meter/meson.build                |   1 +
 examples/qos_sched/Makefile                   |   1 +
 examples/qos_sched/init.c                     |   1 +
 examples/qos_sched/meson.build                |   1 +
 examples/quota_watermark/qw/Makefile          |   1 +
 examples/quota_watermark/qw/init.c            |   1 +
 examples/rxtx_callbacks/main.c                |   1 +
 examples/server_node_efd/server/Makefile      |   1 +
 examples/server_node_efd/server/init.c        |   1 +
 examples/skeleton/Makefile                    |   1 +
 examples/skeleton/basicfwd.c                  |   1 +
 examples/skeleton/meson.build                 |   1 +
 examples/tep_termination/Makefile             |   1 +
 examples/tep_termination/meson.build          |   1 +
 examples/tep_termination/vxlan_setup.c        |   1 +
 examples/vhost/Makefile                       |   1 +
 examples/vhost/main.c                         |   1 +
 examples/vm_power_manager/Makefile            |   1 +
 examples/vm_power_manager/main.c              |   1 +
 examples/vm_power_manager/meson.build         |   1 +
 examples/vmdq/Makefile                        |   1 +
 examples/vmdq/main.c                          |   1 +
 examples/vmdq/meson.build                     |   1 +
 examples/vmdq_dcb/Makefile                    |   1 +
 examples/vmdq_dcb/main.c                      |   1 +
 examples/vmdq_dcb/meson.build                 |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  61 +++++++++
 lib/librte_ethdev/rte_ethdev.h                |  38 ++++++
 lib/librte_ethdev/rte_ethdev_core.h           |  12 ++
 lib/librte_ethdev/rte_ethdev_version.map      |   3 +
 lib/librte_ethdev/rte_flow.h                  |   6 +-
 119 files changed, 557 insertions(+), 160 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v8 1/7] ethdev: add set ptype function
  2019-10-02 21:36           ` [dpdk-dev] [PATCH v8 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-10-02 21:36             ` pbhagavatula
  2019-10-03  7:40               ` Andrew Rybchenko
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                               ` (6 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-02 21:36 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 doc/guides/nics/features.rst             |  8 +++-
 doc/guides/rel_notes/release_19_11.rst   |  8 ++++
 lib/librte_ethdev/rte_ethdev.c           | 59 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 36 +++++++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      | 12 +++++
 lib/librte_ethdev/rte_ethdev_version.map |  3 ++
 6 files changed, 124 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index c4e128d2f..1756fa73a 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,13 @@ Packet type parsing
 -------------------

 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.

-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+  ``dev_supported_ptypes_set``.
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.


 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 27cfbd9e3..abb7b6529 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -56,6 +56,14 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================

+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
+

 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e1f..57bc12b56 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2602,6 +2602,65 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }

+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	unsigned int i, j;
+	struct rte_eth_dev *dev;
+	const uint32_t *all_ptypes;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
+			*dev->dev_ops->dev_supported_ptypes_set == NULL) {
+		if (num > 0)
+			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+		return 0;
+	}
+
+	if (ptype_mask == 0) {
+		if (num > 0)
+			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+		return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		if (num > 0)
+			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+		return 0;
+	}
+
+	/*
+	 * Accodommodate as many set_ptypes as possible. If the supplied
+	 * set_ptypes array is insufficient fill it partially.
+	 */
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+}
+
 void
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d9871782e..c577a9172 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2431,6 +2431,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification in which
+ * the recipient is interested.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, unsigned int num);

 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 2922d5b7c..06afd6a3d 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -110,6 +110,16 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */

+typedef int (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+/**< @internal Inform an Ethernet device about packet types in which the
+ *   recipient is interested.
+ *   Ptype_mask can have any of the following values RTE_PTYPE_UNKNOWN |
+ *   RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK | RTE_PTYPE_L4_MASK |
+ *   RTE_PTYPE_TUNNEL_MASK | RTE_PTYPE_INNER_L2_MASK | RTE_PTYPE_INNER_L3_MASK |
+ *   RTE_PTYPE_INNER_L4_MASK | RTE_PTYPE_ALL_MASK.
+ */
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -421,6 +431,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform Ethernet device about packet types in which the recipient is interested. */

 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6df42a47b..e14745b9c 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -283,4 +283,7 @@ EXPERIMENTAL {

 	# added in 19.08
 	rte_eth_read_clock;
+
+	# added in 19.11
+	rte_eth_dev_set_supported_ptypes;
 };
--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v8 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-02 21:36           ` [dpdk-dev] [PATCH v8 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-02 21:36             ` pbhagavatula
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 3/7] ethdev: add flow action type " pbhagavatula
                               ` (5 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02 21:36 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 2 ++
 doc/guides/rel_notes/release_19_11.rst | 7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 1 +
 lib/librte_ethdev/rte_ethdev.h         | 1 +
 4 files changed, 11 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 1756fa73a..f7c6d918f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index abb7b6529..724228faa 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -64,6 +64,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 57bc12b56..b90db8d2d 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c577a9172..c3fa69412 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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v8 3/7] ethdev: add flow action type update as an offload
  2019-10-02 21:36           ` [dpdk-dev] [PATCH v8 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 1/7] ethdev: add set ptype function pbhagavatula
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-02 21:36             ` pbhagavatula
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                               ` (4 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02 21:36 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, Adrien Mazarguil
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 12 ++++++++++++
 doc/guides/rel_notes/release_19_11.rst |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.c         |  1 +
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 lib/librte_ethdev/rte_flow.h           |  6 ++++--
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f7c6d918f..9737ff7a1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@ Allows application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 724228faa..670fbfd36 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -71,6 +71,15 @@ New Features
   *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
      by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
 
+* **Added Rx offload flag to enable or disable flow action type update**
+
+  *  Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
+     `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
+     `RTE_FLOW_ACTION_FLAG` are enabled.
+  *  PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the application
+     by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index b90db8d2d..ed10ad380 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c3fa69412..a2e86d155 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1014,6 +1014,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index 354cb1dd0..5d62686c0 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1316,7 +1316,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1324,7 +1325,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * No associated configuration structure.
 	 */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v8 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-02 21:36           ` [dpdk-dev] [PATCH v8 0/7] ethdev: add new Rx offload flags pbhagavatula
                               ` (2 preceding siblings ...)
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-10-02 21:36             ` pbhagavatula
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
                               ` (3 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02 21:36 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 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/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
 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/liquidio/lio_ethdev.c    |  3 ++-
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
 25 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7d9..6c106baf7 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_RSS_HASH)
 
 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..22e61a55c 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_RSS_HASH)
 
 
 #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..18c7bd0d5 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_RSS_HASH;
 
 /* 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..55a1c4455 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_RSS_HASH;
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 9405e1933..607a085f8 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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d72129..ba9b174cf 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1797,7 +1797,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af9053..53bd2b9ae 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->rx_offload_capa = 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_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7ab5..7058e0213 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_RSS_HASH;
 
 	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..aef91a79b 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_RSS_HASH;
 	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 63997fdfb..2e2a6b2af 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2145,7 +2145,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index c25dab00c..ff118586e 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -406,7 +406,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	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..b5fd57693 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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..230d64c8a 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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index b84128fef..2e88d1844 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 7b15d6bc8..0cca6746d 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_RSS_HASH)
 
 #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..da25b26df 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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 9cd5eb65b..da768ced7 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 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] 246+ messages in thread

* [dpdk-dev] [PATCH v8 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-10-02 21:36           ` [dpdk-dev] [PATCH v8 0/7] ethdev: add new Rx offload flags pbhagavatula
                               ` (3 preceding siblings ...)
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-02 21:36             ` pbhagavatula
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                               ` (2 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02 21:36 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
flag and mark.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 3 ++-
 drivers/net/enic/enic_res.c             | 3 ++-
 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/mlx5/mlx5_rxq.c             | 3 ++-
 drivers/net/octeontx2/otx2_ethdev.h     | 3 ++-
 drivers/net/octeontx2/otx2_flow.c       | 9 ++-------
 drivers/net/octeontx2/otx2_flow.h       | 1 -
 drivers/net/octeontx2/otx2_flow_parse.c | 5 +----
 drivers/net/sfc/sfc_ef10_essb_rx.c      | 3 ++-
 12 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6c106baf7..fd1fb7eda 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -161,7 +161,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_JUMBO_FRAME | \
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_RSS_HASH)
+				     DEV_RX_OFFLOAD_RSS_HASH | \
+				     DEV_RX_OFFLOAD_FLOW_MARK)
 
 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/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 607a085f8..3503d5d7e 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -199,7 +199,8 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7058e0213..6311943be 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3512,7 +3512,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_VLAN_EXTEND |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 
 	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 aef91a79b..7bdaa87b1 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -518,7 +518,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_SCATTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	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 2e2a6b2af..984af659f 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2146,7 +2146,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 			DEV_RX_OFFLOAD_VLAN_EXTEND |
-			DEV_RX_OFFLOAD_RSS_HASH;
+			DEV_RX_OFFLOAD_RSS_HASH |
+			DEV_RX_OFFLOAD_FLOW_MARK;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index fa572d184..1481e2426 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
 		   DEV_RX_OFFLOAD_VLAN_FILTER |
 		   DEV_RX_OFFLOAD_SCATTER |
-		   DEV_RX_OFFLOAD_RSS_HASH;
+		   DEV_RX_OFFLOAD_RSS_HASH |
+		   DEV_RX_OFFLOAD_FLOW_MARK;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index b5fd57693..1bf01bda3 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
 	uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
 			     DEV_RX_OFFLOAD_TIMESTAMP |
 			     DEV_RX_OFFLOAD_JUMBO_FRAME |
-			     DEV_RX_OFFLOAD_RSS_HASH);
+			     DEV_RX_OFFLOAD_RSS_HASH |
+			     DEV_RX_OFFLOAD_FLOW_MARK);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 0cca6746d..97c1a636a 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -141,7 +141,8 @@
 	DEV_RX_OFFLOAD_VLAN_FILTER	| \
 	DEV_RX_OFFLOAD_QINQ_STRIP	| \
 	DEV_RX_OFFLOAD_TIMESTAMP	| \
-	DEV_RX_OFFLOAD_RSS_HASH)
+	DEV_RX_OFFLOAD_RSS_HASH		| \
+	DEV_RX_OFFLOAD_FLOW_MARK)
 
 #define NIX_DEFAULT_RSS_CTX_GROUP  0
 #define NIX_DEFAULT_RSS_MCAM_IDX  -1
diff --git a/drivers/net/octeontx2/otx2_flow.c b/drivers/net/octeontx2/otx2_flow.c
index bdbf123a9..ea4e380b1 100644
--- a/drivers/net/octeontx2/otx2_flow.c
+++ b/drivers/net/octeontx2/otx2_flow.c
@@ -524,11 +524,8 @@ otx2_flow_destroy(struct rte_eth_dev *dev,
 		NIX_RX_ACT_MATCH_MASK;
 
 	if (match_id && match_id < OTX2_FLOW_ACTION_FLAG_DEFAULT) {
-		if (rte_atomic32_read(&npc->mark_actions) == 0)
-			return -EINVAL;
-
-		/* Clear mark offload flag if there are no more mark actions */
-		if (rte_atomic32_sub_return(&npc->mark_actions, 1) == 0) {
+		/* Clear mark offload flag if there is no more mark action */
+		if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 			hw->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F;
 			otx2_eth_set_rx_function(dev);
 		}
@@ -821,8 +818,6 @@ otx2_flow_init(struct otx2_eth_dev *hw)
 		return rc;
 	}
 
-	rte_atomic32_init(&npc->mark_actions);
-
 	npc->mcam_entries = NPC_MCAM_TOT_ENTRIES >> npc->keyw[NPC_MCAM_RX];
 	/* Free, free_rev, live and live_rev entries */
 	bmap_sz = rte_bitmap_get_memory_footprint(npc->mcam_entries);
diff --git a/drivers/net/octeontx2/otx2_flow.h b/drivers/net/octeontx2/otx2_flow.h
index ab068b088..85129cc9d 100644
--- a/drivers/net/octeontx2/otx2_flow.h
+++ b/drivers/net/octeontx2/otx2_flow.h
@@ -160,7 +160,6 @@ TAILQ_HEAD(otx2_flow_list, rte_flow);
 
 /* Accessed from ethdev private - otx2_eth_dev */
 struct otx2_npc_flow_info {
-	rte_atomic32_t mark_actions;
 	uint32_t keyx_supp_nmask[NPC_MAX_INTF];/* nibble mask */
 	uint32_t keyx_len[NPC_MAX_INTF];	/* per intf key len in bits */
 	uint32_t datax_len[NPC_MAX_INTF];	/* per intf data len in bits */
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a70..541479445 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -761,7 +761,6 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			struct rte_flow *flow)
 {
 	struct otx2_eth_dev *hw = dev->data->dev_private;
-	struct otx2_npc_flow_info *npc = &hw->npc_flow;
 	const struct rte_flow_action_count *act_count;
 	const struct rte_flow_action_mark *act_mark;
 	const struct rte_flow_action_queue *act_q;
@@ -795,13 +794,11 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			}
 			mark = act_mark->id + 1;
 			req_act |= OTX2_FLOW_ACT_MARK;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_FLAG:
 			mark = OTX2_FLOW_FLAG_VAL;
 			req_act |= OTX2_FLOW_ACT_FLAG;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_COUNT:
@@ -979,7 +976,7 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 	if (mark)
 		flow->npc_action |= (uint64_t)mark << 40;
 
-	if (rte_atomic32_read(&npc->mark_actions) == 1) {
+	if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 		hw->rx_offload_flags |=
 			NIX_RX_OFFLOAD_MARK_UPDATE_F;
 		otx2_eth_set_rx_function(dev);
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 220ef0e47..1887731e2 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v8 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-02 21:36           ` [dpdk-dev] [PATCH v8 0/7] ethdev: add new Rx offload flags pbhagavatula
                               ` (4 preceding siblings ...)
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-10-02 21:36             ` pbhagavatula
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 7/7] examples: disable Rx packet type parsing pbhagavatula
  2019-10-07  6:51             ` [dpdk-dev] [PATCH v9 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02 21:36 UTC (permalink / raw)
  To: arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 113 -----------------
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 3 files changed, 232 insertions(+), 113 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f541..a73b61d59 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,118 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	rte_eth_dev_info_get(port, &dev_info);
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	rte_eth_macaddr_get(port, &addr);
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
 
 static void
 do_capability_setup(uint8_t eventdev_id)
@@ -501,7 +389,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..aa1678fe7 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,123 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +414,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 8961cd656..52a1b4174 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,119 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +734,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v8 7/7] examples: disable Rx packet type parsing
  2019-10-02 21:36           ` [dpdk-dev] [PATCH v8 0/7] ethdev: add new Rx offload flags pbhagavatula
                               ` (5 preceding siblings ...)
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-02 21:36             ` pbhagavatula
  2019-10-07  6:51             ` [dpdk-dev] [PATCH v9 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-02 21:36 UTC (permalink / raw)
  To: arybchenko, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki, Bernard Iremonger,
	Cristian Dumitrescu, Konstantin Ananyev, Ferruh Yigit,
	Declan Doherty, Reshma Pattan, John McNamara, Xiaoyun Li,
	Jasvinder Singh, Byron Marohn, Yipeng Wang, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing in examples that don't use
`rte_mbuf::packet_type` by setting ptype_mask as 0 in
`rte_eth_dev_set_supported_ptypes`

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/bbdev_app/main.c                  | 1 +
 examples/bond/main.c                       | 2 ++
 examples/distributor/Makefile              | 1 +
 examples/distributor/main.c                | 1 +
 examples/distributor/meson.build           | 1 +
 examples/eventdev_pipeline/main.c          | 2 ++
 examples/eventdev_pipeline/meson.build     | 1 +
 examples/exception_path/Makefile           | 1 +
 examples/exception_path/main.c             | 1 +
 examples/exception_path/meson.build        | 1 +
 examples/flow_classify/flow_classify.c     | 1 +
 examples/flow_filtering/Makefile           | 1 +
 examples/flow_filtering/main.c             | 1 +
 examples/flow_filtering/meson.build        | 1 +
 examples/ip_pipeline/link.c                | 1 +
 examples/ip_reassembly/Makefile            | 1 +
 examples/ip_reassembly/main.c              | 2 ++
 examples/ip_reassembly/meson.build         | 1 +
 examples/ipsec-secgw/ipsec-secgw.c         | 2 ++
 examples/ipv4_multicast/Makefile           | 1 +
 examples/ipv4_multicast/main.c             | 2 ++
 examples/ipv4_multicast/meson.build        | 1 +
 examples/kni/main.c                        | 1 +
 examples/l2fwd-cat/Makefile                | 1 +
 examples/l2fwd-cat/l2fwd-cat.c             | 1 +
 examples/l2fwd-cat/meson.build             | 1 +
 examples/l2fwd-crypto/main.c               | 2 ++
 examples/l2fwd-jobstats/Makefile           | 1 +
 examples/l2fwd-jobstats/main.c             | 2 ++
 examples/l2fwd-jobstats/meson.build        | 1 +
 examples/l2fwd-keepalive/Makefile          | 1 +
 examples/l2fwd-keepalive/main.c            | 2 ++
 examples/l2fwd-keepalive/meson.build       | 1 +
 examples/l2fwd/Makefile                    | 1 +
 examples/l2fwd/main.c                      | 2 ++
 examples/l2fwd/meson.build                 | 1 +
 examples/l3fwd-acl/Makefile                | 1 +
 examples/l3fwd-acl/main.c                  | 2 ++
 examples/l3fwd-acl/meson.build             | 1 +
 examples/l3fwd-vf/Makefile                 | 1 +
 examples/l3fwd-vf/main.c                   | 2 ++
 examples/l3fwd-vf/meson.build              | 1 +
 examples/link_status_interrupt/Makefile    | 1 +
 examples/link_status_interrupt/main.c      | 2 ++
 examples/link_status_interrupt/meson.build | 1 +
 examples/load_balancer/Makefile            | 1 +
 examples/load_balancer/init.c              | 2 ++
 examples/load_balancer/meson.build         | 1 +
 examples/packet_ordering/Makefile          | 1 +
 examples/packet_ordering/main.c            | 1 +
 examples/packet_ordering/meson.build       | 1 +
 examples/ptpclient/Makefile                | 1 +
 examples/ptpclient/meson.build             | 1 +
 examples/ptpclient/ptpclient.c             | 1 +
 examples/qos_meter/Makefile                | 1 +
 examples/qos_meter/main.c                  | 2 ++
 examples/qos_meter/meson.build             | 1 +
 examples/qos_sched/Makefile                | 1 +
 examples/qos_sched/init.c                  | 1 +
 examples/qos_sched/meson.build             | 1 +
 examples/quota_watermark/qw/Makefile       | 1 +
 examples/quota_watermark/qw/init.c         | 1 +
 examples/rxtx_callbacks/main.c             | 1 +
 examples/server_node_efd/server/Makefile   | 1 +
 examples/server_node_efd/server/init.c     | 1 +
 examples/skeleton/Makefile                 | 1 +
 examples/skeleton/basicfwd.c               | 1 +
 examples/skeleton/meson.build              | 1 +
 examples/tep_termination/Makefile          | 1 +
 examples/tep_termination/meson.build       | 1 +
 examples/tep_termination/vxlan_setup.c     | 1 +
 examples/vhost/Makefile                    | 1 +
 examples/vhost/main.c                      | 1 +
 examples/vm_power_manager/Makefile         | 1 +
 examples/vm_power_manager/main.c           | 1 +
 examples/vm_power_manager/meson.build      | 1 +
 examples/vmdq/Makefile                     | 1 +
 examples/vmdq/main.c                       | 1 +
 examples/vmdq/meson.build                  | 1 +
 examples/vmdq_dcb/Makefile                 | 1 +
 examples/vmdq_dcb/main.c                   | 1 +
 examples/vmdq_dcb/meson.build              | 1 +
 82 files changed, 96 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 9acf666dc..277725a6b 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 
 	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
 	print_mac(port_id, &bbdev_port_eth_addr);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 1c0df9d46..f92104908 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -195,6 +195,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				portid, retval);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(portid);
 	if (retval < 0)
 		rte_exit(retval,
@@ -271,6 +272,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
+	rte_eth_dev_set_supported_ptypes(BOND_PORT, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(BOND_PORT);
 	if (retval < 0)
 		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d5578..a2a477279 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 81d7ca61d..35930d8a3 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -162,6 +162,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 26f108d65..c2976f6bd 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -10,6 +10,7 @@
 build = dpdk_conf.has('RTE_LIBRTE_POWER')
 
 deps += ['distributor', 'power']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index a73b61d59..66b6420f9 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -393,6 +393,8 @@ main(int argc, char **argv)
 
 	/* Start the Ethernet port. */
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		err = rte_eth_dev_start(portid);
 		if (err < 0)
 			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
index a54c35aa7..0fc916b05 100644
--- a/examples/eventdev_pipeline/meson.build
+++ b/examples/eventdev_pipeline/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'eventdev'
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 	'pipeline_worker_generic.c',
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 90c7f133a..a7c961276 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0d79e5a24..0165e4553 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -464,6 +464,7 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		FATAL_ERROR("Could not start port%u (%d)", port, ret);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index bc7f43ea9..f34d27428 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -231,6 +231,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	}
 
 	/* Start the Ethernet port. */
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a75555..793a08fae 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a0487be77..4b8712324 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -176,6 +176,7 @@ init_port(void)
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
 		rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index 407795c42..6f5d1b08a 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 )
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 787eb866a..7d02962e3 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -205,6 +205,7 @@ link_create(const char *name, struct link_params *params)
 			return NULL;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Port start */
 	status = rte_eth_dev_start(port_id);
 	if (status < 0)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904e0..19c462388 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 38b39be6b..f2c28ef76 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1158,6 +1158,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0d1fd6af6..2aceaf549 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2448,6 +2448,8 @@ main(int32_t argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/*
 		 * Start device
 		 * note: device must be started before a flow rule
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67dd4..5171f7ab2 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 72eaadc51..3d327a00b 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -765,6 +765,8 @@ main(int argc, char **argv)
 			qconf->tx_queue_id[portid] = queueid;
 			queueid++;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		rte_eth_allmulticast_enable(portid);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'hash'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d7176..99f500e25 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -625,6 +625,7 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6d3..d6a25e42a 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -66,6 +66,7 @@ endif
 EXTRA_CFLAGS += -O3 -g -Wfatal-errors
 
 CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
 LDLIBS += -lpqos
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index b34b40a00..a54a1ed25 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 4e2777a03..37c96040d 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
 ext_deps += pqos
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
+allow_experimental_apis = true
 sources = files(
 	'cat.c', 'l2fwd-cat.c'
 )
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 3fe2ba725..5071ef389 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2559,6 +2559,8 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			return -1;
 		}
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		retval = rte_eth_dev_start(portid);
 		if (retval < 0) {
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e93..09834e979 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 77e44dc82..03d986a68 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -902,6 +902,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['jobstats', 'timer']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a6f..584257ae2 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS += -lrt
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 9831a4323..8d3e5eadd 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -696,6 +696,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
 
 ext_deps += cc.find_library('rt')
 deps += 'timer'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'shm.c'
 )
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1e2b14297..b7d6ee2ff 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -694,6 +694,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f71..df590f8e9 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 0c44df767..e113b1a4d 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2056,6 +2056,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index 7b186a23c..db7f51f2f 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 572e74cf5..5bf70f52d 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1051,6 +1051,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14a8..6ddedd4de 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7a6..04da4732b 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -676,6 +676,8 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
 					"tx buffer on port %u\n", (unsigned) portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/link_status_interrupt/meson.build
+++ b/examples/link_status_interrupt/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index caae8a107..dcba9194c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3ab7d0211..d49d61474 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -496,6 +496,8 @@ app_init_nics(void)
 			}
 		}
 
+		rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start port */
 		ret = rte_eth_dev_start(port);
 		if (ret < 0) {
diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
index 4f7ac3999..19708974c 100644
--- a/examples/load_balancer/meson.build
+++ b/examples/load_balancer/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'lpm'
+allow_experimental_apis = true
 sources = files(
 	'config.c', 'init.c', 'main.c', 'runtime.c'
 )
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7eb..9ba3fa9e8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e92299..59354fad5 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -312,6 +312,7 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
 		return ret;
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'reorder'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bacbd..f158d96b9 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'ptpclient.c'
 )
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 31778fd95..e2cf4b136 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -227,6 +227,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf7c..a1533d08f 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8be..ade8e49c3 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -419,10 +419,12 @@ main(int argc, char **argv)
 
 	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
 
+	rte_eth_dev_set_supported_ptypes(port_rx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_rx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_tx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_tx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
index ef7779f2f..10cd4bc79 100644
--- a/examples/qos_meter/meson.build
+++ b/examples/qos_meter/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'meter'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'rte_policer.c'
 )
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d25371..7d3d3019f 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -58,6 +58,7 @@ else
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index b05206d5a..d165b3dd4 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -138,6 +138,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
 			 ret, portid, 0);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81ce8..5101652af 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
 sources = files(
 	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
 	'init.c', 'main.c', 'stats.c'
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
index 3f10f01c3..e06f4482b 100644
--- a/examples/quota_watermark/qw/Makefile
+++ b/examples/quota_watermark/qw/Makefile
@@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
 
 CFLAGS += -O3 -DQW_SOFTWARE_FC
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 5a0f64f45..4753eb900 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
 				"Failed to setup hardware flow control on port %u (error %d)\n",
 				(unsigned int) port_id, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index dbcd9f4fc..8949f0d93 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -152,6 +152,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 4837bd3ea..acbd12ae2 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
 
 CFLAGS += $(WERROR_FLAGS) -O3
 CFLAGS += -I$(SRCDIR)/../shared
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e28..bbea0c4c9 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -149,6 +149,7 @@ init_port(uint16_t port_num)
 
 	rte_eth_promiscuous_enable(port_num);
 
+	rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port_num);
 	if (retval < 0)
 		return retval;
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac26029..0037d6b25 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98f0..423ce05f8 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -76,6 +76,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'basicfwd.c'
 )
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd92..586838676 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -61,6 +61,7 @@ endif
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index f65d68980..f40b1c0b8 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -11,6 +11,7 @@ if not is_linux
 endif
 deps += ['hash', 'vhost']
 cflags += '-Wno-deprecated-declarations'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'vxlan.c', 'vxlan_setup.c'
 )
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a0880002..219d3e215 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -167,6 +167,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f017..7722e81c7 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -62,6 +62,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0961db080..3d9f125e5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -321,6 +321,7 @@ port_init(uint16_t port)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..65c2ad179 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -28,6 +28,7 @@ endif
 
 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lvirt
 
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 54c704610..4cb4ccecf 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -99,6 +99,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
index 20a4a05b3..54e2b584f 100644
--- a/examples/vm_power_manager/meson.build
+++ b/examples/vm_power_manager/meson.build
@@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
 	deps += ['pmd_ixgbe']
 endif
 
+allow_experimental_apis = true
 sources = files(
 	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
 )
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee86b..2168747cc 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 EXTRA_CFLAGS += -O3
 
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd7f..65431f95e 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -258,6 +258,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096cfb..ea1574d91 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 389000327..44fe63482 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -313,6 +313,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v8 1/7] ethdev: add set ptype function
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-03  7:40               ` Andrew Rybchenko
  2019-10-03 17:15                 ` Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-03  7:40 UTC (permalink / raw)
  To: pbhagavatula, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev

On 10/3/19 12:36 AM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add `rte_eth_dev_set_supported_ptypes` function that will allow the
> application to inform the PMD the packet types it is interested in.
> Based on the ptypes set PMDs can optimize their Rx path.
>
> -If application doesn’t want any ptype information it can call
> `rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
> and PMD may skip packet type processing and set rte_mbuf::packet_type to
> RTE_PTYPE_UNKNOWN.
>
> -If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
> return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>
> -If application is interested only in L2/L3 layer, it can inform the PMD
> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
> `rte_eth_dev_set_supported_ptypes(ethdev_id,
> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>
> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

With few fixes below:
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

[snip]

> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 17d183e1f..57bc12b56 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -2602,6 +2602,65 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>   	return j;
>   }
>
> +int
> +rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
> +				 uint32_t *set_ptypes, unsigned int num)
> +{
> +	unsigned int i, j;
> +	struct rte_eth_dev *dev;
> +	const uint32_t *all_ptypes;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +	dev = &rte_eth_devices[port_id];
> +
> +	if (num > 0 && set_ptypes == NULL)
> +		return -EINVAL;
> +
> +	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
> +			*dev->dev_ops->dev_supported_ptypes_set == NULL) {
> +		if (num > 0)
> +			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
> +		return 0;
> +	}
> +
> +	if (ptype_mask == 0) {
> +		if (num > 0)
> +			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
> +
> +		return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
> +				ptype_mask);
> +	}
> +
> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
> +	if (all_ptypes == NULL) {
> +		if (num > 0)
> +			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
> +
> +		return 0;
> +	}
> +
> +	/*
> +	 * Accodommodate as many set_ptypes as possible. If the supplied
> +	 * set_ptypes array is insufficient fill it partially.
> +	 */
> +	for (i = 0, j = 0; set_ptypes != NULL &&
> +				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
> +		if (ptype_mask & all_ptypes[i]) {
> +			if (j < num - 1) {
> +				set_ptypes[j] = all_ptypes[i];
> +				j++;
> +				continue;
> +			}
> +			break;
> +		}
> +	}
> +
> +	if (set_ptypes != NULL)
> +		set_ptypes[j] = RTE_PTYPE_UNKNOWN;

Initially I thought that we are safe here, but now realized that we
can write more than num here, e.g. if set_ptypes is not NULL, but num is 0.
I think the right condition here is (j < num) since it guarantees that
set_ptype is not NULL as well (since num is greater than 0 if unsigned j
is less than num).

> +
> +	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
> +}
> +
>   void
>   rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>   {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index d9871782e..c577a9172 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -2431,6 +2431,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
>    */
>   int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>   				     uint32_t *ptypes, int num);
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Inform Ethernet device of the packet types classification in which
> + * the recipient is interested.
> + *
> + * Application can use this function to set only specific ptypes that it's
> + * interested. This information can be used by the PMD to optimize Rx path.
> + *
> + * The function accepts an array `set_ptypes` allocated by the caller to
> + * store the packet types set by the driver, the last element of the array
> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
> + * partially.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param ptype_mask
> + *   The ptype family that application is interested in.

I think it is better to highlight here that it should be bitwise OR of
RTE_PTYPE_*_MASK or 0.

BTW, I think it would be useful to check it to avoid misuse of the API
when, for example, RTE_PTYPE_L4_TCP is specified as ptype_mask.

> + * @param set_ptypes
> + *   An array pointer to store set packet types, allocated by caller. The
> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
> + * @param num
> + *   Size of the array pointed by param ptypes.
> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
> + *   set ptypes.
> + * @return
> + *   - (0) if Success.
> + *   - (-ENODEV) if *port_id* invalid.
> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
> + *     num > 0.
> + */
> +__rte_experimental
> +int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
> +				     uint32_t *set_ptypes, unsigned int num);
>
>   /**
>    * Retrieve the MTU of an Ethernet device.
> diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
> index 2922d5b7c..06afd6a3d 100644
> --- a/lib/librte_ethdev/rte_ethdev_core.h
> +++ b/lib/librte_ethdev/rte_ethdev_core.h
> @@ -110,6 +110,16 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
>   typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
>   /**< @internal Get supported ptypes of an Ethernet device. */
>
> +typedef int (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
> +					      uint32_t ptype_mask);
> +/**< @internal Inform an Ethernet device about packet types in which the
> + *   recipient is interested.
> + *   Ptype_mask can have any of the following values RTE_PTYPE_UNKNOWN |
> + *   RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK | RTE_PTYPE_L4_MASK |
> + *   RTE_PTYPE_TUNNEL_MASK | RTE_PTYPE_INNER_L2_MASK | RTE_PTYPE_INNER_L3_MASK |
> + *   RTE_PTYPE_INNER_L4_MASK | RTE_PTYPE_ALL_MASK.
> + */
> +

I'm sorry for misunderstanding. It should be a comment before the typedef
which start from /** . So long post comments looks a bit strange.
Please, describe parameters using @param and return values using @return
and @retval.
Also there is no point to mention all RTE_PTYPE masks here to avoid
duplication and possible unsync if we have more masks.

Will you update a driver to implement it in 19.11 release cycle?
As I understand it is a requirement to add a new API.

>   typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
>   				    uint16_t queue_id);
>   /**< @internal Start rx and tx of a queue of an Ethernet device. */

[snip]

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v8 1/7] ethdev: add set ptype function
  2019-10-03  7:40               ` Andrew Rybchenko
@ 2019-10-03 17:15                 ` Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-10-03 17:15 UTC (permalink / raw)
  To: Andrew Rybchenko, Jerin Jacob Kollanukkaran, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit
  Cc: dev



>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Andrew Rybchenko
>Sent: Thursday, October 3, 2019 1:11 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: Re: [dpdk-dev] [PATCH v8 1/7] ethdev: add set ptype function
>
>On 10/3/19 12:36 AM, pbhagavatula@marvell.com wrote:
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> Add `rte_eth_dev_set_supported_ptypes` function that will allow the
>> application to inform the PMD the packet types it is interested in.
>> Based on the ptypes set PMDs can optimize their Rx path.
>>
>> -If application doesn’t want any ptype information it can call
>> `rte_eth_dev_set_supported_ptypes(ethdev_id,
>RTE_PTYPE_UNKNOWN, NULL, 0)`
>> and PMD may skip packet type processing and set
>rte_mbuf::packet_type to
>> RTE_PTYPE_UNKNOWN.
>>
>> -If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD
>can
>> return `rte_mbuf::packet_type` with
>`rte_eth_dev_get_supported_ptypes`.
>>
>> -If application is interested only in L2/L3 layer, it can inform the PMD
>> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
>> `rte_eth_dev_set_supported_ptypes(ethdev_id,
>> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL,
>0)`.
>>
>> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
>With few fixes below:
>Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>
>[snip]
>
>> diff --git a/lib/librte_ethdev/rte_ethdev.c
>b/lib/librte_ethdev/rte_ethdev.c
>> index 17d183e1f..57bc12b56 100644
>> --- a/lib/librte_ethdev/rte_ethdev.c
>> +++ b/lib/librte_ethdev/rte_ethdev.c
>> @@ -2602,6 +2602,65 @@
>rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t
>ptype_mask,
>>   	return j;
>>   }
>>
>> +int
>> +rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t
>ptype_mask,
>> +				 uint32_t *set_ptypes, unsigned int
>num)
>> +{
>> +	unsigned int i, j;
>> +	struct rte_eth_dev *dev;
>> +	const uint32_t *all_ptypes;
>> +
>> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>> +	dev = &rte_eth_devices[port_id];
>> +
>> +	if (num > 0 && set_ptypes == NULL)
>> +		return -EINVAL;
>> +
>> +	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
>> +			*dev->dev_ops->dev_supported_ptypes_set
>== NULL) {
>> +		if (num > 0)
>> +			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>> +		return 0;
>> +	}
>> +
>> +	if (ptype_mask == 0) {
>> +		if (num > 0)
>> +			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>> +
>> +		return (*dev->dev_ops-
>>dev_supported_ptypes_set)(dev,
>> +				ptype_mask);
>> +	}
>> +
>> +	all_ptypes = (*dev->dev_ops-
>>dev_supported_ptypes_get)(dev);
>> +	if (all_ptypes == NULL) {
>> +		if (num > 0)
>> +			set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>> +
>> +		return 0;
>> +	}
>> +
>> +	/*
>> +	 * Accodommodate as many set_ptypes as possible. If the
>supplied
>> +	 * set_ptypes array is insufficient fill it partially.
>> +	 */
>> +	for (i = 0, j = 0; set_ptypes != NULL &&
>> +				(all_ptypes[i] !=
>RTE_PTYPE_UNKNOWN); ++i) {
>> +		if (ptype_mask & all_ptypes[i]) {
>> +			if (j < num - 1) {
>> +				set_ptypes[j] = all_ptypes[i];
>> +				j++;
>> +				continue;
>> +			}
>> +			break;
>> +		}
>> +	}
>> +
>> +	if (set_ptypes != NULL)
>> +		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
>
>Initially I thought that we are safe here, but now realized that we
>can write more than num here, e.g. if set_ptypes is not NULL, but num
>is 0.
>I think the right condition here is (j < num) since it guarantees that
>set_ptype is not NULL as well (since num is greater than 0 if unsigned j
>is less than num).

Ack will send v9.

>
>> +
>> +	return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
>ptype_mask);
>> +}
>> +
>>   void
>>   rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr
>*mac_addr)
>>   {
>> diff --git a/lib/librte_ethdev/rte_ethdev.h
>b/lib/librte_ethdev/rte_ethdev.h
>> index d9871782e..c577a9172 100644
>> --- a/lib/librte_ethdev/rte_ethdev.h
>> +++ b/lib/librte_ethdev/rte_ethdev.h
>> @@ -2431,6 +2431,42 @@ int rte_eth_dev_fw_version_get(uint16_t
>port_id,
>>    */
>>   int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t
>ptype_mask,
>>   				     uint32_t *ptypes, int num);
>> +/**
>> + * @warning
>> + * @b EXPERIMENTAL: this API may change without prior notice.
>> + *
>> + * Inform Ethernet device of the packet types classification in which
>> + * the recipient is interested.
>> + *
>> + * Application can use this function to set only specific ptypes that it's
>> + * interested. This information can be used by the PMD to optimize
>Rx path.
>> + *
>> + * The function accepts an array `set_ptypes` allocated by the caller
>to
>> + * store the packet types set by the driver, the last element of the
>array
>> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array
>should be
>> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be
>filled
>> + * partially.
>> + *
>> + * @param port_id
>> + *   The port identifier of the Ethernet device.
>> + * @param ptype_mask
>> + *   The ptype family that application is interested in.
>
>I think it is better to highlight here that it should be bitwise OR of
>RTE_PTYPE_*_MASK or 0.
>
>BTW, I think it would be useful to check it to avoid misuse of the API
>when, for example, RTE_PTYPE_L4_TCP is specified as ptype_mask.

I feel the same we could do something like 

        test_ptype_mask = ptype_mask;
        while (test_ptype_mask) {
                uint8_t mask = test_ptype_mask & RTE_PTYPE_L2_MASK;

                if (mask && (mask != RTE_PTYPE_L2_MASK)) {
                        if (num > 0)
                                set_ptypes[0] = RTE_PTYPE_UNKNOWN;

                        return -EINVAL;
                }

                test_ptype_mask >>= __builtin_popcount(RTE_PTYPE_L2_MASK);
        }

>
>> + * @param set_ptypes
>> + *   An array pointer to store set packet types, allocated by caller. The
>> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
>> + * @param num
>> + *   Size of the array pointed by param ptypes.
>> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to
>accommodate the
>> + *   set ptypes.
>> + * @return
>> + *   - (0) if Success.
>> + *   - (-ENODEV) if *port_id* invalid.
>> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
>> + *     num > 0.
>> + */
>> +__rte_experimental
>> +int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t
>ptype_mask,
>> +				     uint32_t *set_ptypes, unsigned int
>num);
>>
>>   /**
>>    * Retrieve the MTU of an Ethernet device.
>> diff --git a/lib/librte_ethdev/rte_ethdev_core.h
>b/lib/librte_ethdev/rte_ethdev_core.h
>> index 2922d5b7c..06afd6a3d 100644
>> --- a/lib/librte_ethdev/rte_ethdev_core.h
>> +++ b/lib/librte_ethdev/rte_ethdev_core.h
>> @@ -110,6 +110,16 @@ typedef void (*eth_dev_infos_get_t)(struct
>rte_eth_dev *dev,
>>   typedef const uint32_t
>*(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
>>   /**< @internal Get supported ptypes of an Ethernet device. */
>>
>> +typedef int (*eth_dev_supported_ptypes_set_t)(struct
>rte_eth_dev *dev,
>> +					      uint32_t ptype_mask);
>> +/**< @internal Inform an Ethernet device about packet types in
>which the
>> + *   recipient is interested.
>> + *   Ptype_mask can have any of the following values
>RTE_PTYPE_UNKNOWN |
>> + *   RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK |
>RTE_PTYPE_L4_MASK |
>> + *   RTE_PTYPE_TUNNEL_MASK | RTE_PTYPE_INNER_L2_MASK |
>RTE_PTYPE_INNER_L3_MASK |
>> + *   RTE_PTYPE_INNER_L4_MASK | RTE_PTYPE_ALL_MASK.
>> + */
>> +
>
>I'm sorry for misunderstanding. It should be a comment before the
>typedef
>which start from /** . So long post comments looks a bit strange.
>Please, describe parameters using @param and return values using
>@return
>and @retval.
>Also there is no point to mention all RTE_PTYPE masks here to avoid
>duplication and possible unsync if we have more masks.

My bad. Will cleanup in v9.

>
>Will you update a driver to implement it in 19.11 release cycle?
>As I understand it is a requirement to add a new API.
>

Yes, I will add support for net/octeontx2.

>>   typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
>>   				    uint16_t queue_id);
>>   /**< @internal Start rx and tx of a queue of an Ethernet device. */
>
>[snip]

^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v9 0/7] ethdev: add new Rx offload flags
  2019-10-02 21:36           ` [dpdk-dev] [PATCH v8 0/7] ethdev: add new Rx offload flags pbhagavatula
                               ` (6 preceding siblings ...)
  2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-10-07  6:51             ` pbhagavatula
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 1/7] ethdev: add set ptype function pbhagavatula
                                 ` (7 more replies)
  7 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-07  6:51 UTC (permalink / raw)
  To: arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
`DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN, NULL,
                                          0);

v9 Changes:
----------
- Add ptype_mask validationin set_supported_ptypes.(Andrew)
- Make description more verbose.

v8 Changes:
----------
- Make description more verbose.
- Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
  is not supported by ethernet device.

v7 Changes:
----------
- Fix unused variable in net/octeontx2

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.


Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add flow action type update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  drivers/net: update Rx flow flag and mark capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples: disable Rx packet type parsing

 doc/guides/nics/features.rst                  |  22 +++-
 doc/guides/rel_notes/release_19_11.rst        |  24 ++++
 drivers/net/bnxt/bnxt_ethdev.c                |   4 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   3 +-
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_res.c                   |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   3 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   3 +-
 drivers/net/i40e/i40e_ethdev.c                |   4 +-
 drivers/net/iavf/iavf_ethdev.c                |   4 +-
 drivers/net/ice/ice_ethdev.c                  |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |   4 +-
 drivers/net/liquidio/lio_ethdev.c             |   3 +-
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   4 +-
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   3 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  16 +--
 drivers/net/octeontx2/otx2_flow.c             |   9 +-
 drivers/net/octeontx2/otx2_flow.h             |   1 -
 drivers/net/octeontx2/otx2_flow_parse.c       |   5 +-
 drivers/net/qede/qede_ethdev.c                |   3 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   3 +-
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   3 +-
 examples/bbdev_app/main.c                     |   1 +
 examples/bond/main.c                          |   2 +
 examples/distributor/Makefile                 |   1 +
 examples/distributor/main.c                   |   1 +
 examples/distributor/meson.build              |   1 +
 examples/eventdev_pipeline/main.c             | 115 +----------------
 examples/eventdev_pipeline/meson.build        |   1 +
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 examples/exception_path/Makefile              |   1 +
 examples/exception_path/main.c                |   1 +
 examples/exception_path/meson.build           |   1 +
 examples/flow_classify/flow_classify.c        |   1 +
 examples/flow_filtering/Makefile              |   1 +
 examples/flow_filtering/main.c                |   1 +
 examples/flow_filtering/meson.build           |   1 +
 examples/ip_pipeline/link.c                   |   1 +
 examples/ip_reassembly/Makefile               |   1 +
 examples/ip_reassembly/main.c                 |   2 +
 examples/ip_reassembly/meson.build            |   1 +
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +
 examples/ipv4_multicast/Makefile              |   1 +
 examples/ipv4_multicast/main.c                |   2 +
 examples/ipv4_multicast/meson.build           |   1 +
 examples/kni/main.c                           |   1 +
 examples/l2fwd-cat/Makefile                   |   1 +
 examples/l2fwd-cat/l2fwd-cat.c                |   1 +
 examples/l2fwd-cat/meson.build                |   1 +
 examples/l2fwd-crypto/main.c                  |   2 +
 examples/l2fwd-jobstats/Makefile              |   1 +
 examples/l2fwd-jobstats/main.c                |   2 +
 examples/l2fwd-jobstats/meson.build           |   1 +
 examples/l2fwd-keepalive/Makefile             |   1 +
 examples/l2fwd-keepalive/main.c               |   2 +
 examples/l2fwd-keepalive/meson.build          |   1 +
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 examples/l3fwd-acl/Makefile                   |   1 +
 examples/l3fwd-acl/main.c                     |   2 +
 examples/l3fwd-acl/meson.build                |   1 +
 examples/l3fwd-vf/Makefile                    |   1 +
 examples/l3fwd-vf/main.c                      |   2 +
 examples/l3fwd-vf/meson.build                 |   1 +
 examples/link_status_interrupt/Makefile       |   1 +
 examples/link_status_interrupt/main.c         |   2 +
 examples/link_status_interrupt/meson.build    |   1 +
 examples/load_balancer/Makefile               |   1 +
 examples/load_balancer/init.c                 |   2 +
 examples/load_balancer/meson.build            |   1 +
 examples/packet_ordering/Makefile             |   1 +
 examples/packet_ordering/main.c               |   1 +
 examples/packet_ordering/meson.build          |   1 +
 examples/ptpclient/Makefile                   |   1 +
 examples/ptpclient/meson.build                |   1 +
 examples/ptpclient/ptpclient.c                |   1 +
 examples/qos_meter/Makefile                   |   1 +
 examples/qos_meter/main.c                     |   2 +
 examples/qos_meter/meson.build                |   1 +
 examples/qos_sched/Makefile                   |   1 +
 examples/qos_sched/init.c                     |   1 +
 examples/qos_sched/meson.build                |   1 +
 examples/quota_watermark/qw/Makefile          |   1 +
 examples/quota_watermark/qw/init.c            |   1 +
 examples/rxtx_callbacks/main.c                |   1 +
 examples/server_node_efd/server/Makefile      |   1 +
 examples/server_node_efd/server/init.c        |   1 +
 examples/skeleton/Makefile                    |   1 +
 examples/skeleton/basicfwd.c                  |   1 +
 examples/skeleton/meson.build                 |   1 +
 examples/tep_termination/Makefile             |   1 +
 examples/tep_termination/meson.build          |   1 +
 examples/tep_termination/vxlan_setup.c        |   1 +
 examples/vhost/Makefile                       |   1 +
 examples/vhost/main.c                         |   1 +
 examples/vm_power_manager/Makefile            |   1 +
 examples/vm_power_manager/main.c              |   1 +
 examples/vm_power_manager/meson.build         |   1 +
 examples/vmdq/Makefile                        |   1 +
 examples/vmdq/main.c                          |   1 +
 examples/vmdq/meson.build                     |   1 +
 examples/vmdq_dcb/Makefile                    |   1 +
 examples/vmdq_dcb/main.c                      |   1 +
 examples/vmdq_dcb/meson.build                 |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  75 +++++++++++
 lib/librte_ethdev/rte_ethdev.h                |  39 ++++++
 lib/librte_ethdev/rte_ethdev_core.h           |  19 +++
 lib/librte_ethdev/rte_ethdev_version.map      |   3 +
 lib/librte_ethdev/rte_flow.h                  |   6 +-
 119 files changed, 579 insertions(+), 160 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v9 1/7] ethdev: add set ptype function
  2019-10-07  6:51             ` [dpdk-dev] [PATCH v9 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-10-07  6:51               ` pbhagavatula
  2019-10-08 14:48                 ` Andrew Rybchenko
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                                 ` (6 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-07  6:51 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst             |  8 ++-
 doc/guides/rel_notes/release_19_11.rst   |  8 +++
 lib/librte_ethdev/rte_ethdev.c           | 73 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 37 ++++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      | 19 ++++++
 lib/librte_ethdev/rte_ethdev_version.map |  3 +
 6 files changed, 146 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index c4e128d2f..1756fa73a 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,13 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+  ``dev_supported_ptypes_set``.
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 27cfbd9e3..abb7b6529 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -56,6 +56,14 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e1f..d2561272c 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2602,6 +2602,79 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	const uint32_t *all_ptypes;
+	uint32_t test_ptype_mask;
+	struct rte_eth_dev *dev;
+	unsigned int i, j;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
+			*dev->dev_ops->dev_supported_ptypes_set == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	if (ptype_mask == 0) {
+		ret = (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+		goto ptype_unknown;
+	}
+
+	test_ptype_mask = ptype_mask;
+	while (test_ptype_mask) {
+		uint8_t mask = test_ptype_mask & RTE_PTYPE_L2_MASK;
+
+		if (mask && (mask != RTE_PTYPE_L2_MASK)) {
+			ret = -EINVAL;
+			goto ptype_unknown;
+		}
+		test_ptype_mask >>= __builtin_popcount(RTE_PTYPE_L2_MASK);
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	/*
+	 * Accodommodate as many set_ptypes as possible. If the supplied
+	 * set_ptypes array is insufficient fill it partially.
+	 */
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL && j < num)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+
+ptype_unknown:
+	if (num > 0)
+		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+	return ret;
+}
+
 void
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d9871782e..35e171e3c 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2431,6 +2431,43 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification the recipient is
+ * interested in.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, unsigned int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 2922d5b7c..7202a216d 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -110,6 +110,23 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+/**
+ * @internal
+ * Inform an Ethernet device about packet types classifications the recipient
+ * is interested in.
+ *
+ * @param dev
+ *   The Ethernet device identifier.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @return
+ *   - (0) if Success.
+ *   - (-EINVAL) if *ptype_mask* is invalid.
+ */
+typedef int (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -421,6 +438,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform Ethernet device about packet types the recipient is interested in. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6df42a47b..e14745b9c 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -283,4 +283,7 @@ EXPERIMENTAL {
 
 	# added in 19.08
 	rte_eth_read_clock;
+
+	# added in 19.11
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v9 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-07  6:51             ` [dpdk-dev] [PATCH v9 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-07  6:51               ` pbhagavatula
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 3/7] ethdev: add flow action type " pbhagavatula
                                 ` (5 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-07  6:51 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 2 ++
 doc/guides/rel_notes/release_19_11.rst | 7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 1 +
 lib/librte_ethdev/rte_ethdev.h         | 1 +
 4 files changed, 11 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 1756fa73a..f7c6d918f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index abb7b6529..724228faa 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -64,6 +64,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index d2561272c..e0c3d0157 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 35e171e3c..6110c1772 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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v9 3/7] ethdev: add flow action type update as an offload
  2019-10-07  6:51             ` [dpdk-dev] [PATCH v9 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 1/7] ethdev: add set ptype function pbhagavatula
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-07  6:51               ` pbhagavatula
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                                 ` (4 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-07  6:51 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, Adrien Mazarguil
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 12 ++++++++++++
 doc/guides/rel_notes/release_19_11.rst |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.c         |  1 +
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 lib/librte_ethdev/rte_flow.h           |  6 ++++--
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f7c6d918f..9737ff7a1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@ Allows application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 724228faa..670fbfd36 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -71,6 +71,15 @@ New Features
   *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
      by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
 
+* **Added Rx offload flag to enable or disable flow action type update**
+
+  *  Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
+     `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
+     `RTE_FLOW_ACTION_FLAG` are enabled.
+  *  PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the application
+     by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index e0c3d0157..4174a7389 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 6110c1772..db32f5589 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1014,6 +1014,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index 354cb1dd0..5d62686c0 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1316,7 +1316,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1324,7 +1325,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * No associated configuration structure.
 	 */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v9 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-07  6:51             ` [dpdk-dev] [PATCH v9 0/7] ethdev: add new Rx offload flags pbhagavatula
                                 ` (2 preceding siblings ...)
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-10-07  6:51               ` pbhagavatula
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
                                 ` (3 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-07  6:51 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 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/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
 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/liquidio/lio_ethdev.c    |  3 ++-
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
 25 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7d9..6c106baf7 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_RSS_HASH)
 
 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..22e61a55c 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_RSS_HASH)
 
 
 #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..18c7bd0d5 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_RSS_HASH;
 
 /* 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..55a1c4455 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_RSS_HASH;
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 9405e1933..607a085f8 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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d72129..ba9b174cf 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1797,7 +1797,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af9053..53bd2b9ae 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->rx_offload_capa = 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_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7ab5..7058e0213 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_RSS_HASH;
 
 	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..aef91a79b 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_RSS_HASH;
 	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 63997fdfb..2e2a6b2af 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2145,7 +2145,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index c25dab00c..ff118586e 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -406,7 +406,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	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..b5fd57693 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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..230d64c8a 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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index b84128fef..2e88d1844 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 7b15d6bc8..0cca6746d 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_RSS_HASH)
 
 #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..da25b26df 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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 9cd5eb65b..da768ced7 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 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] 246+ messages in thread

* [dpdk-dev] [PATCH v9 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-10-07  6:51             ` [dpdk-dev] [PATCH v9 0/7] ethdev: add new Rx offload flags pbhagavatula
                                 ` (3 preceding siblings ...)
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-07  6:51               ` pbhagavatula
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                                 ` (2 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-07  6:51 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
flag and mark.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 3 ++-
 drivers/net/enic/enic_res.c             | 3 ++-
 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/mlx5/mlx5_rxq.c             | 3 ++-
 drivers/net/octeontx2/otx2_ethdev.h     | 3 ++-
 drivers/net/octeontx2/otx2_flow.c       | 9 ++-------
 drivers/net/octeontx2/otx2_flow.h       | 1 -
 drivers/net/octeontx2/otx2_flow_parse.c | 5 +----
 drivers/net/sfc/sfc_ef10_essb_rx.c      | 3 ++-
 12 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6c106baf7..fd1fb7eda 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -161,7 +161,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_JUMBO_FRAME | \
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_RSS_HASH)
+				     DEV_RX_OFFLOAD_RSS_HASH | \
+				     DEV_RX_OFFLOAD_FLOW_MARK)
 
 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/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 607a085f8..3503d5d7e 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -199,7 +199,8 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7058e0213..6311943be 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3512,7 +3512,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_VLAN_EXTEND |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 
 	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 aef91a79b..7bdaa87b1 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -518,7 +518,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_SCATTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	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 2e2a6b2af..984af659f 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2146,7 +2146,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 			DEV_RX_OFFLOAD_VLAN_EXTEND |
-			DEV_RX_OFFLOAD_RSS_HASH;
+			DEV_RX_OFFLOAD_RSS_HASH |
+			DEV_RX_OFFLOAD_FLOW_MARK;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index fa572d184..1481e2426 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
 		   DEV_RX_OFFLOAD_VLAN_FILTER |
 		   DEV_RX_OFFLOAD_SCATTER |
-		   DEV_RX_OFFLOAD_RSS_HASH;
+		   DEV_RX_OFFLOAD_RSS_HASH |
+		   DEV_RX_OFFLOAD_FLOW_MARK;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index b5fd57693..1bf01bda3 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
 	uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
 			     DEV_RX_OFFLOAD_TIMESTAMP |
 			     DEV_RX_OFFLOAD_JUMBO_FRAME |
-			     DEV_RX_OFFLOAD_RSS_HASH);
+			     DEV_RX_OFFLOAD_RSS_HASH |
+			     DEV_RX_OFFLOAD_FLOW_MARK);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 0cca6746d..97c1a636a 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -141,7 +141,8 @@
 	DEV_RX_OFFLOAD_VLAN_FILTER	| \
 	DEV_RX_OFFLOAD_QINQ_STRIP	| \
 	DEV_RX_OFFLOAD_TIMESTAMP	| \
-	DEV_RX_OFFLOAD_RSS_HASH)
+	DEV_RX_OFFLOAD_RSS_HASH		| \
+	DEV_RX_OFFLOAD_FLOW_MARK)
 
 #define NIX_DEFAULT_RSS_CTX_GROUP  0
 #define NIX_DEFAULT_RSS_MCAM_IDX  -1
diff --git a/drivers/net/octeontx2/otx2_flow.c b/drivers/net/octeontx2/otx2_flow.c
index bdbf123a9..ea4e380b1 100644
--- a/drivers/net/octeontx2/otx2_flow.c
+++ b/drivers/net/octeontx2/otx2_flow.c
@@ -524,11 +524,8 @@ otx2_flow_destroy(struct rte_eth_dev *dev,
 		NIX_RX_ACT_MATCH_MASK;
 
 	if (match_id && match_id < OTX2_FLOW_ACTION_FLAG_DEFAULT) {
-		if (rte_atomic32_read(&npc->mark_actions) == 0)
-			return -EINVAL;
-
-		/* Clear mark offload flag if there are no more mark actions */
-		if (rte_atomic32_sub_return(&npc->mark_actions, 1) == 0) {
+		/* Clear mark offload flag if there is no more mark action */
+		if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 			hw->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F;
 			otx2_eth_set_rx_function(dev);
 		}
@@ -821,8 +818,6 @@ otx2_flow_init(struct otx2_eth_dev *hw)
 		return rc;
 	}
 
-	rte_atomic32_init(&npc->mark_actions);
-
 	npc->mcam_entries = NPC_MCAM_TOT_ENTRIES >> npc->keyw[NPC_MCAM_RX];
 	/* Free, free_rev, live and live_rev entries */
 	bmap_sz = rte_bitmap_get_memory_footprint(npc->mcam_entries);
diff --git a/drivers/net/octeontx2/otx2_flow.h b/drivers/net/octeontx2/otx2_flow.h
index ab068b088..85129cc9d 100644
--- a/drivers/net/octeontx2/otx2_flow.h
+++ b/drivers/net/octeontx2/otx2_flow.h
@@ -160,7 +160,6 @@ TAILQ_HEAD(otx2_flow_list, rte_flow);
 
 /* Accessed from ethdev private - otx2_eth_dev */
 struct otx2_npc_flow_info {
-	rte_atomic32_t mark_actions;
 	uint32_t keyx_supp_nmask[NPC_MAX_INTF];/* nibble mask */
 	uint32_t keyx_len[NPC_MAX_INTF];	/* per intf key len in bits */
 	uint32_t datax_len[NPC_MAX_INTF];	/* per intf data len in bits */
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a70..541479445 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -761,7 +761,6 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			struct rte_flow *flow)
 {
 	struct otx2_eth_dev *hw = dev->data->dev_private;
-	struct otx2_npc_flow_info *npc = &hw->npc_flow;
 	const struct rte_flow_action_count *act_count;
 	const struct rte_flow_action_mark *act_mark;
 	const struct rte_flow_action_queue *act_q;
@@ -795,13 +794,11 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			}
 			mark = act_mark->id + 1;
 			req_act |= OTX2_FLOW_ACT_MARK;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_FLAG:
 			mark = OTX2_FLOW_FLAG_VAL;
 			req_act |= OTX2_FLOW_ACT_FLAG;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_COUNT:
@@ -979,7 +976,7 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 	if (mark)
 		flow->npc_action |= (uint64_t)mark << 40;
 
-	if (rte_atomic32_read(&npc->mark_actions) == 1) {
+	if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 		hw->rx_offload_flags |=
 			NIX_RX_OFFLOAD_MARK_UPDATE_F;
 		otx2_eth_set_rx_function(dev);
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 220ef0e47..1887731e2 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v9 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-07  6:51             ` [dpdk-dev] [PATCH v9 0/7] ethdev: add new Rx offload flags pbhagavatula
                                 ` (4 preceding siblings ...)
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-10-07  6:51               ` pbhagavatula
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 7/7] examples: disable Rx packet type parsing pbhagavatula
  2019-10-09 15:33               ` [dpdk-dev] [PATCH v10 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-07  6:51 UTC (permalink / raw)
  To: arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 113 -----------------
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 3 files changed, 232 insertions(+), 113 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f541..a73b61d59 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,118 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	rte_eth_dev_info_get(port, &dev_info);
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	rte_eth_macaddr_get(port, &addr);
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
 
 static void
 do_capability_setup(uint8_t eventdev_id)
@@ -501,7 +389,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..aa1678fe7 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,123 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +414,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 8961cd656..52a1b4174 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,119 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +734,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v9 7/7] examples: disable Rx packet type parsing
  2019-10-07  6:51             ` [dpdk-dev] [PATCH v9 0/7] ethdev: add new Rx offload flags pbhagavatula
                                 ` (5 preceding siblings ...)
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-07  6:51               ` pbhagavatula
  2019-10-09 15:33               ` [dpdk-dev] [PATCH v10 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-07  6:51 UTC (permalink / raw)
  To: arybchenko, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki, Bernard Iremonger,
	Cristian Dumitrescu, Konstantin Ananyev, Ferruh Yigit,
	Declan Doherty, Reshma Pattan, John McNamara, Xiaoyun Li,
	Jasvinder Singh, Byron Marohn, Yipeng Wang, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing in examples that don't use
`rte_mbuf::packet_type` by setting ptype_mask as 0 in
`rte_eth_dev_set_supported_ptypes`

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/bbdev_app/main.c                  | 1 +
 examples/bond/main.c                       | 2 ++
 examples/distributor/Makefile              | 1 +
 examples/distributor/main.c                | 1 +
 examples/distributor/meson.build           | 1 +
 examples/eventdev_pipeline/main.c          | 2 ++
 examples/eventdev_pipeline/meson.build     | 1 +
 examples/exception_path/Makefile           | 1 +
 examples/exception_path/main.c             | 1 +
 examples/exception_path/meson.build        | 1 +
 examples/flow_classify/flow_classify.c     | 1 +
 examples/flow_filtering/Makefile           | 1 +
 examples/flow_filtering/main.c             | 1 +
 examples/flow_filtering/meson.build        | 1 +
 examples/ip_pipeline/link.c                | 1 +
 examples/ip_reassembly/Makefile            | 1 +
 examples/ip_reassembly/main.c              | 2 ++
 examples/ip_reassembly/meson.build         | 1 +
 examples/ipsec-secgw/ipsec-secgw.c         | 2 ++
 examples/ipv4_multicast/Makefile           | 1 +
 examples/ipv4_multicast/main.c             | 2 ++
 examples/ipv4_multicast/meson.build        | 1 +
 examples/kni/main.c                        | 1 +
 examples/l2fwd-cat/Makefile                | 1 +
 examples/l2fwd-cat/l2fwd-cat.c             | 1 +
 examples/l2fwd-cat/meson.build             | 1 +
 examples/l2fwd-crypto/main.c               | 2 ++
 examples/l2fwd-jobstats/Makefile           | 1 +
 examples/l2fwd-jobstats/main.c             | 2 ++
 examples/l2fwd-jobstats/meson.build        | 1 +
 examples/l2fwd-keepalive/Makefile          | 1 +
 examples/l2fwd-keepalive/main.c            | 2 ++
 examples/l2fwd-keepalive/meson.build       | 1 +
 examples/l2fwd/Makefile                    | 1 +
 examples/l2fwd/main.c                      | 2 ++
 examples/l2fwd/meson.build                 | 1 +
 examples/l3fwd-acl/Makefile                | 1 +
 examples/l3fwd-acl/main.c                  | 2 ++
 examples/l3fwd-acl/meson.build             | 1 +
 examples/l3fwd-vf/Makefile                 | 1 +
 examples/l3fwd-vf/main.c                   | 2 ++
 examples/l3fwd-vf/meson.build              | 1 +
 examples/link_status_interrupt/Makefile    | 1 +
 examples/link_status_interrupt/main.c      | 2 ++
 examples/link_status_interrupt/meson.build | 1 +
 examples/load_balancer/Makefile            | 1 +
 examples/load_balancer/init.c              | 2 ++
 examples/load_balancer/meson.build         | 1 +
 examples/packet_ordering/Makefile          | 1 +
 examples/packet_ordering/main.c            | 1 +
 examples/packet_ordering/meson.build       | 1 +
 examples/ptpclient/Makefile                | 1 +
 examples/ptpclient/meson.build             | 1 +
 examples/ptpclient/ptpclient.c             | 1 +
 examples/qos_meter/Makefile                | 1 +
 examples/qos_meter/main.c                  | 2 ++
 examples/qos_meter/meson.build             | 1 +
 examples/qos_sched/Makefile                | 1 +
 examples/qos_sched/init.c                  | 1 +
 examples/qos_sched/meson.build             | 1 +
 examples/quota_watermark/qw/Makefile       | 1 +
 examples/quota_watermark/qw/init.c         | 1 +
 examples/rxtx_callbacks/main.c             | 1 +
 examples/server_node_efd/server/Makefile   | 1 +
 examples/server_node_efd/server/init.c     | 1 +
 examples/skeleton/Makefile                 | 1 +
 examples/skeleton/basicfwd.c               | 1 +
 examples/skeleton/meson.build              | 1 +
 examples/tep_termination/Makefile          | 1 +
 examples/tep_termination/meson.build       | 1 +
 examples/tep_termination/vxlan_setup.c     | 1 +
 examples/vhost/Makefile                    | 1 +
 examples/vhost/main.c                      | 1 +
 examples/vm_power_manager/Makefile         | 1 +
 examples/vm_power_manager/main.c           | 1 +
 examples/vm_power_manager/meson.build      | 1 +
 examples/vmdq/Makefile                     | 1 +
 examples/vmdq/main.c                       | 1 +
 examples/vmdq/meson.build                  | 1 +
 examples/vmdq_dcb/Makefile                 | 1 +
 examples/vmdq_dcb/main.c                   | 1 +
 examples/vmdq_dcb/meson.build              | 1 +
 82 files changed, 96 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 9acf666dc..277725a6b 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 
 	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
 	print_mac(port_id, &bbdev_port_eth_addr);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 1c0df9d46..f92104908 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -195,6 +195,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				portid, retval);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(portid);
 	if (retval < 0)
 		rte_exit(retval,
@@ -271,6 +272,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
+	rte_eth_dev_set_supported_ptypes(BOND_PORT, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(BOND_PORT);
 	if (retval < 0)
 		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d5578..a2a477279 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 81d7ca61d..35930d8a3 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -162,6 +162,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 26f108d65..c2976f6bd 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -10,6 +10,7 @@
 build = dpdk_conf.has('RTE_LIBRTE_POWER')
 
 deps += ['distributor', 'power']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index a73b61d59..66b6420f9 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -393,6 +393,8 @@ main(int argc, char **argv)
 
 	/* Start the Ethernet port. */
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		err = rte_eth_dev_start(portid);
 		if (err < 0)
 			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
index a54c35aa7..0fc916b05 100644
--- a/examples/eventdev_pipeline/meson.build
+++ b/examples/eventdev_pipeline/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'eventdev'
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 	'pipeline_worker_generic.c',
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 90c7f133a..a7c961276 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0d79e5a24..0165e4553 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -464,6 +464,7 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		FATAL_ERROR("Could not start port%u (%d)", port, ret);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index bc7f43ea9..f34d27428 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -231,6 +231,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	}
 
 	/* Start the Ethernet port. */
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a75555..793a08fae 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a0487be77..4b8712324 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -176,6 +176,7 @@ init_port(void)
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
 		rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index 407795c42..6f5d1b08a 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 )
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 787eb866a..7d02962e3 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -205,6 +205,7 @@ link_create(const char *name, struct link_params *params)
 			return NULL;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Port start */
 	status = rte_eth_dev_start(port_id);
 	if (status < 0)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904e0..19c462388 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 38b39be6b..f2c28ef76 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1158,6 +1158,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0d1fd6af6..2aceaf549 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2448,6 +2448,8 @@ main(int32_t argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/*
 		 * Start device
 		 * note: device must be started before a flow rule
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67dd4..5171f7ab2 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 72eaadc51..3d327a00b 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -765,6 +765,8 @@ main(int argc, char **argv)
 			qconf->tx_queue_id[portid] = queueid;
 			queueid++;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		rte_eth_allmulticast_enable(portid);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'hash'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d7176..99f500e25 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -625,6 +625,7 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6d3..d6a25e42a 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -66,6 +66,7 @@ endif
 EXTRA_CFLAGS += -O3 -g -Wfatal-errors
 
 CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
 LDLIBS += -lpqos
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index b34b40a00..a54a1ed25 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 4e2777a03..37c96040d 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
 ext_deps += pqos
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
+allow_experimental_apis = true
 sources = files(
 	'cat.c', 'l2fwd-cat.c'
 )
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 3fe2ba725..5071ef389 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2559,6 +2559,8 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			return -1;
 		}
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		retval = rte_eth_dev_start(portid);
 		if (retval < 0) {
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e93..09834e979 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 77e44dc82..03d986a68 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -902,6 +902,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['jobstats', 'timer']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a6f..584257ae2 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS += -lrt
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 9831a4323..8d3e5eadd 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -696,6 +696,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
 
 ext_deps += cc.find_library('rt')
 deps += 'timer'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'shm.c'
 )
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1e2b14297..b7d6ee2ff 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -694,6 +694,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f71..df590f8e9 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 0c44df767..e113b1a4d 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2056,6 +2056,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index 7b186a23c..db7f51f2f 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 572e74cf5..5bf70f52d 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1051,6 +1051,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14a8..6ddedd4de 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7a6..04da4732b 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -676,6 +676,8 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
 					"tx buffer on port %u\n", (unsigned) portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/link_status_interrupt/meson.build
+++ b/examples/link_status_interrupt/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index caae8a107..dcba9194c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3ab7d0211..d49d61474 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -496,6 +496,8 @@ app_init_nics(void)
 			}
 		}
 
+		rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start port */
 		ret = rte_eth_dev_start(port);
 		if (ret < 0) {
diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
index 4f7ac3999..19708974c 100644
--- a/examples/load_balancer/meson.build
+++ b/examples/load_balancer/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'lpm'
+allow_experimental_apis = true
 sources = files(
 	'config.c', 'init.c', 'main.c', 'runtime.c'
 )
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7eb..9ba3fa9e8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e92299..59354fad5 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -312,6 +312,7 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
 		return ret;
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'reorder'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bacbd..f158d96b9 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'ptpclient.c'
 )
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 31778fd95..e2cf4b136 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -227,6 +227,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf7c..a1533d08f 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8be..ade8e49c3 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -419,10 +419,12 @@ main(int argc, char **argv)
 
 	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
 
+	rte_eth_dev_set_supported_ptypes(port_rx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_rx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_tx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_tx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
index ef7779f2f..10cd4bc79 100644
--- a/examples/qos_meter/meson.build
+++ b/examples/qos_meter/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'meter'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'rte_policer.c'
 )
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d25371..7d3d3019f 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -58,6 +58,7 @@ else
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index b05206d5a..d165b3dd4 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -138,6 +138,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
 			 ret, portid, 0);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81ce8..5101652af 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
 sources = files(
 	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
 	'init.c', 'main.c', 'stats.c'
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
index 3f10f01c3..e06f4482b 100644
--- a/examples/quota_watermark/qw/Makefile
+++ b/examples/quota_watermark/qw/Makefile
@@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
 
 CFLAGS += -O3 -DQW_SOFTWARE_FC
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 5a0f64f45..4753eb900 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
 				"Failed to setup hardware flow control on port %u (error %d)\n",
 				(unsigned int) port_id, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index dbcd9f4fc..8949f0d93 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -152,6 +152,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 4837bd3ea..acbd12ae2 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
 
 CFLAGS += $(WERROR_FLAGS) -O3
 CFLAGS += -I$(SRCDIR)/../shared
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e28..bbea0c4c9 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -149,6 +149,7 @@ init_port(uint16_t port_num)
 
 	rte_eth_promiscuous_enable(port_num);
 
+	rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port_num);
 	if (retval < 0)
 		return retval;
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac26029..0037d6b25 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98f0..423ce05f8 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -76,6 +76,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'basicfwd.c'
 )
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd92..586838676 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -61,6 +61,7 @@ endif
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index f65d68980..f40b1c0b8 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -11,6 +11,7 @@ if not is_linux
 endif
 deps += ['hash', 'vhost']
 cflags += '-Wno-deprecated-declarations'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'vxlan.c', 'vxlan_setup.c'
 )
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a0880002..219d3e215 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -167,6 +167,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f017..7722e81c7 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -62,6 +62,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0961db080..3d9f125e5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -321,6 +321,7 @@ port_init(uint16_t port)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..65c2ad179 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -28,6 +28,7 @@ endif
 
 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lvirt
 
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 54c704610..4cb4ccecf 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -99,6 +99,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
index 20a4a05b3..54e2b584f 100644
--- a/examples/vm_power_manager/meson.build
+++ b/examples/vm_power_manager/meson.build
@@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
 	deps += ['pmd_ixgbe']
 endif
 
+allow_experimental_apis = true
 sources = files(
 	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
 )
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee86b..2168747cc 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 EXTRA_CFLAGS += -O3
 
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd7f..65431f95e 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -258,6 +258,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096cfb..ea1574d91 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 389000327..44fe63482 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -313,6 +313,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v9 1/7] ethdev: add set ptype function
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-08 14:48                 ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-08 14:48 UTC (permalink / raw)
  To: pbhagavatula, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev

On 10/7/19 9:51 AM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add `rte_eth_dev_set_supported_ptypes` function that will allow the
> application to inform the PMD the packet types it is interested in.
> Based on the ptypes set PMDs can optimize their Rx path.
>
> -If application doesn’t want any ptype information it can call
> `rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
> and PMD may skip packet type processing and set rte_mbuf::packet_type to
> RTE_PTYPE_UNKNOWN.
>
> -If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
> return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>
> -If application is interested only in L2/L3 layer, it can inform the PMD
> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
> `rte_eth_dev_set_supported_ptypes(ethdev_id,
> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>
> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

Looks good except one thing below.

[snip]

> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 17d183e1f..d2561272c 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -2602,6 +2602,79 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>   	return j;
>   }
>   
> +int
> +rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
> +				 uint32_t *set_ptypes, unsigned int num)
> +{
> +	const uint32_t *all_ptypes;
> +	uint32_t test_ptype_mask;
> +	struct rte_eth_dev *dev;
> +	unsigned int i, j;
> +	int ret;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +	dev = &rte_eth_devices[port_id];
> +
> +	if (num > 0 && set_ptypes == NULL)
> +		return -EINVAL;
> +
> +	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
> +			*dev->dev_ops->dev_supported_ptypes_set == NULL) {
> +		ret = 0;
> +		goto ptype_unknown;
> +	}
> +
> +	if (ptype_mask == 0) {
> +		ret = (*dev->dev_ops->dev_supported_ptypes_set)(dev,
> +				ptype_mask);
> +		goto ptype_unknown;
> +	}
> +
> +	test_ptype_mask = ptype_mask;
> +	while (test_ptype_mask) {
> +		uint8_t mask = test_ptype_mask & RTE_PTYPE_L2_MASK;
> +
> +		if (mask && (mask != RTE_PTYPE_L2_MASK)) {
> +			ret = -EINVAL;
> +			goto ptype_unknown;
> +		}
> +		test_ptype_mask >>= __builtin_popcount(RTE_PTYPE_L2_MASK);

It heavily relies on current MASK values - 4 bits in each mask one by one.
IMO const array of all supported masks is less evil here. Plus it should
be checked that no set bits remain when all masks are removed.

> +	}
> +
> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
> +	if (all_ptypes == NULL) {
> +		ret = 0;
> +		goto ptype_unknown;
> +	}
> +
> +	/*
> +	 * Accodommodate as many set_ptypes as possible. If the supplied
> +	 * set_ptypes array is insufficient fill it partially.
> +	 */
> +	for (i = 0, j = 0; set_ptypes != NULL &&
> +				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
> +		if (ptype_mask & all_ptypes[i]) {
> +			if (j < num - 1) {
> +				set_ptypes[j] = all_ptypes[i];
> +				j++;
> +				continue;
> +			}
> +			break;
> +		}
> +	}
> +
> +	if (set_ptypes != NULL && j < num)
> +		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
> +
> +	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
> +
> +ptype_unknown:
> +	if (num > 0)
> +		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
> +
> +	return ret;
> +}
> +
>   void
>   rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>   {

[snip]


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v10 0/7] ethdev: add new Rx offload flags
  2019-10-07  6:51             ` [dpdk-dev] [PATCH v9 0/7] ethdev: add new Rx offload flags pbhagavatula
                                 ` (6 preceding siblings ...)
  2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-10-09 15:33               ` pbhagavatula
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 1/7] ethdev: add set ptype function pbhagavatula
                                   ` (7 more replies)
  7 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-09 15:33 UTC (permalink / raw)
  To: arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
`DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
					  NULL, 0);

v10 Changes:
-----------
- Modify ptype_mask validation in set_supported_ptypes.(Andrew)

v9 Changes:
----------
- Add ptype_mask validation in set_supported_ptypes.(Andrew)
- Make description more verbose.

v8 Changes:
----------
- Make description more verbose.
- Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
  is not supported by ethernet device.

v7 Changes:
----------
- Fix unused variable in net/octeontx2

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.


Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add flow action type update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  drivers/net: update Rx flow flag and mark capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples: disable Rx packet type parsing

 doc/guides/nics/features.rst                  |  22 +++-
 doc/guides/rel_notes/release_19_11.rst        |  24 ++++
 drivers/net/bnxt/bnxt_ethdev.c                |   4 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   3 +-
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_res.c                   |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   3 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   3 +-
 drivers/net/i40e/i40e_ethdev.c                |   4 +-
 drivers/net/iavf/iavf_ethdev.c                |   4 +-
 drivers/net/ice/ice_ethdev.c                  |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |   4 +-
 drivers/net/liquidio/lio_ethdev.c             |   3 +-
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   4 +-
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   3 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  16 +--
 drivers/net/octeontx2/otx2_flow.c             |   9 +-
 drivers/net/octeontx2/otx2_flow.h             |   1 -
 drivers/net/octeontx2/otx2_flow_parse.c       |   5 +-
 drivers/net/qede/qede_ethdev.c                |   3 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   3 +-
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   3 +-
 examples/bbdev_app/main.c                     |   1 +
 examples/bond/main.c                          |   2 +
 examples/distributor/Makefile                 |   1 +
 examples/distributor/main.c                   |   1 +
 examples/distributor/meson.build              |   1 +
 examples/eventdev_pipeline/main.c             | 115 +----------------
 examples/eventdev_pipeline/meson.build        |   1 +
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 examples/exception_path/Makefile              |   1 +
 examples/exception_path/main.c                |   1 +
 examples/exception_path/meson.build           |   1 +
 examples/flow_classify/flow_classify.c        |   1 +
 examples/flow_filtering/Makefile              |   1 +
 examples/flow_filtering/main.c                |   1 +
 examples/flow_filtering/meson.build           |   1 +
 examples/ip_pipeline/link.c                   |   1 +
 examples/ip_reassembly/Makefile               |   1 +
 examples/ip_reassembly/main.c                 |   2 +
 examples/ip_reassembly/meson.build            |   1 +
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +
 examples/ipv4_multicast/Makefile              |   1 +
 examples/ipv4_multicast/main.c                |   2 +
 examples/ipv4_multicast/meson.build           |   1 +
 examples/kni/main.c                           |   1 +
 examples/l2fwd-cat/Makefile                   |   1 +
 examples/l2fwd-cat/l2fwd-cat.c                |   1 +
 examples/l2fwd-cat/meson.build                |   1 +
 examples/l2fwd-crypto/main.c                  |   2 +
 examples/l2fwd-jobstats/Makefile              |   1 +
 examples/l2fwd-jobstats/main.c                |   2 +
 examples/l2fwd-jobstats/meson.build           |   1 +
 examples/l2fwd-keepalive/Makefile             |   1 +
 examples/l2fwd-keepalive/main.c               |   2 +
 examples/l2fwd-keepalive/meson.build          |   1 +
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 examples/l3fwd-acl/Makefile                   |   1 +
 examples/l3fwd-acl/main.c                     |   2 +
 examples/l3fwd-acl/meson.build                |   1 +
 examples/l3fwd-vf/Makefile                    |   1 +
 examples/l3fwd-vf/main.c                      |   2 +
 examples/l3fwd-vf/meson.build                 |   1 +
 examples/link_status_interrupt/Makefile       |   1 +
 examples/link_status_interrupt/main.c         |   2 +
 examples/link_status_interrupt/meson.build    |   1 +
 examples/load_balancer/Makefile               |   1 +
 examples/load_balancer/init.c                 |   2 +
 examples/load_balancer/meson.build            |   1 +
 examples/packet_ordering/Makefile             |   1 +
 examples/packet_ordering/main.c               |   1 +
 examples/packet_ordering/meson.build          |   1 +
 examples/ptpclient/Makefile                   |   1 +
 examples/ptpclient/meson.build                |   1 +
 examples/ptpclient/ptpclient.c                |   1 +
 examples/qos_meter/Makefile                   |   1 +
 examples/qos_meter/main.c                     |   2 +
 examples/qos_meter/meson.build                |   1 +
 examples/qos_sched/Makefile                   |   1 +
 examples/qos_sched/init.c                     |   1 +
 examples/qos_sched/meson.build                |   1 +
 examples/quota_watermark/qw/Makefile          |   1 +
 examples/quota_watermark/qw/init.c            |   1 +
 examples/rxtx_callbacks/main.c                |   1 +
 examples/server_node_efd/server/Makefile      |   1 +
 examples/server_node_efd/server/init.c        |   1 +
 examples/skeleton/Makefile                    |   1 +
 examples/skeleton/basicfwd.c                  |   1 +
 examples/skeleton/meson.build                 |   1 +
 examples/tep_termination/Makefile             |   1 +
 examples/tep_termination/meson.build          |   1 +
 examples/tep_termination/vxlan_setup.c        |   1 +
 examples/vhost/Makefile                       |   1 +
 examples/vhost/main.c                         |   1 +
 examples/vm_power_manager/Makefile            |   1 +
 examples/vm_power_manager/main.c              |   1 +
 examples/vm_power_manager/meson.build         |   1 +
 examples/vmdq/Makefile                        |   1 +
 examples/vmdq/main.c                          |   1 +
 examples/vmdq/meson.build                     |   1 +
 examples/vmdq_dcb/Makefile                    |   1 +
 examples/vmdq_dcb/main.c                      |   1 +
 examples/vmdq_dcb/meson.build                 |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  86 +++++++++++++
 lib/librte_ethdev/rte_ethdev.h                |  39 ++++++
 lib/librte_ethdev/rte_ethdev_core.h           |  19 +++
 lib/librte_ethdev/rte_ethdev_version.map      |   3 +
 lib/librte_ethdev/rte_flow.h                  |   6 +-
 119 files changed, 590 insertions(+), 160 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v10 1/7] ethdev: add set ptype function
  2019-10-09 15:33               ` [dpdk-dev] [PATCH v10 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-10-09 15:33                 ` pbhagavatula
  2019-10-10  8:46                   ` Andrew Rybchenko
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-09 15:33 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst             |  8 ++-
 doc/guides/rel_notes/release_19_11.rst   |  8 +++
 lib/librte_ethdev/rte_ethdev.c           | 84 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 37 +++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      | 19 ++++++
 lib/librte_ethdev/rte_ethdev_version.map |  3 +
 6 files changed, 157 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index c4e128d2f..1756fa73a 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,13 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+  ``dev_supported_ptypes_set``.
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 8049144e1..18a67c96d 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -79,6 +79,14 @@ New Features
   Added stateful decompression support in the Intel QuickAssist Technology PMD.
   Please note that stateful compression is not supported.
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e1f..349483707 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2602,6 +2602,90 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	const uint32_t valid_ptype_masks[] = {
+		RTE_PTYPE_L2_MASK,
+		RTE_PTYPE_L3_MASK,
+		RTE_PTYPE_L4_MASK,
+		RTE_PTYPE_TUNNEL_MASK,
+		RTE_PTYPE_INNER_L2_MASK,
+		RTE_PTYPE_INNER_L3_MASK,
+		RTE_PTYPE_INNER_L4_MASK,
+	};
+	const uint32_t *all_ptypes;
+	struct rte_eth_dev *dev;
+	unsigned int i, j;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
+			*dev->dev_ops->dev_supported_ptypes_set == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	if (ptype_mask == 0) {
+		ret = (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+		goto ptype_unknown;
+	}
+
+	for (i = 0; i < sizeof(valid_ptype_masks)/sizeof(valid_ptype_masks[0]);
+									i++) {
+		uint32_t mask = ptype_mask & valid_ptype_masks[i];
+		if (mask && mask != valid_ptype_masks[i]) {
+			ret = -EINVAL;
+			goto ptype_unknown;
+		}
+	}
+
+	if (ptype_mask & ~RTE_PTYPE_ALL_MASK) {
+		ret = -EINVAL;
+		goto ptype_unknown;
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	/*
+	 * Accodommodate as many set_ptypes as possible. If the supplied
+	 * set_ptypes array is insufficient fill it partially.
+	 */
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL && j < num)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+
+ptype_unknown:
+	if (num > 0)
+		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+	return ret;
+}
+
 void
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d9871782e..35e171e3c 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2431,6 +2431,43 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification the recipient is
+ * interested in.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, unsigned int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 2922d5b7c..7202a216d 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -110,6 +110,23 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+/**
+ * @internal
+ * Inform an Ethernet device about packet types classifications the recipient
+ * is interested in.
+ *
+ * @param dev
+ *   The Ethernet device identifier.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @return
+ *   - (0) if Success.
+ *   - (-EINVAL) if *ptype_mask* is invalid.
+ */
+typedef int (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -421,6 +438,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform Ethernet device about packet types the recipient is interested in. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6df42a47b..e14745b9c 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -283,4 +283,7 @@ EXPERIMENTAL {
 
 	# added in 19.08
 	rte_eth_read_clock;
+
+	# added in 19.11
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v10 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-09 15:33               ` [dpdk-dev] [PATCH v10 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-09 15:33                 ` pbhagavatula
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 3/7] ethdev: add flow action type " pbhagavatula
                                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-09 15:33 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 2 ++
 doc/guides/rel_notes/release_19_11.rst | 7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 1 +
 lib/librte_ethdev/rte_ethdev.h         | 1 +
 4 files changed, 11 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 1756fa73a..f7c6d918f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 18a67c96d..55b334a6d 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -87,6 +87,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 349483707..096e6a13c 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 35e171e3c..6110c1772 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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v10 3/7] ethdev: add flow action type update as an offload
  2019-10-09 15:33               ` [dpdk-dev] [PATCH v10 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 1/7] ethdev: add set ptype function pbhagavatula
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-09 15:33                 ` pbhagavatula
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-09 15:33 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, Adrien Mazarguil
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 12 ++++++++++++
 doc/guides/rel_notes/release_19_11.rst |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.c         |  1 +
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 lib/librte_ethdev/rte_flow.h           |  6 ++++--
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f7c6d918f..9737ff7a1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@ Allows application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 55b334a6d..b319a4339 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -94,6 +94,15 @@ New Features
   *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
      by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
 
+* **Added Rx offload flag to enable or disable flow action type update**
+
+  *  Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
+     `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
+     `RTE_FLOW_ACTION_FLAG` are enabled.
+  *  PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the application
+     by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 096e6a13c..71d915213 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 6110c1772..db32f5589 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1014,6 +1014,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index 354cb1dd0..5d62686c0 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1316,7 +1316,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1324,7 +1325,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * No associated configuration structure.
 	 */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v10 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-09 15:33               ` [dpdk-dev] [PATCH v10 0/7] ethdev: add new Rx offload flags pbhagavatula
                                   ` (2 preceding siblings ...)
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-10-09 15:33                 ` pbhagavatula
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
                                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-09 15:33 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 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/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
 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/liquidio/lio_ethdev.c    |  3 ++-
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
 25 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6685ee7d9..6c106baf7 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_RSS_HASH)
 
 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..22e61a55c 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_RSS_HASH)
 
 
 #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..18c7bd0d5 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_RSS_HASH;
 
 /* 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..55a1c4455 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_RSS_HASH;
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 9405e1933..607a085f8 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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index db4d72129..ba9b174cf 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1797,7 +1797,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af9053..53bd2b9ae 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->rx_offload_capa = 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_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4e40b7ab5..7058e0213 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_RSS_HASH;
 
 	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..aef91a79b 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_RSS_HASH;
 	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 63997fdfb..2e2a6b2af 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2145,7 +2145,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index c25dab00c..ff118586e 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -406,7 +406,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	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..b5fd57693 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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..230d64c8a 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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index b84128fef..2e88d1844 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 7b15d6bc8..0cca6746d 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_RSS_HASH)
 
 #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..da25b26df 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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 9cd5eb65b..da768ced7 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 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] 246+ messages in thread

* [dpdk-dev] [PATCH v10 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-10-09 15:33               ` [dpdk-dev] [PATCH v10 0/7] ethdev: add new Rx offload flags pbhagavatula
                                   ` (3 preceding siblings ...)
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-09 15:33                 ` pbhagavatula
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-09 15:33 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
flag and mark.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 3 ++-
 drivers/net/enic/enic_res.c             | 3 ++-
 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/mlx5/mlx5_rxq.c             | 3 ++-
 drivers/net/octeontx2/otx2_ethdev.h     | 3 ++-
 drivers/net/octeontx2/otx2_flow.c       | 9 ++-------
 drivers/net/octeontx2/otx2_flow.h       | 1 -
 drivers/net/octeontx2/otx2_flow_parse.c | 5 +----
 drivers/net/sfc/sfc_ef10_essb_rx.c      | 3 ++-
 12 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6c106baf7..fd1fb7eda 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -161,7 +161,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_JUMBO_FRAME | \
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_RSS_HASH)
+				     DEV_RX_OFFLOAD_RSS_HASH | \
+				     DEV_RX_OFFLOAD_FLOW_MARK)
 
 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/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 607a085f8..3503d5d7e 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -199,7 +199,8 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7058e0213..6311943be 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3512,7 +3512,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_VLAN_EXTEND |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 
 	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 aef91a79b..7bdaa87b1 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -518,7 +518,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_SCATTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	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 2e2a6b2af..984af659f 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2146,7 +2146,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 			DEV_RX_OFFLOAD_VLAN_EXTEND |
-			DEV_RX_OFFLOAD_RSS_HASH;
+			DEV_RX_OFFLOAD_RSS_HASH |
+			DEV_RX_OFFLOAD_FLOW_MARK;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index fa572d184..1481e2426 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
 		   DEV_RX_OFFLOAD_VLAN_FILTER |
 		   DEV_RX_OFFLOAD_SCATTER |
-		   DEV_RX_OFFLOAD_RSS_HASH;
+		   DEV_RX_OFFLOAD_RSS_HASH |
+		   DEV_RX_OFFLOAD_FLOW_MARK;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index b5fd57693..1bf01bda3 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
 	uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
 			     DEV_RX_OFFLOAD_TIMESTAMP |
 			     DEV_RX_OFFLOAD_JUMBO_FRAME |
-			     DEV_RX_OFFLOAD_RSS_HASH);
+			     DEV_RX_OFFLOAD_RSS_HASH |
+			     DEV_RX_OFFLOAD_FLOW_MARK);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 0cca6746d..97c1a636a 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -141,7 +141,8 @@
 	DEV_RX_OFFLOAD_VLAN_FILTER	| \
 	DEV_RX_OFFLOAD_QINQ_STRIP	| \
 	DEV_RX_OFFLOAD_TIMESTAMP	| \
-	DEV_RX_OFFLOAD_RSS_HASH)
+	DEV_RX_OFFLOAD_RSS_HASH		| \
+	DEV_RX_OFFLOAD_FLOW_MARK)
 
 #define NIX_DEFAULT_RSS_CTX_GROUP  0
 #define NIX_DEFAULT_RSS_MCAM_IDX  -1
diff --git a/drivers/net/octeontx2/otx2_flow.c b/drivers/net/octeontx2/otx2_flow.c
index bdbf123a9..ea4e380b1 100644
--- a/drivers/net/octeontx2/otx2_flow.c
+++ b/drivers/net/octeontx2/otx2_flow.c
@@ -524,11 +524,8 @@ otx2_flow_destroy(struct rte_eth_dev *dev,
 		NIX_RX_ACT_MATCH_MASK;
 
 	if (match_id && match_id < OTX2_FLOW_ACTION_FLAG_DEFAULT) {
-		if (rte_atomic32_read(&npc->mark_actions) == 0)
-			return -EINVAL;
-
-		/* Clear mark offload flag if there are no more mark actions */
-		if (rte_atomic32_sub_return(&npc->mark_actions, 1) == 0) {
+		/* Clear mark offload flag if there is no more mark action */
+		if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 			hw->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F;
 			otx2_eth_set_rx_function(dev);
 		}
@@ -821,8 +818,6 @@ otx2_flow_init(struct otx2_eth_dev *hw)
 		return rc;
 	}
 
-	rte_atomic32_init(&npc->mark_actions);
-
 	npc->mcam_entries = NPC_MCAM_TOT_ENTRIES >> npc->keyw[NPC_MCAM_RX];
 	/* Free, free_rev, live and live_rev entries */
 	bmap_sz = rte_bitmap_get_memory_footprint(npc->mcam_entries);
diff --git a/drivers/net/octeontx2/otx2_flow.h b/drivers/net/octeontx2/otx2_flow.h
index ab068b088..85129cc9d 100644
--- a/drivers/net/octeontx2/otx2_flow.h
+++ b/drivers/net/octeontx2/otx2_flow.h
@@ -160,7 +160,6 @@ TAILQ_HEAD(otx2_flow_list, rte_flow);
 
 /* Accessed from ethdev private - otx2_eth_dev */
 struct otx2_npc_flow_info {
-	rte_atomic32_t mark_actions;
 	uint32_t keyx_supp_nmask[NPC_MAX_INTF];/* nibble mask */
 	uint32_t keyx_len[NPC_MAX_INTF];	/* per intf key len in bits */
 	uint32_t datax_len[NPC_MAX_INTF];	/* per intf data len in bits */
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a70..541479445 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -761,7 +761,6 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			struct rte_flow *flow)
 {
 	struct otx2_eth_dev *hw = dev->data->dev_private;
-	struct otx2_npc_flow_info *npc = &hw->npc_flow;
 	const struct rte_flow_action_count *act_count;
 	const struct rte_flow_action_mark *act_mark;
 	const struct rte_flow_action_queue *act_q;
@@ -795,13 +794,11 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			}
 			mark = act_mark->id + 1;
 			req_act |= OTX2_FLOW_ACT_MARK;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_FLAG:
 			mark = OTX2_FLOW_FLAG_VAL;
 			req_act |= OTX2_FLOW_ACT_FLAG;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_COUNT:
@@ -979,7 +976,7 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 	if (mark)
 		flow->npc_action |= (uint64_t)mark << 40;
 
-	if (rte_atomic32_read(&npc->mark_actions) == 1) {
+	if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 		hw->rx_offload_flags |=
 			NIX_RX_OFFLOAD_MARK_UPDATE_F;
 		otx2_eth_set_rx_function(dev);
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 220ef0e47..1887731e2 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v10 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-09 15:33               ` [dpdk-dev] [PATCH v10 0/7] ethdev: add new Rx offload flags pbhagavatula
                                   ` (4 preceding siblings ...)
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-10-09 15:33                 ` pbhagavatula
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 7/7] examples: disable Rx packet type parsing pbhagavatula
  2019-10-10 10:51                 ` [dpdk-dev] [PATCH v11 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-09 15:33 UTC (permalink / raw)
  To: arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 113 -----------------
 .../pipeline_worker_generic.c                 | 118 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 114 +++++++++++++++++
 3 files changed, 232 insertions(+), 113 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f541..a73b61d59 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,118 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	rte_eth_dev_info_get(port, &dev_info);
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	rte_eth_macaddr_get(port, &addr);
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
 
 static void
 do_capability_setup(uint8_t eventdev_id)
@@ -501,7 +389,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..aa1678fe7 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,123 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +414,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 8961cd656..52a1b4174 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,119 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +734,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v10 7/7] examples: disable Rx packet type parsing
  2019-10-09 15:33               ` [dpdk-dev] [PATCH v10 0/7] ethdev: add new Rx offload flags pbhagavatula
                                   ` (5 preceding siblings ...)
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-09 15:33                 ` pbhagavatula
  2019-10-10 10:51                 ` [dpdk-dev] [PATCH v11 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-09 15:33 UTC (permalink / raw)
  To: arybchenko, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki, Bernard Iremonger,
	Cristian Dumitrescu, Konstantin Ananyev, Ferruh Yigit,
	Declan Doherty, Reshma Pattan, John McNamara, Xiaoyun Li,
	Jasvinder Singh, Byron Marohn, Yipeng Wang, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing in examples that don't use
`rte_mbuf::packet_type` by setting ptype_mask as 0 in
`rte_eth_dev_set_supported_ptypes`

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/bbdev_app/main.c                  | 1 +
 examples/bond/main.c                       | 2 ++
 examples/distributor/Makefile              | 1 +
 examples/distributor/main.c                | 1 +
 examples/distributor/meson.build           | 1 +
 examples/eventdev_pipeline/main.c          | 2 ++
 examples/eventdev_pipeline/meson.build     | 1 +
 examples/exception_path/Makefile           | 1 +
 examples/exception_path/main.c             | 1 +
 examples/exception_path/meson.build        | 1 +
 examples/flow_classify/flow_classify.c     | 1 +
 examples/flow_filtering/Makefile           | 1 +
 examples/flow_filtering/main.c             | 1 +
 examples/flow_filtering/meson.build        | 1 +
 examples/ip_pipeline/link.c                | 1 +
 examples/ip_reassembly/Makefile            | 1 +
 examples/ip_reassembly/main.c              | 2 ++
 examples/ip_reassembly/meson.build         | 1 +
 examples/ipsec-secgw/ipsec-secgw.c         | 2 ++
 examples/ipv4_multicast/Makefile           | 1 +
 examples/ipv4_multicast/main.c             | 2 ++
 examples/ipv4_multicast/meson.build        | 1 +
 examples/kni/main.c                        | 1 +
 examples/l2fwd-cat/Makefile                | 1 +
 examples/l2fwd-cat/l2fwd-cat.c             | 1 +
 examples/l2fwd-cat/meson.build             | 1 +
 examples/l2fwd-crypto/main.c               | 2 ++
 examples/l2fwd-jobstats/Makefile           | 1 +
 examples/l2fwd-jobstats/main.c             | 2 ++
 examples/l2fwd-jobstats/meson.build        | 1 +
 examples/l2fwd-keepalive/Makefile          | 1 +
 examples/l2fwd-keepalive/main.c            | 2 ++
 examples/l2fwd-keepalive/meson.build       | 1 +
 examples/l2fwd/Makefile                    | 1 +
 examples/l2fwd/main.c                      | 2 ++
 examples/l2fwd/meson.build                 | 1 +
 examples/l3fwd-acl/Makefile                | 1 +
 examples/l3fwd-acl/main.c                  | 2 ++
 examples/l3fwd-acl/meson.build             | 1 +
 examples/l3fwd-vf/Makefile                 | 1 +
 examples/l3fwd-vf/main.c                   | 2 ++
 examples/l3fwd-vf/meson.build              | 1 +
 examples/link_status_interrupt/Makefile    | 1 +
 examples/link_status_interrupt/main.c      | 2 ++
 examples/link_status_interrupt/meson.build | 1 +
 examples/load_balancer/Makefile            | 1 +
 examples/load_balancer/init.c              | 2 ++
 examples/load_balancer/meson.build         | 1 +
 examples/packet_ordering/Makefile          | 1 +
 examples/packet_ordering/main.c            | 1 +
 examples/packet_ordering/meson.build       | 1 +
 examples/ptpclient/Makefile                | 1 +
 examples/ptpclient/meson.build             | 1 +
 examples/ptpclient/ptpclient.c             | 1 +
 examples/qos_meter/Makefile                | 1 +
 examples/qos_meter/main.c                  | 2 ++
 examples/qos_meter/meson.build             | 1 +
 examples/qos_sched/Makefile                | 1 +
 examples/qos_sched/init.c                  | 1 +
 examples/qos_sched/meson.build             | 1 +
 examples/quota_watermark/qw/Makefile       | 1 +
 examples/quota_watermark/qw/init.c         | 1 +
 examples/rxtx_callbacks/main.c             | 1 +
 examples/server_node_efd/server/Makefile   | 1 +
 examples/server_node_efd/server/init.c     | 1 +
 examples/skeleton/Makefile                 | 1 +
 examples/skeleton/basicfwd.c               | 1 +
 examples/skeleton/meson.build              | 1 +
 examples/tep_termination/Makefile          | 1 +
 examples/tep_termination/meson.build       | 1 +
 examples/tep_termination/vxlan_setup.c     | 1 +
 examples/vhost/Makefile                    | 1 +
 examples/vhost/main.c                      | 1 +
 examples/vm_power_manager/Makefile         | 1 +
 examples/vm_power_manager/main.c           | 1 +
 examples/vm_power_manager/meson.build      | 1 +
 examples/vmdq/Makefile                     | 1 +
 examples/vmdq/main.c                       | 1 +
 examples/vmdq/meson.build                  | 1 +
 examples/vmdq_dcb/Makefile                 | 1 +
 examples/vmdq_dcb/main.c                   | 1 +
 examples/vmdq_dcb/meson.build              | 1 +
 82 files changed, 96 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 9acf666dc..277725a6b 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 
 	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
 	print_mac(port_id, &bbdev_port_eth_addr);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 1c0df9d46..f92104908 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -195,6 +195,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				portid, retval);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(portid);
 	if (retval < 0)
 		rte_exit(retval,
@@ -271,6 +272,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
+	rte_eth_dev_set_supported_ptypes(BOND_PORT, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(BOND_PORT);
 	if (retval < 0)
 		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d5578..a2a477279 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 81d7ca61d..35930d8a3 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -162,6 +162,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 26f108d65..c2976f6bd 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -10,6 +10,7 @@
 build = dpdk_conf.has('RTE_LIBRTE_POWER')
 
 deps += ['distributor', 'power']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index a73b61d59..66b6420f9 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -393,6 +393,8 @@ main(int argc, char **argv)
 
 	/* Start the Ethernet port. */
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		err = rte_eth_dev_start(portid);
 		if (err < 0)
 			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
index a54c35aa7..0fc916b05 100644
--- a/examples/eventdev_pipeline/meson.build
+++ b/examples/eventdev_pipeline/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'eventdev'
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 	'pipeline_worker_generic.c',
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 90c7f133a..a7c961276 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 0d79e5a24..0165e4553 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -464,6 +464,7 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		FATAL_ERROR("Could not start port%u (%d)", port, ret);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index bc7f43ea9..f34d27428 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -231,6 +231,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	}
 
 	/* Start the Ethernet port. */
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a75555..793a08fae 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a0487be77..4b8712324 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -176,6 +176,7 @@ init_port(void)
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
 		rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index 407795c42..6f5d1b08a 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 )
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 787eb866a..7d02962e3 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -205,6 +205,7 @@ link_create(const char *name, struct link_params *params)
 			return NULL;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Port start */
 	status = rte_eth_dev_start(port_id);
 	if (status < 0)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904e0..19c462388 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 38b39be6b..f2c28ef76 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1158,6 +1158,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 345c8e51b..2e902fba2 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2451,6 +2451,8 @@ main(int32_t argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/*
 		 * Start device
 		 * note: device must be started before a flow rule
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67dd4..5171f7ab2 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 72eaadc51..3d327a00b 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -765,6 +765,8 @@ main(int argc, char **argv)
 			qconf->tx_queue_id[portid] = queueid;
 			queueid++;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		rte_eth_allmulticast_enable(portid);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'hash'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 4710d7176..99f500e25 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -625,6 +625,7 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6d3..d6a25e42a 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -66,6 +66,7 @@ endif
 EXTRA_CFLAGS += -O3 -g -Wfatal-errors
 
 CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
 LDLIBS += -lpqos
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index b34b40a00..a54a1ed25 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 4e2777a03..37c96040d 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
 ext_deps += pqos
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
+allow_experimental_apis = true
 sources = files(
 	'cat.c', 'l2fwd-cat.c'
 )
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 3fe2ba725..5071ef389 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2559,6 +2559,8 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			return -1;
 		}
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		retval = rte_eth_dev_start(portid);
 		if (retval < 0) {
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e93..09834e979 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 77e44dc82..03d986a68 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -902,6 +902,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['jobstats', 'timer']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a6f..584257ae2 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS += -lrt
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 9831a4323..8d3e5eadd 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -696,6 +696,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
 
 ext_deps += cc.find_library('rt')
 deps += 'timer'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'shm.c'
 )
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1e2b14297..b7d6ee2ff 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -694,6 +694,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f71..df590f8e9 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 0c44df767..e113b1a4d 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2056,6 +2056,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index 7b186a23c..db7f51f2f 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 572e74cf5..5bf70f52d 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1051,6 +1051,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14a8..6ddedd4de 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7a6..04da4732b 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -676,6 +676,8 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
 					"tx buffer on port %u\n", (unsigned) portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/link_status_interrupt/meson.build
+++ b/examples/link_status_interrupt/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index caae8a107..dcba9194c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3ab7d0211..d49d61474 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -496,6 +496,8 @@ app_init_nics(void)
 			}
 		}
 
+		rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start port */
 		ret = rte_eth_dev_start(port);
 		if (ret < 0) {
diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
index 4f7ac3999..19708974c 100644
--- a/examples/load_balancer/meson.build
+++ b/examples/load_balancer/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'lpm'
+allow_experimental_apis = true
 sources = files(
 	'config.c', 'init.c', 'main.c', 'runtime.c'
 )
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7eb..9ba3fa9e8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e92299..59354fad5 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -312,6 +312,7 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
 		return ret;
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'reorder'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bacbd..f158d96b9 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'ptpclient.c'
 )
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 31778fd95..e2cf4b136 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -227,6 +227,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf7c..a1533d08f 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8be..ade8e49c3 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -419,10 +419,12 @@ main(int argc, char **argv)
 
 	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
 
+	rte_eth_dev_set_supported_ptypes(port_rx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_rx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_tx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_tx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
index ef7779f2f..10cd4bc79 100644
--- a/examples/qos_meter/meson.build
+++ b/examples/qos_meter/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'meter'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'rte_policer.c'
 )
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d25371..7d3d3019f 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -58,6 +58,7 @@ else
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index b05206d5a..d165b3dd4 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -138,6 +138,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
 			 ret, portid, 0);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81ce8..5101652af 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
 sources = files(
 	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
 	'init.c', 'main.c', 'stats.c'
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
index 3f10f01c3..e06f4482b 100644
--- a/examples/quota_watermark/qw/Makefile
+++ b/examples/quota_watermark/qw/Makefile
@@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
 
 CFLAGS += -O3 -DQW_SOFTWARE_FC
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 5a0f64f45..4753eb900 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
 				"Failed to setup hardware flow control on port %u (error %d)\n",
 				(unsigned int) port_id, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index dbcd9f4fc..8949f0d93 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -152,6 +152,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 4837bd3ea..acbd12ae2 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
 
 CFLAGS += $(WERROR_FLAGS) -O3
 CFLAGS += -I$(SRCDIR)/../shared
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e28..bbea0c4c9 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -149,6 +149,7 @@ init_port(uint16_t port_num)
 
 	rte_eth_promiscuous_enable(port_num);
 
+	rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port_num);
 	if (retval < 0)
 		return retval;
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac26029..0037d6b25 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index a8a8e98f0..423ce05f8 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -76,6 +76,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'basicfwd.c'
 )
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd92..586838676 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -61,6 +61,7 @@ endif
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index f65d68980..f40b1c0b8 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -11,6 +11,7 @@ if not is_linux
 endif
 deps += ['hash', 'vhost']
 cflags += '-Wno-deprecated-declarations'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'vxlan.c', 'vxlan_setup.c'
 )
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a0880002..219d3e215 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -167,6 +167,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f017..7722e81c7 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -62,6 +62,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 0961db080..3d9f125e5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -321,6 +321,7 @@ port_init(uint16_t port)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..65c2ad179 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -28,6 +28,7 @@ endif
 
 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lvirt
 
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 54c704610..4cb4ccecf 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -99,6 +99,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
index 20a4a05b3..54e2b584f 100644
--- a/examples/vm_power_manager/meson.build
+++ b/examples/vm_power_manager/meson.build
@@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
 	deps += ['pmd_ixgbe']
 endif
 
+allow_experimental_apis = true
 sources = files(
 	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
 )
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee86b..2168747cc 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 EXTRA_CFLAGS += -O3
 
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd7f..65431f95e 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -258,6 +258,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096cfb..ea1574d91 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 389000327..44fe63482 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -313,6 +313,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v10 1/7] ethdev: add set ptype function
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-10  8:46                   ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-10  8:46 UTC (permalink / raw)
  To: pbhagavatula, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev

On 10/9/19 6:33 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add `rte_eth_dev_set_supported_ptypes` function that will allow the
> application to inform the PMD the packet types it is interested in.
> Based on the ptypes set PMDs can optimize their Rx path.
>
> -If application doesn’t want any ptype information it can call
> `rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
> and PMD may skip packet type processing and set rte_mbuf::packet_type to
> RTE_PTYPE_UNKNOWN.
>
> -If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
> return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>
> -If application is interested only in L2/L3 layer, it can inform the PMD
> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
> `rte_eth_dev_set_supported_ptypes(ethdev_id,
> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>
> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

Sorry, but few nits below.

[snip]

> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 17d183e1f..349483707 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -2602,6 +2602,90 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>   	return j;
>   }
>   
> +int
> +rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
> +				 uint32_t *set_ptypes, unsigned int num)
> +{
> +	const uint32_t valid_ptype_masks[] = {
> +		RTE_PTYPE_L2_MASK,
> +		RTE_PTYPE_L3_MASK,
> +		RTE_PTYPE_L4_MASK,
> +		RTE_PTYPE_TUNNEL_MASK,
> +		RTE_PTYPE_INNER_L2_MASK,
> +		RTE_PTYPE_INNER_L3_MASK,
> +		RTE_PTYPE_INNER_L4_MASK,
> +	};
> +	const uint32_t *all_ptypes;
> +	struct rte_eth_dev *dev;
> +	unsigned int i, j;
> +	int ret;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +	dev = &rte_eth_devices[port_id];
> +
> +	if (num > 0 && set_ptypes == NULL)
> +		return -EINVAL;
> +
> +	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
> +			*dev->dev_ops->dev_supported_ptypes_set == NULL) {
> +		ret = 0;
> +		goto ptype_unknown;
> +	}
> +
> +	if (ptype_mask == 0) {
> +		ret = (*dev->dev_ops->dev_supported_ptypes_set)(dev,
> +				ptype_mask);
> +		goto ptype_unknown;
> +	}
> +
> +	for (i = 0; i < sizeof(valid_ptype_masks)/sizeof(valid_ptype_masks[0]);

RTE_DIM should be used instead of sizeof/sizeof

> +									i++) {
> +		uint32_t mask = ptype_mask & valid_ptype_masks[i];
> +		if (mask && mask != valid_ptype_masks[i]) {
> +			ret = -EINVAL;
> +			goto ptype_unknown;
> +		}
> +	}
> +
> +	if (ptype_mask & ~RTE_PTYPE_ALL_MASK) {
> +		ret = -EINVAL;
> +		goto ptype_unknown;
> +	}

It does not protect against more masks added in the future and lost
in your list above but still used in request.
It is better just add extra variable and remove bits
from there while masks are checked in the loop. Then it should be
checked here that the mask is 0 (no bits are left and everything is 
checked).

> +
> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
> +	if (all_ptypes == NULL) {
> +		ret = 0;
> +		goto ptype_unknown;
> +	}
> +
> +	/*
> +	 * Accodommodate as many set_ptypes as possible. If the supplied
> +	 * set_ptypes array is insufficient fill it partially.
> +	 */
> +	for (i = 0, j = 0; set_ptypes != NULL &&
> +				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
> +		if (ptype_mask & all_ptypes[i]) {
> +			if (j < num - 1) {
> +				set_ptypes[j] = all_ptypes[i];
> +				j++;
> +				continue;
> +			}
> +			break;
> +		}
> +	}
> +
> +	if (set_ptypes != NULL && j < num)
> +		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
> +
> +	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
> +
> +ptype_unknown:
> +	if (num > 0)
> +		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
> +
> +	return ret;
> +}
> +
>   void
>   rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>   {

[snip]

^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v11 0/7] ethdev: add new Rx offload flags
  2019-10-09 15:33               ` [dpdk-dev] [PATCH v10 0/7] ethdev: add new Rx offload flags pbhagavatula
                                   ` (6 preceding siblings ...)
  2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-10-10 10:51                 ` pbhagavatula
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 1/7] ethdev: add set ptype function pbhagavatula
                                     ` (7 more replies)
  7 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-10 10:51 UTC (permalink / raw)
  To: arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
`DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
					  NULL, 0);

v11 Changes:
-----------
- Use RTE_DIM to get array size.
- Since we are using a list of MASKs to validate ptype_mask return -EINVAL
  if any unknown mask is set.
- Rebase to TOT.

v10 Changes:
-----------
- Modify ptype_mask validation in set_supported_ptypes.(Andrew)

v9 Changes:
----------
- Add ptype_mask validation in set_supported_ptypes.(Andrew)
- Make description more verbose.

v8 Changes:
----------
- Make description more verbose.
- Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
  is not supported by ethernet device.

v7 Changes:
----------
- Fix unused variable in net/octeontx2

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.


Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add flow action type update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  drivers/net: update Rx flow flag and mark capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples: disable Rx packet type parsing

 doc/guides/nics/features.rst                  |  22 +++-
 doc/guides/rel_notes/release_19_11.rst        |  24 ++++
 drivers/net/bnxt/bnxt_ethdev.c                |   4 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   3 +-
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_res.c                   |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   3 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   3 +-
 drivers/net/i40e/i40e_ethdev.c                |   4 +-
 drivers/net/iavf/iavf_ethdev.c                |   4 +-
 drivers/net/ice/ice_ethdev.c                  |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |   4 +-
 drivers/net/liquidio/lio_ethdev.c             |   3 +-
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   4 +-
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   3 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  16 ++-
 drivers/net/octeontx2/otx2_flow.c             |   9 +-
 drivers/net/octeontx2/otx2_flow.h             |   1 -
 drivers/net/octeontx2/otx2_flow_parse.c       |   5 +-
 drivers/net/qede/qede_ethdev.c                |   3 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   3 +-
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   3 +-
 examples/bbdev_app/main.c                     |   1 +
 examples/bond/main.c                          |   2 +
 examples/distributor/Makefile                 |   1 +
 examples/distributor/main.c                   |   1 +
 examples/distributor/meson.build              |   1 +
 examples/eventdev_pipeline/main.c             | 122 +----------------
 examples/eventdev_pipeline/meson.build        |   1 +
 .../pipeline_worker_generic.c                 | 124 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 120 +++++++++++++++++
 examples/exception_path/Makefile              |   1 +
 examples/exception_path/main.c                |   1 +
 examples/exception_path/meson.build           |   1 +
 examples/flow_classify/flow_classify.c        |   1 +
 examples/flow_filtering/Makefile              |   1 +
 examples/flow_filtering/main.c                |   1 +
 examples/flow_filtering/meson.build           |   1 +
 examples/ip_pipeline/link.c                   |   1 +
 examples/ip_reassembly/Makefile               |   1 +
 examples/ip_reassembly/main.c                 |   2 +
 examples/ip_reassembly/meson.build            |   1 +
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +
 examples/ipv4_multicast/Makefile              |   1 +
 examples/ipv4_multicast/main.c                |   2 +
 examples/ipv4_multicast/meson.build           |   1 +
 examples/kni/main.c                           |   1 +
 examples/l2fwd-cat/Makefile                   |   1 +
 examples/l2fwd-cat/l2fwd-cat.c                |   1 +
 examples/l2fwd-cat/meson.build                |   1 +
 examples/l2fwd-crypto/main.c                  |   2 +
 examples/l2fwd-jobstats/Makefile              |   1 +
 examples/l2fwd-jobstats/main.c                |   2 +
 examples/l2fwd-jobstats/meson.build           |   1 +
 examples/l2fwd-keepalive/Makefile             |   1 +
 examples/l2fwd-keepalive/main.c               |   2 +
 examples/l2fwd-keepalive/meson.build          |   1 +
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 examples/l3fwd-acl/Makefile                   |   1 +
 examples/l3fwd-acl/main.c                     |   2 +
 examples/l3fwd-acl/meson.build                |   1 +
 examples/l3fwd-vf/Makefile                    |   1 +
 examples/l3fwd-vf/main.c                      |   2 +
 examples/l3fwd-vf/meson.build                 |   1 +
 examples/link_status_interrupt/Makefile       |   1 +
 examples/link_status_interrupt/main.c         |   2 +
 examples/link_status_interrupt/meson.build    |   1 +
 examples/load_balancer/Makefile               |   1 +
 examples/load_balancer/init.c                 |   2 +
 examples/load_balancer/meson.build            |   1 +
 examples/packet_ordering/Makefile             |   1 +
 examples/packet_ordering/main.c               |   1 +
 examples/packet_ordering/meson.build          |   1 +
 examples/ptpclient/Makefile                   |   1 +
 examples/ptpclient/meson.build                |   1 +
 examples/ptpclient/ptpclient.c                |   1 +
 examples/qos_meter/Makefile                   |   1 +
 examples/qos_meter/main.c                     |   2 +
 examples/qos_meter/meson.build                |   1 +
 examples/qos_sched/Makefile                   |   1 +
 examples/qos_sched/init.c                     |   1 +
 examples/qos_sched/meson.build                |   1 +
 examples/quota_watermark/qw/Makefile          |   1 +
 examples/quota_watermark/qw/init.c            |   1 +
 examples/rxtx_callbacks/main.c                |   1 +
 examples/server_node_efd/server/Makefile      |   1 +
 examples/server_node_efd/server/init.c        |   1 +
 examples/skeleton/Makefile                    |   1 +
 examples/skeleton/basicfwd.c                  |   1 +
 examples/skeleton/meson.build                 |   1 +
 examples/tep_termination/Makefile             |   1 +
 examples/tep_termination/meson.build          |   1 +
 examples/tep_termination/vxlan_setup.c        |   1 +
 examples/vhost/Makefile                       |   1 +
 examples/vhost/main.c                         |   1 +
 examples/vm_power_manager/Makefile            |   1 +
 examples/vm_power_manager/main.c              |   1 +
 examples/vm_power_manager/meson.build         |   1 +
 examples/vmdq/Makefile                        |   1 +
 examples/vmdq/main.c                          |   1 +
 examples/vmdq/meson.build                     |   1 +
 examples/vmdq_dcb/Makefile                    |   1 +
 examples/vmdq_dcb/main.c                      |   1 +
 examples/vmdq_dcb/meson.build                 |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  88 +++++++++++++
 lib/librte_ethdev/rte_ethdev.h                |  39 ++++++
 lib/librte_ethdev/rte_ethdev_core.h           |  19 +++
 lib/librte_ethdev/rte_ethdev_version.map      |   3 +
 lib/librte_ethdev/rte_flow.h                  |   6 +-
 119 files changed, 604 insertions(+), 167 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v11 1/7] ethdev: add set ptype function
  2019-10-10 10:51                 ` [dpdk-dev] [PATCH v11 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-10-10 10:51                   ` pbhagavatula
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-10 10:51 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst             |  8 ++-
 doc/guides/rel_notes/release_19_11.rst   |  8 +++
 lib/librte_ethdev/rte_ethdev.c           | 86 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 37 ++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      | 19 ++++++
 lib/librte_ethdev/rte_ethdev_version.map |  3 +
 6 files changed, 159 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index c4e128d2f..1756fa73a 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,13 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+  ``dev_supported_ptypes_set``.
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 02fc8fbd3..39b191117 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -85,6 +85,14 @@ New Features
   Added stateful decompression support in the Intel QuickAssist Technology PMD.
   Please note that stateful compression is not supported.
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 30b0c7803..30b873389 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2619,6 +2619,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	const uint32_t valid_ptype_masks[] = {
+		RTE_PTYPE_L2_MASK,
+		RTE_PTYPE_L3_MASK,
+		RTE_PTYPE_L4_MASK,
+		RTE_PTYPE_TUNNEL_MASK,
+		RTE_PTYPE_INNER_L2_MASK,
+		RTE_PTYPE_INNER_L3_MASK,
+		RTE_PTYPE_INNER_L4_MASK,
+	};
+	const uint32_t *all_ptypes;
+	struct rte_eth_dev *dev;
+	uint32_t unused_mask;
+	unsigned int i, j;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
+			*dev->dev_ops->dev_supported_ptypes_set == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	if (ptype_mask == 0) {
+		ret = (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+		goto ptype_unknown;
+	}
+
+	unused_mask = ptype_mask;
+	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
+		uint32_t mask = ptype_mask & valid_ptype_masks[i];
+		if (mask && mask != valid_ptype_masks[i]) {
+			ret = -EINVAL;
+			goto ptype_unknown;
+		}
+		unused_mask &= ~valid_ptype_masks[i];
+	}
+
+	if (unused_mask) {
+		ret = -EINVAL;
+		goto ptype_unknown;
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	/*
+	 * Accodommodate as many set_ptypes as possible. If the supplied
+	 * set_ptypes array is insufficient fill it partially.
+	 */
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL && j < num)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+
+ptype_unknown:
+	if (num > 0)
+		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+	return ret;
+}
+
 void
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 475dbdae1..8247b37f6 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2435,6 +2435,43 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification the recipient is
+ * interested in.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, unsigned int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 2394b32c8..37bb57247 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -110,6 +110,23 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+/**
+ * @internal
+ * Inform an Ethernet device about packet types classifications the recipient
+ * is interested in.
+ *
+ * @param dev
+ *   The Ethernet device identifier.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @return
+ *   - (0) if Success.
+ *   - (-EINVAL) if *ptype_mask* is invalid.
+ */
+typedef int (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -421,6 +438,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform Ethernet device about packet types the recipient is interested in. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6df42a47b..e14745b9c 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -283,4 +283,7 @@ EXPERIMENTAL {
 
 	# added in 19.08
 	rte_eth_read_clock;
+
+	# added in 19.11
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v11 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-10 10:51                 ` [dpdk-dev] [PATCH v11 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-10 10:51                   ` pbhagavatula
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 3/7] ethdev: add flow action type " pbhagavatula
                                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-10 10:51 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 2 ++
 doc/guides/rel_notes/release_19_11.rst | 7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 1 +
 lib/librte_ethdev/rte_ethdev.h         | 1 +
 4 files changed, 11 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 1756fa73a..f7c6d918f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 39b191117..9cf61a748 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -93,6 +93,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 30b873389..116478d46 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 8247b37f6..fb696baed 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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v11 3/7] ethdev: add flow action type update as an offload
  2019-10-10 10:51                 ` [dpdk-dev] [PATCH v11 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 1/7] ethdev: add set ptype function pbhagavatula
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-10 10:51                   ` pbhagavatula
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-10 10:51 UTC (permalink / raw)
  To: arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Ferruh Yigit, Adrien Mazarguil
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 12 ++++++++++++
 doc/guides/rel_notes/release_19_11.rst |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.c         |  1 +
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 lib/librte_ethdev/rte_flow.h           |  6 ++++--
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f7c6d918f..9737ff7a1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@ Allows application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 9cf61a748..33d4f428d 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -100,6 +100,15 @@ New Features
   *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
      by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
 
+* **Added Rx offload flag to enable or disable flow action type update**
+
+  *  Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
+     `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
+     `RTE_FLOW_ACTION_FLAG` are enabled.
+  *  PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the application
+     by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 116478d46..5b1800f00 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index fb696baed..39e84358e 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1014,6 +1014,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index 354cb1dd0..5d62686c0 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1316,7 +1316,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1324,7 +1325,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * No associated configuration structure.
 	 */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v11 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-10 10:51                 ` [dpdk-dev] [PATCH v11 0/7] ethdev: add new Rx offload flags pbhagavatula
                                     ` (2 preceding siblings ...)
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-10-10 10:51                   ` pbhagavatula
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
                                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-10 10:51 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 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/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
 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/liquidio/lio_ethdev.c    |  3 ++-
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
 25 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b521a7296..034814a35 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_RSS_HASH)
 
 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..22e61a55c 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_RSS_HASH)
 
 
 #define CXGBE_DEVARG_KEEP_OVLAN "keep_ovlan"
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 25deadb94..7ba4c0e53 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_RSS_HASH;
 
 /* 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 879bbc120..be02646d7 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_RSS_HASH;
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 9405e1933..607a085f8 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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 8cb7337ea..27b4850e3 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1799,7 +1799,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 17a3625d6..83ed6a98e 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -680,7 +680,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->rx_offload_capa = 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_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 390cb2196..62ae976cd 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_RSS_HASH;
 
 	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 99b1f43b8..bae807ceb 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_RSS_HASH;
 	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 3214ed601..df30a975e 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2275,7 +2275,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index d97e357e3..4a1bce58f 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -407,7 +407,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	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..b5fd57693 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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 3d5b99c94..d92fbb169 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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index b84128fef..2e88d1844 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -569,7 +569,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 5de0a1d4d..81cce03bf 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_RSS_HASH)
 
 #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 d2e3d36d6..509cc2f0e 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1288,7 +1288,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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 3ed34f825..5ebe3f6a5 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 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] 246+ messages in thread

* [dpdk-dev] [PATCH v11 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-10-10 10:51                 ` [dpdk-dev] [PATCH v11 0/7] ethdev: add new Rx offload flags pbhagavatula
                                     ` (3 preceding siblings ...)
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-10 10:51                   ` pbhagavatula
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-10 10:51 UTC (permalink / raw)
  To: arybchenko, jerinj, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu, Wenzhuo Lu,
	Qiming Yang, Konstantin Ananyev, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Nithin Dabilpuram, Kiran Kumar K
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
flag and mark.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 3 ++-
 drivers/net/enic/enic_res.c             | 3 ++-
 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/mlx5/mlx5_rxq.c             | 3 ++-
 drivers/net/octeontx2/otx2_ethdev.h     | 3 ++-
 drivers/net/octeontx2/otx2_flow.c       | 9 ++-------
 drivers/net/octeontx2/otx2_flow.h       | 1 -
 drivers/net/octeontx2/otx2_flow_parse.c | 5 +----
 drivers/net/sfc/sfc_ef10_essb_rx.c      | 3 ++-
 12 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 034814a35..924bdda00 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -161,7 +161,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_JUMBO_FRAME | \
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_RSS_HASH)
+				     DEV_RX_OFFLOAD_RSS_HASH | \
+				     DEV_RX_OFFLOAD_FLOW_MARK)
 
 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/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 607a085f8..3503d5d7e 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -199,7 +199,8 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 62ae976cd..c23a245f7 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3512,7 +3512,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_VLAN_EXTEND |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 
 	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 bae807ceb..6680b1948 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -518,7 +518,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_SCATTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	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 df30a975e..8f8b1852d 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2276,7 +2276,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 			DEV_RX_OFFLOAD_VLAN_EXTEND |
-			DEV_RX_OFFLOAD_RSS_HASH;
+			DEV_RX_OFFLOAD_RSS_HASH |
+			DEV_RX_OFFLOAD_FLOW_MARK;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index fa572d184..1481e2426 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
 		   DEV_RX_OFFLOAD_VLAN_FILTER |
 		   DEV_RX_OFFLOAD_SCATTER |
-		   DEV_RX_OFFLOAD_RSS_HASH;
+		   DEV_RX_OFFLOAD_RSS_HASH |
+		   DEV_RX_OFFLOAD_FLOW_MARK;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index b5fd57693..1bf01bda3 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
 	uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
 			     DEV_RX_OFFLOAD_TIMESTAMP |
 			     DEV_RX_OFFLOAD_JUMBO_FRAME |
-			     DEV_RX_OFFLOAD_RSS_HASH);
+			     DEV_RX_OFFLOAD_RSS_HASH |
+			     DEV_RX_OFFLOAD_FLOW_MARK);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 81cce03bf..7884153ce 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -141,7 +141,8 @@
 	DEV_RX_OFFLOAD_VLAN_FILTER	| \
 	DEV_RX_OFFLOAD_QINQ_STRIP	| \
 	DEV_RX_OFFLOAD_TIMESTAMP	| \
-	DEV_RX_OFFLOAD_RSS_HASH)
+	DEV_RX_OFFLOAD_RSS_HASH		| \
+	DEV_RX_OFFLOAD_FLOW_MARK)
 
 #define NIX_DEFAULT_RSS_CTX_GROUP  0
 #define NIX_DEFAULT_RSS_MCAM_IDX  -1
diff --git a/drivers/net/octeontx2/otx2_flow.c b/drivers/net/octeontx2/otx2_flow.c
index bdbf123a9..ea4e380b1 100644
--- a/drivers/net/octeontx2/otx2_flow.c
+++ b/drivers/net/octeontx2/otx2_flow.c
@@ -524,11 +524,8 @@ otx2_flow_destroy(struct rte_eth_dev *dev,
 		NIX_RX_ACT_MATCH_MASK;
 
 	if (match_id && match_id < OTX2_FLOW_ACTION_FLAG_DEFAULT) {
-		if (rte_atomic32_read(&npc->mark_actions) == 0)
-			return -EINVAL;
-
-		/* Clear mark offload flag if there are no more mark actions */
-		if (rte_atomic32_sub_return(&npc->mark_actions, 1) == 0) {
+		/* Clear mark offload flag if there is no more mark action */
+		if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 			hw->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F;
 			otx2_eth_set_rx_function(dev);
 		}
@@ -821,8 +818,6 @@ otx2_flow_init(struct otx2_eth_dev *hw)
 		return rc;
 	}
 
-	rte_atomic32_init(&npc->mark_actions);
-
 	npc->mcam_entries = NPC_MCAM_TOT_ENTRIES >> npc->keyw[NPC_MCAM_RX];
 	/* Free, free_rev, live and live_rev entries */
 	bmap_sz = rte_bitmap_get_memory_footprint(npc->mcam_entries);
diff --git a/drivers/net/octeontx2/otx2_flow.h b/drivers/net/octeontx2/otx2_flow.h
index ab068b088..85129cc9d 100644
--- a/drivers/net/octeontx2/otx2_flow.h
+++ b/drivers/net/octeontx2/otx2_flow.h
@@ -160,7 +160,6 @@ TAILQ_HEAD(otx2_flow_list, rte_flow);
 
 /* Accessed from ethdev private - otx2_eth_dev */
 struct otx2_npc_flow_info {
-	rte_atomic32_t mark_actions;
 	uint32_t keyx_supp_nmask[NPC_MAX_INTF];/* nibble mask */
 	uint32_t keyx_len[NPC_MAX_INTF];	/* per intf key len in bits */
 	uint32_t datax_len[NPC_MAX_INTF];	/* per intf data len in bits */
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6670c1a70..541479445 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -761,7 +761,6 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			struct rte_flow *flow)
 {
 	struct otx2_eth_dev *hw = dev->data->dev_private;
-	struct otx2_npc_flow_info *npc = &hw->npc_flow;
 	const struct rte_flow_action_count *act_count;
 	const struct rte_flow_action_mark *act_mark;
 	const struct rte_flow_action_queue *act_q;
@@ -795,13 +794,11 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			}
 			mark = act_mark->id + 1;
 			req_act |= OTX2_FLOW_ACT_MARK;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_FLAG:
 			mark = OTX2_FLOW_FLAG_VAL;
 			req_act |= OTX2_FLOW_ACT_FLAG;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_COUNT:
@@ -979,7 +976,7 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 	if (mark)
 		flow->npc_action |= (uint64_t)mark << 40;
 
-	if (rte_atomic32_read(&npc->mark_actions) == 1) {
+	if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 		hw->rx_offload_flags |=
 			NIX_RX_OFFLOAD_MARK_UPDATE_F;
 		otx2_eth_set_rx_function(dev);
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 220ef0e47..1887731e2 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v11 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-10 10:51                 ` [dpdk-dev] [PATCH v11 0/7] ethdev: add new Rx offload flags pbhagavatula
                                     ` (4 preceding siblings ...)
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-10-10 10:51                   ` pbhagavatula
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 7/7] examples: disable Rx packet type parsing pbhagavatula
  2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-10 10:51 UTC (permalink / raw)
  To: arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 120 -----------------
 .../pipeline_worker_generic.c                 | 124 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 120 +++++++++++++++++
 3 files changed, 244 insertions(+), 120 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index 3789fbfd7..d3ff1bbe4 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,125 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	retval = rte_eth_dev_info_get(port, &dev_info);
-	if (retval != 0) {
-		printf("Error during getting device (port %u) info: %s\n",
-				port, strerror(-retval));
-		return retval;
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	rte_eth_macaddr_get(port, &addr);
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	rte_eth_promiscuous_enable(port);
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
-
 static void
 do_capability_setup(uint8_t eventdev_id)
 {
@@ -507,7 +388,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..6bc9203ec 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,129 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +420,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 8961cd656..03ff762b3 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,125 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	rte_eth_macaddr_get(port, &addr);
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	rte_eth_promiscuous_enable(port);
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +740,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v11 7/7] examples: disable Rx packet type parsing
  2019-10-10 10:51                 ` [dpdk-dev] [PATCH v11 0/7] ethdev: add new Rx offload flags pbhagavatula
                                     ` (5 preceding siblings ...)
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-10 10:51                   ` pbhagavatula
  2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-10 10:51 UTC (permalink / raw)
  To: arybchenko, jerinj, Nicolas Chautru, Chas Williams, David Hunt,
	Harry van Haaren, Marko Kovacevic, Ori Kam, Bruce Richardson,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki, Bernard Iremonger,
	Cristian Dumitrescu, Konstantin Ananyev, Ferruh Yigit,
	Declan Doherty, Reshma Pattan, John McNamara, Xiaoyun Li,
	Jasvinder Singh, Byron Marohn, Yipeng Wang, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing in examples that don't use
`rte_mbuf::packet_type` by setting ptype_mask as 0 in
`rte_eth_dev_set_supported_ptypes`

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/bbdev_app/main.c                  | 1 +
 examples/bond/main.c                       | 2 ++
 examples/distributor/Makefile              | 1 +
 examples/distributor/main.c                | 1 +
 examples/distributor/meson.build           | 1 +
 examples/eventdev_pipeline/main.c          | 2 ++
 examples/eventdev_pipeline/meson.build     | 1 +
 examples/exception_path/Makefile           | 1 +
 examples/exception_path/main.c             | 1 +
 examples/exception_path/meson.build        | 1 +
 examples/flow_classify/flow_classify.c     | 1 +
 examples/flow_filtering/Makefile           | 1 +
 examples/flow_filtering/main.c             | 1 +
 examples/flow_filtering/meson.build        | 1 +
 examples/ip_pipeline/link.c                | 1 +
 examples/ip_reassembly/Makefile            | 1 +
 examples/ip_reassembly/main.c              | 2 ++
 examples/ip_reassembly/meson.build         | 1 +
 examples/ipsec-secgw/ipsec-secgw.c         | 2 ++
 examples/ipv4_multicast/Makefile           | 1 +
 examples/ipv4_multicast/main.c             | 2 ++
 examples/ipv4_multicast/meson.build        | 1 +
 examples/kni/main.c                        | 1 +
 examples/l2fwd-cat/Makefile                | 1 +
 examples/l2fwd-cat/l2fwd-cat.c             | 1 +
 examples/l2fwd-cat/meson.build             | 1 +
 examples/l2fwd-crypto/main.c               | 2 ++
 examples/l2fwd-jobstats/Makefile           | 1 +
 examples/l2fwd-jobstats/main.c             | 2 ++
 examples/l2fwd-jobstats/meson.build        | 1 +
 examples/l2fwd-keepalive/Makefile          | 1 +
 examples/l2fwd-keepalive/main.c            | 2 ++
 examples/l2fwd-keepalive/meson.build       | 1 +
 examples/l2fwd/Makefile                    | 1 +
 examples/l2fwd/main.c                      | 2 ++
 examples/l2fwd/meson.build                 | 1 +
 examples/l3fwd-acl/Makefile                | 1 +
 examples/l3fwd-acl/main.c                  | 2 ++
 examples/l3fwd-acl/meson.build             | 1 +
 examples/l3fwd-vf/Makefile                 | 1 +
 examples/l3fwd-vf/main.c                   | 2 ++
 examples/l3fwd-vf/meson.build              | 1 +
 examples/link_status_interrupt/Makefile    | 1 +
 examples/link_status_interrupt/main.c      | 2 ++
 examples/link_status_interrupt/meson.build | 1 +
 examples/load_balancer/Makefile            | 1 +
 examples/load_balancer/init.c              | 2 ++
 examples/load_balancer/meson.build         | 1 +
 examples/packet_ordering/Makefile          | 1 +
 examples/packet_ordering/main.c            | 1 +
 examples/packet_ordering/meson.build       | 1 +
 examples/ptpclient/Makefile                | 1 +
 examples/ptpclient/meson.build             | 1 +
 examples/ptpclient/ptpclient.c             | 1 +
 examples/qos_meter/Makefile                | 1 +
 examples/qos_meter/main.c                  | 2 ++
 examples/qos_meter/meson.build             | 1 +
 examples/qos_sched/Makefile                | 1 +
 examples/qos_sched/init.c                  | 1 +
 examples/qos_sched/meson.build             | 1 +
 examples/quota_watermark/qw/Makefile       | 1 +
 examples/quota_watermark/qw/init.c         | 1 +
 examples/rxtx_callbacks/main.c             | 1 +
 examples/server_node_efd/server/Makefile   | 1 +
 examples/server_node_efd/server/init.c     | 1 +
 examples/skeleton/Makefile                 | 1 +
 examples/skeleton/basicfwd.c               | 1 +
 examples/skeleton/meson.build              | 1 +
 examples/tep_termination/Makefile          | 1 +
 examples/tep_termination/meson.build       | 1 +
 examples/tep_termination/vxlan_setup.c     | 1 +
 examples/vhost/Makefile                    | 1 +
 examples/vhost/main.c                      | 1 +
 examples/vm_power_manager/Makefile         | 1 +
 examples/vm_power_manager/main.c           | 1 +
 examples/vm_power_manager/meson.build      | 1 +
 examples/vmdq/Makefile                     | 1 +
 examples/vmdq/main.c                       | 1 +
 examples/vmdq/meson.build                  | 1 +
 examples/vmdq_dcb/Makefile                 | 1 +
 examples/vmdq_dcb/main.c                   | 1 +
 examples/vmdq_dcb/meson.build              | 1 +
 82 files changed, 96 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 9acf666dc..277725a6b 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -478,6 +478,7 @@ initialize_ports(struct app_config_params *app_params,
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 
 	rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
 	print_mac(port_id, &bbdev_port_eth_addr);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index be62c1713..30c54c35c 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -200,6 +200,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				portid, retval);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(portid);
 	if (retval < 0)
 		rte_exit(retval,
@@ -281,6 +282,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
+	rte_eth_dev_set_supported_ptypes(BOND_PORT, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(BOND_PORT);
 	if (retval < 0)
 		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d5578..a2a477279 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 8942f3607..c1f34908b 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -168,6 +168,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 26f108d65..c2976f6bd 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -10,6 +10,7 @@
 build = dpdk_conf.has('RTE_LIBRTE_POWER')
 
 deps += ['distributor', 'power']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index d3ff1bbe4..4c7700795 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -392,6 +392,8 @@ main(int argc, char **argv)
 
 	/* Start the Ethernet port. */
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		err = rte_eth_dev_start(portid);
 		if (err < 0)
 			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
index a54c35aa7..0fc916b05 100644
--- a/examples/eventdev_pipeline/meson.build
+++ b/examples/eventdev_pipeline/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'eventdev'
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 	'pipeline_worker_generic.c',
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 90c7f133a..a7c961276 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index d7f3598af..cbacc5c28 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -469,6 +469,7 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		FATAL_ERROR("Could not start port%u (%d)", port, ret);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 2130c13d8..2b54175f4 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -237,6 +237,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	}
 
 	/* Start the Ethernet port. */
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a75555..793a08fae 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index fe064fa02..dad603e39 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -181,6 +181,7 @@ init_port(void)
 	}
 
 	rte_eth_promiscuous_enable(port_id);
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
 		rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index 407795c42..6f5d1b08a 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 )
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 4e3a40b5a..bcd2a941c 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -206,6 +206,7 @@ link_create(const char *name, struct link_params *params)
 			return NULL;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Port start */
 	status = rte_eth_dev_start(port_id);
 	if (status < 0)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904e0..19c462388 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 87d4b5c01..c3f9b2b72 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1163,6 +1163,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 5ed41312e..b6df263ce 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2455,6 +2455,8 @@ main(int32_t argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/*
 		 * Start device
 		 * note: device must be started before a flow rule
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67dd4..5171f7ab2 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 1ee3b61d1..6cd8c5ba5 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -770,6 +770,8 @@ main(int argc, char **argv)
 			qconf->tx_queue_id[portid] = queueid;
 			queueid++;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		rte_eth_allmulticast_enable(portid);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'hash'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/kni/main.c b/examples/kni/main.c
index e43f17447..cc8a087fa 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -631,6 +631,7 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6d3..d6a25e42a 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -66,6 +66,7 @@ endif
 EXTRA_CFLAGS += -O3 -g -Wfatal-errors
 
 CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
 LDLIBS += -lpqos
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index b34b40a00..a54a1ed25 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 4e2777a03..37c96040d 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
 ext_deps += pqos
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
+allow_experimental_apis = true
 sources = files(
 	'cat.c', 'l2fwd-cat.c'
 )
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 9a370f2de..dd13825e6 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2566,6 +2566,8 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			return -1;
 		}
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		retval = rte_eth_dev_start(portid);
 		if (retval < 0) {
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e93..09834e979 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 5fcba5c88..7eb7c1156 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -908,6 +908,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['jobstats', 'timer']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a6f..584257ae2 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS += -lrt
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index a05139068..b35a8fc85 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -702,6 +702,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
 
 ext_deps += cc.find_library('rt')
 deps += 'timer'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'shm.c'
 )
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 8d4c53981..390510f9e 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -700,6 +700,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f71..df590f8e9 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 60531ce0e..47ace9037 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2072,6 +2072,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index 7b186a23c..db7f51f2f 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 572e74cf5..5bf70f52d 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1051,6 +1051,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14a8..6ddedd4de 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 0c3dfc691..a175964f5 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -682,6 +682,8 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
 					"tx buffer on port %u\n", (unsigned) portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/link_status_interrupt/meson.build
+++ b/examples/link_status_interrupt/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index caae8a107..dcba9194c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 660f5a8ed..7dd4de274 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -501,6 +501,8 @@ app_init_nics(void)
 			}
 		}
 
+		rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start port */
 		ret = rte_eth_dev_start(port);
 		if (ret < 0) {
diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
index 4f7ac3999..19708974c 100644
--- a/examples/load_balancer/meson.build
+++ b/examples/load_balancer/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'lpm'
+allow_experimental_apis = true
 sources = files(
 	'config.c', 'init.c', 'main.c', 'runtime.c'
 )
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7eb..9ba3fa9e8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index a99961f82..71e3b4015 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -318,6 +318,7 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
 		return ret;
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'reorder'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bacbd..f158d96b9 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'ptpclient.c'
 )
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index bc427a526..040bb8355 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -234,6 +234,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf7c..a1533d08f 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index 13c85e940..7e4cc6e0c 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -431,10 +431,12 @@ main(int argc, char **argv)
 
 	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
 
+	rte_eth_dev_set_supported_ptypes(port_rx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_rx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_tx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_tx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
index ef7779f2f..10cd4bc79 100644
--- a/examples/qos_meter/meson.build
+++ b/examples/qos_meter/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'meter'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'rte_policer.c'
 )
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d25371..7d3d3019f 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -58,6 +58,7 @@ else
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index cf9e8f4ac..4ec6ab445 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -144,6 +144,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
 			 ret, portid, 0);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81ce8..5101652af 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
 sources = files(
 	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
 	'init.c', 'main.c', 'stats.c'
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
index 3f10f01c3..e06f4482b 100644
--- a/examples/quota_watermark/qw/Makefile
+++ b/examples/quota_watermark/qw/Makefile
@@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
 
 CFLAGS += -O3 -DQW_SOFTWARE_FC
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 5a0f64f45..4753eb900 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
 				"Failed to setup hardware flow control on port %u (error %d)\n",
 				(unsigned int) port_id, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index 9fd4b8efd..8995557f2 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -159,6 +159,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 4837bd3ea..acbd12ae2 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
 
 CFLAGS += $(WERROR_FLAGS) -O3
 CFLAGS += -I$(SRCDIR)/../shared
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index 773780b4d..995fc125e 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -152,6 +152,7 @@ init_port(uint16_t port_num)
 
 	rte_eth_promiscuous_enable(port_num);
 
+	rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port_num);
 	if (retval < 0)
 		return retval;
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac26029..0037d6b25 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index 171ebde7b..54cc1921f 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -82,6 +82,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'basicfwd.c'
 )
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd92..586838676 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -61,6 +61,7 @@ endif
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index f65d68980..f40b1c0b8 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -11,6 +11,7 @@ if not is_linux
 endif
 deps += ['hash', 'vhost']
 cflags += '-Wno-deprecated-declarations'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'vxlan.c', 'vxlan_setup.c'
 )
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 8d6514dd8..37b9f3d34 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -171,6 +171,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f017..7722e81c7 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -62,6 +62,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 794d12ba7..6a88d62a3 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -328,6 +328,7 @@ port_init(uint16_t port)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..65c2ad179 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -28,6 +28,7 @@ endif
 
 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lvirt
 
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 0f48ae926..be9342f92 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -105,6 +105,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
index 20a4a05b3..54e2b584f 100644
--- a/examples/vm_power_manager/meson.build
+++ b/examples/vm_power_manager/meson.build
@@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
 	deps += ['pmd_ixgbe']
 endif
 
+allow_experimental_apis = true
 sources = files(
 	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
 )
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee86b..2168747cc 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 EXTRA_CFLAGS += -O3
 
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 91f9a9904..7e337f92c 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -270,6 +270,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096cfb..ea1574d91 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 2122e41f5..1e3c490e1 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -327,6 +327,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v12 0/7] ethdev: add new Rx offload flags
  2019-10-10 10:51                 ` [dpdk-dev] [PATCH v11 0/7] ethdev: add new Rx offload flags pbhagavatula
                                     ` (6 preceding siblings ...)
  2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-10-17 12:02                   ` pbhagavatula
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 1/7] ethdev: add set ptype function pbhagavatula
                                       ` (8 more replies)
  7 siblings, 9 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-17 12:02 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

 Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
 `DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
 enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
 and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

 Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
 allows application to inform PMDs about the packet types it is interested
 in. Based on ptypes requested by application PMDs can optimize the Rx path.

 For example, if a given PMD doesn't support any packet types that the
 application is interested in then the application can disable[1] writes to
 `mbuf.packet_type` done by the PMD and use a software ptype parser.
      [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
					  NULL, 0);

v12 Changes:
-----------
- Rebase onto next-net.

v11 Changes:
-----------
- Use RTE_DIM to get array size.
- Since we are using a list of MASKs to validate ptype_mask return -EINVAL
  if any unknown mask is set.
- Rebase to TOT.

v10 Changes:
-----------
- Modify ptype_mask validation in set_supported_ptypes.(Andrew)

v9 Changes:
----------
- Add ptype_mask validation in set_supported_ptypes.(Andrew)
- Make description more verbose.

v8 Changes:
----------
- Make description more verbose.
- Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
  is not supported by ethernet device.

v7 Changes:
----------
- Fix unused variable in net/octeontx2

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.

Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add flow action type update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  drivers/net: update Rx flow flag and mark capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples: disable Rx packet type parsing

 doc/guides/nics/features.rst                  |  22 ++-
 doc/guides/rel_notes/release_19_11.rst        |  24 ++++
 drivers/net/bnxt/bnxt_ethdev.c                |   4 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   3 +-
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_res.c                   |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   3 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   3 +-
 drivers/net/i40e/i40e_ethdev.c                |   4 +-
 drivers/net/iavf/iavf_ethdev.c                |   4 +-
 drivers/net/ice/ice_ethdev.c                  |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |   4 +-
 drivers/net/liquidio/lio_ethdev.c             |   3 +-
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   4 +-
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   3 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  16 ++-
 drivers/net/octeontx2/otx2_flow.c             |   9 +-
 drivers/net/octeontx2/otx2_flow.h             |   1 -
 drivers/net/octeontx2/otx2_flow_parse.c       |   5 +-
 drivers/net/qede/qede_ethdev.c                |   3 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   3 +-
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   3 +-
 examples/bbdev_app/main.c                     |   2 +
 examples/bond/main.c                          |   2 +
 examples/distributor/Makefile                 |   1 +
 examples/distributor/main.c                   |   1 +
 examples/distributor/meson.build              |   1 +
 examples/eventdev_pipeline/main.c             | 130 +----------------
 examples/eventdev_pipeline/meson.build        |   1 +
 .../pipeline_worker_generic.c                 | 132 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 +++++++++++++++++
 examples/exception_path/Makefile              |   1 +
 examples/exception_path/main.c                |   1 +
 examples/exception_path/meson.build           |   1 +
 examples/flow_classify/flow_classify.c        |   1 +
 examples/flow_filtering/Makefile              |   1 +
 examples/flow_filtering/main.c                |   2 +
 examples/flow_filtering/meson.build           |   1 +
 examples/ip_pipeline/link.c                   |   1 +
 examples/ip_reassembly/Makefile               |   1 +
 examples/ip_reassembly/main.c                 |   2 +
 examples/ip_reassembly/meson.build            |   1 +
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +
 examples/ipv4_multicast/Makefile              |   1 +
 examples/ipv4_multicast/main.c                |   3 +
 examples/ipv4_multicast/meson.build           |   1 +
 examples/kni/main.c                           |   1 +
 examples/l2fwd-cat/Makefile                   |   1 +
 examples/l2fwd-cat/l2fwd-cat.c                |   1 +
 examples/l2fwd-cat/meson.build                |   1 +
 examples/l2fwd-crypto/main.c                  |   2 +
 examples/l2fwd-jobstats/Makefile              |   1 +
 examples/l2fwd-jobstats/main.c                |   2 +
 examples/l2fwd-jobstats/meson.build           |   1 +
 examples/l2fwd-keepalive/Makefile             |   1 +
 examples/l2fwd-keepalive/main.c               |   2 +
 examples/l2fwd-keepalive/meson.build          |   1 +
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 examples/l3fwd-acl/Makefile                   |   1 +
 examples/l3fwd-acl/main.c                     |   2 +
 examples/l3fwd-acl/meson.build                |   1 +
 examples/l3fwd-vf/Makefile                    |   1 +
 examples/l3fwd-vf/main.c                      |   2 +
 examples/l3fwd-vf/meson.build                 |   1 +
 examples/link_status_interrupt/Makefile       |   1 +
 examples/link_status_interrupt/main.c         |   2 +
 examples/link_status_interrupt/meson.build    |   1 +
 examples/load_balancer/Makefile               |   1 +
 examples/load_balancer/init.c                 |   2 +
 examples/load_balancer/meson.build            |   1 +
 examples/packet_ordering/Makefile             |   1 +
 examples/packet_ordering/main.c               |   1 +
 examples/packet_ordering/meson.build          |   1 +
 examples/ptpclient/Makefile                   |   1 +
 examples/ptpclient/meson.build                |   1 +
 examples/ptpclient/ptpclient.c                |   1 +
 examples/qos_meter/Makefile                   |   1 +
 examples/qos_meter/main.c                     |   2 +
 examples/qos_meter/meson.build                |   1 +
 examples/qos_sched/Makefile                   |   1 +
 examples/qos_sched/init.c                     |   1 +
 examples/qos_sched/meson.build                |   1 +
 examples/quota_watermark/qw/Makefile          |   1 +
 examples/quota_watermark/qw/init.c            |   1 +
 examples/rxtx_callbacks/main.c                |   1 +
 examples/server_node_efd/server/Makefile      |   1 +
 examples/server_node_efd/server/init.c        |   1 +
 examples/skeleton/Makefile                    |   1 +
 examples/skeleton/basicfwd.c                  |   1 +
 examples/skeleton/meson.build                 |   1 +
 examples/tep_termination/Makefile             |   1 +
 examples/tep_termination/meson.build          |   1 +
 examples/tep_termination/vxlan_setup.c        |   1 +
 examples/vhost/Makefile                       |   1 +
 examples/vhost/main.c                         |   1 +
 examples/vm_power_manager/Makefile            |   1 +
 examples/vm_power_manager/main.c              |   1 +
 examples/vm_power_manager/meson.build         |   1 +
 examples/vmdq/Makefile                        |   1 +
 examples/vmdq/main.c                          |   1 +
 examples/vmdq/meson.build                     |   1 +
 examples/vmdq_dcb/Makefile                    |   1 +
 examples/vmdq_dcb/main.c                      |   1 +
 examples/vmdq_dcb/meson.build                 |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  89 +++++++++++-
 lib/librte_ethdev/rte_ethdev.h                |  39 ++++++
 lib/librte_ethdev/rte_ethdev_core.h           |  19 +++
 lib/librte_ethdev/rte_ethdev_version.map      |   1 +
 lib/librte_ethdev/rte_flow.h                  |   6 +-
 119 files changed, 621 insertions(+), 176 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v12 1/7] ethdev: add set ptype function
  2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-10-17 12:02                     ` pbhagavatula
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                                       ` (7 subsequent siblings)
  8 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-17 12:02 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst             |  8 ++-
 doc/guides/rel_notes/release_19_11.rst   |  8 +++
 lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
 lib/librte_ethdev/rte_ethdev.h           | 37 ++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      | 19 ++++++
 lib/librte_ethdev/rte_ethdev_version.map |  1 +
 6 files changed, 157 insertions(+), 3 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index d96696801..35cbcd88c 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,13 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+  ``dev_supported_ptypes_set``.
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 9c3de8374..e16060ea0 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -152,6 +152,14 @@ New Features
   * Added a console command to testpmd app, ``show port (port_id) ptypes`` which
     gives ability to print port supported ptypes in different protocol layers.
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 750bc9d02..9974c43fe 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2729,6 +2729,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	const uint32_t valid_ptype_masks[] = {
+		RTE_PTYPE_L2_MASK,
+		RTE_PTYPE_L3_MASK,
+		RTE_PTYPE_L4_MASK,
+		RTE_PTYPE_TUNNEL_MASK,
+		RTE_PTYPE_INNER_L2_MASK,
+		RTE_PTYPE_INNER_L3_MASK,
+		RTE_PTYPE_INNER_L4_MASK,
+	};
+	const uint32_t *all_ptypes;
+	struct rte_eth_dev *dev;
+	uint32_t unused_mask;
+	unsigned int i, j;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
+			*dev->dev_ops->dev_supported_ptypes_set == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	if (ptype_mask == 0) {
+		ret = (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+		goto ptype_unknown;
+	}
+
+	unused_mask = ptype_mask;
+	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
+		uint32_t mask = ptype_mask & valid_ptype_masks[i];
+		if (mask && mask != valid_ptype_masks[i]) {
+			ret = -EINVAL;
+			goto ptype_unknown;
+		}
+		unused_mask &= ~valid_ptype_masks[i];
+	}
+
+	if (unused_mask) {
+		ret = -EINVAL;
+		goto ptype_unknown;
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	/*
+	 * Accodommodate as many set_ptypes as possible. If the supplied
+	 * set_ptypes array is insufficient fill it partially.
+	 */
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL && j < num)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+
+ptype_unknown:
+	if (num > 0)
+		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+	return ret;
+}
+
 int
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
@@ -2741,7 +2827,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 	return 0;
 }
 
-
 int
 rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index ec95f9b19..eef07c2b7 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2506,6 +2506,43 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification the recipient is
+ * interested in.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, unsigned int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 392aea8e6..d5245a7d0 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -234,6 +234,23 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+/**
+ * @internal
+ * Inform an Ethernet device about packet types classifications the recipient
+ * is interested in.
+ *
+ * @param dev
+ *   The Ethernet device identifier.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @return
+ *   - (0) if Success.
+ *   - (-EINVAL) if *ptype_mask* is invalid.
+ */
+typedef int (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -550,6 +567,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform Ethernet device about packet types the recipient is interested in. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index e59d51648..f511294d2 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -288,4 +288,5 @@ EXPERIMENTAL {
 	rte_eth_rx_burst_mode_get;
 	rte_eth_tx_burst_mode_get;
 	rte_eth_burst_mode_option_name;
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v12 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-17 12:02                     ` pbhagavatula
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 3/7] ethdev: add flow action type " pbhagavatula
                                       ` (6 subsequent siblings)
  8 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-17 12:02 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 2 ++
 doc/guides/rel_notes/release_19_11.rst | 7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 1 +
 lib/librte_ethdev/rte_ethdev.h         | 1 +
 4 files changed, 11 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 35cbcd88c..1653e5b9d 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index e16060ea0..498fdfcdf 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -160,6 +160,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 9974c43fe..685b6a9be 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index eef07c2b7..68b2a4ba8 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1015,6 +1015,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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v12 3/7] ethdev: add flow action type update as an offload
  2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 1/7] ethdev: add set ptype function pbhagavatula
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-17 12:02                     ` pbhagavatula
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                                       ` (5 subsequent siblings)
  8 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-17 12:02 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon, Adrien Mazarguil
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
`rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
`RTE_FLOW_ACTION_FLAG` are enabled.

PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the applcation
by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           | 12 ++++++++++++
 doc/guides/rel_notes/release_19_11.rst |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.c         |  1 +
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 lib/librte_ethdev/rte_flow.h           |  6 ++++--
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 1653e5b9d..3780cf4dd 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -594,6 +594,18 @@ Allows application to set ptypes it is interested in.
 * **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
+.. _nic_features_flow_flag_mark:
+
+Flow flag/mark update
+---------------------
+
+Supports flow action type update to ``mbuf.ol_flags`` and ``mbuf.hash.fdir.hi``.
+
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_FLOW_MARK``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_FDIR``, ``mbuf.ol_flags:PKT_RX_FDIR_ID;``,
+  ``mbuf.hash.fdir.hi``
+
+
 .. _nic_features_timesync:
 
 Timesync
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 498fdfcdf..cb280d15b 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -167,6 +167,15 @@ New Features
   *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
      by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
 
+* **Added Rx offload flag to enable or disable flow action type update**
+
+  *  Add new Rx offload flag `DEV_RX_OFFLOAD_FLOW_MARK` that can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::fdir::hi` and
+     `rte_mbuf::ol_flags` when flow actions `RTE_FLOW_ACTION_MARK` and
+     `RTE_FLOW_ACTION_FLAG` are enabled.
+  *  PMDs notify the validity of `rte_mbuf::hash:fdir::hi` to the application
+     by enabling `PKT_RX_FDIR_ID` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 685b6a9be..f8090fd6f 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -130,6 +130,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
+	RTE_RX_OFFLOAD_BIT2STR(FLOW_MARK),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 68b2a4ba8..249303c90 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1016,6 +1016,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 #define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
+#define DEV_RX_OFFLOAD_FLOW_MARK	0x00100000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index bcfc06cdc..5c71b9ef4 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1509,7 +1509,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Attaches an integer value to packets and sets PKT_RX_FDIR and
-	 * PKT_RX_FDIR_ID mbuf flags.
+	 * PKT_RX_FDIR_ID mbuf flags when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * See struct rte_flow_action_mark.
 	 */
@@ -1517,7 +1518,8 @@ enum rte_flow_action_type {
 
 	/**
 	 * Flags packets. Similar to MARK without a specific value; only
-	 * sets the PKT_RX_FDIR mbuf flag.
+	 * sets the PKT_RX_FDIR mbuf flag when
+	 * `rx_mode:offloads:DEV_RX_OFFLOAD_FLOW_MARK` is enabled.
 	 *
 	 * No associated configuration structure.
 	 */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v12 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
                                       ` (2 preceding siblings ...)
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 3/7] ethdev: add flow action type " pbhagavatula
@ 2019-10-17 12:02                     ` pbhagavatula
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
                                       ` (4 subsequent siblings)
  8 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-17 12:02 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 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/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  3 ++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  3 ++-
 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/liquidio/lio_ethdev.c    |  3 ++-
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  3 ++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  3 ++-
 25 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e7ec99e15..5586d23da 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -117,7 +117,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_VLAN_EXTEND | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_SCATTER)
+				     DEV_RX_OFFLOAD_SCATTER | \
+				     DEV_RX_OFFLOAD_RSS_HASH)
 
 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 ed1be3559..6c1f73ac4 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_RSS_HASH)
 
 
 /* Common PF and VF devargs */
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index caf255d67..e24204744 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_RSS_HASH;
 
 /* 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 6a683fef4..9e983f6ae 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -41,7 +41,8 @@ static uint64_t dev_rx_offloads_sup =
 		DEV_RX_OFFLOAD_VLAN_STRIP |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_TIMESTAMP;
+		DEV_RX_OFFLOAD_TIMESTAMP |
+		DEV_RX_OFFLOAD_RSS_HASH;
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index f403a0b66..7c3c270a2 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -205,7 +205,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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 99c4366e4..8af133295 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1805,7 +1805,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 9f37a404b..7f1a27680 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -740,7 +740,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 				DEV_RX_OFFLOAD_VLAN_FILTER |
 				DEV_RX_OFFLOAD_SCATTER |
 				DEV_RX_OFFLOAD_JUMBO_FRAME |
-				DEV_RX_OFFLOAD_TCP_LRO;
+				DEV_RX_OFFLOAD_TCP_LRO |
+				DEV_RX_OFFLOAD_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 77a46832c..3bdde9bb1 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3613,7 +3613,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_RSS_HASH;
 
 	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 64037e11d..8f170810d 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -527,7 +527,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_RSS_HASH;
 	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 dc4d1e6c7..b7d726cbd 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2613,7 +2613,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index ec01343f1..b1b873d54 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -412,7 +412,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	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 0db065a22..ecc1b9be4 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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 22a8b2d19..2b91b5aca 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1236,7 +1236,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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index 4a60f9f74..011800e82 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -575,7 +575,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 33fa0c60b..4879a8a03 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	| \
@@ -140,11 +140,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_RSS_HASH)
 
 #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 53fdfde9a..a26d0ca56 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1302,7 +1302,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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 d1faeaa81..5e3689248 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 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] 246+ messages in thread

* [dpdk-dev] [PATCH v12 5/7] drivers/net: update Rx flow flag and mark capabilities
  2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
                                       ` (3 preceding siblings ...)
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-17 12:02                     ` pbhagavatula
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                                       ` (3 subsequent siblings)
  8 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-17 12:02 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	John Daley, Hyong Youb Kim, Beilei Xing, Qi Zhang, Jingjing Wu,
	Wenzhuo Lu, Qiming Yang, Konstantin Ananyev, Matan Azrad,
	Shahaf Shuler, Viacheslav Ovsiienko, Nithin Dabilpuram,
	Kiran Kumar K
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_FLOW_MARK flag for all PMDs that support flow action
flag and mark.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 3 ++-
 drivers/net/enic/enic_res.c             | 3 ++-
 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/mlx5/mlx5_rxq.c             | 3 ++-
 drivers/net/octeontx2/otx2_ethdev.h     | 3 ++-
 drivers/net/octeontx2/otx2_flow.c       | 9 ++-------
 drivers/net/octeontx2/otx2_flow.h       | 1 -
 drivers/net/octeontx2/otx2_flow_parse.c | 5 +----
 drivers/net/sfc/sfc_ef10_essb_rx.c      | 3 ++-
 12 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 5586d23da..08dbd127e 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -118,7 +118,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_VLAN_EXTEND | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
 				     DEV_RX_OFFLOAD_SCATTER | \
-				     DEV_RX_OFFLOAD_RSS_HASH)
+				     DEV_RX_OFFLOAD_RSS_HASH | \
+				     DEV_RX_OFFLOAD_FLOW_MARK)
 
 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/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 7c3c270a2..96a3db528 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -206,7 +206,8 @@ int enic_get_vnic_config(struct enic *enic)
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 3bdde9bb1..75e5213b5 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3614,7 +3614,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_VLAN_EXTEND |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 
 	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 8f170810d..06eccbd58 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -528,7 +528,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		DEV_RX_OFFLOAD_SCATTER |
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
 		DEV_RX_OFFLOAD_VLAN_FILTER |
-		DEV_RX_OFFLOAD_RSS_HASH;
+		DEV_RX_OFFLOAD_RSS_HASH |
+		DEV_RX_OFFLOAD_FLOW_MARK;
 	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 b7d726cbd..02ee26864 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2614,7 +2614,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
 			DEV_RX_OFFLOAD_VLAN_EXTEND |
-			DEV_RX_OFFLOAD_RSS_HASH;
+			DEV_RX_OFFLOAD_RSS_HASH |
+			DEV_RX_OFFLOAD_FLOW_MARK;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index fa572d184..1481e2426 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2873,7 +2873,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
 		   DEV_RX_OFFLOAD_VLAN_FILTER |
 		   DEV_RX_OFFLOAD_SCATTER |
-		   DEV_RX_OFFLOAD_RSS_HASH;
+		   DEV_RX_OFFLOAD_RSS_HASH |
+		   DEV_RX_OFFLOAD_FLOW_MARK;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index ecc1b9be4..cf46b1fab 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -369,7 +369,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
 	uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
 			     DEV_RX_OFFLOAD_TIMESTAMP |
 			     DEV_RX_OFFLOAD_JUMBO_FRAME |
-			     DEV_RX_OFFLOAD_RSS_HASH);
+			     DEV_RX_OFFLOAD_RSS_HASH |
+			     DEV_RX_OFFLOAD_FLOW_MARK);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 4879a8a03..07a276c6e 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -145,7 +145,8 @@
 	DEV_RX_OFFLOAD_VLAN_FILTER	| \
 	DEV_RX_OFFLOAD_QINQ_STRIP	| \
 	DEV_RX_OFFLOAD_TIMESTAMP	| \
-	DEV_RX_OFFLOAD_RSS_HASH)
+	DEV_RX_OFFLOAD_RSS_HASH		| \
+	DEV_RX_OFFLOAD_FLOW_MARK)
 
 #define NIX_DEFAULT_RSS_CTX_GROUP  0
 #define NIX_DEFAULT_RSS_MCAM_IDX  -1
diff --git a/drivers/net/octeontx2/otx2_flow.c b/drivers/net/octeontx2/otx2_flow.c
index bdbf123a9..ea4e380b1 100644
--- a/drivers/net/octeontx2/otx2_flow.c
+++ b/drivers/net/octeontx2/otx2_flow.c
@@ -524,11 +524,8 @@ otx2_flow_destroy(struct rte_eth_dev *dev,
 		NIX_RX_ACT_MATCH_MASK;
 
 	if (match_id && match_id < OTX2_FLOW_ACTION_FLAG_DEFAULT) {
-		if (rte_atomic32_read(&npc->mark_actions) == 0)
-			return -EINVAL;
-
-		/* Clear mark offload flag if there are no more mark actions */
-		if (rte_atomic32_sub_return(&npc->mark_actions, 1) == 0) {
+		/* Clear mark offload flag if there is no more mark action */
+		if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 			hw->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F;
 			otx2_eth_set_rx_function(dev);
 		}
@@ -821,8 +818,6 @@ otx2_flow_init(struct otx2_eth_dev *hw)
 		return rc;
 	}
 
-	rte_atomic32_init(&npc->mark_actions);
-
 	npc->mcam_entries = NPC_MCAM_TOT_ENTRIES >> npc->keyw[NPC_MCAM_RX];
 	/* Free, free_rev, live and live_rev entries */
 	bmap_sz = rte_bitmap_get_memory_footprint(npc->mcam_entries);
diff --git a/drivers/net/octeontx2/otx2_flow.h b/drivers/net/octeontx2/otx2_flow.h
index ab068b088..85129cc9d 100644
--- a/drivers/net/octeontx2/otx2_flow.h
+++ b/drivers/net/octeontx2/otx2_flow.h
@@ -160,7 +160,6 @@ TAILQ_HEAD(otx2_flow_list, rte_flow);
 
 /* Accessed from ethdev private - otx2_eth_dev */
 struct otx2_npc_flow_info {
-	rte_atomic32_t mark_actions;
 	uint32_t keyx_supp_nmask[NPC_MAX_INTF];/* nibble mask */
 	uint32_t keyx_len[NPC_MAX_INTF];	/* per intf key len in bits */
 	uint32_t datax_len[NPC_MAX_INTF];	/* per intf data len in bits */
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 2cba0a447..44f1b0cac 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -761,7 +761,6 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			struct rte_flow *flow)
 {
 	struct otx2_eth_dev *hw = dev->data->dev_private;
-	struct otx2_npc_flow_info *npc = &hw->npc_flow;
 	const struct rte_flow_action_count *act_count;
 	const struct rte_flow_action_mark *act_mark;
 	const struct rte_flow_action_queue *act_q;
@@ -795,13 +794,11 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 			}
 			mark = act_mark->id + 1;
 			req_act |= OTX2_FLOW_ACT_MARK;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_FLAG:
 			mark = OTX2_FLOW_FLAG_VAL;
 			req_act |= OTX2_FLOW_ACT_FLAG;
-			rte_atomic32_inc(&npc->mark_actions);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_COUNT:
@@ -979,7 +976,7 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,
 	if (mark)
 		flow->npc_action |= (uint64_t)mark << 40;
 
-	if (rte_atomic32_read(&npc->mark_actions) == 1) {
+	if (hw->rx_offloads & DEV_RX_OFFLOAD_FLOW_MARK) {
 		hw->rx_offload_flags |=
 			NIX_RX_OFFLOAD_MARK_UPDATE_F;
 		otx2_eth_set_rx_function(dev);
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 220ef0e47..1887731e2 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH |
+				  DEV_RX_OFFLOAD_FLOW_MARK,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v12 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
                                       ` (4 preceding siblings ...)
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
@ 2019-10-17 12:02                     ` pbhagavatula
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 7/7] examples: disable Rx packet type parsing pbhagavatula
                                       ` (2 subsequent siblings)
  8 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-17 12:02 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 128 -----------------
 .../pipeline_worker_generic.c                 | 132 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 +++++++++++++++++
 3 files changed, 260 insertions(+), 128 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f77830282..d3ff1bbe4 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,133 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	retval = rte_eth_dev_info_get(port, &dev_info);
-	if (retval != 0) {
-		printf("Error during getting device (port %u) info: %s\n",
-				port, strerror(-retval));
-		return retval;
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	retval = rte_eth_macaddr_get(port, &addr);
-	if (retval != 0) {
-		printf("Failed to get MAC address (port %u): %s\n",
-				port, rte_strerror(-retval));
-		return retval;
-	}
-
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	retval = rte_eth_promiscuous_enable(port);
-	if (retval != 0)
-		return retval;
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
-
 static void
 do_capability_setup(uint8_t eventdev_id)
 {
@@ -515,7 +388,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..42ff4eeb9 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,137 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +428,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 8961cd656..f381e1caf 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,133 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +748,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v12 7/7] examples: disable Rx packet type parsing
  2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
                                       ` (5 preceding siblings ...)
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-17 12:02                     ` pbhagavatula
  2019-10-17 17:43                     ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags Ferruh Yigit
  2019-10-25 14:33                     ` [dpdk-dev] [PATCH v13 0/6] " pbhagavatula
  8 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-17 12:02 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Nicolas Chautru, Chas Williams,
	David Hunt, Harry van Haaren, Marko Kovacevic, Ori Kam,
	Bruce Richardson, Radu Nicolau, Akhil Goyal, Tomasz Kantecki,
	Bernard Iremonger, Cristian Dumitrescu, Konstantin Ananyev,
	Declan Doherty, Reshma Pattan, John McNamara, Xiaoyun Li,
	Jasvinder Singh, Byron Marohn, Yipeng Wang, Maxime Coquelin,
	Tiwei Bie, Zhihong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing in examples that don't use
`rte_mbuf::packet_type` by setting ptype_mask as 0 in
`rte_eth_dev_set_supported_ptypes`

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/bbdev_app/main.c                  | 2 ++
 examples/bond/main.c                       | 2 ++
 examples/distributor/Makefile              | 1 +
 examples/distributor/main.c                | 1 +
 examples/distributor/meson.build           | 1 +
 examples/eventdev_pipeline/main.c          | 2 ++
 examples/eventdev_pipeline/meson.build     | 1 +
 examples/exception_path/Makefile           | 1 +
 examples/exception_path/main.c             | 1 +
 examples/exception_path/meson.build        | 1 +
 examples/flow_classify/flow_classify.c     | 1 +
 examples/flow_filtering/Makefile           | 1 +
 examples/flow_filtering/main.c             | 2 ++
 examples/flow_filtering/meson.build        | 1 +
 examples/ip_pipeline/link.c                | 1 +
 examples/ip_reassembly/Makefile            | 1 +
 examples/ip_reassembly/main.c              | 2 ++
 examples/ip_reassembly/meson.build         | 1 +
 examples/ipsec-secgw/ipsec-secgw.c         | 2 ++
 examples/ipv4_multicast/Makefile           | 1 +
 examples/ipv4_multicast/main.c             | 3 +++
 examples/ipv4_multicast/meson.build        | 1 +
 examples/kni/main.c                        | 1 +
 examples/l2fwd-cat/Makefile                | 1 +
 examples/l2fwd-cat/l2fwd-cat.c             | 1 +
 examples/l2fwd-cat/meson.build             | 1 +
 examples/l2fwd-crypto/main.c               | 2 ++
 examples/l2fwd-jobstats/Makefile           | 1 +
 examples/l2fwd-jobstats/main.c             | 2 ++
 examples/l2fwd-jobstats/meson.build        | 1 +
 examples/l2fwd-keepalive/Makefile          | 1 +
 examples/l2fwd-keepalive/main.c            | 2 ++
 examples/l2fwd-keepalive/meson.build       | 1 +
 examples/l2fwd/Makefile                    | 1 +
 examples/l2fwd/main.c                      | 2 ++
 examples/l2fwd/meson.build                 | 1 +
 examples/l3fwd-acl/Makefile                | 1 +
 examples/l3fwd-acl/main.c                  | 2 ++
 examples/l3fwd-acl/meson.build             | 1 +
 examples/l3fwd-vf/Makefile                 | 1 +
 examples/l3fwd-vf/main.c                   | 2 ++
 examples/l3fwd-vf/meson.build              | 1 +
 examples/link_status_interrupt/Makefile    | 1 +
 examples/link_status_interrupt/main.c      | 2 ++
 examples/link_status_interrupt/meson.build | 1 +
 examples/load_balancer/Makefile            | 1 +
 examples/load_balancer/init.c              | 2 ++
 examples/load_balancer/meson.build         | 1 +
 examples/packet_ordering/Makefile          | 1 +
 examples/packet_ordering/main.c            | 1 +
 examples/packet_ordering/meson.build       | 1 +
 examples/ptpclient/Makefile                | 1 +
 examples/ptpclient/meson.build             | 1 +
 examples/ptpclient/ptpclient.c             | 1 +
 examples/qos_meter/Makefile                | 1 +
 examples/qos_meter/main.c                  | 2 ++
 examples/qos_meter/meson.build             | 1 +
 examples/qos_sched/Makefile                | 1 +
 examples/qos_sched/init.c                  | 1 +
 examples/qos_sched/meson.build             | 1 +
 examples/quota_watermark/qw/Makefile       | 1 +
 examples/quota_watermark/qw/init.c         | 1 +
 examples/rxtx_callbacks/main.c             | 1 +
 examples/server_node_efd/server/Makefile   | 1 +
 examples/server_node_efd/server/init.c     | 1 +
 examples/skeleton/Makefile                 | 1 +
 examples/skeleton/basicfwd.c               | 1 +
 examples/skeleton/meson.build              | 1 +
 examples/tep_termination/Makefile          | 1 +
 examples/tep_termination/meson.build       | 1 +
 examples/tep_termination/vxlan_setup.c     | 1 +
 examples/vhost/Makefile                    | 1 +
 examples/vhost/main.c                      | 1 +
 examples/vm_power_manager/Makefile         | 1 +
 examples/vm_power_manager/main.c           | 1 +
 examples/vm_power_manager/meson.build      | 1 +
 examples/vmdq/Makefile                     | 1 +
 examples/vmdq/main.c                       | 1 +
 examples/vmdq/meson.build                  | 1 +
 examples/vmdq_dcb/Makefile                 | 1 +
 examples/vmdq_dcb/main.c                   | 1 +
 examples/vmdq_dcb/meson.build              | 1 +
 82 files changed, 99 insertions(+)

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index fb38dc3a7..7798a6a03 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -499,6 +499,8 @@ initialize_ports(struct app_config_params *app_params,
 
 	print_mac(port_id, &bbdev_port_eth_addr);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
+
 	return 0;
 }
 
diff --git a/examples/bond/main.c b/examples/bond/main.c
index ee8fa2d27..ce681b6fd 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -200,6 +200,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				portid, retval);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(portid);
 	if (retval < 0)
 		rte_exit(retval,
@@ -286,6 +287,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
+	rte_eth_dev_set_supported_ptypes(BOND_PORT, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(BOND_PORT);
 	if (retval < 0)
 		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile
index bac8d5578..a2a477279 100644
--- a/examples/distributor/Makefile
+++ b/examples/distributor/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 567c5e989..75d42a1eb 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -168,6 +168,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 26f108d65..c2976f6bd 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -10,6 +10,7 @@
 build = dpdk_conf.has('RTE_LIBRTE_POWER')
 
 deps += ['distributor', 'power']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index d3ff1bbe4..4c7700795 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -392,6 +392,8 @@ main(int argc, char **argv)
 
 	/* Start the Ethernet port. */
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		err = rte_eth_dev_start(portid);
 		if (err < 0)
 			rte_exit(EXIT_FAILURE, "Error starting ethdev %d\n",
diff --git a/examples/eventdev_pipeline/meson.build b/examples/eventdev_pipeline/meson.build
index a54c35aa7..0fc916b05 100644
--- a/examples/eventdev_pipeline/meson.build
+++ b/examples/eventdev_pipeline/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'eventdev'
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 	'pipeline_worker_generic.c',
diff --git a/examples/exception_path/Makefile b/examples/exception_path/Makefile
index 90c7f133a..a7c961276 100644
--- a/examples/exception_path/Makefile
+++ b/examples/exception_path/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 85dbd7ec7..7ee2213b2 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -469,6 +469,7 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		FATAL_ERROR("Could not start port%u (%d)", port, ret);
diff --git a/examples/exception_path/meson.build b/examples/exception_path/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/exception_path/meson.build
+++ b/examples/exception_path/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 1c12bbb2f..2e9dfd157 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -237,6 +237,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	}
 
 	/* Start the Ethernet port. */
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile
index a63a75555..793a08fae 100644
--- a/examples/flow_filtering/Makefile
+++ b/examples/flow_filtering/Makefile
@@ -49,6 +49,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index cc9e7e780..5a816c0d4 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -190,6 +190,8 @@ init_port(void)
 			":: promiscuous mode enable failed: err=%s, port=%u\n",
 			rte_strerror(-ret), port_id);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
+
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
 		rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index 407795c42..6f5d1b08a 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c',
 )
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 16bcffe35..68609cd7c 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -209,6 +209,7 @@ link_create(const char *name, struct link_params *params)
 			return NULL;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Port start */
 	status = rte_eth_dev_start(port_id);
 	if (status < 0)
diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile
index 0b1a904e0..19c462388 100644
--- a/examples/ip_reassembly/Makefile
+++ b/examples/ip_reassembly/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index d59e6d02f..55b4ddc3f 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1178,6 +1178,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ip_reassembly/meson.build b/examples/ip_reassembly/meson.build
index 8ebd48291..8a667c265 100644
--- a/examples/ip_reassembly/meson.build
+++ b/examples/ip_reassembly/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'ip_frag']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index f52ca5297..38fd16929 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2468,6 +2468,8 @@ main(int32_t argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/*
 		 * Start device
 		 * note: device must be started before a flow rule
diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile
index 5f8a67dd4..5171f7ab2 100644
--- a/examples/ipv4_multicast/Makefile
+++ b/examples/ipv4_multicast/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 63333b5b6..67617a56c 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -788,6 +788,9 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE,
 				"rte_eth_allmulticast_enable: err=%d, port=%d\n",
 				ret, portid);
+
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/ipv4_multicast/meson.build b/examples/ipv4_multicast/meson.build
index d9e4c7c21..6969e2c54 100644
--- a/examples/ipv4_multicast/meson.build
+++ b/examples/ipv4_multicast/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'hash'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/kni/main.c b/examples/kni/main.c
index c576fc767..d8781f29f 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -631,6 +631,7 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not start port%u (%d)\n",
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index c1960d6d3..d6a25e42a 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -66,6 +66,7 @@ endif
 EXTRA_CFLAGS += -O3 -g -Wfatal-errors
 
 CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -L$(PQOS_INSTALL_PATH)
 LDLIBS += -lpqos
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index 6838f288c..5a459937a 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -67,6 +67,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 4e2777a03..37c96040d 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -10,6 +10,7 @@ pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
 ext_deps += pqos
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
+allow_experimental_apis = true
 sources = files(
 	'cat.c', 'l2fwd-cat.c'
 )
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 61d78295d..04aad839e 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2574,6 +2574,8 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			return -1;
 		}
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		retval = rte_eth_dev_start(portid);
 		if (retval < 0) {
diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile
index 729a39e93..09834e979 100644
--- a/examples/l2fwd-jobstats/Makefile
+++ b/examples/l2fwd-jobstats/Makefile
@@ -52,6 +52,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index f975aa12d..47007d1bc 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -921,6 +921,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-jobstats/meson.build b/examples/l2fwd-jobstats/meson.build
index 1ffd484e2..3653aa7ec 100644
--- a/examples/l2fwd-jobstats/meson.build
+++ b/examples/l2fwd-jobstats/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['jobstats', 'timer']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile
index 37de27a6f..584257ae2 100644
--- a/examples/l2fwd-keepalive/Makefile
+++ b/examples/l2fwd-keepalive/Makefile
@@ -53,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 LDFLAGS += -lrt
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index b36834974..d5c3e7981 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -715,6 +715,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd-keepalive/meson.build b/examples/l2fwd-keepalive/meson.build
index 6f7b007e1..2dffffaaa 100644
--- a/examples/l2fwd-keepalive/meson.build
+++ b/examples/l2fwd-keepalive/meson.build
@@ -8,6 +8,7 @@
 
 ext_deps += cc.find_library('rt')
 deps += 'timer'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'shm.c'
 )
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index d7bcbfae7..b2fee8d86 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -713,6 +713,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile
index e2c989f71..df590f8e9 100644
--- a/examples/l3fwd-acl/Makefile
+++ b/examples/l3fwd-acl/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index fa92a2829..d9390cf2c 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2085,6 +2085,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0)
 			continue;
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build
index 7096e00c1..68cebd6ce 100644
--- a/examples/l3fwd-acl/meson.build
+++ b/examples/l3fwd-acl/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['acl', 'lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile
index 7b186a23c..db7f51f2f 100644
--- a/examples/l3fwd-vf/Makefile
+++ b/examples/l3fwd-vf/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 $(USER_FLAGS)
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index ff6c9e2f1..f2e9ef2bd 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1056,6 +1056,8 @@ main(int argc, char **argv)
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			continue;
 		}
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build
index 226286e74..00f3c38f4 100644
--- a/examples/l3fwd-vf/meson.build
+++ b/examples/l3fwd-vf/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['lpm', 'hash']
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 97e5a14a8..6ddedd4de 100644
--- a/examples/link_status_interrupt/Makefile
+++ b/examples/link_status_interrupt/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index a924aa231..4a73b9e4e 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -704,6 +704,8 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE, "Cannot set error callback for "
 					"tx buffer on port %u\n", (unsigned) portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/link_status_interrupt/meson.build b/examples/link_status_interrupt/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/link_status_interrupt/meson.build
+++ b/examples/link_status_interrupt/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index caae8a107..dcba9194c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3 -g
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 762226754..ade737b5e 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -513,6 +513,8 @@ app_init_nics(void)
 			}
 		}
 
+		rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start port */
 		ret = rte_eth_dev_start(port);
 		if (ret < 0) {
diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build
index 4f7ac3999..19708974c 100644
--- a/examples/load_balancer/meson.build
+++ b/examples/load_balancer/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'lpm'
+allow_experimental_apis = true
 sources = files(
 	'config.c', 'init.c', 'main.c', 'runtime.c'
 )
diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile
index 51acaf7eb..9ba3fa9e8 100644
--- a/examples/packet_ordering/Makefile
+++ b/examples/packet_ordering/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index b397b318e..d8857bf59 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -318,6 +318,7 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
 		return ret;
diff --git a/examples/packet_ordering/meson.build b/examples/packet_ordering/meson.build
index 6c2fccdcb..a3776946f 100644
--- a/examples/packet_ordering/meson.build
+++ b/examples/packet_ordering/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'reorder'
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index 89e2bacbd..f158d96b9 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/ptpclient/meson.build b/examples/ptpclient/meson.build
index fa0cbe93c..d4171a218 100644
--- a/examples/ptpclient/meson.build
+++ b/examples/ptpclient/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'ptpclient.c'
 )
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index a1a7ae699..5cd9307fe 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -234,6 +234,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile
index e5217cf7c..a1533d08f 100644
--- a/examples/qos_meter/Makefile
+++ b/examples/qos_meter/Makefile
@@ -52,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index e8112c83a..3f6da6352 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -431,10 +431,12 @@ main(int argc, char **argv)
 
 	rte_eth_tx_buffer_init(tx_buffer, PKT_TX_BURST_MAX);
 
+	rte_eth_dev_set_supported_ptypes(port_rx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_rx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_tx, RTE_PTYPE_UNKNOWN, NULL, 0);
 	ret = rte_eth_dev_start(port_tx);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
diff --git a/examples/qos_meter/meson.build b/examples/qos_meter/meson.build
index ef7779f2f..10cd4bc79 100644
--- a/examples/qos_meter/meson.build
+++ b/examples/qos_meter/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'meter'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'rte_policer.c'
 )
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index ce2d25371..7d3d3019f 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -58,6 +58,7 @@ else
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 32e6e1ba2..e954130de 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -144,6 +144,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 			 "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
 			 ret, portid, 0);
 
+	rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 289b81ce8..5101652af 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -7,6 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += ['sched', 'cfgfile']
+allow_experimental_apis = true
 sources = files(
 	'app_thread.c', 'args.c', 'cfg_file.c', 'cmdline.c',
 	'init.c', 'main.c', 'stats.c'
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile
index 3f10f01c3..e06f4482b 100644
--- a/examples/quota_watermark/qw/Makefile
+++ b/examples/quota_watermark/qw/Makefile
@@ -18,5 +18,6 @@ SRCS-y := args.c init.c main.c
 
 CFLAGS += -O3 -DQW_SOFTWARE_FC
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 5ebcc83ac..3289afc16 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -96,6 +96,7 @@ void configure_eth_port(uint16_t port_id)
 				"Failed to setup hardware flow control on port %u (error %d)\n",
 				(unsigned int) port_id, ret);
 
+	rte_eth_dev_set_supported_ptypes(port_id, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0)
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index 07e95e8d1..50e08b691 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -159,6 +159,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
 		return retval;
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 4837bd3ea..acbd12ae2 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -25,5 +25,6 @@ INC := $(sort $(wildcard *.h))
 
 CFLAGS += $(WERROR_FLAGS) -O3
 CFLAGS += -I$(SRCDIR)/../shared
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index 00e2e4059..60603a415 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -154,6 +154,7 @@ init_port(uint16_t port_num)
 	if (retval != 0)
 		return retval;
 
+	rte_eth_dev_set_supported_ptypes(port_num, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval = rte_eth_dev_start(port_num);
 	if (retval < 0)
 		return retval;
diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile
index c5ac26029..0037d6b25 100644
--- a/examples/skeleton/Makefile
+++ b/examples/skeleton/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index 73d313b84..ff213568f 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -82,6 +82,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build
index 9bb9ec329..ef46b187e 100644
--- a/examples/skeleton/meson.build
+++ b/examples/skeleton/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'basicfwd.c'
 )
diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile
index 31165bd92..586838676 100644
--- a/examples/tep_termination/Makefile
+++ b/examples/tep_termination/Makefile
@@ -61,6 +61,7 @@ endif
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index f65d68980..f40b1c0b8 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -11,6 +11,7 @@ if not is_linux
 endif
 deps += ['hash', 'vhost']
 cflags += '-Wno-deprecated-declarations'
+allow_experimental_apis = true
 sources = files(
 	'main.c', 'vxlan.c', 'vxlan_setup.c'
 )
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index f9f857c09..9a6796afe 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -171,6 +171,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f84b7f017..7722e81c7 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -62,6 +62,7 @@ else
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O2 -D_FILE_OFFSET_BITS=64
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index ab649bf14..04240a782 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -328,6 +328,7 @@ port_init(uint16_t port)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the device. */
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..65c2ad179 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -28,6 +28,7 @@ endif
 
 CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lvirt
 
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index d39f044c1..9842a73dd 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -105,6 +105,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	/* Start the Ethernet port. */
 	retval = rte_eth_dev_start(port);
 	if (retval < 0)
diff --git a/examples/vm_power_manager/meson.build b/examples/vm_power_manager/meson.build
index 20a4a05b3..54e2b584f 100644
--- a/examples/vm_power_manager/meson.build
+++ b/examples/vm_power_manager/meson.build
@@ -25,6 +25,7 @@ if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
 	deps += ['pmd_ixgbe']
 endif
 
+allow_experimental_apis = true
 sources = files(
 	'channel_manager.c', 'channel_monitor.c', 'main.c', 'parse.c', 'power_manager.c', 'vm_power_cli.c'
 )
diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile
index 1557ee86b..2168747cc 100644
--- a/examples/vmdq/Makefile
+++ b/examples/vmdq/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 EXTRA_CFLAGS += -O3
 
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 6e6fc91ec..4cde9d1d8 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -270,6 +270,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile
index 391096cfb..ea1574d91 100644
--- a/examples/vmdq_dcb/Makefile
+++ b/examples/vmdq_dcb/Makefile
@@ -50,6 +50,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf
 include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 594c4f195..f3d1934f2 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -327,6 +327,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	rte_eth_dev_set_supported_ptypes(port, RTE_PTYPE_UNKNOWN, NULL, 0);
 	retval  = rte_eth_dev_start(port);
 	if (retval < 0) {
 		printf("port %d start failed\n", port);
diff --git a/examples/vmdq_dcb/meson.build b/examples/vmdq_dcb/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/vmdq_dcb/meson.build
+++ b/examples/vmdq_dcb/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags
  2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
                                       ` (6 preceding siblings ...)
  2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 7/7] examples: disable Rx packet type parsing pbhagavatula
@ 2019-10-17 17:43                     ` Ferruh Yigit
  2019-10-18  7:32                       ` Andrew Rybchenko
  2019-10-25 14:33                     ` [dpdk-dev] [PATCH v13 0/6] " pbhagavatula
  8 siblings, 1 reply; 246+ messages in thread
From: Ferruh Yigit @ 2019-10-17 17:43 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj
  Cc: dev, Adrien Mazarguil, Thomas Monjalon, Xiaolong Ye

On 10/17/2019 1:02 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
>  Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
>  `DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
>  enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
>  and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Hi Pavan,

Initially sorry for involving late,

When we expose an interface to the applications, they will expect those will be
respected by underlying PMDs.
As far as I can see drivers are updated to report new added Rx offload flags as
supported capabilities but drivers are not using those flags at all, so
application providing that flag won't really enable/disable anything, I think
this is a problem and it is wrong to lie even for the PMDs J


Specific to `DEV_RX_OFFLOAD_RSS_HASH`, we have already some RSS config
structures and it is part of the 'rte_eth_dev_configure()' API, won't it create
multiple way to do same thing?

And for the `ol_flags:PKT_RX_RSS` flag, it was already used to mark that
'mbuf::hash::rss' is valid, right? Is there anything new related that in the set?


Specific to the `DEV_RX_OFFLOAD_FLOW_MARK` and `RTE_FLOW_ACTION_FLAG`, they are
rte_flow actions, application can verify and later request these actions via
rte_flow APIs. Why we are adding an additional RX_OFFLOAD flag for them?


> 
>  Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
>  allows application to inform PMDs about the packet types it is interested
>  in. Based on ptypes requested by application PMDs can optimize the Rx path.

OK to the API, but why "Packet type parsing" feature updated to say it should
implement this API?
Is this API really required to say "Packet type parsing" supported by PMD?

> 
>  For example, if a given PMD doesn't support any packet types that the
>  application is interested in then the application can disable[1] writes to
>  `mbuf.packet_type` done by the PMD and use a software ptype parser.
>       [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
> 					  NULL, 0);

And for the 7/7 patch, why we are updating all examples, is the API something do
we really need to call for any DPDK application? I am for leaving the default
behavior unless there is a very specific case for set or disable packet typing.
Instead implement a command in testpmd to test this feature.

> 
> v12 Changes:
> -----------
> - Rebase onto next-net.
> 
> v11 Changes:
> -----------
> - Use RTE_DIM to get array size.
> - Since we are using a list of MASKs to validate ptype_mask return -EINVAL
>   if any unknown mask is set.
> - Rebase to TOT.
> 
> v10 Changes:
> -----------
> - Modify ptype_mask validation in set_supported_ptypes.(Andrew)
> 
> v9 Changes:
> ----------
> - Add ptype_mask validation in set_supported_ptypes.(Andrew)
> - Make description more verbose.
> 
> v8 Changes:
> ----------
> - Make description more verbose.
> - Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
>   is not supported by ethernet device.
> 
> v7 Changes:
> ----------
> - Fix unused variable in net/octeontx2
> 
> v6 Changes:
> ----------
> - Add additional checks for set supported ptypes.(Andrew)
> - Clarify `rte_eth_dev_set_supported_ptypes` documentation.
> - Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.
> 
> v5 Changes:
> ----------
> - Fix typos.
> 
> v4 Changes:
> ----------
> - Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
>   of array.
> - Fix invalid set ptype function call in examples.
> - Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.
> 
> v3 Changes:
> ----------
> - Add missing release notes. (Andrew)
> - Re-word various descriptions.
> - Fix ptype set logic.
> 
> v2 Changes:
> ----------
> - Update release notes. (Andrew)
> - Redo commit logs. (Andrew)
> - Disable ptype parsing for unsupported examples. (Jerin)
> - Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
> - Modify set_supported_ptypes function to return successfuly set mask
>   instead of failure.
> - Dropped set_supported_ptypes to drivers by handling in library
>   layer, interested PMD can add it in.
> 
> Pavan Nikhilesh (7):
>   ethdev: add set ptype function
>   ethdev: add mbuf RSS update as an offload
>   ethdev: add flow action type update as an offload
>   drivers/net: update Rx RSS hash offload capabilities
>   drivers/net: update Rx flow flag and mark capabilities
>   examples/eventdev_pipeline: add new Rx RSS hash offload
>   examples: disable Rx packet type parsing

<...>

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags
  2019-10-17 17:43                     ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags Ferruh Yigit
@ 2019-10-18  7:32                       ` Andrew Rybchenko
  2019-10-18  9:42                         ` Ferruh Yigit
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-18  7:32 UTC (permalink / raw)
  To: Ferruh Yigit, pbhagavatula, jerinj
  Cc: dev, Adrien Mazarguil, Thomas Monjalon, Xiaolong Ye

Hi Ferruh,

since I've reviewed I'll reply as I understand it.

On 10/17/19 8:43 PM, Ferruh Yigit wrote:
> On 10/17/2019 1:02 PM, pbhagavatula@marvell.com wrote:
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>>   Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
>>   `DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
>>   enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
>>   and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.
> Hi Pavan,
>
> Initially sorry for involving late,
>
> When we expose an interface to the applications, they will expect those will be
> respected by underlying PMDs.
> As far as I can see drivers are updated to report new added Rx offload flags as
> supported capabilities but drivers are not using those flags at all, so
> application providing that flag won't really enable/disable anything, I think
> this is a problem and it is wrong to lie even for the PMDs J

It is required to let applications know that the offload is supported.
There are a number of cases when an offload cannot be disabled,
but it does not mean that the offload must not be advertised.
If driver see benefits from disabling the offload (e.g. avoid delivery
of RSS hash from NIC to host), it can do it after the patchset.

> Specific to `DEV_RX_OFFLOAD_RSS_HASH`, we have already some RSS config
> structures and it is part of the 'rte_eth_dev_configure()' API, won't it create
> multiple way to do same thing?

No, a new offload is responsible for RSS hash delivery from NIC to host
and fill in in mbuf returned to application on Rx.

> And for the `ol_flags:PKT_RX_RSS` flag, it was already used to mark that
> 'mbuf::hash::rss' is valid, right? Is there anything new related that in the set?

As I understand you mean, ol_flags::PKT_RX_RSS_HASH.
Yes, the new offload allows say if application needs it or now.
Basically it decouples RSS distribution and hash delivery.

> Specific to the `DEV_RX_OFFLOAD_FLOW_MARK` and `RTE_FLOW_ACTION_FLAG`, they are
> rte_flow actions, application can verify and later request these actions via
> rte_flow APIs. Why we are adding an additional RX_OFFLOAD flag for them?

The reason is basically the same as above. HW needs to know in advance,
if application is going to use flow marks and configure Rx queue to enable
the information delivery.

>>   Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
>>   allows application to inform PMDs about the packet types it is interested
>>   in. Based on ptypes requested by application PMDs can optimize the Rx path.
> OK to the API, but why "Packet type parsing" feature updated to say it should
> implement this API?
> Is this API really required to say "Packet type parsing" supported by PMD?

As I understand it is not strictly required, but related to the feature.

>>   For example, if a given PMD doesn't support any packet types that the
>>   application is interested in then the application can disable[1] writes to
>>   `mbuf.packet_type` done by the PMD and use a software ptype parser.
>>        [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
>> 					  NULL, 0);
> And for the 7/7 patch, why we are updating all examples, is the API something do
> we really need to call for any DPDK application? I am for leaving the default
> behavior unless there is a very specific case for set or disable packet typing.
> Instead implement a command in testpmd to test this feature.

If an application does not use packet types provided in mbuf, it is
better to inform PMD that the information is not required to allow PMD
to do optimizations. Yes, may be it would be better to have it as the
default behaviour, but it would be behaviour change in comparison
to previous DPDK releases and it is better to avoid it.

Thanks,
Andrew.

>> v12 Changes:
>> -----------
>> - Rebase onto next-net.
>>
>> v11 Changes:
>> -----------
>> - Use RTE_DIM to get array size.
>> - Since we are using a list of MASKs to validate ptype_mask return -EINVAL
>>    if any unknown mask is set.
>> - Rebase to TOT.
>>
>> v10 Changes:
>> -----------
>> - Modify ptype_mask validation in set_supported_ptypes.(Andrew)
>>
>> v9 Changes:
>> ----------
>> - Add ptype_mask validation in set_supported_ptypes.(Andrew)
>> - Make description more verbose.
>>
>> v8 Changes:
>> ----------
>> - Make description more verbose.
>> - Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
>>    is not supported by ethernet device.
>>
>> v7 Changes:
>> ----------
>> - Fix unused variable in net/octeontx2
>>
>> v6 Changes:
>> ----------
>> - Add additional checks for set supported ptypes.(Andrew)
>> - Clarify `rte_eth_dev_set_supported_ptypes` documentation.
>> - Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.
>>
>> v5 Changes:
>> ----------
>> - Fix typos.
>>
>> v4 Changes:
>> ----------
>> - Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
>>    of array.
>> - Fix invalid set ptype function call in examples.
>> - Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.
>>
>> v3 Changes:
>> ----------
>> - Add missing release notes. (Andrew)
>> - Re-word various descriptions.
>> - Fix ptype set logic.
>>
>> v2 Changes:
>> ----------
>> - Update release notes. (Andrew)
>> - Redo commit logs. (Andrew)
>> - Disable ptype parsing for unsupported examples. (Jerin)
>> - Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
>> - Modify set_supported_ptypes function to return successfuly set mask
>>    instead of failure.
>> - Dropped set_supported_ptypes to drivers by handling in library
>>    layer, interested PMD can add it in.
>>
>> Pavan Nikhilesh (7):
>>    ethdev: add set ptype function
>>    ethdev: add mbuf RSS update as an offload
>>    ethdev: add flow action type update as an offload
>>    drivers/net: update Rx RSS hash offload capabilities
>>    drivers/net: update Rx flow flag and mark capabilities
>>    examples/eventdev_pipeline: add new Rx RSS hash offload
>>    examples: disable Rx packet type parsing
> <...>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags
  2019-10-18  7:32                       ` Andrew Rybchenko
@ 2019-10-18  9:42                         ` Ferruh Yigit
  2019-10-18 10:31                           ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Ferruh Yigit @ 2019-10-18  9:42 UTC (permalink / raw)
  To: Andrew Rybchenko, pbhagavatula, jerinj
  Cc: dev, Adrien Mazarguil, Thomas Monjalon, Xiaolong Ye, Bruce Richardson

On 10/18/2019 8:32 AM, Andrew Rybchenko wrote:
> Hi Ferruh,
> 
> since I've reviewed I'll reply as I understand it.
> 
> On 10/17/19 8:43 PM, Ferruh Yigit wrote:
>> On 10/17/2019 1:02 PM, pbhagavatula@marvell.com wrote:
>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>
>>>   Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
>>>   `DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
>>>   enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
>>>   and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.
>> Hi Pavan,
>>
>> Initially sorry for involving late,
>>
>> When we expose an interface to the applications, they will expect those will be
>> respected by underlying PMDs.
>> As far as I can see drivers are updated to report new added Rx offload flags as
>> supported capabilities but drivers are not using those flags at all, so
>> application providing that flag won't really enable/disable anything, I think
>> this is a problem and it is wrong to lie even for the PMDs J
> 
> It is required to let applications know that the offload is supported.
> There are a number of cases when an offload cannot be disabled,
> but it does not mean that the offload must not be advertised.

Can't disable is something else, although I believe that is rare case, in this
case driver can enable/disable the RSS and representing this as an offload
capability.
But when user want to configure this offload by setting or unsetting in offload
config, driver just ignores it.

> If driver see benefits from disabling the offload (e.g. avoid delivery
> of RSS hash from NIC to host), it can do it after the patchset.

Yes but I think this patchset shouldn't ignore that disabling the feature is not
implemented yet. If those PMDs that has been updated to report the HASH
capability has RSS enabled by default, I suggest adding a check for this offload
in PMD,
if it is requested to disable (which means not requested for enable), print a
log saying disabling HASH is not supported and set this flag in the offload
configuration to say PMD is configured to calculate the HASH.
Later PMD maintainers may prefer to replace that error log with actual disable code.

> 
>> Specific to `DEV_RX_OFFLOAD_RSS_HASH`, we have already some RSS config
>> structures and it is part of the 'rte_eth_dev_configure()' API, won't it create
>> multiple way to do same thing?
> 
> No, a new offload is responsible for RSS hash delivery from NIC to host
> and fill in in mbuf returned to application on Rx.

What you have described is already happening without the new offload flag and
this is my concern that we are duplicating it.


There is a 'struct rte_eth_rxmode' (under 'struct rte_eth_conf')
which has 'enum rte_eth_rx_mq_mode mq_mode;'

If "mq_mode == ETH_MQ_RX_NONE" hash calculation is disabled, and
'mbuf::hash::rss' is not updated.

(Thanks Bruce to helping finding it out)


> 
>> And for the `ol_flags:PKT_RX_RSS` flag, it was already used to mark that
>> 'mbuf::hash::rss' is valid, right? Is there anything new related that in the set?
> 
> As I understand you mean, ol_flags::PKT_RX_RSS_HASH.
> Yes, the new offload allows say if application needs it or now.
> Basically it decouples RSS distribution and hash delivery.

Setting 'ol_flags::PKT_RX_RSS_HASH' and 'mbuf::hash::rss' already there and not
changing. I just want to clarify since this is not clear in the commit log.

Only addition is to add a new flag to control PMD to enable/disable hash
calculation (which PMDs ignore in the patch ???)

> 
>> Specific to the `DEV_RX_OFFLOAD_FLOW_MARK` and `RTE_FLOW_ACTION_FLAG`, they are
>> rte_flow actions, application can verify and later request these actions via
>> rte_flow APIs. Why we are adding an additional RX_OFFLOAD flag for them?
> 
> The reason is basically the same as above. HW needs to know in advance,
> if application is going to use flow marks and configure Rx queue to enable
> the information delivery.

What you described is done via 'rte_flow_create()' API, application will request
those actions via API and Rx queue will be configured accordingly, this is more
dynamic approach. Why application need to set this additional configuration flag?

And as above the new RX offload flags ignored by PMDs, hard to understand what
is the intention here.


Above usage of flags feels like the intention is adding some capability
information for the PMDs more that adding new offload configuration.
If so this is bigger/older problem, and instead of abusing the offload flags we
can think of an API to present device capabilities, and move features.ini
content to the API in long term.

> 
>>>   Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
>>>   allows application to inform PMDs about the packet types it is interested
>>>   in. Based on ptypes requested by application PMDs can optimize the Rx path.
>> OK to the API, but why "Packet type parsing" feature updated to say it should
>> implement this API?
>> Is this API really required to say "Packet type parsing" supported by PMD?
> 
> As I understand it is not strictly required, but related to the feature.

I am OK with "related", but it is documented as "implements", so doc says it is
required.

> 
>>>   For example, if a given PMD doesn't support any packet types that the
>>>   application is interested in then the application can disable[1] writes to
>>>   `mbuf.packet_type` done by the PMD and use a software ptype parser.
>>>        [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
>>> 					  NULL, 0);
>> And for the 7/7 patch, why we are updating all examples, is the API something do
>> we really need to call for any DPDK application? I am for leaving the default
>> behavior unless there is a very specific case for set or disable packet typing.
>> Instead implement a command in testpmd to test this feature.
> 
> If an application does not use packet types provided in mbuf, it is
> better to inform PMD that the information is not required to allow PMD
> to do optimizations. 
> 

I can see disabling packet type detection may increase the performance but
sample applications are to demonstrate a specific feature, adding these kind of
APIs will pollute them.
'skeleton' app that shows the most basic code for forwarding sample, why it is
now having "experimental" 'set_supported_ptypes()' API? Same for other. As said
before I think a testpmd command suits better here.


> Yes, may be it would be better to have it as the
> default behaviour, but it would be behaviour change in comparison
> to previous DPDK releases and it is better to avoid it.

Sorry I missed why not calling this function cause behavior change? I think it
is other way around, no?


> Thanks,
> Andrew.
> 
>>> v12 Changes:
>>> -----------
>>> - Rebase onto next-net.
>>>
>>> v11 Changes:
>>> -----------
>>> - Use RTE_DIM to get array size.
>>> - Since we are using a list of MASKs to validate ptype_mask return -EINVAL
>>>    if any unknown mask is set.
>>> - Rebase to TOT.
>>>
>>> v10 Changes:
>>> -----------
>>> - Modify ptype_mask validation in set_supported_ptypes.(Andrew)
>>>
>>> v9 Changes:
>>> ----------
>>> - Add ptype_mask validation in set_supported_ptypes.(Andrew)
>>> - Make description more verbose.
>>>
>>> v8 Changes:
>>> ----------
>>> - Make description more verbose.
>>> - Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
>>>    is not supported by ethernet device.
>>>
>>> v7 Changes:
>>> ----------
>>> - Fix unused variable in net/octeontx2
>>>
>>> v6 Changes:
>>> ----------
>>> - Add additional checks for set supported ptypes.(Andrew)
>>> - Clarify `rte_eth_dev_set_supported_ptypes` documentation.
>>> - Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.
>>>
>>> v5 Changes:
>>> ----------
>>> - Fix typos.
>>>
>>> v4 Changes:
>>> ----------
>>> - Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
>>>    of array.
>>> - Fix invalid set ptype function call in examples.
>>> - Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.
>>>
>>> v3 Changes:
>>> ----------
>>> - Add missing release notes. (Andrew)
>>> - Re-word various descriptions.
>>> - Fix ptype set logic.
>>>
>>> v2 Changes:
>>> ----------
>>> - Update release notes. (Andrew)
>>> - Redo commit logs. (Andrew)
>>> - Disable ptype parsing for unsupported examples. (Jerin)
>>> - Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
>>> - Modify set_supported_ptypes function to return successfuly set mask
>>>    instead of failure.
>>> - Dropped set_supported_ptypes to drivers by handling in library
>>>    layer, interested PMD can add it in.
>>>
>>> Pavan Nikhilesh (7):
>>>    ethdev: add set ptype function
>>>    ethdev: add mbuf RSS update as an offload
>>>    ethdev: add flow action type update as an offload
>>>    drivers/net: update Rx RSS hash offload capabilities
>>>    drivers/net: update Rx flow flag and mark capabilities
>>>    examples/eventdev_pipeline: add new Rx RSS hash offload
>>>    examples: disable Rx packet type parsing
>> <...>
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags
  2019-10-18  9:42                         ` Ferruh Yigit
@ 2019-10-18 10:31                           ` Andrew Rybchenko
  2019-10-21 15:06                             ` Ferruh Yigit
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-18 10:31 UTC (permalink / raw)
  To: Ferruh Yigit, pbhagavatula, jerinj
  Cc: dev, Adrien Mazarguil, Thomas Monjalon, Xiaolong Ye, Bruce Richardson

On 10/18/19 12:42 PM, Ferruh Yigit wrote:
> On 10/18/2019 8:32 AM, Andrew Rybchenko wrote:
>> Hi Ferruh,
>>
>> since I've reviewed I'll reply as I understand it.
>>
>> On 10/17/19 8:43 PM, Ferruh Yigit wrote:
>>> On 10/17/2019 1:02 PM, pbhagavatula@marvell.com wrote:
>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>>
>>>>    Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
>>>>    `DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
>>>>    enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
>>>>    and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.
>>> Hi Pavan,
>>>
>>> Initially sorry for involving late,
>>>
>>> When we expose an interface to the applications, they will expect those will be
>>> respected by underlying PMDs.
>>> As far as I can see drivers are updated to report new added Rx offload flags as
>>> supported capabilities but drivers are not using those flags at all, so
>>> application providing that flag won't really enable/disable anything, I think
>>> this is a problem and it is wrong to lie even for the PMDs J
>> It is required to let applications know that the offload is supported.
>> There are a number of cases when an offload cannot be disabled,
>> but it does not mean that the offload must not be advertised.
> Can't disable is something else, although I believe that is rare case, in this
> case driver can enable/disable the RSS and representing this as an offload
> capability.

It is not enabling/disabling the RSS. It is enabling/disabling RSS hash 
delivery
together with an mbuf.

> But when user want to configure this offload by setting or unsetting in offload
> config, driver just ignores it.

When application enables offload, it says that it needs it and going to use
(required). When the offload is not enabled, application simply don't care.
So, if the information is still provided it does not harm.

>> If driver see benefits from disabling the offload (e.g. avoid delivery
>> of RSS hash from NIC to host), it can do it after the patchset.
> Yes but I think this patchset shouldn't ignore that disabling the feature is not
> implemented yet. If those PMDs that has been updated to report the HASH
> capability has RSS enabled by default, I suggest adding a check for this offload
> in PMD,
> if it is requested to disable (which means not requested for enable), print a
> log saying disabling HASH is not supported and set this flag in the offload
> configuration to say PMD is configured to calculate the HASH.
> Later PMD maintainers may prefer to replace that error log with actual disable code.

It is possible to do. Of course, it is better to provide real offload 
values on get, but
eth_conf is const in rte_eth_dev_configure(), so, we can't change it and 
it is good.
So, the only way is rte_eth_rx_queue_info_get().
I guess there is a lot of space for the same improvement for other Rx 
offloads
in various PMDs.
Also I worry that it could be not that trivial to do in all effected PMDs.

>>> Specific to `DEV_RX_OFFLOAD_RSS_HASH`, we have already some RSS config
>>> structures and it is part of the 'rte_eth_dev_configure()' API, won't it create
>>> multiple way to do same thing?
>> No, a new offload is responsible for RSS hash delivery from NIC to host
>> and fill in in mbuf returned to application on Rx.
> What you have described is already happening without the new offload flag and
> this is my concern that we are duplicating it.
>
>
> There is a 'struct rte_eth_rxmode' (under 'struct rte_eth_conf')
> which has 'enum rte_eth_rx_mq_mode mq_mode;'
>
> If "mq_mode == ETH_MQ_RX_NONE" hash calculation is disabled, and
> 'mbuf::hash::rss' is not updated.

No-no. It binds RSS distribution and hash delivery. What the new
offload allows to achieve: I want Rx to spread traffic over many Rx
queues, but I don't need RSS hash.

> (Thanks Bruce to helping finding it out)
>
>
>>> And for the `ol_flags:PKT_RX_RSS` flag, it was already used to mark that
>>> 'mbuf::hash::rss' is valid, right? Is there anything new related that in the set?
>> As I understand you mean, ol_flags::PKT_RX_RSS_HASH.
>> Yes, the new offload allows say if application needs it or now.
>> Basically it decouples RSS distribution and hash delivery.
> Setting 'ol_flags::PKT_RX_RSS_HASH' and 'mbuf::hash::rss' already there and not
> changing. I just want to clarify since this is not clear in the commit log.
>
> Only addition is to add a new flag to control PMD to enable/disable hash
> calculation (which PMDs ignore in the patch ???)

It is not calculation, but delivery of the value from HW to applications.
Yes, commit log may/should be improved.

>>> Specific to the `DEV_RX_OFFLOAD_FLOW_MARK` and `RTE_FLOW_ACTION_FLAG`, they are
>>> rte_flow actions, application can verify and later request these actions via
>>> rte_flow APIs. Why we are adding an additional RX_OFFLOAD flag for them?
>> The reason is basically the same as above. HW needs to know in advance,
>> if application is going to use flow marks and configure Rx queue to enable
>> the information delivery.
> What you described is done via 'rte_flow_create()' API, application will request
> those actions via API and Rx queue will be configured accordingly, this is more
> dynamic approach. Why application need to set this additional configuration flag?

More dynamic approach is definitely better, but it is not always possible.
Some PMDs can't even change MTU dynamically or MTU changing requires
restart which is hardly really a dynamic change. Of course, it is 
unlikely that
MTU is changed when traffic is running etc, but still possible.
The information about necessity to support flow marks delivery may
be required on Rx queue setup and cannot be changed dynamically when
Rx queue is running and application would like to add flow rule with mark
action.

> And as above the new RX offload flags ignored by PMDs, hard to understand what
> is the intention here.
>
>
> Above usage of flags feels like the intention is adding some capability
> information for the PMDs more that adding new offload configuration.
> If so this is bigger/older problem, and instead of abusing the offload flags we
> can think of an API to present device capabilities, and move features.ini
> content to the API in long term.

What I really like with these new offload flags for Rx hash and flow mark is
that it makes features which provide information in mbuf on Rx consistent:
  - want timestamp? => DEV_RX_OFFLOAD_TIMESTAMP
  - want Rx checksum flags => DEV_RX_OFFLOAD_CHECKSUM
  - want to strip VLAN? => DEV_RX_OFFLOAD_VLAN_STRIP
  - want RSS hash? => DEV_RX_OFFLOAD_RSS_HASH
  - want flow mark support? => DEV_RX_OFFLOAD_FLOW_MARK

Also it perfectly fits dynamic mbuf fields and allows to make RSS hash
and flow mark fields dynamic with the new offloads as controls.

>>>>    Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
>>>>    allows application to inform PMDs about the packet types it is interested
>>>>    in. Based on ptypes requested by application PMDs can optimize the Rx path.
>>> OK to the API, but why "Packet type parsing" feature updated to say it should
>>> implement this API?
>>> Is this API really required to say "Packet type parsing" supported by PMD?
>> As I understand it is not strictly required, but related to the feature.
> I am OK with "related", but it is documented as "implements", so doc says it is
> required.

Agreed.

>>>>    For example, if a given PMD doesn't support any packet types that the
>>>>    application is interested in then the application can disable[1] writes to
>>>>    `mbuf.packet_type` done by the PMD and use a software ptype parser.
>>>>         [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
>>>> 					  NULL, 0);
>>> And for the 7/7 patch, why we are updating all examples, is the API something do
>>> we really need to call for any DPDK application? I am for leaving the default
>>> behavior unless there is a very specific case for set or disable packet typing.
>>> Instead implement a command in testpmd to test this feature.
>> If an application does not use packet types provided in mbuf, it is
>> better to inform PMD that the information is not required to allow PMD
>> to do optimizations.
>>
> I can see disabling packet type detection may increase the performance but
> sample applications are to demonstrate a specific feature, adding these kind of
> APIs will pollute them.
> 'skeleton' app that shows the most basic code for forwarding sample, why it is
> now having "experimental" 'set_supported_ptypes()' API? Same for other. As said
> before I think a testpmd command suits better here.

May be you're right and we should reconsider which applications
are updated and which are ignored. I guess before the criteria
was simple: don't use packet type information, say so to take
benefits from all possible optimizations.

>> Yes, may be it would be better to have it as the
>> default behaviour, but it would be behaviour change in comparison
>> to previous DPDK releases and it is better to avoid it.
> Sorry I missed why not calling this function cause behavior change? I think it
> is other way around, no?

Just misunderstanding. What I was trying to say is that it could
be more logical to have packet type parsing and delivery
disabled by default  (as we have for all other offloads), but
it would be behaviour change from application point of view.
That's why it is necessary to disable explicitly.

Thanks,
Andrew.

>> Thanks,
>> Andrew.
>>
>>>> v12 Changes:
>>>> -----------
>>>> - Rebase onto next-net.
>>>>
>>>> v11 Changes:
>>>> -----------
>>>> - Use RTE_DIM to get array size.
>>>> - Since we are using a list of MASKs to validate ptype_mask return -EINVAL
>>>>     if any unknown mask is set.
>>>> - Rebase to TOT.
>>>>
>>>> v10 Changes:
>>>> -----------
>>>> - Modify ptype_mask validation in set_supported_ptypes.(Andrew)
>>>>
>>>> v9 Changes:
>>>> ----------
>>>> - Add ptype_mask validation in set_supported_ptypes.(Andrew)
>>>> - Make description more verbose.
>>>>
>>>> v8 Changes:
>>>> ----------
>>>> - Make description more verbose.
>>>> - Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
>>>>     is not supported by ethernet device.
>>>>
>>>> v7 Changes:
>>>> ----------
>>>> - Fix unused variable in net/octeontx2
>>>>
>>>> v6 Changes:
>>>> ----------
>>>> - Add additional checks for set supported ptypes.(Andrew)
>>>> - Clarify `rte_eth_dev_set_supported_ptypes` documentation.
>>>> - Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.
>>>>
>>>> v5 Changes:
>>>> ----------
>>>> - Fix typos.
>>>>
>>>> v4 Changes:
>>>> ----------
>>>> - Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
>>>>     of array.
>>>> - Fix invalid set ptype function call in examples.
>>>> - Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.
>>>>
>>>> v3 Changes:
>>>> ----------
>>>> - Add missing release notes. (Andrew)
>>>> - Re-word various descriptions.
>>>> - Fix ptype set logic.
>>>>
>>>> v2 Changes:
>>>> ----------
>>>> - Update release notes. (Andrew)
>>>> - Redo commit logs. (Andrew)
>>>> - Disable ptype parsing for unsupported examples. (Jerin)
>>>> - Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
>>>> - Modify set_supported_ptypes function to return successfuly set mask
>>>>     instead of failure.
>>>> - Dropped set_supported_ptypes to drivers by handling in library
>>>>     layer, interested PMD can add it in.
>>>>
>>>> Pavan Nikhilesh (7):
>>>>     ethdev: add set ptype function
>>>>     ethdev: add mbuf RSS update as an offload
>>>>     ethdev: add flow action type update as an offload
>>>>     drivers/net: update Rx RSS hash offload capabilities
>>>>     drivers/net: update Rx flow flag and mark capabilities
>>>>     examples/eventdev_pipeline: add new Rx RSS hash offload
>>>>     examples: disable Rx packet type parsing
>>> <...>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags
  2019-10-18 10:31                           ` Andrew Rybchenko
@ 2019-10-21 15:06                             ` Ferruh Yigit
  0 siblings, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-10-21 15:06 UTC (permalink / raw)
  To: Andrew Rybchenko, pbhagavatula, jerinj
  Cc: dev, Adrien Mazarguil, Thomas Monjalon, Xiaolong Ye, Bruce Richardson

On 10/18/2019 11:31 AM, Andrew Rybchenko wrote:
> On 10/18/19 12:42 PM, Ferruh Yigit wrote:
>> On 10/18/2019 8:32 AM, Andrew Rybchenko wrote:
>>> Hi Ferruh,
>>>
>>> since I've reviewed I'll reply as I understand it.
>>>
>>> On 10/17/19 8:43 PM, Ferruh Yigit wrote:
>>>> On 10/17/2019 1:02 PM, pbhagavatula@marvell.com wrote:
>>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>>>
>>>>>    Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` and
>>>>>    `DEV_RX_OFFLOAD_FLOW_MARK`. These flags can be used to
>>>>>    enable/disable PMD writes to rte_mbuf fields `hash.rss` and `hash.fdir.hi`
>>>>>    and also `ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.
>>>> Hi Pavan,
>>>>
>>>> Initially sorry for involving late,
>>>>
>>>> When we expose an interface to the applications, they will expect those will be
>>>> respected by underlying PMDs.
>>>> As far as I can see drivers are updated to report new added Rx offload flags as
>>>> supported capabilities but drivers are not using those flags at all, so
>>>> application providing that flag won't really enable/disable anything, I think
>>>> this is a problem and it is wrong to lie even for the PMDs J
>>> It is required to let applications know that the offload is supported.
>>> There are a number of cases when an offload cannot be disabled,
>>> but it does not mean that the offload must not be advertised.
>> Can't disable is something else, although I believe that is rare case, in this
>> case driver can enable/disable the RSS and representing this as an offload
>> capability.
> 
> It is not enabling/disabling the RSS. It is enabling/disabling RSS hash 
> delivery
> together with an mbuf.


Got it, it is related to the RSS hash delivery.

> 
>> But when user want to configure this offload by setting or unsetting in offload
>> config, driver just ignores it.
> 
> When application enables offload, it says that it needs it and going to use
> (required). When the offload is not enabled, application simply don't care.
> So, if the information is still provided it does not harm.


Not sure if there is no harm, a config option not respected by underlying PMDs
silently is a problem I think.

> 
>>> If driver see benefits from disabling the offload (e.g. avoid delivery
>>> of RSS hash from NIC to host), it can do it after the patchset.
>> Yes but I think this patchset shouldn't ignore that disabling the feature is not
>> implemented yet. If those PMDs that has been updated to report the HASH
>> capability has RSS enabled by default, I suggest adding a check for this offload
>> in PMD,
>> if it is requested to disable (which means not requested for enable), print a
>> log saying disabling HASH is not supported and set this flag in the offload
>> configuration to say PMD is configured to calculate the HASH.
>> Later PMD maintainers may prefer to replace that error log with actual disable code.
> 
> It is possible to do. Of course, it is better to provide real offload 
> values on get, but
> eth_conf is const in rte_eth_dev_configure(), so, we can't change it and 
> it is good.
> So, the only way is rte_eth_rx_queue_info_get().
> I guess there is a lot of space for the same improvement for other Rx 
> offloads
> in various PMDs.


We don't need the update 'eth_conf' parameter of the 'rte_eth_dev_configure()',
that is what user requested, but config stored in 'dev->data->dev_conf' which
can be updated.

> Also I worry that it could be not that trivial to do in all effected PMDs.


Yes it can be some work, and if this patchset doesn't do it, who will do the work?

> 
>>>> Specific to `DEV_RX_OFFLOAD_RSS_HASH`, we have already some RSS config
>>>> structures and it is part of the 'rte_eth_dev_configure()' API, won't it create
>>>> multiple way to do same thing?
>>> No, a new offload is responsible for RSS hash delivery from NIC to host
>>> and fill in in mbuf returned to application on Rx.
>> What you have described is already happening without the new offload flag and
>> this is my concern that we are duplicating it.
>>
>>
>> There is a 'struct rte_eth_rxmode' (under 'struct rte_eth_conf')
>> which has 'enum rte_eth_rx_mq_mode mq_mode;'
>>
>> If "mq_mode == ETH_MQ_RX_NONE" hash calculation is disabled, and
>> 'mbuf::hash::rss' is not updated.
> 
> No-no. It binds RSS distribution and hash delivery. What the new
> offload allows to achieve: I want Rx to spread traffic over many Rx
> queues, but I don't need RSS hash.


I see, so RSS configuration will stay same, but driver needs to take care the
new flags to decide to update or not the mbuf::rss::hash field.

I don't know if disabling RSS but calculating hash is supported, if not
supported that case also should be checked by driver.

> 
>> (Thanks Bruce to helping finding it out)
>>
>>
>>>> And for the `ol_flags:PKT_RX_RSS` flag, it was already used to mark that
>>>> 'mbuf::hash::rss' is valid, right? Is there anything new related that in the set?
>>> As I understand you mean, ol_flags::PKT_RX_RSS_HASH.
>>> Yes, the new offload allows say if application needs it or now.
>>> Basically it decouples RSS distribution and hash delivery.
>> Setting 'ol_flags::PKT_RX_RSS_HASH' and 'mbuf::hash::rss' already there and not
>> changing. I just want to clarify since this is not clear in the commit log.
>>
>> Only addition is to add a new flag to control PMD to enable/disable hash
>> calculation (which PMDs ignore in the patch ???)
> 
> It is not calculation, but delivery of the value from HW to applications.


OK

> Yes, commit log may/should be improved.>
>>>> Specific to the `DEV_RX_OFFLOAD_FLOW_MARK` and `RTE_FLOW_ACTION_FLAG`, they are
>>>> rte_flow actions, application can verify and later request these actions via
>>>> rte_flow APIs. Why we are adding an additional RX_OFFLOAD flag for them?
>>> The reason is basically the same as above. HW needs to know in advance,
>>> if application is going to use flow marks and configure Rx queue to enable
>>> the information delivery.
>> What you described is done via 'rte_flow_create()' API, application will request
>> those actions via API and Rx queue will be configured accordingly, this is more
>> dynamic approach. Why application need to set this additional configuration flag?
> 
> More dynamic approach is definitely better, but it is not always possible.
> Some PMDs can't even change MTU dynamically or MTU changing requires
> restart which is hardly really a dynamic change. Of course, it is 
> unlikely that
> MTU is changed when traffic is running etc, but still possible.
> The information about necessity to support flow marks delivery may
> be required on Rx queue setup and cannot be changed dynamically when
> Rx queue is running and application would like to add flow rule with mark
> action.

It doesn't need to be changed dynamically, application can call
'rte_flow_validate()' and learn if it can set this action or not. Perhaps I am
missing something, when it is required to have this as configuration option?

> 
>> And as above the new RX offload flags ignored by PMDs, hard to understand what
>> is the intention here.
>>
>>
>> Above usage of flags feels like the intention is adding some capability
>> information for the PMDs more that adding new offload configuration.
>> If so this is bigger/older problem, and instead of abusing the offload flags we
>> can think of an API to present device capabilities, and move features.ini
>> content to the API in long term.
> 
> What I really like with these new offload flags for Rx hash and flow mark is
> that it makes features which provide information in mbuf on Rx consistent:
>   - want timestamp? => DEV_RX_OFFLOAD_TIMESTAMP
>   - want Rx checksum flags => DEV_RX_OFFLOAD_CHECKSUM
>   - want to strip VLAN? => DEV_RX_OFFLOAD_VLAN_STRIP
>   - want RSS hash? => DEV_RX_OFFLOAD_RSS_HASH
>   - want flow mark support? => DEV_RX_OFFLOAD_FLOW_MARK
> 
> Also it perfectly fits dynamic mbuf fields and allows to make RSS hash
> and flow mark fields dynamic with the new offloads as controls

Agree RSS_HASH fits well, my main concern with the patchset is driver
implementations are missing and just ignored.

I am not so sure about FLOW_MARK one, it looks like it is duplicating the
rte_flow API.

> 
>>>>>    Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
>>>>>    allows application to inform PMDs about the packet types it is interested
>>>>>    in. Based on ptypes requested by application PMDs can optimize the Rx path.
>>>> OK to the API, but why "Packet type parsing" feature updated to say it should
>>>> implement this API?
>>>> Is this API really required to say "Packet type parsing" supported by PMD?
>>> As I understand it is not strictly required, but related to the feature.
>> I am OK with "related", but it is documented as "implements", so doc says it is
>> required.
> 
> Agreed.
> 
>>>>>    For example, if a given PMD doesn't support any packet types that the
>>>>>    application is interested in then the application can disable[1] writes to
>>>>>    `mbuf.packet_type` done by the PMD and use a software ptype parser.
>>>>>         [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
>>>>> 					  NULL, 0);
>>>> And for the 7/7 patch, why we are updating all examples, is the API something do
>>>> we really need to call for any DPDK application? I am for leaving the default
>>>> behavior unless there is a very specific case for set or disable packet typing.
>>>> Instead implement a command in testpmd to test this feature.
>>> If an application does not use packet types provided in mbuf, it is
>>> better to inform PMD that the information is not required to allow PMD
>>> to do optimizations.
>>>
>> I can see disabling packet type detection may increase the performance but
>> sample applications are to demonstrate a specific feature, adding these kind of
>> APIs will pollute them.
>> 'skeleton' app that shows the most basic code for forwarding sample, why it is
>> now having "experimental" 'set_supported_ptypes()' API? Same for other. As said
>> before I think a testpmd command suits better here.
> 
> May be you're right and we should reconsider which applications
> are updated and which are ignored. I guess before the criteria
> was simple: don't use packet type information, say so to take
> benefits from all possible optimizations.
> 
>>> Yes, may be it would be better to have it as the
>>> default behaviour, but it would be behaviour change in comparison
>>> to previous DPDK releases and it is better to avoid it.
>> Sorry I missed why not calling this function cause behavior change? I think it
>> is other way around, no?
> 
> Just misunderstanding. What I was trying to say is that it could
> be more logical to have packet type parsing and delivery
> disabled by default  (as we have for all other offloads), but
> it would be behaviour change from application point of view.
> That's why it is necessary to disable explicitly.
> 
> Thanks,
> Andrew.
> 
>>> Thanks,
>>> Andrew.
>>>
>>>>> v12 Changes:
>>>>> -----------
>>>>> - Rebase onto next-net.
>>>>>
>>>>> v11 Changes:
>>>>> -----------
>>>>> - Use RTE_DIM to get array size.
>>>>> - Since we are using a list of MASKs to validate ptype_mask return -EINVAL
>>>>>     if any unknown mask is set.
>>>>> - Rebase to TOT.
>>>>>
>>>>> v10 Changes:
>>>>> -----------
>>>>> - Modify ptype_mask validation in set_supported_ptypes.(Andrew)
>>>>>
>>>>> v9 Changes:
>>>>> ----------
>>>>> - Add ptype_mask validation in set_supported_ptypes.(Andrew)
>>>>> - Make description more verbose.
>>>>>
>>>>> v8 Changes:
>>>>> ----------
>>>>> - Make description more verbose.
>>>>> - Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
>>>>>     is not supported by ethernet device.
>>>>>
>>>>> v7 Changes:
>>>>> ----------
>>>>> - Fix unused variable in net/octeontx2
>>>>>
>>>>> v6 Changes:
>>>>> ----------
>>>>> - Add additional checks for set supported ptypes.(Andrew)
>>>>> - Clarify `rte_eth_dev_set_supported_ptypes` documentation.
>>>>> - Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.
>>>>>
>>>>> v5 Changes:
>>>>> ----------
>>>>> - Fix typos.
>>>>>
>>>>> v4 Changes:
>>>>> ----------
>>>>> - Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
>>>>>     of array.
>>>>> - Fix invalid set ptype function call in examples.
>>>>> - Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.
>>>>>
>>>>> v3 Changes:
>>>>> ----------
>>>>> - Add missing release notes. (Andrew)
>>>>> - Re-word various descriptions.
>>>>> - Fix ptype set logic.
>>>>>
>>>>> v2 Changes:
>>>>> ----------
>>>>> - Update release notes. (Andrew)
>>>>> - Redo commit logs. (Andrew)
>>>>> - Disable ptype parsing for unsupported examples. (Jerin)
>>>>> - Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
>>>>> - Modify set_supported_ptypes function to return successfuly set mask
>>>>>     instead of failure.
>>>>> - Dropped set_supported_ptypes to drivers by handling in library
>>>>>     layer, interested PMD can add it in.
>>>>>
>>>>> Pavan Nikhilesh (7):
>>>>>     ethdev: add set ptype function
>>>>>     ethdev: add mbuf RSS update as an offload
>>>>>     ethdev: add flow action type update as an offload
>>>>>     drivers/net: update Rx RSS hash offload capabilities
>>>>>     drivers/net: update Rx flow flag and mark capabilities
>>>>>     examples/eventdev_pipeline: add new Rx RSS hash offload
>>>>>     examples: disable Rx packet type parsing
>>>> <...>
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v13 0/6] ethdev: add new Rx offload flags
  2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
                                       ` (7 preceding siblings ...)
  2019-10-17 17:43                     ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags Ferruh Yigit
@ 2019-10-25 14:33                     ` pbhagavatula
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 1/6] ethdev: add set ptype function pbhagavatula
                                         ` (6 more replies)
  8 siblings, 7 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-25 14:33 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` These flags can be used
to enable/disable PMD writes to rte_mbuf fields `hash.rss` and also
`ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
                                          NULL, 0);

v13 Changes:
-----------
- Remove DEV_RX_OFFLOAD_FLOW_MARK from this patchset to allow foreward
  progress will be sent as a seperate patch.
- Use set_supported function only for l2fwd and testpmd.
- Add info log in drivers which expose the DEV_RX_OFFLOAD_RSS_HASH
  indicating that disabling DEV_RX_OFFLOAD_RSS_HASH is not supported.
- Few documentation changes.

v12 Changes:
-----------
- Rebase onto next-net.

v11 Changes:
-----------
- Use RTE_DIM to get array size.
- Since we are using a list of MASKs to validate ptype_mask return -EINVAL
  if any unknown mask is set.
- Rebase to TOT.

v10 Changes:
-----------
- Modify ptype_mask validation in set_supported_ptypes.(Andrew)

v9 Changes:
----------
- Add ptype_mask validation in set_supported_ptypes.(Andrew)
- Make description more verbose.

v8 Changes:
----------
- Make description more verbose.
- Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
  is not supported by ethernet device.

v7 Changes:
----------
- Fix unused variable in net/octeontx2

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.

Pavan Nikhilesh (6):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  drivers/net: update Rx RSS hash offload capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples/l2fwd: disable ptype parsing
  app/testpmd: add command to set supported ptype mask

 app/test-pmd/cmdline.c                        |  80 +++++++++++
 doc/guides/nics/features.rst                  |   9 +-
 doc/guides/rel_notes/release_19_11.rst        |  15 ++
 drivers/net/bnxt/bnxt_ethdev.c                |   9 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/cxgbe/cxgbe_ethdev.c              |   7 +
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   1 +
 drivers/net/e1000/igb_ethdev.c                |  10 ++
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_ethdev.c                |   7 +
 drivers/net/enic/enic_res.c                   |   3 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   8 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   8 +-
 drivers/net/i40e/i40e_ethdev.c                |   8 +-
 drivers/net/iavf/iavf_ethdev.c                |   8 +-
 drivers/net/ice/ice_ethdev.c                  |   8 +-
 drivers/net/ixgbe/ixgbe_ethdev.c              |  11 ++
 drivers/net/ixgbe/ixgbe_rxtx.c                |   3 +-
 drivers/net/liquidio/lio_ethdev.c             |  10 +-
 drivers/net/mlx4/mlx4.c                       |   5 +
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_ethdev.c                |   6 +
 drivers/net/mlx5/mlx5_rxq.c                   |   3 +-
 drivers/net/netvsc/hn_ethdev.c                |   5 +
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   8 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  15 +-
 drivers/net/qede/qede_ethdev.c                |   8 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   2 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_ethdev.c                  |   5 +
 drivers/net/sfc/sfc_rx.c                      |   3 +-
 drivers/net/thunderx/nicvf_ethdev.c           |   5 +
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   8 +-
 examples/eventdev_pipeline/main.c             | 128 -----------------
 .../pipeline_worker_generic.c                 | 132 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 +++++++++++++++++
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 lib/librte_ethdev/rte_ethdev.c                |  88 +++++++++++-
 lib/librte_ethdev/rte_ethdev.h                |  38 +++++
 lib/librte_ethdev/rte_ethdev_core.h           |  19 +++
 lib/librte_ethdev/rte_ethdev_version.map      |   1 +
 47 files changed, 679 insertions(+), 161 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v13 1/6] ethdev: add set ptype function
  2019-10-25 14:33                     ` [dpdk-dev] [PATCH v13 0/6] " pbhagavatula
@ 2019-10-25 14:33                       ` pbhagavatula
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 2/6] ethdev: add mbuf RSS update as an offload pbhagavatula
                                         ` (5 subsequent siblings)
  6 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-25 14:33 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst             |  7 +-
 doc/guides/rel_notes/release_19_11.rst   |  8 +++
 lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
 lib/librte_ethdev/rte_ethdev.h           | 37 ++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      | 19 ++++++
 lib/librte_ethdev/rte_ethdev_version.map |  1 +
 6 files changed, 156 insertions(+), 3 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index d96696801..6e20bee5f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,12 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``, ``dev_supported_ptypes_set``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index faf69b0d9..96aac2053 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -185,6 +185,14 @@ New Features
   * Added a console command to testpmd app, ``show port (port_id) ptypes`` which
     gives ability to print port supported ptypes in different protocol layers.
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 7743205d3..6ce8f5e75 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2734,6 +2734,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	const uint32_t valid_ptype_masks[] = {
+		RTE_PTYPE_L2_MASK,
+		RTE_PTYPE_L3_MASK,
+		RTE_PTYPE_L4_MASK,
+		RTE_PTYPE_TUNNEL_MASK,
+		RTE_PTYPE_INNER_L2_MASK,
+		RTE_PTYPE_INNER_L3_MASK,
+		RTE_PTYPE_INNER_L4_MASK,
+	};
+	const uint32_t *all_ptypes;
+	struct rte_eth_dev *dev;
+	uint32_t unused_mask;
+	unsigned int i, j;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
+			*dev->dev_ops->dev_supported_ptypes_set == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	if (ptype_mask == 0) {
+		ret = (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+		goto ptype_unknown;
+	}
+
+	unused_mask = ptype_mask;
+	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
+		uint32_t mask = ptype_mask & valid_ptype_masks[i];
+		if (mask && mask != valid_ptype_masks[i]) {
+			ret = -EINVAL;
+			goto ptype_unknown;
+		}
+		unused_mask &= ~valid_ptype_masks[i];
+	}
+
+	if (unused_mask) {
+		ret = -EINVAL;
+		goto ptype_unknown;
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	/*
+	 * Accodommodate as many set_ptypes as possible. If the supplied
+	 * set_ptypes array is insufficient fill it partially.
+	 */
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL && j < num)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+
+ptype_unknown:
+	if (num > 0)
+		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+	return ret;
+}
+
 int
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
@@ -2746,7 +2832,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 	return 0;
 }
 
-
 int
 rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c36c1b631..c4ec36ea7 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2539,6 +2539,43 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification the recipient is
+ * interested in.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, unsigned int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 392aea8e6..d5245a7d0 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -234,6 +234,23 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+/**
+ * @internal
+ * Inform an Ethernet device about packet types classifications the recipient
+ * is interested in.
+ *
+ * @param dev
+ *   The Ethernet device identifier.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @return
+ *   - (0) if Success.
+ *   - (-EINVAL) if *ptype_mask* is invalid.
+ */
+typedef int (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -550,6 +567,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform Ethernet device about packet types the recipient is interested in. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index e59d51648..f511294d2 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -288,4 +288,5 @@ EXPERIMENTAL {
 	rte_eth_rx_burst_mode_get;
 	rte_eth_tx_burst_mode_get;
 	rte_eth_burst_mode_option_name;
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v13 2/6] ethdev: add mbuf RSS update as an offload
  2019-10-25 14:33                     ` [dpdk-dev] [PATCH v13 0/6] " pbhagavatula
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 1/6] ethdev: add set ptype function pbhagavatula
@ 2019-10-25 14:33                       ` pbhagavatula
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 3/6] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                                         ` (4 subsequent siblings)
  6 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-25 14:33 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           |  2 ++
 doc/guides/rel_notes/release_19_11.rst |  7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 11 +++++++++++
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 4 files changed, 21 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 6e20bee5f..9d45e927d 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 96aac2053..fab4eca22 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -193,6 +193,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 6ce8f5e75..fef1dbb61 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
@@ -1303,6 +1304,16 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	/* Check if Rx*/
+	if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_NONE) &&
+	    (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u config invalid mq_mode %s with offloads %s\n",
+			port_id, "ETH_MQ_RX_NONE", "DEV_RX_OFFLOAD_RSS_HASH");
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of RX/TX queues and reconfigure device.
 	 */
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c4ec36ea7..a85e5bb0d 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1048,6 +1048,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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v13 3/6] drivers/net: update Rx RSS hash offload capabilities
  2019-10-25 14:33                     ` [dpdk-dev] [PATCH v13 0/6] " pbhagavatula
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 1/6] ethdev: add set ptype function pbhagavatula
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 2/6] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-25 14:33                       ` pbhagavatula
  2019-10-25 14:56                         ` Andrew Rybchenko
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 4/6] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                                         ` (3 subsequent siblings)
  6 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-25 14:33 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c       |  9 ++++++++-
 drivers/net/cxgbe/cxgbe.h            |  3 ++-
 drivers/net/cxgbe/cxgbe_ethdev.c     |  7 +++++++
 drivers/net/dpaa/dpaa_ethdev.c       |  3 ++-
 drivers/net/dpaa2/dpaa2_ethdev.c     |  1 +
 drivers/net/e1000/igb_ethdev.c       | 10 ++++++++++
 drivers/net/e1000/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_ethdev.c       |  7 +++++++
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  8 +++++++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  8 +++++++-
 drivers/net/i40e/i40e_ethdev.c       |  8 +++++++-
 drivers/net/iavf/iavf_ethdev.c       |  8 +++++++-
 drivers/net/ice/ice_ethdev.c         |  8 +++++++-
 drivers/net/ixgbe/ixgbe_ethdev.c     | 11 +++++++++++
 drivers/net/ixgbe/ixgbe_rxtx.c       |  3 ++-
 drivers/net/liquidio/lio_ethdev.c    | 10 +++++++++-
 drivers/net/mlx4/mlx4.c              |  5 +++++
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_ethdev.c       |  6 ++++++
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_ethdev.c       |  5 +++++
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  8 +++++++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  8 +++++++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  2 +-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_ethdev.c         |  5 +++++
 drivers/net/sfc/sfc_rx.c             |  3 ++-
 drivers/net/thunderx/nicvf_ethdev.c  |  5 +++++
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  8 +++++++-
 34 files changed, 168 insertions(+), 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e7ec99e15..d4f8cc92a 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -117,7 +117,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_VLAN_EXTEND | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_SCATTER)
+				     DEV_RX_OFFLOAD_SCATTER | \
+				     DEV_RX_OFFLOAD_RSS_HASH)
 
 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);
@@ -681,6 +682,12 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
 	bp->rx_cp_nr_rings = bp->rx_nr_rings;
 	bp->tx_cp_nr_rings = bp->tx_nr_rings;
 
+	if (!(rx_offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_DRV_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled\n");
+		rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+		eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
+	}
+
 	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
 		eth_dev->data->mtu =
 			eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
diff --git a/drivers/net/cxgbe/cxgbe.h b/drivers/net/cxgbe/cxgbe.h
index ed1be3559..6c1f73ac4 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_RSS_HASH)
 
 
 /* Common PF and VF devargs */
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 615dda607..67a6129d1 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -426,6 +426,13 @@ int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)
 
 	CXGBE_FUNC_TRACE();
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+				DEV_RX_OFFLOAD_RSS_HASH)) {
+		dev_info(adapter, "RX_OFFLOAD_RSS_HASH cannot be disabled\n");
+		eth_dev->data->dev_conf.rxmode.offloads |=
+							DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	if (!(adapter->flags & FW_QUEUE_BOUND)) {
 		err = cxgbe_setup_sge_fwevtq(adapter);
 		if (err)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index caf255d67..096da752d 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -56,7 +56,8 @@ static uint64_t dev_rx_offloads_nodis =
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+		DEV_RX_OFFLOAD_RSS_HASH;
 
 /* Supported Tx offloads */
 static uint64_t dev_tx_offloads_sup =
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 03131b903..eea31f254 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -45,6 +45,7 @@ static uint64_t dev_rx_offloads_sup =
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
+		DEV_RX_OFFLOAD_RSS_HASH |
 		DEV_RX_OFFLOAD_SCATTER;
 
 /* Supported Tx offloads */
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index ce7c9e664..8efb4f103 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1182,6 +1182,11 @@ eth_igb_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_INIT_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	/* multipe queue mode checking */
 	ret  = igb_check_mq_mode(dev);
 	if (ret != 0) {
@@ -3255,6 +3260,11 @@ igbvf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_INIT_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 12c59a3c5..ffca027b3 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -405,6 +405,13 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
 		return ret;
 	}
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+						DEV_RX_OFFLOAD_RSS_HASH)) {
+		dev_info(enic, "RX_OFFLOAD_RSS_HASH cannot be disabled\n");
+		eth_dev->data->dev_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	enic->mc_count = 0;
 	enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads &
 				  DEV_RX_OFFLOAD_CHECKSUM);
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index f403a0b66..7c3c270a2 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -205,7 +205,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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 99c4366e4..c513bed64 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -461,6 +461,11 @@ fm10k_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_INIT_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	/* multipe queue mode checking */
 	ret  = fm10k_check_mq_mode(dev);
 	if (ret != 0) {
@@ -1805,7 +1810,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 9f37a404b..9db7ceb02 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -318,6 +318,11 @@ static int hinic_dev_configure(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_DRV_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	/* mtu size is 256~9600 */
 	if (dev->data->dev_conf.rxmode.max_rx_pkt_len < HINIC_MIN_FRAME_SIZE ||
 	    dev->data->dev_conf.rxmode.max_rx_pkt_len >
@@ -740,7 +745,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 				DEV_RX_OFFLOAD_VLAN_FILTER |
 				DEV_RX_OFFLOAD_SCATTER |
 				DEV_RX_OFFLOAD_JUMBO_FRAME |
-				DEV_RX_OFFLOAD_TCP_LRO;
+				DEV_RX_OFFLOAD_TCP_LRO |
+				DEV_RX_OFFLOAD_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 77a46832c..efc6c7afc 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1812,6 +1812,11 @@ i40e_dev_configure(struct rte_eth_dev *dev)
 	ad->tx_simple_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_DRV_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled.");
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	/* Only legacy filter API needs the following fdir config. So when the
 	 * legacy filter API is deprecated, the following codes should also be
 	 * removed.
@@ -3613,7 +3618,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_RSS_HASH;
 
 	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 eebc49ade..e5caaef46 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -147,6 +147,11 @@ iavf_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_vec_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_DRV_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	/* Vlan stripping setting */
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
 		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
@@ -522,7 +527,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_RSS_HASH;
 	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 d74675842..9a8e54958 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2357,6 +2357,11 @@ ice_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_bulk_alloc_allowed = true;
 	ad->tx_simple_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_DRV_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled\n");
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	return 0;
 }
 
@@ -2800,7 +2805,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index dbce7a80e..c51758c35 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2402,6 +2402,12 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
 	int ret;
 
 	PMD_INIT_FUNC_TRACE();
+
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_DRV_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	/* multipe queue mode checking */
 	ret  = ixgbe_check_mq_mode(dev);
 	if (ret != 0) {
@@ -5140,6 +5146,11 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_INIT_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index ec01343f1..d8f2522bf 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -412,7 +412,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
@@ -1735,6 +1736,13 @@ lio_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+						DEV_RX_OFFLOAD_RSS_HASH)) {
+		lio_dev_info(lio_dev,
+			     "RX_OFFLOAD_RSS_HASH cannot be disabled\n");
+		eth_dev->data->dev_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_RSS_HASH;
+	}
 	/* Inform firmware about change in number of queues to use.
 	 * Disable IO queues and reset registers for re-configuration.
 	 */
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 931e4f4fe..d54da25b0 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -248,6 +248,11 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
 	struct rte_flow_error error;
 	int ret;
 
+	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH)) {
+		INFO("RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	/* Prepare internal flow rules. */
 	ret = mlx4_flow_sync(priv, &error);
 	if (ret) {
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	if (priv->hw_csum)
 		offloads |= DEV_RX_OFFLOAD_CHECKSUM;
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 2278b24c0..824033a78 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -407,6 +407,12 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
 		rte_errno = ENOMEM;
 		return -rte_errno;
 	}
+
+	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH)) {
+		DRV_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	memcpy(priv->rss_conf.rss_key,
 	       use_app_rss_key ?
 	       dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key :
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index f0ab8438d..c8e1fc4b6 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index eed8dece9..cccdb0b8b 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -532,6 +532,11 @@ static int hn_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_DRV_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev_conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	unsupported = txmode->offloads & ~HN_TX_OFFLOAD_CAPS;
 	if (unsupported) {
 		PMD_DRV_LOG(NOTICE,
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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 22a8b2d19..3911e8b71 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -407,6 +407,11 @@ nfp_net_configure(struct rte_eth_dev *dev)
 	rxmode = &dev_conf->rxmode;
 	txmode = &dev_conf->txmode;
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_DRV_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	/* Checking TX mode */
 	if (txmode->mq_mode) {
 		PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported");
@@ -1236,7 +1241,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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index 62291c698..d6e8ae745 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -575,7 +575,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 4d9ed4870..d581240fe 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	| \
@@ -140,11 +140,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_RSS_HASH)
 
 #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 53fdfde9a..578cc16e3 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1182,6 +1182,11 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE(edev);
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		DP_INFO(edev, "RX_OFFLOAD_RSS_HASH cannot be disabled\n");
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	/* We need to have min 1 RX queue.There is no min check in
 	 * rte_eth_dev_configure(), so we are checking it here.
 	 */
@@ -1302,7 +1307,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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..220ef0e47 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= 0,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..85b5df466 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
 				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
 	.qcreate		= sfc_ef10_rx_qcreate,
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 454b8956a..403711ca0 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -206,6 +206,11 @@ sfc_dev_configure(struct rte_eth_dev *dev)
 	sfc_log_init(sa, "entry n_rxq=%u n_txq=%u",
 		     dev_data->nb_rx_queues, dev_data->nb_tx_queues);
 
+	if (!(dev_data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		sfc_info(sa, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev_data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	sfc_adapter_lock(sa);
 	switch (sa->state) {
 	case SFC_ADAPTER_CONFIGURED:
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..695580b22 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
-	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
+	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index b93d45712..4143cf4d0 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1920,6 +1920,11 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_INIT_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	if (!rte_eal_has_hugepages()) {
 		PMD_INIT_LOG(INFO, "Huge page is not configured");
 		return -EINVAL;
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 d1faeaa81..e702ab613 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);
 static int eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev);
@@ -407,6 +408,11 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		PMD_INIT_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled");
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	}
+
 	if (dev->data->nb_tx_queues > VMXNET3_MAX_TX_QUEUES ||
 	    dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES) {
 		PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v13 4/6] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-25 14:33                     ` [dpdk-dev] [PATCH v13 0/6] " pbhagavatula
                                         ` (2 preceding siblings ...)
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 3/6] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-25 14:33                       ` pbhagavatula
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 5/6] examples/l2fwd: disable ptype parsing pbhagavatula
                                         ` (2 subsequent siblings)
  6 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-25 14:33 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 128 -----------------
 .../pipeline_worker_generic.c                 | 132 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 +++++++++++++++++
 3 files changed, 260 insertions(+), 128 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f77830282..d3ff1bbe4 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,133 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	retval = rte_eth_dev_info_get(port, &dev_info);
-	if (retval != 0) {
-		printf("Error during getting device (port %u) info: %s\n",
-				port, strerror(-retval));
-		return retval;
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	retval = rte_eth_macaddr_get(port, &addr);
-	if (retval != 0) {
-		printf("Failed to get MAC address (port %u): %s\n",
-				port, rte_strerror(-retval));
-		return retval;
-	}
-
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	retval = rte_eth_promiscuous_enable(port);
-	if (retval != 0)
-		return retval;
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
-
 static void
 do_capability_setup(uint8_t eventdev_id)
 {
@@ -515,7 +388,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..42ff4eeb9 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,137 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +428,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index a0f40c27c..55bb2f762 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,133 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +748,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v13 5/6] examples/l2fwd: disable ptype parsing
  2019-10-25 14:33                     ` [dpdk-dev] [PATCH v13 0/6] " pbhagavatula
                                         ` (3 preceding siblings ...)
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 4/6] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-25 14:33                       ` pbhagavatula
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 6/6] app/testpmd: add command to set supported ptype mask pbhagavatula
  2019-10-29  5:03                       ` [dpdk-dev] [PATCH v14 0/6] ethdev: add new Rx offload flags pbhagavatula
  6 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-25 14:33 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Marko Kovacevic, Ori Kam,
	Bruce Richardson, Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing as l2fwd doesn't rely on packet types.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/l2fwd/Makefile    | 1 +
 examples/l2fwd/main.c      | 2 ++
 examples/l2fwd/meson.build | 1 +
 3 files changed, 4 insertions(+)

diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index d7bcbfae7..b2fee8d86 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -713,6 +713,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v13 6/6] app/testpmd: add command to set supported ptype mask
  2019-10-25 14:33                     ` [dpdk-dev] [PATCH v13 0/6] " pbhagavatula
                                         ` (4 preceding siblings ...)
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 5/6] examples/l2fwd: disable ptype parsing pbhagavatula
@ 2019-10-25 14:33                       ` pbhagavatula
  2019-10-29  5:03                       ` [dpdk-dev] [PATCH v14 0/6] ethdev: add new Rx offload flags pbhagavatula
  6 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-25 14:33 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Wenzhuo Lu, Jingjing Wu,
	Bernard Iremonger, John McNamara, Marko Kovacevic
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add command to set supported ptype mask.
Usage:
	set port <port_id> ptype_mask <ptype_mask>

Disable ptype parsing by default.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test-pmd/cmdline.c                      | 80 +++++++++++++++++++++
 app/test-pmd/testpmd.c                      |  6 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
 3 files changed, 93 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 447806991..9f0356b50 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -18915,6 +18915,85 @@ cmdline_parse_inst_t cmd_show_port_supported_ptypes = {
 	},
 };
 
+/* Common result structure for set port ptypes */
+struct cmd_set_port_supported_ptypes_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t port;
+	portid_t port_id;
+	cmdline_fixed_string_t ptype_mask;
+	uint32_t mask;
+};
+
+/* Common CLI fields for set port ptypes */
+cmdline_parse_token_string_t cmd_set_port_supported_ptypes_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_set_port_supported_ptypes_port =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 port, "port");
+cmdline_parse_token_num_t cmd_set_port_supported_ptypes_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 port_id, UINT16);
+cmdline_parse_token_string_t cmd_set_port_supported_ptypes_mask_str =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 ptype_mask, "ptype_mask");
+cmdline_parse_token_num_t cmd_set_port_supported_ptypes_mask_u32 =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 mask, UINT32);
+
+static void
+cmd_set_port_supported_ptypes_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_set_port_supported_ptypes_result *res = parsed_result;
+#define PTYPE_NAMESIZE        256
+	char ptype_name[PTYPE_NAMESIZE];
+	uint16_t port_id = res->port_id;
+	uint32_t ptype_mask = res->mask;
+	int ret, i;
+
+	ret = rte_eth_dev_get_supported_ptypes(port_id, ptype_mask, NULL, 0);
+	if (ret <= 0) {
+		printf("Port %d doesn't support any ptypes.\n", port_id);
+		return;
+	}
+
+	uint32_t ptypes[ret];
+	ret = rte_eth_dev_set_supported_ptypes(port_id, ptype_mask, ptypes,
+					       ret);
+	if (ret <= 0) {
+		printf("Unable to set requested ptypes for Port %d\n", port_id);
+		return;
+	}
+
+	printf("Successfully set following ptypes for Port %d\n", port_id);
+	for (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {
+		rte_get_ptype_name(ptypes[i], ptype_name, sizeof(ptype_name));
+		printf("%s\n", ptype_name);
+	}
+}
+
+cmdline_parse_inst_t cmd_set_port_supported_ptypes = {
+	.f = cmd_set_port_supported_ptypes_parsed,
+	.data = NULL,
+	.help_str = "set port <port_id> ptype_mask <mask>",
+	.tokens = {
+		(void *)&cmd_set_port_supported_ptypes_set,
+		(void *)&cmd_set_port_supported_ptypes_port,
+		(void *)&cmd_set_port_supported_ptypes_port_id,
+		(void *)&cmd_set_port_supported_ptypes_mask_str,
+		(void *)&cmd_set_port_supported_ptypes_mask_u32,
+		NULL,
+	},
+};
+
 /* ******************************************************************************** */
 
 /* list of instructions */
@@ -19154,6 +19233,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_show_vf_stats,
 	(cmdline_parse_inst_t *)&cmd_clear_vf_stats,
 	(cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
+	(cmdline_parse_inst_t *)&cmd_set_port_supported_ptypes,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5701f3141..318a668e6 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2064,6 +2064,7 @@ start_port(portid_t pid)
 	queueid_t qi;
 	struct rte_port *port;
 	struct rte_ether_addr mac_addr;
+	static uint8_t clr_ptypes = 1;
 
 	if (port_id_is_invalid(pid, ENABLED_WARN))
 		return 0;
@@ -2193,6 +2194,11 @@ start_port(portid_t pid)
 			}
 		}
 		configure_rxtx_dump_callbacks(verbose_level);
+		if (clr_ptypes) {
+			clr_ptypes = 0;
+			rte_eth_dev_set_supported_ptypes(pi, RTE_PTYPE_UNKNOWN,
+					NULL, 0);
+		}
 		/* start port */
 		if (rte_eth_dev_start(pi) < 0) {
 			printf("Fail to start port %d\n", pi);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index c68a742eb..9c4dc92aa 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -472,6 +472,13 @@ Show ptypes supported for a specific port::
 
    testpmd> show port (port_id) ptypes
 
+set port supported ptypes
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Inform packet types classification interested in for a specific port::
+
+   testpmd> set port (port_id) ptypes_mask (mask)
+
 show device info
 ~~~~~~~~~~~~~~~~
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v13 3/6] drivers/net: update Rx RSS hash offload capabilities
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 3/6] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-25 14:56                         ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-25 14:56 UTC (permalink / raw)
  To: pbhagavatula, ferruh.yigit, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev

On 10/25/19 5:33 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
> delivery.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Acked-by: Jerin Jacob <jerinj@marvell.com>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

[snip]

> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index e7ec99e15..d4f8cc92a 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -117,7 +117,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
>   				     DEV_RX_OFFLOAD_KEEP_CRC | \
>   				     DEV_RX_OFFLOAD_VLAN_EXTEND | \
>   				     DEV_RX_OFFLOAD_TCP_LRO | \
> -				     DEV_RX_OFFLOAD_SCATTER)
> +				     DEV_RX_OFFLOAD_SCATTER | \
> +				     DEV_RX_OFFLOAD_RSS_HASH)
>   
>   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);
> @@ -681,6 +682,12 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
>   	bp->rx_cp_nr_rings = bp->rx_nr_rings;
>   	bp->tx_cp_nr_rings = bp->tx_nr_rings;
>   
> +	if (!(rx_offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
> +		PMD_DRV_LOG(INFO, "RX_OFFLOAD_RSS_HASH cannot be disabled\n");

Shouldn't logging be done from rte_eth_dev_configure()?
I.e. a generic function which is called after dev_configure callback and
take a look at dev_conf->rx_mode.offloads and
dev->data->dev_conf.rxmode.offloads and for each bit which differs
log message using rte_eth_dev_rx_offload_name().
Same for Tx while we are on the page. I.e. two more patch just before
this one.

> +		rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +		eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
> +	}
> +
>   	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
>   		eth_dev->data->mtu =
>   			eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -

[snip]

> diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
> index 63da807ea..220ef0e47 100644
> --- a/drivers/net/sfc/sfc_ef10_essb_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
> @@ -716,7 +716,7 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
>   	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
>   				  SFC_DP_RX_FEAT_FLOW_MARK,
>   	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
> -	.queue_offload_capa	= 0,
> +	.queue_offload_capa	= DEV_RX_OFFLOAD_RSS_HASH,

Please, move it dev_offload_capa to be sure that it cannot
be requested on queue level and no checks are required
on queue level that the offload cannot be disabled.
We'll move to queue level when/if it is really supported on queue level.

>   	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
>   	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
>   	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
> diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
> index f2fc6e70a..85b5df466 100644
> --- a/drivers/net/sfc/sfc_ef10_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_rx.c
> @@ -797,7 +797,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
>   				  SFC_DP_RX_FEAT_INTR,
>   	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
>   				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
> -	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
> +	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
> +				  DEV_RX_OFFLOAD_RSS_HASH,

Same here

>   	.get_dev_info		= sfc_ef10_rx_get_dev_info,
>   	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
>   	.qcreate		= sfc_ef10_rx_qcreate,
> diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
> index 454b8956a..403711ca0 100644
> --- a/drivers/net/sfc/sfc_ethdev.c
> +++ b/drivers/net/sfc/sfc_ethdev.c
> @@ -206,6 +206,11 @@ sfc_dev_configure(struct rte_eth_dev *dev)
>   	sfc_log_init(sa, "entry n_rxq=%u n_txq=%u",
>   		     dev_data->nb_rx_queues, dev_data->nb_tx_queues);
>   
> +	if (!(dev_data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
> +		sfc_info(sa, "RX_OFFLOAD_RSS_HASH cannot be disabled");
> +		dev_data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +	}
> +

It should be in drivers/net/sfc/sfc_rx.c sfc_rx_check_mode() close to the
end of the function and similar to DEV_RX_OFFLOAD_CHECKSUM.

>   	sfc_adapter_lock(sa);
>   	switch (sa->state) {
>   	case SFC_ADAPTER_CONFIGURED:
> diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
> index e6809bb64..695580b22 100644
> --- a/drivers/net/sfc/sfc_rx.c
> +++ b/drivers/net/sfc/sfc_rx.c
> @@ -618,7 +618,8 @@ struct sfc_dp_rx sfc_efx_rx = {
>   	},
>   	.features		= SFC_DP_RX_FEAT_INTR,
>   	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
> -	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
> +	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER |
> +				  DEV_RX_OFFLOAD_RSS_HASH,

Please, move to dev_offload_capa.

>   	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
>   	.qcreate		= sfc_efx_rx_qcreate,
>   	.qdestroy		= sfc_efx_rx_qdestroy,

[snip]


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v14 0/6] ethdev: add new Rx offload flags
  2019-10-25 14:33                     ` [dpdk-dev] [PATCH v13 0/6] " pbhagavatula
                                         ` (5 preceding siblings ...)
  2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 6/6] app/testpmd: add command to set supported ptype mask pbhagavatula
@ 2019-10-29  5:03                       ` pbhagavatula
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 1/7] ethdev: add set ptype function pbhagavatula
                                           ` (7 more replies)
  6 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-29  5:03 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` These flags can be used
to enable/disable PMD writes to rte_mbuf fields `hash.rss` and also
`ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
					  NULL, 0);

v14 Changes:
-----------
- Remove log from drives
- Add log in rte_eth_dev_configure when certain offloads are requested to be
  disabled and PMD cannot honor the request.
- Make changes to default offloads in net/sfc.(Andrew)

v13 Changes:
-----------
- Remove DEV_RX_OFFLOAD_FLOW_MARK from this patchset to allow foreward
  progress will be sent as a seperate patch.
- Use set_supported function only for l2fwd and testpmd.
- Add info log in drivers which expose the DEV_RX_OFFLOAD_RSS_HASH
  indicating that disabling DEV_RX_OFFLOAD_RSS_HASH is not supported.
- Few documentation changes.

v12 Changes:
-----------
- Rebase onto next-net.

v11 Changes:
-----------
- Use RTE_DIM to get array size.
- Since we are using a list of MASKs to validate ptype_mask return -EINVAL
  if any unknown mask is set.
- Rebase to TOT.

v10 Changes:
-----------
- Modify ptype_mask validation in set_supported_ptypes.(Andrew)

v9 Changes:
----------
- Add ptype_mask validation in set_supported_ptypes.(Andrew)
- Make description more verbose.

v8 Changes:
----------
- Make description more verbose.
- Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
  is not supported by ethernet device.

v7 Changes:
----------
- Fix unused variable in net/octeontx2

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.


Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: log offloads that can't be disabled by PMD
  drivers/net: update Rx RSS hash offload capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples/l2fwd: disable ptype parsing
  app/testpmd: add command to set supported ptype mask

 app/test-pmd/cmdline.c                        |  80 +++++++++++
 app/test-pmd/testpmd.c                        |   6 +
 doc/guides/nics/features.rst                  |   9 +-
 doc/guides/rel_notes/release_19_11.rst        |  15 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst   |   7 +
 drivers/net/bnxt/bnxt_ethdev.c                |   8 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/cxgbe/cxgbe_ethdev.c              |   5 +
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   1 +
 drivers/net/e1000/igb_ethdev.c                |   6 +
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_ethdev.c                |   5 +
 drivers/net/enic/enic_res.c                   |   3 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   6 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   6 +-
 drivers/net/i40e/i40e_ethdev.c                |   6 +-
 drivers/net/iavf/iavf_ethdev.c                |   6 +-
 drivers/net/ice/ice_ethdev.c                  |   6 +-
 drivers/net/ixgbe/ixgbe_ethdev.c              |   7 +
 drivers/net/ixgbe/ixgbe_rxtx.c                |   3 +-
 drivers/net/liquidio/lio_ethdev.c             |   7 +-
 drivers/net/mlx4/mlx4.c                       |   3 +
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_ethdev.c                |   4 +
 drivers/net/mlx5/mlx5_rxq.c                   |   3 +-
 drivers/net/netvsc/hn_ethdev.c                |   3 +
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   6 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  15 +-
 drivers/net/qede/qede_ethdev.c                |   6 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   6 +-
 drivers/net/thunderx/nicvf_ethdev.c           |   3 +
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   6 +-
 examples/eventdev_pipeline/main.c             | 128 -----------------
 .../pipeline_worker_generic.c                 | 132 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 +++++++++++++++++
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 lib/librte_ethdev/rte_ethdev.c                | 120 +++++++++++++++-
 lib/librte_ethdev/rte_ethdev.h                |  38 +++++
 lib/librte_ethdev/rte_ethdev_core.h           |  19 +++
 lib/librte_ethdev/rte_ethdev_version.map      |   1 +
 48 files changed, 683 insertions(+), 161 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v14 1/7] ethdev: add set ptype function
  2019-10-29  5:03                       ` [dpdk-dev] [PATCH v14 0/6] ethdev: add new Rx offload flags pbhagavatula
@ 2019-10-29  5:03                         ` pbhagavatula
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                                           ` (6 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-29  5:03 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst             |  7 +-
 doc/guides/rel_notes/release_19_11.rst   |  8 +++
 lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
 lib/librte_ethdev/rte_ethdev.h           | 37 ++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      | 19 ++++++
 lib/librte_ethdev/rte_ethdev_version.map |  1 +
 6 files changed, 156 insertions(+), 3 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index d96696801..6e20bee5f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,12 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``, ``dev_supported_ptypes_set``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index e02e2f421..60f565401 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -224,6 +224,14 @@ New Features
   * Added a console command to testpmd app, ``show port (port_id) ptypes`` which
     gives ability to print port supported ptypes in different protocol layers.
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 7743205d3..6ce8f5e75 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2734,6 +2734,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	const uint32_t valid_ptype_masks[] = {
+		RTE_PTYPE_L2_MASK,
+		RTE_PTYPE_L3_MASK,
+		RTE_PTYPE_L4_MASK,
+		RTE_PTYPE_TUNNEL_MASK,
+		RTE_PTYPE_INNER_L2_MASK,
+		RTE_PTYPE_INNER_L3_MASK,
+		RTE_PTYPE_INNER_L4_MASK,
+	};
+	const uint32_t *all_ptypes;
+	struct rte_eth_dev *dev;
+	uint32_t unused_mask;
+	unsigned int i, j;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
+			*dev->dev_ops->dev_supported_ptypes_set == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	if (ptype_mask == 0) {
+		ret = (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+		goto ptype_unknown;
+	}
+
+	unused_mask = ptype_mask;
+	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
+		uint32_t mask = ptype_mask & valid_ptype_masks[i];
+		if (mask && mask != valid_ptype_masks[i]) {
+			ret = -EINVAL;
+			goto ptype_unknown;
+		}
+		unused_mask &= ~valid_ptype_masks[i];
+	}
+
+	if (unused_mask) {
+		ret = -EINVAL;
+		goto ptype_unknown;
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	/*
+	 * Accodommodate as many set_ptypes as possible. If the supplied
+	 * set_ptypes array is insufficient fill it partially.
+	 */
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL && j < num)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+
+ptype_unknown:
+	if (num > 0)
+		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+	return ret;
+}
+
 int
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
@@ -2746,7 +2832,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 	return 0;
 }
 
-
 int
 rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c36c1b631..c4ec36ea7 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2539,6 +2539,43 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification the recipient is
+ * interested in.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, unsigned int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 392aea8e6..d5245a7d0 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -234,6 +234,23 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+/**
+ * @internal
+ * Inform an Ethernet device about packet types classifications the recipient
+ * is interested in.
+ *
+ * @param dev
+ *   The Ethernet device identifier.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @return
+ *   - (0) if Success.
+ *   - (-EINVAL) if *ptype_mask* is invalid.
+ */
+typedef int (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -550,6 +567,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform Ethernet device about packet types the recipient is interested in. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index e59d51648..f511294d2 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -288,4 +288,5 @@ EXPERIMENTAL {
 	rte_eth_rx_burst_mode_get;
 	rte_eth_tx_burst_mode_get;
 	rte_eth_burst_mode_option_name;
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-29  5:03                       ` [dpdk-dev] [PATCH v14 0/6] ethdev: add new Rx offload flags pbhagavatula
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-29  5:03                         ` pbhagavatula
  2019-10-29  7:13                           ` Andrew Rybchenko
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 3/7] ethdev: log offloads that can't be disabled by PMD pbhagavatula
                                           ` (5 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-29  5:03 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           |  2 ++
 doc/guides/rel_notes/release_19_11.rst |  7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 11 +++++++++++
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 4 files changed, 21 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 6e20bee5f..9d45e927d 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 60f565401..8b829ba11 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -232,6 +232,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 6ce8f5e75..fef1dbb61 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
@@ -1303,6 +1304,16 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	/* Check if Rx*/
+	if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_NONE) &&
+	    (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u config invalid mq_mode %s with offloads %s\n",
+			port_id, "ETH_MQ_RX_NONE", "DEV_RX_OFFLOAD_RSS_HASH");
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of RX/TX queues and reconfigure device.
 	 */
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c4ec36ea7..a85e5bb0d 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1048,6 +1048,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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v14 3/7] ethdev: log offloads that can't be disabled by PMD
  2019-10-29  5:03                       ` [dpdk-dev] [PATCH v14 0/6] ethdev: add new Rx offload flags pbhagavatula
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 1/7] ethdev: add set ptype function pbhagavatula
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-29  5:03                         ` pbhagavatula
  2019-10-29  7:05                           ` Andrew Rybchenko
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                                           ` (4 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-29  5:03 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Thomas Monjalon; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Some PMD can't work when certain offloads are disabled, to work around
this the PMD auto enable the offloads internally and expose it through
dev->data->dev_conf.rxmode.offloads.
After dev_configure is called compare the requested offloads to the
enabled offloads and log any offloads that have been enabled by the PMD.

Suggested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 lib/librte_ethdev/rte_ethdev.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index fef1dbb61..7dfc2f691 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1142,6 +1142,8 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_conf orig_conf;
+	uint64_t offloads_force_ena;
+	uint64_t offload;
 	int diag;
 	int ret;
 
@@ -1357,6 +1359,26 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	/* Extract Rx offload bits that can't be disabled and log them */
+	offloads_force_ena = dev_conf->rxmode.offloads ^
+			dev->data->dev_conf.rxmode.offloads;
+	while (__builtin_popcount(offloads_force_ena)) {
+		offload = 1ULL << __builtin_ctzll(offloads_force_ena);
+		offloads_force_ena &= ~offload;
+		RTE_ETHDEV_LOG(INFO, "Port %u can't disable Rx offload %s\n",
+			       port_id, rte_eth_dev_rx_offload_name(offload));
+	}
+
+	/* Extract Tx offload bits that can't be disabled and log them */
+	offloads_force_ena = dev_conf->txmode.offloads ^
+				    dev->data->dev_conf.txmode.offloads;
+	while (__builtin_popcount(offloads_force_ena)) {
+		offload = 1ULL << __builtin_ctzll(offloads_force_ena);
+		offloads_force_ena &= ~offload;
+		RTE_ETHDEV_LOG(INFO, "Port %u can't disable Tx offload %s\n",
+			       port_id, rte_eth_dev_tx_offload_name(offload));
+	}
+
 	return 0;
 
 rollback:
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v14 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-29  5:03                       ` [dpdk-dev] [PATCH v14 0/6] ethdev: add new Rx offload flags pbhagavatula
                                           ` (2 preceding siblings ...)
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 3/7] ethdev: log offloads that can't be disabled by PMD pbhagavatula
@ 2019-10-29  5:03                         ` pbhagavatula
  2019-10-29  7:21                           ` Andrew Rybchenko
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 5/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                                           ` (3 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-29  5:03 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c       |  8 +++++++-
 drivers/net/cxgbe/cxgbe.h            |  3 ++-
 drivers/net/cxgbe/cxgbe_ethdev.c     |  5 +++++
 drivers/net/dpaa/dpaa_ethdev.c       |  3 ++-
 drivers/net/dpaa2/dpaa2_ethdev.c     |  1 +
 drivers/net/e1000/igb_ethdev.c       |  6 ++++++
 drivers/net/e1000/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_ethdev.c       |  5 +++++
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  6 +++++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  6 +++++-
 drivers/net/i40e/i40e_ethdev.c       |  6 +++++-
 drivers/net/iavf/iavf_ethdev.c       |  6 +++++-
 drivers/net/ice/ice_ethdev.c         |  6 +++++-
 drivers/net/ixgbe/ixgbe_ethdev.c     |  7 +++++++
 drivers/net/ixgbe/ixgbe_rxtx.c       |  3 ++-
 drivers/net/liquidio/lio_ethdev.c    |  7 ++++++-
 drivers/net/mlx4/mlx4.c              |  3 +++
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_ethdev.c       |  4 ++++
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_ethdev.c       |  3 +++
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  6 +++++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  6 +++++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  3 ++-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  6 +++++-
 drivers/net/thunderx/nicvf_ethdev.c  |  3 +++
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  6 +++++-
 33 files changed, 127 insertions(+), 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 7d9459f0a..01d48f47c 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -123,7 +123,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_VLAN_EXTEND | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_SCATTER)
+				     DEV_RX_OFFLOAD_SCATTER | \
+				     DEV_RX_OFFLOAD_RSS_HASH)
 
 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);
@@ -689,6 +690,11 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
 	bp->rx_cp_nr_rings = bp->rx_nr_rings;
 	bp->tx_cp_nr_rings = bp->tx_nr_rings;
 
+	if (!(rx_offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+		eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
+	}
+
 	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
 		eth_dev->data->mtu =
 			eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
diff --git a/drivers/net/cxgbe/cxgbe.h b/drivers/net/cxgbe/cxgbe.h
index ed1be3559..6c1f73ac4 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_RSS_HASH)
 
 
 /* Common PF and VF devargs */
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 615dda607..6df127087 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -426,6 +426,11 @@ int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)
 
 	CXGBE_FUNC_TRACE();
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+				DEV_RX_OFFLOAD_RSS_HASH))
+		eth_dev->data->dev_conf.rxmode.offloads |=
+							DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (!(adapter->flags & FW_QUEUE_BOUND)) {
 		err = cxgbe_setup_sge_fwevtq(adapter);
 		if (err)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index caf255d67..096da752d 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -56,7 +56,8 @@ static uint64_t dev_rx_offloads_nodis =
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+		DEV_RX_OFFLOAD_RSS_HASH;
 
 /* Supported Tx offloads */
 static uint64_t dev_tx_offloads_sup =
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 03131b903..eea31f254 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -45,6 +45,7 @@ static uint64_t dev_rx_offloads_sup =
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
+		DEV_RX_OFFLOAD_RSS_HASH |
 		DEV_RX_OFFLOAD_SCATTER;
 
 /* Supported Tx offloads */
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index ce7c9e664..22665b51c 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1182,6 +1182,9 @@ eth_igb_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = igb_check_mq_mode(dev);
 	if (ret != 0) {
@@ -3255,6 +3258,9 @@ igbvf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 12c59a3c5..d2d1488d9 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -405,6 +405,11 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
 		return ret;
 	}
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+						DEV_RX_OFFLOAD_RSS_HASH))
+		eth_dev->data->dev_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_RSS_HASH;
+
 	enic->mc_count = 0;
 	enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads &
 				  DEV_RX_OFFLOAD_CHECKSUM);
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index f403a0b66..7c3c270a2 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -205,7 +205,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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 99c4366e4..2e834130d 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -461,6 +461,9 @@ fm10k_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = fm10k_check_mq_mode(dev);
 	if (ret != 0) {
@@ -1805,7 +1808,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 9f37a404b..6673777e9 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -318,6 +318,9 @@ static int hinic_dev_configure(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* mtu size is 256~9600 */
 	if (dev->data->dev_conf.rxmode.max_rx_pkt_len < HINIC_MIN_FRAME_SIZE ||
 	    dev->data->dev_conf.rxmode.max_rx_pkt_len >
@@ -740,7 +743,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 				DEV_RX_OFFLOAD_VLAN_FILTER |
 				DEV_RX_OFFLOAD_SCATTER |
 				DEV_RX_OFFLOAD_JUMBO_FRAME |
-				DEV_RX_OFFLOAD_TCP_LRO;
+				DEV_RX_OFFLOAD_TCP_LRO |
+				DEV_RX_OFFLOAD_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 77a46832c..78fea04f8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1812,6 +1812,9 @@ i40e_dev_configure(struct rte_eth_dev *dev)
 	ad->tx_simple_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Only legacy filter API needs the following fdir config. So when the
 	 * legacy filter API is deprecated, the following codes should also be
 	 * removed.
@@ -3613,7 +3616,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_RSS_HASH;
 
 	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 eebc49ade..172c3f6ac 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -147,6 +147,9 @@ iavf_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_vec_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Vlan stripping setting */
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
 		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
@@ -522,7 +525,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_RSS_HASH;
 	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 d74675842..8ff96a96e 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2357,6 +2357,9 @@ ice_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_bulk_alloc_allowed = true;
 	ad->tx_simple_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	return 0;
 }
 
@@ -2800,7 +2803,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index dbce7a80e..a299c1c74 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2402,6 +2402,10 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
 	int ret;
 
 	PMD_INIT_FUNC_TRACE();
+
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = ixgbe_check_mq_mode(dev);
 	if (ret != 0) {
@@ -5140,6 +5144,9 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index ec01343f1..d873b6ff4 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -412,7 +412,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
@@ -1735,6 +1736,10 @@ lio_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+						DEV_RX_OFFLOAD_RSS_HASH))
+		eth_dev->data->dev_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_RSS_HASH;
 	/* Inform firmware about change in number of queues to use.
 	 * Disable IO queues and reset registers for re-configuration.
 	 */
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 931e4f4fe..6df2f6f90 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -248,6 +248,9 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
 	struct rte_flow_error error;
 	int ret;
 
+	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Prepare internal flow rules. */
 	ret = mlx4_flow_sync(priv, &error);
 	if (ret) {
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	if (priv->hw_csum)
 		offloads |= DEV_RX_OFFLOAD_CHECKSUM;
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 2278b24c0..e87d52ea1 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -407,6 +407,10 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
 		rte_errno = ENOMEM;
 		return -rte_errno;
 	}
+
+	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	memcpy(priv->rss_conf.rss_key,
 	       use_app_rss_key ?
 	       dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key :
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index f0ab8438d..c8e1fc4b6 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index eed8dece9..5c027e1a4 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -532,6 +532,9 @@ static int hn_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev_conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	unsupported = txmode->offloads & ~HN_TX_OFFLOAD_CAPS;
 	if (unsupported) {
 		PMD_DRV_LOG(NOTICE,
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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 22a8b2d19..e288a7f7e 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -407,6 +407,9 @@ nfp_net_configure(struct rte_eth_dev *dev)
 	rxmode = &dev_conf->rxmode;
 	txmode = &dev_conf->txmode;
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Checking TX mode */
 	if (txmode->mq_mode) {
 		PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported");
@@ -1236,7 +1239,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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index 62291c698..d6e8ae745 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -575,7 +575,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 4d9ed4870..d581240fe 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	| \
@@ -140,11 +140,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_RSS_HASH)
 
 #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 53fdfde9a..8cdf04eaf 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1182,6 +1182,9 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE(edev);
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* We need to have min 1 RX queue.There is no min check in
 	 * rte_eth_dev_configure(), so we are checking it here.
 	 */
@@ -1302,7 +1305,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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..d9d2ce6bd 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -715,7 +715,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
-	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
+	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= 0,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..9e527b7fb 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -796,7 +796,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 	.features		= SFC_DP_RX_FEAT_MULTI_PROCESS |
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
-				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
+				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..4af8f1977 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -617,7 +617,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 		.hw_fw_caps	= 0,
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
-	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
+	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
@@ -1556,6 +1557,9 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
 		rxmode->offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
 	}
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	return rc;
 }
 
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index b93d45712..28ee3e46d 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1920,6 +1920,9 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (!rte_eal_has_hugepages()) {
 		PMD_INIT_LOG(INFO, "Huge page is not configured");
 		return -EINVAL;
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 d1faeaa81..5ef6ad43c 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);
 static int eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev);
@@ -407,6 +408,9 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (dev->data->nb_tx_queues > VMXNET3_MAX_TX_QUEUES ||
 	    dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES) {
 		PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v14 5/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-29  5:03                       ` [dpdk-dev] [PATCH v14 0/6] ethdev: add new Rx offload flags pbhagavatula
                                           ` (3 preceding siblings ...)
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-29  5:03                         ` pbhagavatula
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 6/7] examples/l2fwd: disable ptype parsing pbhagavatula
                                           ` (2 subsequent siblings)
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-29  5:03 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 128 -----------------
 .../pipeline_worker_generic.c                 | 132 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 +++++++++++++++++
 3 files changed, 260 insertions(+), 128 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f77830282..d3ff1bbe4 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,133 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	retval = rte_eth_dev_info_get(port, &dev_info);
-	if (retval != 0) {
-		printf("Error during getting device (port %u) info: %s\n",
-				port, strerror(-retval));
-		return retval;
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	retval = rte_eth_macaddr_get(port, &addr);
-	if (retval != 0) {
-		printf("Failed to get MAC address (port %u): %s\n",
-				port, rte_strerror(-retval));
-		return retval;
-	}
-
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	retval = rte_eth_promiscuous_enable(port);
-	if (retval != 0)
-		return retval;
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
-
 static void
 do_capability_setup(uint8_t eventdev_id)
 {
@@ -515,7 +388,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..42ff4eeb9 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,137 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +428,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index a0f40c27c..55bb2f762 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,133 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +748,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v14 6/7] examples/l2fwd: disable ptype parsing
  2019-10-29  5:03                       ` [dpdk-dev] [PATCH v14 0/6] ethdev: add new Rx offload flags pbhagavatula
                                           ` (4 preceding siblings ...)
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 5/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-29  5:03                         ` pbhagavatula
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 7/7] app/testpmd: add command to set supported ptype mask pbhagavatula
  2019-10-29 15:37                         ` [dpdk-dev] [PATCH v15 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-29  5:03 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Marko Kovacevic, Ori Kam,
	Bruce Richardson, Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing as l2fwd doesn't rely on packet types.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/l2fwd/Makefile    | 1 +
 examples/l2fwd/main.c      | 2 ++
 examples/l2fwd/meson.build | 1 +
 3 files changed, 4 insertions(+)

diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index d7bcbfae7..b2fee8d86 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -713,6 +713,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v14 7/7] app/testpmd: add command to set supported ptype mask
  2019-10-29  5:03                       ` [dpdk-dev] [PATCH v14 0/6] ethdev: add new Rx offload flags pbhagavatula
                                           ` (5 preceding siblings ...)
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 6/7] examples/l2fwd: disable ptype parsing pbhagavatula
@ 2019-10-29  5:03                         ` pbhagavatula
  2019-10-29 15:37                         ` [dpdk-dev] [PATCH v15 0/7] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-29  5:03 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Wenzhuo Lu, Jingjing Wu,
	Bernard Iremonger, John McNamara, Marko Kovacevic
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add command to set supported ptype mask.
Usage:
	set port <port_id> ptype_mask <ptype_mask>

Disable ptype parsing by default.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test-pmd/cmdline.c                      | 80 +++++++++++++++++++++
 app/test-pmd/testpmd.c                      |  6 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
 3 files changed, 93 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 447806991..9f0356b50 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -18915,6 +18915,85 @@ cmdline_parse_inst_t cmd_show_port_supported_ptypes = {
 	},
 };
 
+/* Common result structure for set port ptypes */
+struct cmd_set_port_supported_ptypes_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t port;
+	portid_t port_id;
+	cmdline_fixed_string_t ptype_mask;
+	uint32_t mask;
+};
+
+/* Common CLI fields for set port ptypes */
+cmdline_parse_token_string_t cmd_set_port_supported_ptypes_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_set_port_supported_ptypes_port =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 port, "port");
+cmdline_parse_token_num_t cmd_set_port_supported_ptypes_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 port_id, UINT16);
+cmdline_parse_token_string_t cmd_set_port_supported_ptypes_mask_str =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 ptype_mask, "ptype_mask");
+cmdline_parse_token_num_t cmd_set_port_supported_ptypes_mask_u32 =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 mask, UINT32);
+
+static void
+cmd_set_port_supported_ptypes_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_set_port_supported_ptypes_result *res = parsed_result;
+#define PTYPE_NAMESIZE        256
+	char ptype_name[PTYPE_NAMESIZE];
+	uint16_t port_id = res->port_id;
+	uint32_t ptype_mask = res->mask;
+	int ret, i;
+
+	ret = rte_eth_dev_get_supported_ptypes(port_id, ptype_mask, NULL, 0);
+	if (ret <= 0) {
+		printf("Port %d doesn't support any ptypes.\n", port_id);
+		return;
+	}
+
+	uint32_t ptypes[ret];
+	ret = rte_eth_dev_set_supported_ptypes(port_id, ptype_mask, ptypes,
+					       ret);
+	if (ret <= 0) {
+		printf("Unable to set requested ptypes for Port %d\n", port_id);
+		return;
+	}
+
+	printf("Successfully set following ptypes for Port %d\n", port_id);
+	for (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {
+		rte_get_ptype_name(ptypes[i], ptype_name, sizeof(ptype_name));
+		printf("%s\n", ptype_name);
+	}
+}
+
+cmdline_parse_inst_t cmd_set_port_supported_ptypes = {
+	.f = cmd_set_port_supported_ptypes_parsed,
+	.data = NULL,
+	.help_str = "set port <port_id> ptype_mask <mask>",
+	.tokens = {
+		(void *)&cmd_set_port_supported_ptypes_set,
+		(void *)&cmd_set_port_supported_ptypes_port,
+		(void *)&cmd_set_port_supported_ptypes_port_id,
+		(void *)&cmd_set_port_supported_ptypes_mask_str,
+		(void *)&cmd_set_port_supported_ptypes_mask_u32,
+		NULL,
+	},
+};
+
 /* ******************************************************************************** */
 
 /* list of instructions */
@@ -19154,6 +19233,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_show_vf_stats,
 	(cmdline_parse_inst_t *)&cmd_clear_vf_stats,
 	(cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
+	(cmdline_parse_inst_t *)&cmd_set_port_supported_ptypes,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5701f3141..318a668e6 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2064,6 +2064,7 @@ start_port(portid_t pid)
 	queueid_t qi;
 	struct rte_port *port;
 	struct rte_ether_addr mac_addr;
+	static uint8_t clr_ptypes = 1;
 
 	if (port_id_is_invalid(pid, ENABLED_WARN))
 		return 0;
@@ -2193,6 +2194,11 @@ start_port(portid_t pid)
 			}
 		}
 		configure_rxtx_dump_callbacks(verbose_level);
+		if (clr_ptypes) {
+			clr_ptypes = 0;
+			rte_eth_dev_set_supported_ptypes(pi, RTE_PTYPE_UNKNOWN,
+					NULL, 0);
+		}
 		/* start port */
 		if (rte_eth_dev_start(pi) < 0) {
 			printf("Fail to start port %d\n", pi);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index c68a742eb..9c4dc92aa 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -472,6 +472,13 @@ Show ptypes supported for a specific port::
 
    testpmd> show port (port_id) ptypes
 
+set port supported ptypes
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Inform packet types classification interested in for a specific port::
+
+   testpmd> set port (port_id) ptypes_mask (mask)
+
 show device info
 ~~~~~~~~~~~~~~~~
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v14 3/7] ethdev: log offloads that can't be disabled by PMD
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 3/7] ethdev: log offloads that can't be disabled by PMD pbhagavatula
@ 2019-10-29  7:05                           ` Andrew Rybchenko
  2019-10-29  8:33                             ` Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-29  7:05 UTC (permalink / raw)
  To: pbhagavatula, ferruh.yigit, jerinj, Thomas Monjalon; +Cc: dev

Hi Pavan,

thanks for the patch. Please, see my review notes below.

On 10/29/19 8:03 AM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Some PMD can't work when certain offloads are disabled, to work around
> this the PMD auto enable the offloads internally and expose it through
> dev->data->dev_conf.rxmode.offloads.
> After dev_configure is called compare the requested offloads to the
> enabled offloads and log any offloads that have been enabled by the PMD.
>
> Suggested-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>   lib/librte_ethdev/rte_ethdev.c | 22 ++++++++++++++++++++++
>   1 file changed, 22 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index fef1dbb61..7dfc2f691 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -1142,6 +1142,8 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>   	struct rte_eth_dev *dev;
>   	struct rte_eth_dev_info dev_info;
>   	struct rte_eth_conf orig_conf;
> +	uint64_t offloads_force_ena;
> +	uint64_t offload;
>   	int diag;
>   	int ret;
>   
> @@ -1357,6 +1359,26 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>   		goto rollback;
>   	}
>   
> +	/* Extract Rx offload bits that can't be disabled and log them */
> +	offloads_force_ena = dev_conf->rxmode.offloads ^
> +			dev->data->dev_conf.rxmode.offloads;

Strictly speaking XOR returns diff and in theory the diff could
catch requested but not enabled offload in fact.
So, I think the variable name should be offloads_diff.
Yes, it is unexpected and very bad, but it adds even more
value to the check.
May be requested but not enabled offloads should be checked first:
((dev_conf->rxmode.offloads & ~dev->data->dev_conf.rxmode.offloads) != 0)
but I think it would be useful to log these offloads as well to help 
debugging,
so, it should be handled below.

> +	while (__builtin_popcount(offloads_force_ena)) {

If we really need it, __builtin_popcountll() should be used, but I think we
don't need it here in fact since all we want to know if offloads_diff is 
0 or not.
So, comparison to 0 will do the job without any builtins.

> +		offload = 1ULL << __builtin_ctzll(offloads_force_ena);
> +		offloads_force_ena &= ~offload;

Below we should differentiate if the offload is requested but not 
enabled (error)
and if the offload is not requested but enabled (info or warning as Ferruh
suggested).
I think ret should be set to some error if we find any requested, but not
enabled offload and finally configure should fail (after logging of all
violations) since it is a strong violation.

Same for Tx below.

Also I think that it is better to factor out these checks into a separate
function since  rte_eth_dev_configure() is already too long.
It looks like that parameters should port ID, requested and
result offloads.

> +		RTE_ETHDEV_LOG(INFO, "Port %u can't disable Rx offload %s\n",
> +			       port_id, rte_eth_dev_rx_offload_name(offload));
> +	}
> +
> +	/* Extract Tx offload bits that can't be disabled and log them */
> +	offloads_force_ena = dev_conf->txmode.offloads ^
> +				    dev->data->dev_conf.txmode.offloads;
> +	while (__builtin_popcount(offloads_force_ena)) {
> +		offload = 1ULL << __builtin_ctzll(offloads_force_ena);
> +		offloads_force_ena &= ~offload;
> +		RTE_ETHDEV_LOG(INFO, "Port %u can't disable Tx offload %s\n",
> +			       port_id, rte_eth_dev_tx_offload_name(offload));
> +	}
> +
>   	return 0;
>   
>   rollback:


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-29  7:13                           ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-29  7:13 UTC (permalink / raw)
  To: pbhagavatula, ferruh.yigit, jerinj, John McNamara,
	Marko Kovacevic, Thomas Monjalon
  Cc: dev

On 10/29/19 8:03 AM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
> enable/disable PMDs write to `rte_mbuf::hash::rss`.
> PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
> by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

[snip]

> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 6ce8f5e75..fef1dbb61 100644

[snip]

> @@ -1303,6 +1304,16 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>   		goto rollback;
>   	}
>   
> +	/* Check if Rx*/
> +	if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_NONE) &&

ETH_MQ_RX_NONE is 0 so above condition is always false.
It should be
if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0 &&

> +	    (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
> +		RTE_ETHDEV_LOG(ERR,
> +			"Ethdev port_id=%u config invalid mq_mode %s with offloads %s\n",
> +			port_id, "ETH_MQ_RX_NONE", "DEV_RX_OFFLOAD_RSS_HASH");

I think the error message is a bit misleading. It should be:

"Ethdev port_id=%u config invalid mq_mode without RSS but %s offload is requested\n"

rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH) should be used
to log offload name.

> +		ret = -EINVAL;
> +		goto rollback;
> +	}
> +
>   	/*
>   	 * Setup new number of RX/TX queues and reconfigure device.
>   	 */

[snip]


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v14 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-29  7:21                           ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-29  7:21 UTC (permalink / raw)
  To: pbhagavatula, ferruh.yigit, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev

On 10/29/19 8:03 AM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
> delivery.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Acked-by: Jerin Jacob <jerinj@marvell.com>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

[snip]

> diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
> index 63da807ea..d9d2ce6bd 100644
> --- a/drivers/net/sfc/sfc_ef10_essb_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
> @@ -715,7 +715,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
>   	},
>   	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
>   				  SFC_DP_RX_FEAT_FLOW_MARK,
> -	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
> +	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
> +				  DEV_RX_OFFLOAD_RSS_HASH,
>   	.queue_offload_capa	= 0,
>   	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
>   	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
> diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
> index f2fc6e70a..9e527b7fb 100644
> --- a/drivers/net/sfc/sfc_ef10_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_rx.c
> @@ -796,7 +796,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
>   	.features		= SFC_DP_RX_FEAT_MULTI_PROCESS |
>   				  SFC_DP_RX_FEAT_INTR,
>   	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
> -				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
> +				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
> +				  DEV_RX_OFFLOAD_RSS_HASH,
>   	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
>   	.get_dev_info		= sfc_ef10_rx_get_dev_info,
>   	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
> diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
> index e6809bb64..4af8f1977 100644
> --- a/drivers/net/sfc/sfc_rx.c
> +++ b/drivers/net/sfc/sfc_rx.c
> @@ -617,7 +617,8 @@ struct sfc_dp_rx sfc_efx_rx = {
>   		.hw_fw_caps	= 0,
>   	},
>   	.features		= SFC_DP_RX_FEAT_INTR,
> -	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
> +	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
> +				  DEV_RX_OFFLOAD_RSS_HASH,
>   	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
>   	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
>   	.qcreate		= sfc_efx_rx_qcreate,

Thanks  a lot, above looks good to me now.

> @@ -1556,6 +1557,9 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
>   		rxmode->offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
>   	}
>   
> +	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +

I've tried to highlight on my previous review notes, but it looks like not
that successful. The right condition should check that offload is really
supported:

if ((offloads_supported & DEV_RX_OFFLOAD_RSS_HASH) &&
     (~rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
           rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;

Basically similar to DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM above
(including style of disabled offload check just to have common style).

Thanks.

>   	return rc;
>   }
>

[snip]


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v14 3/7] ethdev: log offloads that can't be disabled by PMD
  2019-10-29  7:05                           ` Andrew Rybchenko
@ 2019-10-29  8:33                             ` Pavan Nikhilesh Bhagavatula
  2019-10-29  8:42                               ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-10-29  8:33 UTC (permalink / raw)
  To: Andrew Rybchenko, ferruh.yigit, Jerin Jacob Kollanukkaran,
	Thomas Monjalon
  Cc: dev



>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Andrew Rybchenko
>Sent: Tuesday, October 29, 2019 12:36 PM
>To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>;
>ferruh.yigit@intel.com; Jerin Jacob Kollanukkaran
><jerinj@marvell.com>; Thomas Monjalon <thomas@monjalon.net>
>Cc: dev@dpdk.org
>Subject: Re: [dpdk-dev] [PATCH v14 3/7] ethdev: log offloads that can't
>be disabled by PMD
>
>Hi Pavan,
>
>thanks for the patch. Please, see my review notes below.
>
>On 10/29/19 8:03 AM, pbhagavatula@marvell.com wrote:
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> Some PMD can't work when certain offloads are disabled, to work
>around
>> this the PMD auto enable the offloads internally and expose it
>through
>> dev->data->dev_conf.rxmode.offloads.
>> After dev_configure is called compare the requested offloads to the
>> enabled offloads and log any offloads that have been enabled by the
>PMD.
>>
>> Suggested-by: Andrew Rybchenko <arybchenko@solarflare.com>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> ---
>>   lib/librte_ethdev/rte_ethdev.c | 22 ++++++++++++++++++++++
>>   1 file changed, 22 insertions(+)
>>
>> diff --git a/lib/librte_ethdev/rte_ethdev.c
>b/lib/librte_ethdev/rte_ethdev.c
>> index fef1dbb61..7dfc2f691 100644
>> --- a/lib/librte_ethdev/rte_ethdev.c
>> +++ b/lib/librte_ethdev/rte_ethdev.c
>> @@ -1142,6 +1142,8 @@ rte_eth_dev_configure(uint16_t port_id,
>uint16_t nb_rx_q, uint16_t nb_tx_q,
>>   	struct rte_eth_dev *dev;
>>   	struct rte_eth_dev_info dev_info;
>>   	struct rte_eth_conf orig_conf;
>> +	uint64_t offloads_force_ena;
>> +	uint64_t offload;
>>   	int diag;
>>   	int ret;
>>
>> @@ -1357,6 +1359,26 @@ rte_eth_dev_configure(uint16_t port_id,
>uint16_t nb_rx_q, uint16_t nb_tx_q,
>>   		goto rollback;
>>   	}
>>
>> +	/* Extract Rx offload bits that can't be disabled and log them */
>> +	offloads_force_ena = dev_conf->rxmode.offloads ^
>> +			dev->data->dev_conf.rxmode.offloads;
>
>Strictly speaking XOR returns diff and in theory the diff could
>catch requested but not enabled offload in fact.
>So, I think the variable name should be offloads_diff.
>Yes, it is unexpected and very bad, but it adds even more
>value to the check.
>May be requested but not enabled offloads should be checked first:
>((dev_conf->rxmode.offloads & ~dev->data-
>>dev_conf.rxmode.offloads) != 0)

Isn't the above already taken care through
"
        /* Any requested offloading must be within its device capabilities */
        if ((dev_conf->rxmode.offloads & dev_info.rx_offload_capa) !=
             dev_conf->rxmode.offloads) {
                RTE_ETHDEV_LOG(ERR,
                        "Ethdev port_id=%u requested Rx offloads 0x%"PRIx64" doesn't match Rx offloads "
                        "capabilities 0x%"PRIx64" in %s()\n",
                        port_id, dev_conf->rxmode.offloads,
                        dev_info.rx_offload_capa,
                        __func__);
                ret = -EINVAL;
                goto rollback;
        }
        if ((dev_conf->txmode.offloads & dev_info.tx_offload_capa) !=
             dev_conf->txmode.offloads) {
                RTE_ETHDEV_LOG(ERR,
                        "Ethdev port_id=%u requested Tx offloads 0x%"PRIx64" doesn't match Tx offloads "
                        "capabilities 0x%"PRIx64" in %s()\n",
                        port_id, dev_conf->txmode.offloads,
                        dev_info.tx_offload_capa,
                        __func__);
                ret = -EINVAL;
                goto rollback;
        }
"

Do you think PMDs will advertise but not enable?

>but I think it would be useful to log these offloads as well to help
>debugging,
>so, it should be handled below.
>
>> +	while (__builtin_popcount(offloads_force_ena)) {
>
>If we really need it, __builtin_popcountll() should be used, but I think
>we
>don't need it here in fact since all we want to know if offloads_diff is
>0 or not.
>So, comparison to 0 will do the job without any builtins.

Yes, we can skip using __builtin_popcount.

>
>> +		offload = 1ULL << __builtin_ctzll(offloads_force_ena);
>> +		offloads_force_ena &= ~offload;
>
>Below we should differentiate if the offload is requested but not
>enabled (error)
>and if the offload is not requested but enabled (info or warning as
>Ferruh
>suggested).
>I think ret should be set to some error if we find any requested, but not
>enabled offload and finally configure should fail (after logging of all
>violations) since it is a strong violation.
>
>Same for Tx below.
>
>Also I think that it is better to factor out these checks into a separate
>function since  rte_eth_dev_configure() is already too long.
>It looks like that parameters should port ID, requested and
>result offloads.
>

I will move it to static function in next iteration.

>> +		RTE_ETHDEV_LOG(INFO, "Port %u can't disable Rx
>offload %s\n",
>> +			       port_id,
>rte_eth_dev_rx_offload_name(offload));
>> +	}
>> +
>> +	/* Extract Tx offload bits that can't be disabled and log them */
>> +	offloads_force_ena = dev_conf->txmode.offloads ^
>> +				    dev->data-
>>dev_conf.txmode.offloads;
>> +	while (__builtin_popcount(offloads_force_ena)) {
>> +		offload = 1ULL << __builtin_ctzll(offloads_force_ena);
>> +		offloads_force_ena &= ~offload;
>> +		RTE_ETHDEV_LOG(INFO, "Port %u can't disable Tx
>offload %s\n",
>> +			       port_id,
>rte_eth_dev_tx_offload_name(offload));
>> +	}
>> +
>>   	return 0;
>>
>>   rollback:


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v14 3/7] ethdev: log offloads that can't be disabled by PMD
  2019-10-29  8:33                             ` Pavan Nikhilesh Bhagavatula
@ 2019-10-29  8:42                               ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-29  8:42 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev

On 10/29/19 11:33 AM, Pavan Nikhilesh Bhagavatula wrote:
>
>> -----Original Message-----
>> From: dev <dev-bounces@dpdk.org> On Behalf Of Andrew Rybchenko
>> Sent: Tuesday, October 29, 2019 12:36 PM
>> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>;
>> ferruh.yigit@intel.com; Jerin Jacob Kollanukkaran
>> <jerinj@marvell.com>; Thomas Monjalon <thomas@monjalon.net>
>> Cc: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH v14 3/7] ethdev: log offloads that can't
>> be disabled by PMD
>>
>> Hi Pavan,
>>
>> thanks for the patch. Please, see my review notes below.
>>
>> On 10/29/19 8:03 AM, pbhagavatula@marvell.com wrote:
>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>
>>> Some PMD can't work when certain offloads are disabled, to work
>> around
>>> this the PMD auto enable the offloads internally and expose it
>> through
>>> dev->data->dev_conf.rxmode.offloads.
>>> After dev_configure is called compare the requested offloads to the
>>> enabled offloads and log any offloads that have been enabled by the
>> PMD.
>>> Suggested-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>> ---
>>>    lib/librte_ethdev/rte_ethdev.c | 22 ++++++++++++++++++++++
>>>    1 file changed, 22 insertions(+)
>>>
>>> diff --git a/lib/librte_ethdev/rte_ethdev.c
>> b/lib/librte_ethdev/rte_ethdev.c
>>> index fef1dbb61..7dfc2f691 100644
>>> --- a/lib/librte_ethdev/rte_ethdev.c
>>> +++ b/lib/librte_ethdev/rte_ethdev.c
>>> @@ -1142,6 +1142,8 @@ rte_eth_dev_configure(uint16_t port_id,
>> uint16_t nb_rx_q, uint16_t nb_tx_q,
>>>    	struct rte_eth_dev *dev;
>>>    	struct rte_eth_dev_info dev_info;
>>>    	struct rte_eth_conf orig_conf;
>>> +	uint64_t offloads_force_ena;
>>> +	uint64_t offload;
>>>    	int diag;
>>>    	int ret;
>>>
>>> @@ -1357,6 +1359,26 @@ rte_eth_dev_configure(uint16_t port_id,
>> uint16_t nb_rx_q, uint16_t nb_tx_q,
>>>    		goto rollback;
>>>    	}
>>>
>>> +	/* Extract Rx offload bits that can't be disabled and log them */
>>> +	offloads_force_ena = dev_conf->rxmode.offloads ^
>>> +			dev->data->dev_conf.rxmode.offloads;
>> Strictly speaking XOR returns diff and in theory the diff could
>> catch requested but not enabled offload in fact.
>> So, I think the variable name should be offloads_diff.
>> Yes, it is unexpected and very bad, but it adds even more
>> value to the check.
>> May be requested but not enabled offloads should be checked first:
>> ((dev_conf->rxmode.offloads & ~dev->data-
>>> dev_conf.rxmode.offloads) != 0)
> Isn't the above already taken care through
> "
>          /* Any requested offloading must be within its device capabilities */
>          if ((dev_conf->rxmode.offloads & dev_info.rx_offload_capa) !=
>               dev_conf->rxmode.offloads) {
>                  RTE_ETHDEV_LOG(ERR,
>                          "Ethdev port_id=%u requested Rx offloads 0x%"PRIx64" doesn't match Rx offloads "
>                          "capabilities 0x%"PRIx64" in %s()\n",
>                          port_id, dev_conf->rxmode.offloads,
>                          dev_info.rx_offload_capa,
>                          __func__);
>                  ret = -EINVAL;
>                  goto rollback;
>          }
>          if ((dev_conf->txmode.offloads & dev_info.tx_offload_capa) !=
>               dev_conf->txmode.offloads) {
>                  RTE_ETHDEV_LOG(ERR,
>                          "Ethdev port_id=%u requested Tx offloads 0x%"PRIx64" doesn't match Tx offloads "
>                          "capabilities 0x%"PRIx64" in %s()\n",
>                          port_id, dev_conf->txmode.offloads,
>                          dev_info.tx_offload_capa,
>                          __func__);
>                  ret = -EINVAL;
>                  goto rollback;
>          }
> "
>
> Do you think PMDs will advertise but not enable?

Above we check the request for correctness. Here I'd like to check that
the result is correct. The problem here that we make it 100% legal for
PMD to adjust dev->data->dev_conf.rxmode.offloads so it is better
to check the result as well.

>> but I think it would be useful to log these offloads as well to help
>> debugging,
>> so, it should be handled below.
>>
>>> +	while (__builtin_popcount(offloads_force_ena)) {
>> If we really need it, __builtin_popcountll() should be used, but I think
>> we
>> don't need it here in fact since all we want to know if offloads_diff is
>> 0 or not.
>> So, comparison to 0 will do the job without any builtins.
> Yes, we can skip using __builtin_popcount.
>
>>> +		offload = 1ULL << __builtin_ctzll(offloads_force_ena);
>>> +		offloads_force_ena &= ~offload;
>> Below we should differentiate if the offload is requested but not
>> enabled (error)
>> and if the offload is not requested but enabled (info or warning as
>> Ferruh
>> suggested).
>> I think ret should be set to some error if we find any requested, but not
>> enabled offload and finally configure should fail (after logging of all
>> violations) since it is a strong violation.
>>
>> Same for Tx below.
>>
>> Also I think that it is better to factor out these checks into a separate
>> function since  rte_eth_dev_configure() is already too long.
>> It looks like that parameters should port ID, requested and
>> result offloads.
>>
> I will move it to static function in next iteration.
>
>>> +		RTE_ETHDEV_LOG(INFO, "Port %u can't disable Rx
>> offload %s\n",
>>> +			       port_id,
>> rte_eth_dev_rx_offload_name(offload));
>>> +	}
>>> +
>>> +	/* Extract Tx offload bits that can't be disabled and log them */
>>> +	offloads_force_ena = dev_conf->txmode.offloads ^
>>> +				    dev->data-
>>> dev_conf.txmode.offloads;
>>> +	while (__builtin_popcount(offloads_force_ena)) {
>>> +		offload = 1ULL << __builtin_ctzll(offloads_force_ena);
>>> +		offloads_force_ena &= ~offload;
>>> +		RTE_ETHDEV_LOG(INFO, "Port %u can't disable Tx
>> offload %s\n",
>>> +			       port_id,
>> rte_eth_dev_tx_offload_name(offload));
>>> +	}
>>> +
>>>    	return 0;
>>>
>>>    rollback:


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v15 0/7] ethdev: add new Rx offload flags
  2019-10-29  5:03                       ` [dpdk-dev] [PATCH v14 0/6] ethdev: add new Rx offload flags pbhagavatula
                                           ` (6 preceding siblings ...)
  2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 7/7] app/testpmd: add command to set supported ptype mask pbhagavatula
@ 2019-10-29 15:37                         ` pbhagavatula
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 1/7] ethdev: add set ptype function pbhagavatula
                                             ` (7 more replies)
  7 siblings, 8 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-29 15:37 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` These flags can be used
to enable/disable PMD writes to rte_mbuf fields `hash.rss` and also
`ol_flags:PKT_RX_RSS` and `ol_flags:PKT_RX_FDIR`.

Add new packet type set function `rte_eth_dev_set_supported_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_supported_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
					  NULL, 0);

v15 Changes:
-----------
- Fix sfc RSS_HASH offload check.
- Fix ethdev RSS_HASH offload check when mq_mode is configured with
  MQ_RX_NONE.
- Extend offload validation to return error in the case where application
  has requested an offload to be enabled and PMD couldn't honor it.

v14 Changes:
-----------
- Remove log from drives
- Add log in rte_eth_dev_configure when certain offloads are requested to be
  disabled and PMD cannot honor the request.
- Make changes to default offloads in net/sfc.(Andrew)

v13 Changes:
-----------
- Remove DEV_RX_OFFLOAD_FLOW_MARK from this patchset to allow foreward
  progress will be sent as a seperate patch.
- Use set_supported function only for l2fwd and testpmd.
- Add info log in drivers which expose the DEV_RX_OFFLOAD_RSS_HASH
  indicating that disabling DEV_RX_OFFLOAD_RSS_HASH is not supported.
- Few documentation changes.

v12 Changes:
-----------
- Rebase onto next-net.

v11 Changes:
-----------
- Use RTE_DIM to get array size.
- Since we are using a list of MASKs to validate ptype_mask return -EINVAL
  if any unknown mask is set.
- Rebase to TOT.

v10 Changes:
-----------
- Modify ptype_mask validation in set_supported_ptypes.(Andrew)

v9 Changes:
----------
- Add ptype_mask validation in set_supported_ptypes.(Andrew)
- Make description more verbose.

v8 Changes:
----------
- Make description more verbose.
- Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
  is not supported by ethernet device.

v7 Changes:
----------
- Fix unused variable in net/octeontx2

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.

Pavan Nikhilesh (7):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add validation to offloads set by PMD
  drivers/net: update Rx RSS hash offload capabilities
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples/l2fwd: disable ptype parsing
  app/testpmd: add command to set supported ptype mask

 app/test-pmd/cmdline.c                        |  80 +++++++++
 app/test-pmd/testpmd.c                        |   6 +
 doc/guides/nics/features.rst                  |   9 +-
 doc/guides/rel_notes/release_19_11.rst        |  15 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst   |   7 +
 drivers/net/bnxt/bnxt_ethdev.c                |   8 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/cxgbe/cxgbe_ethdev.c              |   5 +
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   1 +
 drivers/net/e1000/igb_ethdev.c                |   6 +
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_ethdev.c                |   5 +
 drivers/net/enic/enic_res.c                   |   3 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   6 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   6 +-
 drivers/net/i40e/i40e_ethdev.c                |   6 +-
 drivers/net/iavf/iavf_ethdev.c                |   6 +-
 drivers/net/ice/ice_ethdev.c                  |   6 +-
 drivers/net/ixgbe/ixgbe_ethdev.c              |   7 +
 drivers/net/ixgbe/ixgbe_rxtx.c                |   3 +-
 drivers/net/liquidio/lio_ethdev.c             |   7 +-
 drivers/net/mlx4/mlx4.c                       |   3 +
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_ethdev.c                |   4 +
 drivers/net/mlx5/mlx5_rxq.c                   |   3 +-
 drivers/net/netvsc/hn_ethdev.c                |   3 +
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   6 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  15 +-
 drivers/net/qede/qede_ethdev.c                |   6 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   7 +-
 drivers/net/thunderx/nicvf_ethdev.c           |   3 +
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   6 +-
 examples/eventdev_pipeline/main.c             | 128 --------------
 .../pipeline_worker_generic.c                 | 132 +++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 ++++++++++++++
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 lib/librte_ethdev/rte_ethdev.c                | 158 +++++++++++++++++-
 lib/librte_ethdev/rte_ethdev.h                |  38 +++++
 lib/librte_ethdev/rte_ethdev_core.h           |  19 +++
 lib/librte_ethdev/rte_ethdev_version.map      |   1 +
 48 files changed, 722 insertions(+), 161 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v15 1/7] ethdev: add set ptype function
  2019-10-29 15:37                         ` [dpdk-dev] [PATCH v15 0/7] ethdev: add new Rx offload flags pbhagavatula
@ 2019-10-29 15:37                           ` pbhagavatula
  2019-10-31 13:39                             ` Thomas Monjalon
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
                                             ` (6 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-29 15:37 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_supported_ptypes` function that will allow the
application to inform the PMD the packet types it is interested in.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can
return `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_supported_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst             |  7 +-
 doc/guides/rel_notes/release_19_11.rst   |  8 +++
 lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
 lib/librte_ethdev/rte_ethdev.h           | 37 ++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      | 19 ++++++
 lib/librte_ethdev/rte_ethdev_version.map |  1 +
 6 files changed, 156 insertions(+), 3 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index d96696801..6e20bee5f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,12 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_supported_ptypes()``, ``dev_supported_ptypes_set``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index ae8e7b2f0..194afc8b9 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -231,6 +231,14 @@ New Features
   * Added a console command to testpmd app, ``show port (port_id) ptypes`` which
     gives ability to print port supported ptypes in different protocol layers.
 
+* **Added ethdev API to set supported packet types**
+
+  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
+     application to inform PMD about packet types classification the application
+     is interested in
+  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+     and thereby improve Rx performance if application wishes do so.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 7743205d3..6ce8f5e75 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2734,6 +2734,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	const uint32_t valid_ptype_masks[] = {
+		RTE_PTYPE_L2_MASK,
+		RTE_PTYPE_L3_MASK,
+		RTE_PTYPE_L4_MASK,
+		RTE_PTYPE_TUNNEL_MASK,
+		RTE_PTYPE_INNER_L2_MASK,
+		RTE_PTYPE_INNER_L3_MASK,
+		RTE_PTYPE_INNER_L4_MASK,
+	};
+	const uint32_t *all_ptypes;
+	struct rte_eth_dev *dev;
+	uint32_t unused_mask;
+	unsigned int i, j;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
+			*dev->dev_ops->dev_supported_ptypes_set == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	if (ptype_mask == 0) {
+		ret = (*dev->dev_ops->dev_supported_ptypes_set)(dev,
+				ptype_mask);
+		goto ptype_unknown;
+	}
+
+	unused_mask = ptype_mask;
+	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
+		uint32_t mask = ptype_mask & valid_ptype_masks[i];
+		if (mask && mask != valid_ptype_masks[i]) {
+			ret = -EINVAL;
+			goto ptype_unknown;
+		}
+		unused_mask &= ~valid_ptype_masks[i];
+	}
+
+	if (unused_mask) {
+		ret = -EINVAL;
+		goto ptype_unknown;
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	/*
+	 * Accodommodate as many set_ptypes as possible. If the supplied
+	 * set_ptypes array is insufficient fill it partially.
+	 */
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL && j < num)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);
+
+ptype_unknown:
+	if (num > 0)
+		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+	return ret;
+}
+
 int
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
@@ -2746,7 +2832,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 	return 0;
 }
 
-
 int
 rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c36c1b631..c4ec36ea7 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2539,6 +2539,43 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device of the packet types classification the recipient is
+ * interested in.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				     uint32_t *set_ptypes, unsigned int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index 392aea8e6..d5245a7d0 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -234,6 +234,23 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+/**
+ * @internal
+ * Inform an Ethernet device about packet types classifications the recipient
+ * is interested in.
+ *
+ * @param dev
+ *   The Ethernet device identifier.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @return
+ *   - (0) if Success.
+ *   - (-EINVAL) if *ptype_mask* is invalid.
+ */
+typedef int (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,
+					      uint32_t ptype_mask);
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -550,6 +567,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_supported_ptypes_set_t dev_supported_ptypes_set;
+	/**< Inform Ethernet device about packet types the recipient is interested in. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index e59d51648..f511294d2 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -288,4 +288,5 @@ EXPERIMENTAL {
 	rte_eth_rx_burst_mode_get;
 	rte_eth_tx_burst_mode_get;
 	rte_eth_burst_mode_option_name;
+	rte_eth_dev_set_supported_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v15 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-29 15:37                         ` [dpdk-dev] [PATCH v15 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-29 15:37                           ` pbhagavatula
  2019-10-31 13:43                             ` Thomas Monjalon
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD pbhagavatula
                                             ` (5 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-29 15:37 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           |  2 ++
 doc/guides/rel_notes/release_19_11.rst |  7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 12 ++++++++++++
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 4 files changed, 22 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 6e20bee5f..9d45e927d 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 194afc8b9..22eec8359 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -239,6 +239,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 6ce8f5e75..3f45b9e9c 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
@@ -1303,6 +1304,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
+	if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
+	    (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u config invalid Rx mq_mode without RSS but %s offload is requested",
+			port_id,
+			rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of RX/TX queues and reconfigure device.
 	 */
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c4ec36ea7..a85e5bb0d 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1048,6 +1048,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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-29 15:37                         ` [dpdk-dev] [PATCH v15 0/7] ethdev: add new Rx offload flags pbhagavatula
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 1/7] ethdev: add set ptype function pbhagavatula
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-29 15:37                           ` pbhagavatula
  2019-10-29 16:53                             ` Andrew Rybchenko
                                               ` (2 more replies)
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                                             ` (4 subsequent siblings)
  7 siblings, 3 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-29 15:37 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Thomas Monjalon; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Some PMDs cannot work when certain offloads are enable/disabled, as a
workaround PMDs auto enable/disable offloads internally and expose it
through dev->data->dev_conf.rxmode.offloads.

After device specific dev_configure is called compare the requested
offloads to the offloads exposed by the PMD and, if the PMD failed
to enable a given offload then log it and return -EINVAL from
rte_eth_dev_configure, else if the PMD failed to disable a given offload
log and continue with rte_eth_dev_configure.

Suggested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 lib/librte_ethdev/rte_ethdev.c | 59 ++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 3f45b9e9c..8c58da91c 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1135,6 +1135,41 @@ rte_eth_dev_tx_offload_name(uint64_t offload)
 	return name;
 }

+static int
+_rte_eth_dev_validate_offloads(uint16_t port_id, uint64_t req_offloads,
+			       uint64_t set_offloads,
+			       const char *(*f)(uint64_t))
+{
+	uint64_t offloads_diff = req_offloads ^ set_offloads;
+	uint64_t offloads_req_diff, offloads_set_diff;
+	uint64_t offload;
+	uint8_t err = 0;
+
+	/* Check if any offload is advertised but not enabled. */
+	offloads_req_diff = offloads_diff & req_offloads;
+	while (offloads_req_diff) {
+		offload = 1ULL << __builtin_ctzll(offloads_req_diff);
+		offloads_req_diff &= ~offload;
+		RTE_ETHDEV_LOG(ERR, "Port %u failed to enable %s offload",
+			       port_id, f(offload));
+		err = 1;
+	}
+
+	if (err)
+		return -EINVAL;
+
+	/* Chech if any offload couldn't be disabled. */
+	offloads_set_diff = offloads_diff & set_offloads;
+	while (offloads_set_diff) {
+		offload = 1ULL << __builtin_ctzll(offloads_set_diff);
+		offloads_set_diff &= ~offload;
+		RTE_ETHDEV_LOG(INFO, "Port %u failed to disable %s offload",
+			       port_id, f(offload));
+	}
+
+	return 0;
+}
+
 int
 rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		      const struct rte_eth_conf *dev_conf)
@@ -1358,6 +1393,30 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}

+	/* Validate Rx offloads. */
+	diag = _rte_eth_dev_validate_offloads(port_id,
+			dev_conf->rxmode.offloads,
+			dev->data->dev_conf.rxmode.offloads,
+			rte_eth_dev_rx_offload_name);
+	if (diag != 0) {
+		rte_eth_dev_rx_queue_config(dev, 0);
+		rte_eth_dev_tx_queue_config(dev, 0);
+		ret = diag;
+		goto rollback;
+	}
+
+	/* Validate Tx offloads. */
+	diag = _rte_eth_dev_validate_offloads(port_id,
+			dev_conf->txmode.offloads,
+			dev->data->dev_conf.txmode.offloads,
+			rte_eth_dev_tx_offload_name);
+	if (diag != 0) {
+		rte_eth_dev_rx_queue_config(dev, 0);
+		rte_eth_dev_tx_queue_config(dev, 0);
+		ret = diag;
+		goto rollback;
+	}
+
 	return 0;

 rollback:
--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-29 15:37                         ` [dpdk-dev] [PATCH v15 0/7] ethdev: add new Rx offload flags pbhagavatula
                                             ` (2 preceding siblings ...)
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD pbhagavatula
@ 2019-10-29 15:37                           ` pbhagavatula
  2019-10-31 14:03                             ` Thomas Monjalon
  2019-11-01 17:49                             ` Liron Himi
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 5/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                                             ` (3 subsequent siblings)
  7 siblings, 2 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-29 15:37 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c       |  8 +++++++-
 drivers/net/cxgbe/cxgbe.h            |  3 ++-
 drivers/net/cxgbe/cxgbe_ethdev.c     |  5 +++++
 drivers/net/dpaa/dpaa_ethdev.c       |  3 ++-
 drivers/net/dpaa2/dpaa2_ethdev.c     |  1 +
 drivers/net/e1000/igb_ethdev.c       |  6 ++++++
 drivers/net/e1000/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_ethdev.c       |  5 +++++
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  6 +++++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  6 +++++-
 drivers/net/i40e/i40e_ethdev.c       |  6 +++++-
 drivers/net/iavf/iavf_ethdev.c       |  6 +++++-
 drivers/net/ice/ice_ethdev.c         |  6 +++++-
 drivers/net/ixgbe/ixgbe_ethdev.c     |  7 +++++++
 drivers/net/ixgbe/ixgbe_rxtx.c       |  3 ++-
 drivers/net/liquidio/lio_ethdev.c    |  7 ++++++-
 drivers/net/mlx4/mlx4.c              |  3 +++
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_ethdev.c       |  4 ++++
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_ethdev.c       |  3 +++
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  6 +++++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  6 +++++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  3 ++-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  7 ++++++-
 drivers/net/thunderx/nicvf_ethdev.c  |  3 +++
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  6 +++++-
 33 files changed, 128 insertions(+), 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 7d9459f0a..01d48f47c 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -123,7 +123,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_VLAN_EXTEND | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_SCATTER)
+				     DEV_RX_OFFLOAD_SCATTER | \
+				     DEV_RX_OFFLOAD_RSS_HASH)
 
 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);
@@ -689,6 +690,11 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
 	bp->rx_cp_nr_rings = bp->rx_nr_rings;
 	bp->tx_cp_nr_rings = bp->tx_nr_rings;
 
+	if (!(rx_offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+		eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
+	}
+
 	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
 		eth_dev->data->mtu =
 			eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
diff --git a/drivers/net/cxgbe/cxgbe.h b/drivers/net/cxgbe/cxgbe.h
index ed1be3559..6c1f73ac4 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_RSS_HASH)
 
 
 /* Common PF and VF devargs */
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 615dda607..6df127087 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -426,6 +426,11 @@ int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)
 
 	CXGBE_FUNC_TRACE();
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+				DEV_RX_OFFLOAD_RSS_HASH))
+		eth_dev->data->dev_conf.rxmode.offloads |=
+							DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (!(adapter->flags & FW_QUEUE_BOUND)) {
 		err = cxgbe_setup_sge_fwevtq(adapter);
 		if (err)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index caf255d67..096da752d 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -56,7 +56,8 @@ static uint64_t dev_rx_offloads_nodis =
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+		DEV_RX_OFFLOAD_RSS_HASH;
 
 /* Supported Tx offloads */
 static uint64_t dev_tx_offloads_sup =
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 03131b903..eea31f254 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -45,6 +45,7 @@ static uint64_t dev_rx_offloads_sup =
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
+		DEV_RX_OFFLOAD_RSS_HASH |
 		DEV_RX_OFFLOAD_SCATTER;
 
 /* Supported Tx offloads */
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index ce7c9e664..22665b51c 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1182,6 +1182,9 @@ eth_igb_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = igb_check_mq_mode(dev);
 	if (ret != 0) {
@@ -3255,6 +3258,9 @@ igbvf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 12c59a3c5..d2d1488d9 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -405,6 +405,11 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
 		return ret;
 	}
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+						DEV_RX_OFFLOAD_RSS_HASH))
+		eth_dev->data->dev_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_RSS_HASH;
+
 	enic->mc_count = 0;
 	enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads &
 				  DEV_RX_OFFLOAD_CHECKSUM);
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index f403a0b66..7c3c270a2 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -205,7 +205,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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 99c4366e4..2e834130d 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -461,6 +461,9 @@ fm10k_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = fm10k_check_mq_mode(dev);
 	if (ret != 0) {
@@ -1805,7 +1808,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 9f37a404b..6673777e9 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -318,6 +318,9 @@ static int hinic_dev_configure(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* mtu size is 256~9600 */
 	if (dev->data->dev_conf.rxmode.max_rx_pkt_len < HINIC_MIN_FRAME_SIZE ||
 	    dev->data->dev_conf.rxmode.max_rx_pkt_len >
@@ -740,7 +743,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 				DEV_RX_OFFLOAD_VLAN_FILTER |
 				DEV_RX_OFFLOAD_SCATTER |
 				DEV_RX_OFFLOAD_JUMBO_FRAME |
-				DEV_RX_OFFLOAD_TCP_LRO;
+				DEV_RX_OFFLOAD_TCP_LRO |
+				DEV_RX_OFFLOAD_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 77a46832c..78fea04f8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1812,6 +1812,9 @@ i40e_dev_configure(struct rte_eth_dev *dev)
 	ad->tx_simple_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Only legacy filter API needs the following fdir config. So when the
 	 * legacy filter API is deprecated, the following codes should also be
 	 * removed.
@@ -3613,7 +3616,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_RSS_HASH;
 
 	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 eebc49ade..172c3f6ac 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -147,6 +147,9 @@ iavf_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_vec_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Vlan stripping setting */
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
 		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
@@ -522,7 +525,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_RSS_HASH;
 	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 d74675842..8ff96a96e 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2357,6 +2357,9 @@ ice_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_bulk_alloc_allowed = true;
 	ad->tx_simple_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	return 0;
 }
 
@@ -2800,7 +2803,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index dbce7a80e..a299c1c74 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2402,6 +2402,10 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
 	int ret;
 
 	PMD_INIT_FUNC_TRACE();
+
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = ixgbe_check_mq_mode(dev);
 	if (ret != 0) {
@@ -5140,6 +5144,9 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index ec01343f1..d873b6ff4 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -412,7 +412,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
@@ -1735,6 +1736,10 @@ lio_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+						DEV_RX_OFFLOAD_RSS_HASH))
+		eth_dev->data->dev_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_RSS_HASH;
 	/* Inform firmware about change in number of queues to use.
 	 * Disable IO queues and reset registers for re-configuration.
 	 */
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 931e4f4fe..6df2f6f90 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -248,6 +248,9 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
 	struct rte_flow_error error;
 	int ret;
 
+	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Prepare internal flow rules. */
 	ret = mlx4_flow_sync(priv, &error);
 	if (ret) {
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	if (priv->hw_csum)
 		offloads |= DEV_RX_OFFLOAD_CHECKSUM;
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 2278b24c0..e87d52ea1 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -407,6 +407,10 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
 		rte_errno = ENOMEM;
 		return -rte_errno;
 	}
+
+	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	memcpy(priv->rss_conf.rss_key,
 	       use_app_rss_key ?
 	       dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key :
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index f0ab8438d..c8e1fc4b6 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index eed8dece9..5c027e1a4 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -532,6 +532,9 @@ static int hn_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev_conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	unsupported = txmode->offloads & ~HN_TX_OFFLOAD_CAPS;
 	if (unsupported) {
 		PMD_DRV_LOG(NOTICE,
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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 22a8b2d19..e288a7f7e 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -407,6 +407,9 @@ nfp_net_configure(struct rte_eth_dev *dev)
 	rxmode = &dev_conf->rxmode;
 	txmode = &dev_conf->txmode;
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Checking TX mode */
 	if (txmode->mq_mode) {
 		PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported");
@@ -1236,7 +1239,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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index 62291c698..d6e8ae745 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -575,7 +575,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 4d9ed4870..d581240fe 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	| \
@@ -140,11 +140,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_RSS_HASH)
 
 #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 53fdfde9a..8cdf04eaf 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1182,6 +1182,9 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE(edev);
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* We need to have min 1 RX queue.There is no min check in
 	 * rte_eth_dev_configure(), so we are checking it here.
 	 */
@@ -1302,7 +1305,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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..d9d2ce6bd 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -715,7 +715,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
-	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
+	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= 0,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..9e527b7fb 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -796,7 +796,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 	.features		= SFC_DP_RX_FEAT_MULTI_PROCESS |
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
-				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
+				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..10fa1e5ff 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -617,7 +617,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 		.hw_fw_caps	= 0,
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
-	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
+	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
@@ -1556,6 +1557,10 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
 		rxmode->offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
 	}
 
+	if ((offloads_supported & DEV_RX_OFFLOAD_RSS_HASH) &&
+	    (~rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	return rc;
 }
 
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index b93d45712..28ee3e46d 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1920,6 +1920,9 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (!rte_eal_has_hugepages()) {
 		PMD_INIT_LOG(INFO, "Huge page is not configured");
 		return -EINVAL;
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 d1faeaa81..5ef6ad43c 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);
 static int eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev);
@@ -407,6 +408,9 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (dev->data->nb_tx_queues > VMXNET3_MAX_TX_QUEUES ||
 	    dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES) {
 		PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v15 5/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-29 15:37                         ` [dpdk-dev] [PATCH v15 0/7] ethdev: add new Rx offload flags pbhagavatula
                                             ` (3 preceding siblings ...)
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-29 15:37                           ` pbhagavatula
  2019-10-31 14:05                             ` Thomas Monjalon
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 6/7] examples/l2fwd: disable ptype parsing pbhagavatula
                                             ` (2 subsequent siblings)
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-29 15:37 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Harry van Haaren; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 128 -----------------
 .../pipeline_worker_generic.c                 | 132 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 +++++++++++++++++
 3 files changed, 260 insertions(+), 128 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f77830282..d3ff1bbe4 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,133 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	retval = rte_eth_dev_info_get(port, &dev_info);
-	if (retval != 0) {
-		printf("Error during getting device (port %u) info: %s\n",
-				port, strerror(-retval));
-		return retval;
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	retval = rte_eth_macaddr_get(port, &addr);
-	if (retval != 0) {
-		printf("Failed to get MAC address (port %u): %s\n",
-				port, rte_strerror(-retval));
-		return retval;
-	}
-
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	retval = rte_eth_promiscuous_enable(port);
-	if (retval != 0)
-		return retval;
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
-
 static void
 do_capability_setup(uint8_t eventdev_id)
 {
@@ -515,7 +388,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..42ff4eeb9 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,137 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +428,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index a0f40c27c..55bb2f762 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,133 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +748,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v15 6/7] examples/l2fwd: disable ptype parsing
  2019-10-29 15:37                         ` [dpdk-dev] [PATCH v15 0/7] ethdev: add new Rx offload flags pbhagavatula
                                             ` (4 preceding siblings ...)
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 5/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-29 15:37                           ` pbhagavatula
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to set supported ptype mask pbhagavatula
  2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-10-29 15:37 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Marko Kovacevic, Ori Kam,
	Bruce Richardson, Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing as l2fwd doesn't rely on packet types.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/l2fwd/Makefile    | 1 +
 examples/l2fwd/main.c      | 2 ++
 examples/l2fwd/meson.build | 1 +
 3 files changed, 4 insertions(+)

diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index d7bcbfae7..b2fee8d86 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -713,6 +713,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_supported_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to set supported ptype mask
  2019-10-29 15:37                         ` [dpdk-dev] [PATCH v15 0/7] ethdev: add new Rx offload flags pbhagavatula
                                             ` (5 preceding siblings ...)
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 6/7] examples/l2fwd: disable ptype parsing pbhagavatula
@ 2019-10-29 15:37                           ` pbhagavatula
  2019-10-31 10:33                             ` Iremonger, Bernard
  2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
  7 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-10-29 15:37 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, Wenzhuo Lu, Jingjing Wu,
	Bernard Iremonger, John McNamara, Marko Kovacevic
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add command to set supported ptype mask.
Usage:
	set port <port_id> ptype_mask <ptype_mask>

Disable ptype parsing by default.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test-pmd/cmdline.c                      | 80 +++++++++++++++++++++
 app/test-pmd/testpmd.c                      |  6 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
 3 files changed, 93 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 447806991..9f0356b50 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -18915,6 +18915,85 @@ cmdline_parse_inst_t cmd_show_port_supported_ptypes = {
 	},
 };
 
+/* Common result structure for set port ptypes */
+struct cmd_set_port_supported_ptypes_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t port;
+	portid_t port_id;
+	cmdline_fixed_string_t ptype_mask;
+	uint32_t mask;
+};
+
+/* Common CLI fields for set port ptypes */
+cmdline_parse_token_string_t cmd_set_port_supported_ptypes_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_set_port_supported_ptypes_port =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 port, "port");
+cmdline_parse_token_num_t cmd_set_port_supported_ptypes_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 port_id, UINT16);
+cmdline_parse_token_string_t cmd_set_port_supported_ptypes_mask_str =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 ptype_mask, "ptype_mask");
+cmdline_parse_token_num_t cmd_set_port_supported_ptypes_mask_u32 =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_set_port_supported_ptypes_result,
+		 mask, UINT32);
+
+static void
+cmd_set_port_supported_ptypes_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_set_port_supported_ptypes_result *res = parsed_result;
+#define PTYPE_NAMESIZE        256
+	char ptype_name[PTYPE_NAMESIZE];
+	uint16_t port_id = res->port_id;
+	uint32_t ptype_mask = res->mask;
+	int ret, i;
+
+	ret = rte_eth_dev_get_supported_ptypes(port_id, ptype_mask, NULL, 0);
+	if (ret <= 0) {
+		printf("Port %d doesn't support any ptypes.\n", port_id);
+		return;
+	}
+
+	uint32_t ptypes[ret];
+	ret = rte_eth_dev_set_supported_ptypes(port_id, ptype_mask, ptypes,
+					       ret);
+	if (ret <= 0) {
+		printf("Unable to set requested ptypes for Port %d\n", port_id);
+		return;
+	}
+
+	printf("Successfully set following ptypes for Port %d\n", port_id);
+	for (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {
+		rte_get_ptype_name(ptypes[i], ptype_name, sizeof(ptype_name));
+		printf("%s\n", ptype_name);
+	}
+}
+
+cmdline_parse_inst_t cmd_set_port_supported_ptypes = {
+	.f = cmd_set_port_supported_ptypes_parsed,
+	.data = NULL,
+	.help_str = "set port <port_id> ptype_mask <mask>",
+	.tokens = {
+		(void *)&cmd_set_port_supported_ptypes_set,
+		(void *)&cmd_set_port_supported_ptypes_port,
+		(void *)&cmd_set_port_supported_ptypes_port_id,
+		(void *)&cmd_set_port_supported_ptypes_mask_str,
+		(void *)&cmd_set_port_supported_ptypes_mask_u32,
+		NULL,
+	},
+};
+
 /* ******************************************************************************** */
 
 /* list of instructions */
@@ -19154,6 +19233,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_show_vf_stats,
 	(cmdline_parse_inst_t *)&cmd_clear_vf_stats,
 	(cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
+	(cmdline_parse_inst_t *)&cmd_set_port_supported_ptypes,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 38acbc58a..fd2c04d64 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2028,6 +2028,7 @@ start_port(portid_t pid)
 	queueid_t qi;
 	struct rte_port *port;
 	struct rte_ether_addr mac_addr;
+	static uint8_t clr_ptypes = 1;
 
 	if (port_id_is_invalid(pid, ENABLED_WARN))
 		return 0;
@@ -2157,6 +2158,11 @@ start_port(portid_t pid)
 			}
 		}
 		configure_rxtx_dump_callbacks(verbose_level);
+		if (clr_ptypes) {
+			clr_ptypes = 0;
+			rte_eth_dev_set_supported_ptypes(pi, RTE_PTYPE_UNKNOWN,
+					NULL, 0);
+		}
 		/* start port */
 		if (rte_eth_dev_start(pi) < 0) {
 			printf("Fail to start port %d\n", pi);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index c68a742eb..9c4dc92aa 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -472,6 +472,13 @@ Show ptypes supported for a specific port::
 
    testpmd> show port (port_id) ptypes
 
+set port supported ptypes
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Inform packet types classification interested in for a specific port::
+
+   testpmd> set port (port_id) ptypes_mask (mask)
+
 show device info
 ~~~~~~~~~~~~~~~~
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD pbhagavatula
@ 2019-10-29 16:53                             ` Andrew Rybchenko
  2019-10-29 17:25                               ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
  2019-10-31 13:45                               ` [dpdk-dev] " Thomas Monjalon
  2019-10-31 13:58                             ` Thomas Monjalon
  2019-10-31 15:13                             ` [dpdk-dev] " Matan Azrad
  2 siblings, 2 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-10-29 16:53 UTC (permalink / raw)
  To: pbhagavatula, ferruh.yigit, jerinj, Thomas Monjalon; +Cc: dev

On 10/29/19 6:37 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Some PMDs cannot work when certain offloads are enable/disabled, as a
> workaround PMDs auto enable/disable offloads internally and expose it
> through dev->data->dev_conf.rxmode.offloads.
>
> After device specific dev_configure is called compare the requested
> offloads to the offloads exposed by the PMD and, if the PMD failed
> to enable a given offload then log it and return -EINVAL from
> rte_eth_dev_configure, else if the PMD failed to disable a given offload
> log and continue with rte_eth_dev_configure.
>
> Suggested-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Few minor notes below, many thanks
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

> ---
>   lib/librte_ethdev/rte_ethdev.c | 59 ++++++++++++++++++++++++++++++++++
>   1 file changed, 59 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 3f45b9e9c..8c58da91c 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -1135,6 +1135,41 @@ rte_eth_dev_tx_offload_name(uint64_t offload)
>   	return name;
>   }
>
> +static int
> +_rte_eth_dev_validate_offloads(uint16_t port_id, uint64_t req_offloads,

I'm not sure about underscore in function name. May be Thomas or
Ferruh can comment.

> +			       uint64_t set_offloads,
> +			       const char *(*f)(uint64_t))
> +{
> +	uint64_t offloads_diff = req_offloads ^ set_offloads;
> +	uint64_t offloads_req_diff, offloads_set_diff;
> +	uint64_t offload;
> +	uint8_t err = 0;
> +
> +	/* Check if any offload is advertised but not enabled. */
> +	offloads_req_diff = offloads_diff & req_offloads;
> +	while (offloads_req_diff) {
> +		offload = 1ULL << __builtin_ctzll(offloads_req_diff);
> +		offloads_req_diff &= ~offload;
> +		RTE_ETHDEV_LOG(ERR, "Port %u failed to enable %s offload",

Offload name does not include Rx/Tx, so IPV4_CKSUM is identical
and it is required to log if it is Rx or Tx offload separately.
Sounds like one more parameter.

> +			       port_id, f(offload));
> +		err = 1;
> +	}
> +
> +	if (err)
> +		return -EINVAL;
> +
> +	/* Chech if any offload couldn't be disabled. */
> +	offloads_set_diff = offloads_diff & set_offloads;
> +	while (offloads_set_diff) {
> +		offload = 1ULL << __builtin_ctzll(offloads_set_diff);
> +		offloads_set_diff &= ~offload;
> +		RTE_ETHDEV_LOG(INFO, "Port %u failed to disable %s offload",
> +			       port_id, f(offload));
> +	}

Consider to do it in one loop, something like:

         int rc = 0;

      while (offloads_diff != 0) {

		offload = 1ULL << __builtin_ctzll(offloads_diff);
		offloads_diff &= ~offload;
                 if (offload & req_offload) {
                         RTE_ETHDEV_LOG(INFO,
                                 "Port %u failed to enable %s %s offload",
                                 port_id, f(offload), rxtx);
                         rc = -EINVAL;
                 } else {
                         RTE_ETHDEV_LOG(INFO,
                                 "Port %u failed to disable %s %s offload",
	    		        port_id, f(offload), rxtx);
                 }
         }
         
         return rc;


BTW, I'm not sure that -EINVAL is good here, but right now
can't suggest anything better.

> +
> +	return 0;
> +}
> +
>   int
>   rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>   		      const struct rte_eth_conf *dev_conf)
> @@ -1358,6 +1393,30 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>   		goto rollback;
>   	}
>
> +	/* Validate Rx offloads. */
> +	diag = _rte_eth_dev_validate_offloads(port_id,
> +			dev_conf->rxmode.offloads,
> +			dev->data->dev_conf.rxmode.offloads,
> +			rte_eth_dev_rx_offload_name);
> +	if (diag != 0) {
> +		rte_eth_dev_rx_queue_config(dev, 0);
> +		rte_eth_dev_tx_queue_config(dev, 0);

May be it is a good moment to make one more rollback
label with queues release and avoid duplicating it.

> +		ret = diag;
> +		goto rollback;
> +	}
> +
> +	/* Validate Tx offloads. */
> +	diag = _rte_eth_dev_validate_offloads(port_id,
> +			dev_conf->txmode.offloads,
> +			dev->data->dev_conf.txmode.offloads,
> +			rte_eth_dev_tx_offload_name);
> +	if (diag != 0) {
> +		rte_eth_dev_rx_queue_config(dev, 0);
> +		rte_eth_dev_tx_queue_config(dev, 0);
> +		ret = diag;
> +		goto rollback;
> +	}
> +
>   	return 0;
>
>   rollback:
> --
> 2.17.1
>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [EXT] Re: [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-29 16:53                             ` Andrew Rybchenko
@ 2019-10-29 17:25                               ` Pavan Nikhilesh Bhagavatula
  2019-10-31 13:45                               ` [dpdk-dev] " Thomas Monjalon
  1 sibling, 0 replies; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-10-29 17:25 UTC (permalink / raw)
  To: Andrew Rybchenko, ferruh.yigit, Jerin Jacob Kollanukkaran,
	Thomas Monjalon
  Cc: dev

>>lib/librte_ethdev/rte_ethdev.c | 59 ++++++++++++++++++++++++++++++++++
>> 1 file changed, 59 insertions(+)
>>
>>diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
>>index 3f45b9e9c..8c58da91c 100644
>>--- a/lib/librte_ethdev/rte_ethdev.c
>>+++ b/lib/librte_ethdev/rte_ethdev.c
>>@@ -1135,6 +1135,41 @@ rte_eth_dev_tx_offload_name(uint64_t offload)
>> 	return name;
>> }
>>
>>+static int
>>+_rte_eth_dev_validate_offloads(uint16_t port_id, uint64_t req_offloads,
>
>I'm not sure about underscore in function name. May be Thomas or
>Ferruh can comment.
>
>
>>+			       uint64_t set_offloads,
>>+			       const char *(*f)(uint64_t))
>>+{
>>+	uint64_t offloads_diff = req_offloads ^ set_offloads;
>>+	uint64_t offloads_req_diff, offloads_set_diff;
>>+	uint64_t offload;
>>+	uint8_t err = 0;
>>+
>>+	/* Check if any offload is advertised but not enabled. */
>>+	offloads_req_diff = offloads_diff & req_offloads;
>>+	while (offloads_req_diff) {
>>+		offload = 1ULL << __builtin_ctzll(offloads_req_diff);
>>+		offloads_req_diff &= ~offload;
>>+		RTE_ETHDEV_LOG(ERR, "Port %u failed to enable %s offload",
>>
>Offload name does not include Rx/Tx, so IPV4_CKSUM is identical
>and it is required to log if it is Rx or Tx offload separately.
>Sounds like one more parameter.
>

Yes, I guess we can pass "RX"/"Tx" as another parameter.

>
>>+			       port_id, f(offload));
>>+		err = 1;
>>+	}
>>+
>>+	if (err)
>>+		return -EINVAL;
>>+
>>+	/* Chech if any offload couldn't be disabled. */
>>+	offloads_set_diff = offloads_diff & set_offloads;
>>+	while (offloads_set_diff) {
>>+		offload = 1ULL << __builtin_ctzll(offloads_set_diff);
>>+		offloads_set_diff &= ~offload;
>>+		RTE_ETHDEV_LOG(INFO, "Port %u failed to disable %s offload",
>>+			       port_id, f(offload));
>>+	}
>>
>Consider to do it in one loop, something like:
>        int rc = 0;         
>        while (offloads_diff != 0) {
>		offload = 1ULL << __builtin_ctzll(offloads_diff);
>		offloads_diff &= ~offload;
>                if (offload & req_offload) {
>                        RTE_ETHDEV_LOG(INFO,
>                                "Port %u failed to enable %s %s offload",
>                                port_id, f(offload), rxtx);
>                        rc = -EINVAL;
>                } else {
>                        RTE_ETHDEV_LOG(INFO,
>                                "Port %u failed to disable %s %s offload",
>	    		        port_id, f(offload), rxtx);
>                }
>        }
>        
>        return rc;
>

We could merge the loops I though that the differentiating them would 
be informative. No strong opinions we could merge them in v16.

>BTW, I'm not sure that -EINVAL is good here, but right now
>can't suggest anything better.
>
>
>>+
>>+	return 0;
>>+}
>>+
>> int
>> rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>> 		      const struct rte_eth_conf *dev_conf)
>>@@ -1358,6 +1393,30 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>> 		goto rollback;
>> 	}
>>
>>+	/* Validate Rx offloads. */
>>+	diag = _rte_eth_dev_validate_offloads(port_id,
>>+			dev_conf->rxmode.offloads,
>>+			dev->data->dev_conf.rxmode.offloads,
>>+			rte_eth_dev_rx_offload_name);
>>+	if (diag != 0) {
>>+		rte_eth_dev_rx_queue_config(dev, 0);
>>+		rte_eth_dev_tx_queue_config(dev, 0);
>
>May be it is a good moment to make one more rollback
>label with queues release and avoid duplicating it.
>

Yeah we could put them under a new label.

>
>>+		ret = diag;
>>+		goto rollback;
>>+	}
>>+
>>+	/* Validate Tx offloads. */
>>+	diag = _rte_eth_dev_validate_offloads(port_id,
>>+			dev_conf->txmode.offloads,
>>+			dev->data->dev_conf.txmode.offloads,
>>+			rte_eth_dev_tx_offload_name);
>>+	if (diag != 0) {
>>+		rte_eth_dev_rx_queue_config(dev, 0);
>>+		rte_eth_dev_tx_queue_config(dev, 0);
>>+		ret = diag;
>>+		goto rollback;
>>+	}
>>+
>> 	return 0;
>>
>> rollback:
>>--
>>2.17.1

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to set supported ptype mask
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to set supported ptype mask pbhagavatula
@ 2019-10-31 10:33                             ` Iremonger, Bernard
  2019-11-06 18:13                               ` Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 246+ messages in thread
From: Iremonger, Bernard @ 2019-10-31 10:33 UTC (permalink / raw)
  To: pbhagavatula, Yigit, Ferruh, arybchenko, jerinj, Lu, Wenzhuo, Wu,
	Jingjing, Mcnamara, John, Kovacevic, Marko
  Cc: dev

Hi Pavan,

> -----Original Message-----
> From: pbhagavatula@marvell.com <pbhagavatula@marvell.com>
> Sent: Tuesday, October 29, 2019 3:37 PM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>; arybchenko@solarflare.com;
> jerinj@marvell.com; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; Mcnamara, John
> <john.mcnamara@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@marvell.com>
> Subject: [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to set
> supported ptype mask
> 
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Add command to set supported ptype mask.
> Usage:
> 	set port <port_id> ptype_mask <ptype_mask>
> 
> Disable ptype parsing by default.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  app/test-pmd/cmdline.c                      | 80 +++++++++++++++++++++
>  app/test-pmd/testpmd.c                      |  6 ++
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
>  3 files changed, 93 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 447806991..9f0356b50 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c

The help text should be updated to describe the new command at line 240 in cmdline.c

> @@ -18915,6 +18915,85 @@ cmdline_parse_inst_t
> cmd_show_port_supported_ptypes = {
>  	},
>  };
> 
> +/* Common result structure for set port ptypes */ struct
> +cmd_set_port_supported_ptypes_result {
> +	cmdline_fixed_string_t set;
> +	cmdline_fixed_string_t port;
> +	portid_t port_id;
> +	cmdline_fixed_string_t ptype_mask;
> +	uint32_t mask;
> +};
> +
> +/* Common CLI fields for set port ptypes */
> +cmdline_parse_token_string_t cmd_set_port_supported_ptypes_set =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_set_port_supported_ptypes_result,
> +		 set, "set");
> +cmdline_parse_token_string_t cmd_set_port_supported_ptypes_port =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_set_port_supported_ptypes_result,
> +		 port, "port");
> +cmdline_parse_token_num_t cmd_set_port_supported_ptypes_port_id =
> +	TOKEN_NUM_INITIALIZER
> +		(struct cmd_set_port_supported_ptypes_result,
> +		 port_id, UINT16);
> +cmdline_parse_token_string_t
> cmd_set_port_supported_ptypes_mask_str =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_set_port_supported_ptypes_result,
> +		 ptype_mask, "ptype_mask");
> +cmdline_parse_token_num_t
> cmd_set_port_supported_ptypes_mask_u32 =
> +	TOKEN_NUM_INITIALIZER
> +		(struct cmd_set_port_supported_ptypes_result,
> +		 mask, UINT32);
> +
> +static void
> +cmd_set_port_supported_ptypes_parsed(
> +	void *parsed_result,
> +	__attribute__((unused)) struct cmdline *cl,
> +	__attribute__((unused)) void *data)
> +{
> +	struct cmd_set_port_supported_ptypes_result *res =
> parsed_result;
> +#define PTYPE_NAMESIZE        256
> +	char ptype_name[PTYPE_NAMESIZE];
> +	uint16_t port_id = res->port_id;
> +	uint32_t ptype_mask = res->mask;
> +	int ret, i;
> +
> +	ret = rte_eth_dev_get_supported_ptypes(port_id, ptype_mask,
> NULL, 0);
> +	if (ret <= 0) {
> +		printf("Port %d doesn't support any ptypes.\n", port_id);
> +		return;
> +	}
> +
> +	uint32_t ptypes[ret];

Might be better to move above variable declaration to top of function with the other declarations.

> +	ret = rte_eth_dev_set_supported_ptypes(port_id, ptype_mask,
> ptypes,
> +					       ret);
> +	if (ret <= 0) {
> +		printf("Unable to set requested ptypes for Port %d\n",
> port_id);
> +		return;
> +	}
> +
> +	printf("Successfully set following ptypes for Port %d\n", port_id);
> +	for (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {
> +		rte_get_ptype_name(ptypes[i], ptype_name,
> sizeof(ptype_name));
> +		printf("%s\n", ptype_name);
> +	}
> +}
> +
> +cmdline_parse_inst_t cmd_set_port_supported_ptypes = {
> +	.f = cmd_set_port_supported_ptypes_parsed,
> +	.data = NULL,
> +	.help_str = "set port <port_id> ptype_mask <mask>",
> +	.tokens = {
> +		(void *)&cmd_set_port_supported_ptypes_set,
> +		(void *)&cmd_set_port_supported_ptypes_port,
> +		(void *)&cmd_set_port_supported_ptypes_port_id,
> +		(void *)&cmd_set_port_supported_ptypes_mask_str,
> +		(void *)&cmd_set_port_supported_ptypes_mask_u32,
> +		NULL,
> +	},
> +};
> +
>  /*
> **********************************************************
> ********************** */
> 
>  /* list of instructions */
> @@ -19154,6 +19233,7 @@ cmdline_parse_ctx_t main_ctx[] = {
>  	(cmdline_parse_inst_t *)&cmd_show_vf_stats,
>  	(cmdline_parse_inst_t *)&cmd_clear_vf_stats,
>  	(cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
> +	(cmdline_parse_inst_t *)&cmd_set_port_supported_ptypes,
>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset, diff --git
> a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> 38acbc58a..fd2c04d64 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -2028,6 +2028,7 @@ start_port(portid_t pid)
>  	queueid_t qi;
>  	struct rte_port *port;
>  	struct rte_ether_addr mac_addr;
> +	static uint8_t clr_ptypes = 1;
> 
>  	if (port_id_is_invalid(pid, ENABLED_WARN))
>  		return 0;
> @@ -2157,6 +2158,11 @@ start_port(portid_t pid)
>  			}
>  		}
>  		configure_rxtx_dump_callbacks(verbose_level);
> +		if (clr_ptypes) {
> +			clr_ptypes = 0;
> +			rte_eth_dev_set_supported_ptypes(pi,
> RTE_PTYPE_UNKNOWN,
> +					NULL, 0);
> +		}
>  		/* start port */
>  		if (rte_eth_dev_start(pi) < 0) {
>  			printf("Fail to start port %d\n", pi); diff --git
> a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index c68a742eb..9c4dc92aa 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -472,6 +472,13 @@ Show ptypes supported for a specific port::
> 
>     testpmd> show port (port_id) ptypes
> 
> +set port supported ptypes
> +~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +Inform packet types classification interested in for a specific port::

The description of the command is not very clear.
Perhaps something like the following would be better:

"set packet types classification for a specific port::"

> +
> +   testpmd> set port (port_id) ptypes_mask (mask)
> +
>  show device info
>  ~~~~~~~~~~~~~~~~
> 
> --
> 2.17.1

Regards,

Bernard.


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 1/7] ethdev: add set ptype function
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 1/7] ethdev: add set ptype function pbhagavatula
@ 2019-10-31 13:39                             ` Thomas Monjalon
  0 siblings, 0 replies; 246+ messages in thread
From: Thomas Monjalon @ 2019-10-31 13:39 UTC (permalink / raw)
  To: pbhagavatula
  Cc: dev, ferruh.yigit, arybchenko, jerinj, John McNamara, Marko Kovacevic

29/10/2019 16:37, pbhagavatula@marvell.com:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> --- a/doc/guides/rel_notes/release_19_11.rst
> +++ b/doc/guides/rel_notes/release_19_11.rst
> @@ -231,6 +231,14 @@ New Features
>    * Added a console command to testpmd app, ``show port (port_id) ptypes`` which
>      gives ability to print port supported ptypes in different protocol layers.
>  
> +* **Added ethdev API to set supported packet types**
> +
> +  *  Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an
> +     application to inform PMD about packet types classification the application
> +     is interested in
> +  *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
> +     and thereby improve Rx performance if application wishes do so.

You just added or rebased this paragraph at the end.
As mentioned in the release notes files (top of the section),
there is an order for presenting features.

>  Removed Items
>  -------------
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Inform Ethernet device of the packet types classification the recipient is
> + * interested in.

This is a bit convoluted.
What about this?
"Optimize driver handling of packet types by reducing its range."

> + *
> + * Application can use this function to set only specific ptypes that it's
> + * interested. This information can be used by the PMD to optimize Rx path.
> + *
> + * The function accepts an array `set_ptypes` allocated by the caller to
> + * store the packet types set by the driver, the last element of the array
> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
> + * partially.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param ptype_mask
> + *   The ptype family that application is interested in should be bitwise OR of
> + *   RTE_PTYPE_*_MASK or 0.
> + * @param set_ptypes
> + *   An array pointer to store set packet types, allocated by caller. The
> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
> + * @param num
> + *   Size of the array pointed by param ptypes.
> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
> + *   set ptypes.
> + * @return
> + *   - (0) if Success.
> + *   - (-ENODEV) if *port_id* invalid.
> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
> + *     num > 0.
> + */

John, please you check the English wording?

> +__rte_experimental
> +int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
> +				     uint32_t *set_ptypes, unsigned int num);

I don't like the name of the function because they are
not "supported" packet types but "requested".
What about replacing "set_supported" with "set_allowed", or "white_list"?



^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-31 13:43                             ` Thomas Monjalon
  0 siblings, 0 replies; 246+ messages in thread
From: Thomas Monjalon @ 2019-10-31 13:43 UTC (permalink / raw)
  To: pbhagavatula
  Cc: dev, ferruh.yigit, arybchenko, jerinj, John McNamara,
	Marko Kovacevic, olivier.matz

29/10/2019 16:37, pbhagavatula@marvell.com:
> --- a/doc/guides/rel_notes/release_19_11.rst
> +++ b/doc/guides/rel_notes/release_19_11.rst
> @@ -239,6 +239,13 @@ New Features
>    *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
>       and thereby improve Rx performance if application wishes do so.
>  
> +* **Added Rx offload flag to enable or disable RSS update**
> +
> +  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
> +     enable/disable PMDs write to `rte_mbuf::hash::rss`.
> +  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
> +     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Please move this paragraph in the right order (before net drivers).

> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -1048,6 +1048,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_RSS_HASH		0x00080000

OK, it looks simple.

Olivier, are missing something regarding mbuf offload?



^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-29 16:53                             ` Andrew Rybchenko
  2019-10-29 17:25                               ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
@ 2019-10-31 13:45                               ` Thomas Monjalon
  1 sibling, 0 replies; 246+ messages in thread
From: Thomas Monjalon @ 2019-10-31 13:45 UTC (permalink / raw)
  To: Andrew Rybchenko, pbhagavatula; +Cc: dev, ferruh.yigit, jerinj

29/10/2019 17:53, Andrew Rybchenko:
> On 10/29/19 6:37 PM, pbhagavatula@marvell.com wrote:
> > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > +static int
> > +_rte_eth_dev_validate_offloads(uint16_t port_id, uint64_t req_offloads,
> 
> I'm not sure about underscore in function name. May be Thomas or
> Ferruh can comment.

If it is private, don't use the rte_ prefix at all.
This function can be simply named "validate_offloads".




^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD pbhagavatula
  2019-10-29 16:53                             ` Andrew Rybchenko
@ 2019-10-31 13:58                             ` Thomas Monjalon
  2019-10-31 16:44                               ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
  2019-10-31 15:13                             ` [dpdk-dev] " Matan Azrad
  2 siblings, 1 reply; 246+ messages in thread
From: Thomas Monjalon @ 2019-10-31 13:58 UTC (permalink / raw)
  To: pbhagavatula; +Cc: dev, ferruh.yigit, arybchenko, jerinj

29/10/2019 16:37, pbhagavatula@marvell.com:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> +static int
> +_rte_eth_dev_validate_offloads(uint16_t port_id, uint64_t req_offloads,
> +			       uint64_t set_offloads,
> +			       const char *(*f)(uint64_t))

Please do not call "f" a function parameter.
This function has a purpose, please name it.

Overall, I feel it would be easier to understand this function
with a comment on top, explaining each parameter. Thanks

> +{
> +	uint64_t offloads_diff = req_offloads ^ set_offloads;
> +	uint64_t offloads_req_diff, offloads_set_diff;
> +	uint64_t offload;
> +	uint8_t err = 0;
> +
> +	/* Check if any offload is advertised but not enabled. */

Not sure "advertised" is the right word here.




^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-10-31 14:03                             ` Thomas Monjalon
  2019-10-31 16:51                               ` Pavan Nikhilesh Bhagavatula
  2019-11-01 17:49                             ` Liron Himi
  1 sibling, 1 reply; 246+ messages in thread
From: Thomas Monjalon @ 2019-10-31 14:03 UTC (permalink / raw)
  To: pbhagavatula
  Cc: dev, ferruh.yigit, arybchenko, jerinj, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang

29/10/2019 16:37, pbhagavatula@marvell.com:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
> delivery.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Acked-by: Jerin Jacob <jerinj@marvell.com>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;

Excuse me, I miss why you need a check before setting the bit.



^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 5/7] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 5/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-10-31 14:05                             ` Thomas Monjalon
  0 siblings, 0 replies; 246+ messages in thread
From: Thomas Monjalon @ 2019-10-31 14:05 UTC (permalink / raw)
  To: pbhagavatula; +Cc: dev, ferruh.yigit, arybchenko, jerinj, Harry van Haaren

29/10/2019 16:37, pbhagavatula@marvell.com:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
> flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
> into the mbuf.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  examples/eventdev_pipeline/main.c             | 128 -----------------
>  .../pipeline_worker_generic.c                 | 132 ++++++++++++++++++
>  .../eventdev_pipeline/pipeline_worker_tx.c    | 128 +++++++++++++++++
>  3 files changed, 260 insertions(+), 128 deletions(-)

Please split the patch.
Moving code should be always separate.




^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD pbhagavatula
  2019-10-29 16:53                             ` Andrew Rybchenko
  2019-10-31 13:58                             ` Thomas Monjalon
@ 2019-10-31 15:13                             ` Matan Azrad
  2019-10-31 15:18                               ` Pavan Nikhilesh Bhagavatula
  2 siblings, 1 reply; 246+ messages in thread
From: Matan Azrad @ 2019-10-31 15:13 UTC (permalink / raw)
  To: pbhagavatula, ferruh.yigit, arybchenko, jerinj, Thomas Monjalon; +Cc: dev

Hi Pavan

From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Some PMDs cannot work when certain offloads are enable/disabled, as a
> workaround PMDs auto enable/disable offloads internally and expose it
> through dev->data->dev_conf.rxmode.offloads.
> 
> After device specific dev_configure is called compare the requested offloads
> to the offloads exposed by the PMD and, if the PMD failed to enable a given
> offload then log it and return -EINVAL from rte_eth_dev_configure, else if
> the PMD failed to disable a given offload log and continue with
> rte_eth_dev_configure.
>

rte_eth_dev_configure can be called more than 1 time in the device life time,
How can you know what is the minimum offload configurations required by the port after the first call?
Maybe putting it in dev info is better, what do you think?

Matan

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-31 15:13                             ` [dpdk-dev] " Matan Azrad
@ 2019-10-31 15:18                               ` Pavan Nikhilesh Bhagavatula
  2019-10-31 15:50                                 ` Matan Azrad
  0 siblings, 1 reply; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-10-31 15:18 UTC (permalink / raw)
  To: Matan Azrad, ferruh.yigit, arybchenko, Jerin Jacob Kollanukkaran,
	Thomas Monjalon
  Cc: dev

Hi Matan,

>Hi Pavan
>
>From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> Some PMDs cannot work when certain offloads are enable/disabled,
>as a
>> workaround PMDs auto enable/disable offloads internally and expose
>it
>> through dev->data->dev_conf.rxmode.offloads.
>>
>> After device specific dev_configure is called compare the requested
>offloads
>> to the offloads exposed by the PMD and, if the PMD failed to enable a
>given
>> offload then log it and return -EINVAL from rte_eth_dev_configure,
>else if
>> the PMD failed to disable a given offload log and continue with
>> rte_eth_dev_configure.
>>
>
>rte_eth_dev_configure can be called more than 1 time in the device life
>time,
>How can you know what is the minimum offload configurations
>required by the port after the first call?
>Maybe putting it in dev info is better, what do you think?
>

We only return -EINVAL in the case where we enable an offload advertised by 
dev_info and the port still fails to enable it.

>Matan

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-31 15:18                               ` Pavan Nikhilesh Bhagavatula
@ 2019-10-31 15:50                                 ` Matan Azrad
  2019-10-31 16:33                                   ` Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 246+ messages in thread
From: Matan Azrad @ 2019-10-31 15:50 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula, ferruh.yigit, arybchenko,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev



From: Pavan Nikhilesh Bhagavatula
> Hi Matan,
> 
> >Hi Pavan
> >
> >From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >> Some PMDs cannot work when certain offloads are enable/disabled,
> >as a
> >> workaround PMDs auto enable/disable offloads internally and expose
> >it
> >> through dev->data->dev_conf.rxmode.offloads.
> >>
> >> After device specific dev_configure is called compare the requested
> >offloads
> >> to the offloads exposed by the PMD and, if the PMD failed to enable a
> >given
> >> offload then log it and return -EINVAL from rte_eth_dev_configure,
> >else if
> >> the PMD failed to disable a given offload log and continue with
> >> rte_eth_dev_configure.
> >>
> >
> >rte_eth_dev_configure can be called more than 1 time in the device life
> >time, How can you know what is the minimum offload configurations
> >required by the port after the first call?
> >Maybe putting it in dev info is better, what do you think?
> >
> 
> We only return -EINVAL in the case where we enable an offload advertised
> by dev_info and the port still fails to enable it.

Are you sure it is ok that devices may disable\enable offloads under the hood without user notification?
Can't it break applications?
Why does the device expose unsupported offloads in dev info?
Does it update the running offload usynchronically? Race?
Can you explain also your specific use case?

 
> >Matan

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-31 15:50                                 ` Matan Azrad
@ 2019-10-31 16:33                                   ` Pavan Nikhilesh Bhagavatula
  2019-11-01 11:04                                     ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-10-31 16:33 UTC (permalink / raw)
  To: Matan Azrad, ferruh.yigit, arybchenko, Jerin Jacob Kollanukkaran,
	Thomas Monjalon
  Cc: dev

>From: Pavan Nikhilesh Bhagavatula
>> Hi Matan,
>>
>> >Hi Pavan
>> >
>> >From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> >> Some PMDs cannot work when certain offloads are
>enable/disabled,
>> >as a
>> >> workaround PMDs auto enable/disable offloads internally and
>expose
>> >it
>> >> through dev->data->dev_conf.rxmode.offloads.
>> >>
>> >> After device specific dev_configure is called compare the
>requested
>> >offloads
>> >> to the offloads exposed by the PMD and, if the PMD failed to
>enable a
>> >given
>> >> offload then log it and return -EINVAL from
>rte_eth_dev_configure,
>> >else if
>> >> the PMD failed to disable a given offload log and continue with
>> >> rte_eth_dev_configure.
>> >>
>> >
>> >rte_eth_dev_configure can be called more than 1 time in the device
>life
>> >time, How can you know what is the minimum offload configurations
>> >required by the port after the first call?
>> >Maybe putting it in dev info is better, what do you think?
>> >
>>
>> We only return -EINVAL in the case where we enable an offload
>advertised
>> by dev_info and the port still fails to enable it.
>
>Are you sure it is ok that devices may disable\enable offloads under the
>hood without user notification?

Some devices already do it. The above check adds validation for the same.

>Can't it break applications?
>Why does the device expose unsupported offloads in dev info?
>Does it update the running offload usynchronically? Race?
>Can you explain also your specific use case?
>
>
>> >Matan

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [EXT] Re: [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-31 13:58                             ` Thomas Monjalon
@ 2019-10-31 16:44                               ` Pavan Nikhilesh Bhagavatula
  2019-11-01 22:50                                 ` Thomas Monjalon
  0 siblings, 1 reply; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-10-31 16:44 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, ferruh.yigit, arybchenko, Jerin Jacob Kollanukkaran

>29/10/2019 16:37, pbhagavatula@marvell.com:
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> --- a/lib/librte_ethdev/rte_ethdev.c
>> +++ b/lib/librte_ethdev/rte_ethdev.c
>> +static int
>> +_rte_eth_dev_validate_offloads(uint16_t port_id, uint64_t
>req_offloads,
>> +			       uint64_t set_offloads,
>> +			       const char *(*f)(uint64_t))
>
>Please do not call "f" a function parameter.
>This function has a purpose, please name it.
>
>Overall, I feel it would be easier to understand this function
>with a comment on top, explaining each parameter. Thanks

Will fix in v16.

>
>> +{
>> +	uint64_t offloads_diff = req_offloads ^ set_offloads;
>> +	uint64_t offloads_req_diff, offloads_set_diff;
>> +	uint64_t offload;
>> +	uint8_t err = 0;
>> +
>> +	/* Check if any offload is advertised but not enabled. */
>
>Not sure "advertised" is the right word here.

Don't PMDs advertise their capabilities/offloads through dev_info?.

>
>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-31 14:03                             ` Thomas Monjalon
@ 2019-10-31 16:51                               ` Pavan Nikhilesh Bhagavatula
  2019-11-01 11:11                                 ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-10-31 16:51 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, ferruh.yigit, arybchenko, Jerin Jacob Kollanukkaran,
	Ajit Khaparde, Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal,
	Sachin Saxena, Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang,
	Xiao Wang, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Kumar Dabilpuram,
	Kiran Kumar Kokkilagadda, Rasesh Mody, Shahed Shaikh,
	Maciej Czekaj, Yong Wang



>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
>Sent: Thursday, October 31, 2019 7:33 PM
>To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
>Cc: dev@dpdk.org; ferruh.yigit@intel.com;
>arybchenko@solarflare.com; Jerin Jacob Kollanukkaran
><jerinj@marvell.com>; Ajit Khaparde <ajit.khaparde@broadcom.com>;
>Somnath Kotur <somnath.kotur@broadcom.com>; Rahul Lakkireddy
><rahul.lakkireddy@chelsio.com>; Hemant Agrawal
><hemant.agrawal@nxp.com>; Sachin Saxena
><sachin.saxena@nxp.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>;
>John Daley <johndale@cisco.com>; Hyong Youb Kim
><hyonkim@cisco.com>; Qi Zhang <qi.z.zhang@intel.com>; Xiao Wang
><xiao.w.wang@intel.com>; Ziyang Xuan <xuanziyang2@huawei.com>;
>Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>; Guoyang Zhou
><zhouguoyang@huawei.com>; Beilei Xing <beilei.xing@intel.com>;
>Jingjing Wu <jingjing.wu@intel.com>; Qiming Yang
><qiming.yang@intel.com>; Konstantin Ananyev
><konstantin.ananyev@intel.com>; Shijith Thotton
><sthotton@marvell.com>; Srisivasubramanian Srinivasan
><srinivasan@marvell.com>; Matan Azrad <matan@mellanox.com>;
>Shahaf Shuler <shahafs@mellanox.com>; Viacheslav Ovsiienko
><viacheslavo@mellanox.com>; Stephen Hemminger
><sthemmin@microsoft.com>; K. Y. Srinivasan <kys@microsoft.com>;
>Haiyang Zhang <haiyangz@microsoft.com>; Alejandro Lucero
><alejandro.lucero@netronome.com>; Nithin Kumar Dabilpuram
><ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda
><kirankumark@marvell.com>; Rasesh Mody <rmody@marvell.com>;
>Shahed Shaikh <shshaikh@marvell.com>; Maciej Czekaj
><mczekaj@marvell.com>; Yong Wang <yongwang@vmware.com>
>Subject: Re: [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS
>hash offload capabilities
>
>29/10/2019 16:37, pbhagavatula@marvell.com:
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS
>hash
>> delivery.
>>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>> Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>> Acked-by: Jerin Jacob <jerinj@marvell.com>
>> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>> ---
>> +	if (!(dev->data->dev_conf.rxmode.offloads &
>DEV_RX_OFFLOAD_RSS_HASH))
>> +		dev->data->dev_conf.rxmode.offloads |=
>DEV_RX_OFFLOAD_RSS_HASH;
>
>Excuse me, I miss why you need a check before setting the bit.

Currently, none of the PMDs support disabling RSS_HASH (except octeontx2) since it involves 
adding an if check in Rx routine that might lead to perf impact.
So, we are implicitly enabling the offload for all the PMDs if an application decides to disable
RSS_HASH. In future if PMD maintainer decides to add this feature she/he can remove the check.

>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-31 16:33                                   ` Pavan Nikhilesh Bhagavatula
@ 2019-11-01 11:04                                     ` Andrew Rybchenko
  2019-11-03  6:57                                       ` Matan Azrad
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-01 11:04 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula, Matan Azrad, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev

On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula wrote:
>> From: Pavan Nikhilesh Bhagavatula
>>> Hi Matan,
>>>
>>>> Hi Pavan
>>>>
>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>>> Some PMDs cannot work when certain offloads are enable/disabled, as a
>>>>> workaround PMDs auto enable/disable offloads internally and expose it
>>>>> through dev->data->dev_conf.rxmode.offloads.
>>>>>
>>>>> After device specific dev_configure is called compare the requested offloads
>>>>> to the offloads exposed by the PMD and, if the PMD failed to enable a given
>>>>> offload then log it and return -EINVAL from rte_eth_dev_configure, else if
>>>>> the PMD failed to disable a given offload log and continue with
>>>>> rte_eth_dev_configure.
>>>>>
>>>>
>>>> rte_eth_dev_configure can be called more than 1 time in the device life
>>>> time, How can you know what is the minimum offload configurations
>>>> required by the port after the first call?
>>>> Maybe putting it in dev info is better, what do you think?
>>>>
>>>
>>> We only return -EINVAL in the case where we enable an offload advertised
>>> by dev_info and the port still fails to enable it.
>>
>> Are you sure it is ok that devices may disable\enable offloads under the
>> hood without user notification?
> 
> Some devices already do it. The above check adds validation for the same.

The problem is that some offloads cannot be disabled.
If application does not request Rx checksum offload since it
does use it, it is not a problem to report it. Of course, it
could be a problem if the offload is used, but application
wants to disable it, for example, for debugging purposes.
In this case, the solution is to mask offloads on application level,
which is not ideal as well.
Anyway, the patch just tries to highlight difference of applied
from requested. So, it is a step forward.
Also, the patch will fail configure if an offload is requested,
but not enabled.

>> Can't it break applications?
>> Why does the device expose unsupported offloads in dev info?
>> Does it update the running offload usynchronically? Race?
>> Can you explain also your specific use case?
>>
>>
>>>> Matan


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-31 16:51                               ` Pavan Nikhilesh Bhagavatula
@ 2019-11-01 11:11                                 ` Andrew Rybchenko
  2019-11-01 22:22                                   ` Thomas Monjalon
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-01 11:11 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula, Thomas Monjalon
  Cc: dev, ferruh.yigit, Jerin Jacob Kollanukkaran, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Kumar Dabilpuram,
	Kiran Kumar Kokkilagadda, Rasesh Mody, Shahed Shaikh,
	Maciej Czekaj, Yong Wang

On 10/31/19 7:51 PM, Pavan Nikhilesh Bhagavatula wrote:
> 
>> 29/10/2019 16:37, pbhagavatula@marvell.com:
>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>
>>> Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash delivery.
>>>
>>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>> Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>>> Acked-by: Jerin Jacob <jerinj@marvell.com>
>>> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>>> ---
>>> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
>>> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
>>
>> Excuse me, I miss why you need a check before setting the bit.
> 
> Currently, none of the PMDs support disabling RSS_HASH (except octeontx2) since it involves 
> adding an if check in Rx routine that might lead to perf impact.
> So, we are implicitly enabling the offload for all the PMDs if an application decides to disable
> RSS_HASH. In future if PMD maintainer decides to add this feature she/he can remove the check.

As I understand Thomas says that it is just sufficient to do:
    dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
without any if before.

Yes, it is true since right now it looks a bit strange.
I guess it is the result of code evolution. Initially
it was logging inside if, but logging is moved to ethdev.

(Of course, it is true for such trivial checks only)

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
  2019-10-31 14:03                             ` Thomas Monjalon
@ 2019-11-01 17:49                             ` Liron Himi
  2019-11-03 12:06                               ` Andrew Rybchenko
  1 sibling, 1 reply; 246+ messages in thread
From: Liron Himi @ 2019-11-01 17:49 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula, ferruh.yigit, arybchenko,
	Jerin Jacob Kollanukkaran, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Kumar Dabilpuram,
	Kiran Kumar Kokkilagadda, Rasesh Mody, Shahed Shaikh,
	Maciej Czekaj, Yong Wang
  Cc: dev, Pavan Nikhilesh Bhagavatula, Liron Himi

Hi,

mvpp2 and mvneta PMDs are also support RSS hash.
Please add them to the patch.

Regards,
Liron

-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of pbhagavatula@marvell.com
Sent: Tuesday, 29 October 2019 17:37
To: ferruh.yigit@intel.com; arybchenko@solarflare.com; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Ajit Khaparde <ajit.khaparde@broadcom.com>; Somnath Kotur <somnath.kotur@broadcom.com>; Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>; Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena <sachin.saxena@nxp.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>; John Daley <johndale@cisco.com>; Hyong Youb Kim <hyonkim@cisco.com>; Qi Zhang <qi.z.zhang@intel.com>; Xiao Wang <xiao.w.wang@intel.com>; Ziyang Xuan <xuanziyang2@huawei.com>; Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>; Guoyang Zhou <zhouguoyang@huawei.com>; Beilei Xing <beilei.xing@intel.com>; Jingjing Wu <jingjing.wu@intel.com>; Qiming Yang <qiming.yang@intel.com>; Konstantin Ananyev <konstantin.ananyev@intel.com>; Shijith Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Matan Azrad <matan@mellanox.com>; Shahaf Shuler <shahafs@mellanox.com>; Viacheslav Ovsiienko <viacheslavo@mellanox.com>; Stephen Hemminger <sthemmin@microsoft.com>; K. Y. Srinivasan <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; Alejandro Lucero <alejandro.lucero@netronome.com>; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Rasesh Mody <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Maciej Czekaj <mczekaj@marvell.com>; Yong Wang <yongwang@vmware.com>
Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
Subject: [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c       |  8 +++++++-
 drivers/net/cxgbe/cxgbe.h            |  3 ++-
 drivers/net/cxgbe/cxgbe_ethdev.c     |  5 +++++
 drivers/net/dpaa/dpaa_ethdev.c       |  3 ++-
 drivers/net/dpaa2/dpaa2_ethdev.c     |  1 +
 drivers/net/e1000/igb_ethdev.c       |  6 ++++++
 drivers/net/e1000/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_ethdev.c       |  5 +++++
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  6 +++++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  6 +++++-
 drivers/net/i40e/i40e_ethdev.c       |  6 +++++-
 drivers/net/iavf/iavf_ethdev.c       |  6 +++++-
 drivers/net/ice/ice_ethdev.c         |  6 +++++-
 drivers/net/ixgbe/ixgbe_ethdev.c     |  7 +++++++
 drivers/net/ixgbe/ixgbe_rxtx.c       |  3 ++-
 drivers/net/liquidio/lio_ethdev.c    |  7 ++++++-
 drivers/net/mlx4/mlx4.c              |  3 +++
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_ethdev.c       |  4 ++++
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_ethdev.c       |  3 +++
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  6 +++++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-  drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  6 +++++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  3 ++-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  7 ++++++-
 drivers/net/thunderx/nicvf_ethdev.c  |  3 +++  drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-  drivers/net/vmxnet3/vmxnet3_ethdev.c |  6 +++++-
 33 files changed, 128 insertions(+), 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 7d9459f0a..01d48f47c 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -123,7 +123,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_VLAN_EXTEND | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_SCATTER)
+				     DEV_RX_OFFLOAD_SCATTER | \
+				     DEV_RX_OFFLOAD_RSS_HASH)
 
 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); @@ -689,6 +690,11 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
 	bp->rx_cp_nr_rings = bp->rx_nr_rings;
 	bp->tx_cp_nr_rings = bp->tx_nr_rings;
 
+	if (!(rx_offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+		eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
+	}
+
 	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
 		eth_dev->data->mtu =
 			eth_dev->data->dev_conf.rxmode.max_rx_pkt_len - diff --git a/drivers/net/cxgbe/cxgbe.h b/drivers/net/cxgbe/cxgbe.h index ed1be3559..6c1f73ac4 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_RSS_HASH)
 
 
 /* Common PF and VF devargs */
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 615dda607..6df127087 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -426,6 +426,11 @@ int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)
 
 	CXGBE_FUNC_TRACE();
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+				DEV_RX_OFFLOAD_RSS_HASH))
+		eth_dev->data->dev_conf.rxmode.offloads |=
+							DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (!(adapter->flags & FW_QUEUE_BOUND)) {
 		err = cxgbe_setup_sge_fwevtq(adapter);
 		if (err)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index caf255d67..096da752d 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -56,7 +56,8 @@ static uint64_t dev_rx_offloads_nodis =
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+		DEV_RX_OFFLOAD_RSS_HASH;
 
 /* Supported Tx offloads */
 static uint64_t dev_tx_offloads_sup =
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 03131b903..eea31f254 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -45,6 +45,7 @@ static uint64_t dev_rx_offloads_sup =
 
 /* Rx offloads which cannot be disabled */  static uint64_t dev_rx_offloads_nodis =
+		DEV_RX_OFFLOAD_RSS_HASH |
 		DEV_RX_OFFLOAD_SCATTER;
 
 /* Supported Tx offloads */
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index ce7c9e664..22665b51c 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1182,6 +1182,9 @@ eth_igb_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = igb_check_mq_mode(dev);
 	if (ret != 0) {
@@ -3255,6 +3258,9 @@ igbvf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 12c59a3c5..d2d1488d9 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -405,6 +405,11 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
 		return ret;
 	}
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+						DEV_RX_OFFLOAD_RSS_HASH))
+		eth_dev->data->dev_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_RSS_HASH;
+
 	enic->mc_count = 0;
 	enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads &
 				  DEV_RX_OFFLOAD_CHECKSUM);
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c index f403a0b66..7c3c270a2 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -205,7 +205,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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 99c4366e4..2e834130d 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -461,6 +461,9 @@ fm10k_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = fm10k_check_mq_mode(dev);
 	if (ret != 0) {
@@ -1805,7 +1808,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 9f37a404b..6673777e9 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -318,6 +318,9 @@ static int hinic_dev_configure(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* mtu size is 256~9600 */
 	if (dev->data->dev_conf.rxmode.max_rx_pkt_len < HINIC_MIN_FRAME_SIZE ||
 	    dev->data->dev_conf.rxmode.max_rx_pkt_len > @@ -740,7 +743,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 				DEV_RX_OFFLOAD_VLAN_FILTER |
 				DEV_RX_OFFLOAD_SCATTER |
 				DEV_RX_OFFLOAD_JUMBO_FRAME |
-				DEV_RX_OFFLOAD_TCP_LRO;
+				DEV_RX_OFFLOAD_TCP_LRO |
+				DEV_RX_OFFLOAD_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 77a46832c..78fea04f8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1812,6 +1812,9 @@ i40e_dev_configure(struct rte_eth_dev *dev)
 	ad->tx_simple_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Only legacy filter API needs the following fdir config. So when the
 	 * legacy filter API is deprecated, the following codes should also be
 	 * removed.
@@ -3613,7 +3616,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_RSS_HASH;
 
 	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 eebc49ade..172c3f6ac 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -147,6 +147,9 @@ iavf_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_vec_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Vlan stripping setting */
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
 		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) @@ -522,7 +525,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_RSS_HASH;
 	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 d74675842..8ff96a96e 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2357,6 +2357,9 @@ ice_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_bulk_alloc_allowed = true;
 	ad->tx_simple_allowed = true;
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	return 0;
 }
 
@@ -2800,7 +2803,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index dbce7a80e..a299c1c74 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2402,6 +2402,10 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
 	int ret;
 
 	PMD_INIT_FUNC_TRACE();
+
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = ixgbe_check_mq_mode(dev);
 	if (ret != 0) {
@@ -5140,6 +5144,9 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index ec01343f1..d873b6ff4 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -412,7 +412,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
@@ -1735,6 +1736,10 @@ lio_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(eth_dev->data->dev_conf.rxmode.offloads &
+						DEV_RX_OFFLOAD_RSS_HASH))
+		eth_dev->data->dev_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_RSS_HASH;
 	/* Inform firmware about change in number of queues to use.
 	 * Disable IO queues and reset registers for re-configuration.
 	 */
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 931e4f4fe..6df2f6f90 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -248,6 +248,9 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
 	struct rte_flow_error error;
 	int ret;
 
+	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Prepare internal flow rules. */
 	ret = mlx4_flow_sync(priv, &error);
 	if (ret) {
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	if (priv->hw_csum)
 		offloads |= DEV_RX_OFFLOAD_CHECKSUM;
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index 2278b24c0..e87d52ea1 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -407,6 +407,10 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
 		rte_errno = ENOMEM;
 		return -rte_errno;
 	}
+
+	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	memcpy(priv->rss_conf.rss_key,
 	       use_app_rss_key ?
 	       dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key :
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index f0ab8438d..c8e1fc4b6 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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index eed8dece9..5c027e1a4 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -532,6 +532,9 @@ static int hn_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev_conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	unsupported = txmode->offloads & ~HN_TX_OFFLOAD_CAPS;
 	if (unsupported) {
 		PMD_DRV_LOG(NOTICE,
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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 22a8b2d19..e288a7f7e 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -407,6 +407,9 @@ nfp_net_configure(struct rte_eth_dev *dev)
 	rxmode = &dev_conf->rxmode;
 	txmode = &dev_conf->txmode;
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Checking TX mode */
 	if (txmode->mq_mode) {
 		PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported"); @@ -1236,7 +1239,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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT; diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index 62291c698..d6e8ae745 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -575,7 +575,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM | diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 4d9ed4870..d581240fe 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	| \
@@ -140,11 +140,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_RSS_HASH)
 
 #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 53fdfde9a..8cdf04eaf 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1182,6 +1182,9 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE(edev);
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* We need to have min 1 RX queue.There is no min check in
 	 * rte_eth_dev_configure(), so we are checking it here.
 	 */
@@ -1302,7 +1305,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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..d9d2ce6bd 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -715,7 +715,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
-	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
+	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= 0,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c index f2fc6e70a..9e527b7fb 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -796,7 +796,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 	.features		= SFC_DP_RX_FEAT_MULTI_PROCESS |
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
-				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
+				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index e6809bb64..10fa1e5ff 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -617,7 +617,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 		.hw_fw_caps	= 0,
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
-	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
+	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
@@ -1556,6 +1557,10 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
 		rxmode->offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
 	}
 
+	if ((offloads_supported & DEV_RX_OFFLOAD_RSS_HASH) &&
+	    (~rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	return rc;
 }
 
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index b93d45712..28ee3e46d 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1920,6 +1920,9 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (!rte_eal_has_hugepages()) {
 		PMD_INIT_LOG(INFO, "Huge page is not configured");
 		return -EINVAL;
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 d1faeaa81..5ef6ad43c 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);  static int eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev); @@ -407,6 +408,9 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (dev->data->nb_tx_queues > VMXNET3_MAX_TX_QUEUES ||
 	    dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES) {
 		PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-11-01 11:11                                 ` Andrew Rybchenko
@ 2019-11-01 22:22                                   ` Thomas Monjalon
  0 siblings, 0 replies; 246+ messages in thread
From: Thomas Monjalon @ 2019-11-01 22:22 UTC (permalink / raw)
  To: Andrew Rybchenko, Pavan Nikhilesh Bhagavatula
  Cc: dev, ferruh.yigit, Jerin Jacob Kollanukkaran, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Kumar Dabilpuram,
	Kiran Kumar Kokkilagadda, Rasesh Mody, Shahed Shaikh,
	Maciej Czekaj, Yong Wang

01/11/2019 12:11, Andrew Rybchenko:
> On 10/31/19 7:51 PM, Pavan Nikhilesh Bhagavatula wrote:
> > 
> >> 29/10/2019 16:37, pbhagavatula@marvell.com:
> >>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >>>
> >>> Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash delivery.
> >>>
> >>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> >>> Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> >>> Acked-by: Jerin Jacob <jerinj@marvell.com>
> >>> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> >>> ---
> >>> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> >>> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> >>
> >> Excuse me, I miss why you need a check before setting the bit.
> > 
> > Currently, none of the PMDs support disabling RSS_HASH (except octeontx2) since it involves 
> > adding an if check in Rx routine that might lead to perf impact.
> > So, we are implicitly enabling the offload for all the PMDs if an application decides to disable
> > RSS_HASH. In future if PMD maintainer decides to add this feature she/he can remove the check.
> 
> As I understand Thomas says that it is just sufficient to do:
>     dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> without any if before.
> 
> Yes, it is true since right now it looks a bit strange.
> I guess it is the result of code evolution. Initially
> it was logging inside if, but logging is moved to ethdev.
> 
> (Of course, it is true for such trivial checks only)

Yes exactly, this "if" can be removed in several places.



^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [EXT] Re: [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-10-31 16:44                               ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
@ 2019-11-01 22:50                                 ` Thomas Monjalon
  0 siblings, 0 replies; 246+ messages in thread
From: Thomas Monjalon @ 2019-11-01 22:50 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula
  Cc: dev, ferruh.yigit, arybchenko, Jerin Jacob Kollanukkaran

31/10/2019 17:44, Pavan Nikhilesh Bhagavatula:
> >29/10/2019 16:37, pbhagavatula@marvell.com:
> >> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >> +{
> >> +	uint64_t offloads_diff = req_offloads ^ set_offloads;
> >> +	uint64_t offloads_req_diff, offloads_set_diff;
> >> +	uint64_t offload;
> >> +	uint8_t err = 0;
> >> +
> >> +	/* Check if any offload is advertised but not enabled. */
> >
> >Not sure "advertised" is the right word here.
> 
> Don't PMDs advertise their capabilities/offloads through dev_info?.

Yes




^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-01 11:04                                     ` Andrew Rybchenko
@ 2019-11-03  6:57                                       ` Matan Azrad
  2019-11-03 12:12                                         ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Matan Azrad @ 2019-11-03  6:57 UTC (permalink / raw)
  To: Andrew Rybchenko, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev

Hi

From: Andrew Rybchenko
> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula wrote:
> >> From: Pavan Nikhilesh Bhagavatula
> >>> Hi Matan,
> >>>
> >>>> Hi Pavan
> >>>>
> >>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >>>>> Some PMDs cannot work when certain offloads are enable/disabled,
> >>>>> as a workaround PMDs auto enable/disable offloads internally and
> >>>>> expose it through dev->data->dev_conf.rxmode.offloads.
> >>>>>
> >>>>> After device specific dev_configure is called compare the
> >>>>> requested offloads to the offloads exposed by the PMD and, if the
> >>>>> PMD failed to enable a given offload then log it and return
> >>>>> -EINVAL from rte_eth_dev_configure, else if the PMD failed to
> >>>>> disable a given offload log and continue with rte_eth_dev_configure.
> >>>>>
> >>>>
> >>>> rte_eth_dev_configure can be called more than 1 time in the device
> >>>> life time, How can you know what is the minimum offload
> >>>> configurations required by the port after the first call?
> >>>> Maybe putting it in dev info is better, what do you think?
> >>>>
> >>>
> >>> We only return -EINVAL in the case where we enable an offload
> >>> advertised by dev_info and the port still fails to enable it.
> >>
> >> Are you sure it is ok that devices may disable\enable offloads under
> >> the hood without user notification?
> >
> > Some devices already do it. The above check adds validation for the same.
> 
> The problem is that some offloads cannot be disabled.

Yes, I understand it.

> If application does not request Rx checksum offload since it does use it, it is
> not a problem to report it.

Yes, for RX checksum I tend to agree that application doesn't care if the PMD will calculate the checksum in spite of the offload is disabled.

But what's about other offloads:
For example in RX: LRO, CRC_KEEP, VLAN_STRIP, JUMBO
If the PMD will stay them on while the app is disabling it, It can cause a problems to the application (affects the packet length).
For example in TX: TSO, VLAN, MULTI_SEG.....

> Of course, it could be a problem if the offload is
> used, but application wants to disable it, for example, for debugging
> purposes.
> In this case, the solution is to mask offloads on application level, which is not
> ideal as well.

Why not ideal?

If application can know the limitation of offloads disabling (for example to read capability on it)
The application has all information to take decisions.

> Anyway, the patch just tries to highlight difference of applied from
> requested. So, it is a step forward.
> Also, the patch will fail configure if an offload is requested, but not enabled.
> 
> >> Can't it break applications?
> >> Why does the device expose unsupported offloads in dev info?
> >> Does it update the running offload usynchronically? Race?
> >> Can you explain also your specific use case?
> >>
> >>
> >>>> Matan


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-11-01 17:49                             ` Liron Himi
@ 2019-11-03 12:06                               ` Andrew Rybchenko
  2019-11-03 14:06                                 ` [dpdk-dev] [EXT] " Liron Himi
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-03 12:06 UTC (permalink / raw)
  To: Liron Himi, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Kumar Dabilpuram,
	Kiran Kumar Kokkilagadda, Rasesh Mody, Shahed Shaikh,
	Maciej Czekaj, Yong Wang
  Cc: dev

On 11/1/19 8:49 PM, Liron Himi wrote:
> Hi,
>
> mvpp2 and mvneta PMDs are also support RSS hash.
> Please add them to the patch.

I've failed to find where mvpp2 and mvneta set PKT_RX_RSS_HASH.


> Regards,
> Liron
>
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of pbhagavatula@marvell.com
> Sent: Tuesday, 29 October 2019 17:37
> To: ferruh.yigit@intel.com; arybchenko@solarflare.com; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Ajit Khaparde <ajit.khaparde@broadcom.com>; Somnath Kotur <somnath.kotur@broadcom.com>; Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>; Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena <sachin.saxena@nxp.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>; John Daley <johndale@cisco.com>; Hyong Youb Kim <hyonkim@cisco.com>; Qi Zhang <qi.z.zhang@intel.com>; Xiao Wang <xiao.w.wang@intel.com>; Ziyang Xuan <xuanziyang2@huawei.com>; Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>; Guoyang Zhou <zhouguoyang@huawei.com>; Beilei Xing <beilei.xing@intel.com>; Jingjing Wu <jingjing.wu@intel.com>; Qiming Yang <qiming.yang@intel.com>; Konstantin Ananyev <konstantin.ananyev@intel.com>; Shijith Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Matan Azrad <matan@mellanox.com>; Shahaf Shuler <shahafs@mellanox.com>; Viacheslav Ovsiienko <viacheslavo@mellanox.com>; Stephen Hemminger <sthemmin@microsoft.com>; K. Y. Srinivasan <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; Alejandro Lucero <alejandro.lucero@netronome.com>; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Rasesh Mody <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Maciej Czekaj <mczekaj@marvell.com>; Yong Wang <yongwang@vmware.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
> Subject: [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash delivery.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Acked-by: Jerin Jacob <jerinj@marvell.com>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>   drivers/net/bnxt/bnxt_ethdev.c       |  8 +++++++-
>   drivers/net/cxgbe/cxgbe.h            |  3 ++-
>   drivers/net/cxgbe/cxgbe_ethdev.c     |  5 +++++
>   drivers/net/dpaa/dpaa_ethdev.c       |  3 ++-
>   drivers/net/dpaa2/dpaa2_ethdev.c     |  1 +
>   drivers/net/e1000/igb_ethdev.c       |  6 ++++++
>   drivers/net/e1000/igb_rxtx.c         |  3 ++-
>   drivers/net/enic/enic_ethdev.c       |  5 +++++
>   drivers/net/enic/enic_res.c          |  3 ++-
>   drivers/net/fm10k/fm10k_ethdev.c     |  6 +++++-
>   drivers/net/hinic/hinic_pmd_ethdev.c |  6 +++++-
>   drivers/net/i40e/i40e_ethdev.c       |  6 +++++-
>   drivers/net/iavf/iavf_ethdev.c       |  6 +++++-
>   drivers/net/ice/ice_ethdev.c         |  6 +++++-
>   drivers/net/ixgbe/ixgbe_ethdev.c     |  7 +++++++
>   drivers/net/ixgbe/ixgbe_rxtx.c       |  3 ++-
>   drivers/net/liquidio/lio_ethdev.c    |  7 ++++++-
>   drivers/net/mlx4/mlx4.c              |  3 +++
>   drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
>   drivers/net/mlx5/mlx5_ethdev.c       |  4 ++++
>   drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
>   drivers/net/netvsc/hn_ethdev.c       |  3 +++
>   drivers/net/netvsc/hn_rndis.c        |  3 ++-
>   drivers/net/nfp/nfp_net.c            |  6 +++++-
>   drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-  drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
>   drivers/net/qede/qede_ethdev.c       |  6 +++++-
>   drivers/net/sfc/sfc_ef10_essb_rx.c   |  3 ++-
>   drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
>   drivers/net/sfc/sfc_rx.c             |  7 ++++++-
>   drivers/net/thunderx/nicvf_ethdev.c  |  3 +++  drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-  drivers/net/vmxnet3/vmxnet3_ethdev.c |  6 +++++-
>   33 files changed, 128 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 7d9459f0a..01d48f47c 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -123,7 +123,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
>   				     DEV_RX_OFFLOAD_KEEP_CRC | \
>   				     DEV_RX_OFFLOAD_VLAN_EXTEND | \
>   				     DEV_RX_OFFLOAD_TCP_LRO | \
> -				     DEV_RX_OFFLOAD_SCATTER)
> +				     DEV_RX_OFFLOAD_SCATTER | \
> +				     DEV_RX_OFFLOAD_RSS_HASH)
>   
>   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); @@ -689,6 +690,11 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
>   	bp->rx_cp_nr_rings = bp->rx_nr_rings;
>   	bp->tx_cp_nr_rings = bp->tx_nr_rings;
>   
> +	if (!(rx_offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
> +		rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +		eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
> +	}
> +
>   	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
>   		eth_dev->data->mtu =
>   			eth_dev->data->dev_conf.rxmode.max_rx_pkt_len - diff --git a/drivers/net/cxgbe/cxgbe.h b/drivers/net/cxgbe/cxgbe.h index ed1be3559..6c1f73ac4 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_RSS_HASH)
>   
>   
>   /* Common PF and VF devargs */
> diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
> index 615dda607..6df127087 100644
> --- a/drivers/net/cxgbe/cxgbe_ethdev.c
> +++ b/drivers/net/cxgbe/cxgbe_ethdev.c
> @@ -426,6 +426,11 @@ int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)
>   
>   	CXGBE_FUNC_TRACE();
>   
> +	if (!(eth_dev->data->dev_conf.rxmode.offloads &
> +				DEV_RX_OFFLOAD_RSS_HASH))
> +		eth_dev->data->dev_conf.rxmode.offloads |=
> +							DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	if (!(adapter->flags & FW_QUEUE_BOUND)) {
>   		err = cxgbe_setup_sge_fwevtq(adapter);
>   		if (err)
> diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index caf255d67..096da752d 100644
> --- a/drivers/net/dpaa/dpaa_ethdev.c
> +++ b/drivers/net/dpaa/dpaa_ethdev.c
> @@ -56,7 +56,8 @@ static uint64_t dev_rx_offloads_nodis =
>   		DEV_RX_OFFLOAD_IPV4_CKSUM |
>   		DEV_RX_OFFLOAD_UDP_CKSUM |
>   		DEV_RX_OFFLOAD_TCP_CKSUM |
> -		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
> +		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
> +		DEV_RX_OFFLOAD_RSS_HASH;
>   
>   /* Supported Tx offloads */
>   static uint64_t dev_tx_offloads_sup =
> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
> index 03131b903..eea31f254 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.c
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c
> @@ -45,6 +45,7 @@ static uint64_t dev_rx_offloads_sup =
>   
>   /* Rx offloads which cannot be disabled */  static uint64_t dev_rx_offloads_nodis =
> +		DEV_RX_OFFLOAD_RSS_HASH |
>   		DEV_RX_OFFLOAD_SCATTER;
>   
>   /* Supported Tx offloads */
> diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index ce7c9e664..22665b51c 100644
> --- a/drivers/net/e1000/igb_ethdev.c
> +++ b/drivers/net/e1000/igb_ethdev.c
> @@ -1182,6 +1182,9 @@ eth_igb_configure(struct rte_eth_dev *dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* multipe queue mode checking */
>   	ret  = igb_check_mq_mode(dev);
>   	if (ret != 0) {
> @@ -3255,6 +3258,9 @@ igbvf_dev_configure(struct rte_eth_dev *dev)
>   	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
>   		     dev->data->port_id);
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/*
>   	 * VF has no ability to enable/disable HW CRC
>   	 * Keep the persistent behavior the same as Host PF diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index c5606de5d..684fa4ad8 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_RSS_HASH;
>   
>   	return rx_offload_capa;
>   }
> diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 12c59a3c5..d2d1488d9 100644
> --- a/drivers/net/enic/enic_ethdev.c
> +++ b/drivers/net/enic/enic_ethdev.c
> @@ -405,6 +405,11 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
>   		return ret;
>   	}
>   
> +	if (!(eth_dev->data->dev_conf.rxmode.offloads &
> +						DEV_RX_OFFLOAD_RSS_HASH))
> +		eth_dev->data->dev_conf.rxmode.offloads |=
> +						DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	enic->mc_count = 0;
>   	enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads &
>   				  DEV_RX_OFFLOAD_CHECKSUM);
> diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c index f403a0b66..7c3c270a2 100644
> --- a/drivers/net/enic/enic_res.c
> +++ b/drivers/net/enic/enic_res.c
> @@ -205,7 +205,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_RSS_HASH;
>   	enic->tx_offload_mask =
>   		PKT_TX_IPV6 |
>   		PKT_TX_IPV4 |
> diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
> index 99c4366e4..2e834130d 100644
> --- a/drivers/net/fm10k/fm10k_ethdev.c
> +++ b/drivers/net/fm10k/fm10k_ethdev.c
> @@ -461,6 +461,9 @@ fm10k_dev_configure(struct rte_eth_dev *dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* multipe queue mode checking */
>   	ret  = fm10k_check_mq_mode(dev);
>   	if (ret != 0) {
> @@ -1805,7 +1808,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
>   			   DEV_RX_OFFLOAD_UDP_CKSUM   |
>   			   DEV_RX_OFFLOAD_TCP_CKSUM   |
>   			   DEV_RX_OFFLOAD_JUMBO_FRAME |
> -			   DEV_RX_OFFLOAD_HEADER_SPLIT);
> +			   DEV_RX_OFFLOAD_HEADER_SPLIT |
> +			   DEV_RX_OFFLOAD_RSS_HASH);
>   }
>   
>   static int
> diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
> index 9f37a404b..6673777e9 100644
> --- a/drivers/net/hinic/hinic_pmd_ethdev.c
> +++ b/drivers/net/hinic/hinic_pmd_ethdev.c
> @@ -318,6 +318,9 @@ static int hinic_dev_configure(struct rte_eth_dev *dev)
>   		return -EINVAL;
>   	}
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* mtu size is 256~9600 */
>   	if (dev->data->dev_conf.rxmode.max_rx_pkt_len < HINIC_MIN_FRAME_SIZE ||
>   	    dev->data->dev_conf.rxmode.max_rx_pkt_len > @@ -740,7 +743,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
>   				DEV_RX_OFFLOAD_VLAN_FILTER |
>   				DEV_RX_OFFLOAD_SCATTER |
>   				DEV_RX_OFFLOAD_JUMBO_FRAME |
> -				DEV_RX_OFFLOAD_TCP_LRO;
> +				DEV_RX_OFFLOAD_TCP_LRO |
> +				DEV_RX_OFFLOAD_RSS_HASH;
>   
>   	info->tx_queue_offload_capa = 0;
>   	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 77a46832c..78fea04f8 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -1812,6 +1812,9 @@ i40e_dev_configure(struct rte_eth_dev *dev)
>   	ad->tx_simple_allowed = true;
>   	ad->tx_vec_allowed = true;
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* Only legacy filter API needs the following fdir config. So when the
>   	 * legacy filter API is deprecated, the following codes should also be
>   	 * removed.
> @@ -3613,7 +3616,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_RSS_HASH;
>   
>   	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 eebc49ade..172c3f6ac 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -147,6 +147,9 @@ iavf_dev_configure(struct rte_eth_dev *dev)
>   	ad->rx_vec_allowed = true;
>   	ad->tx_vec_allowed = true;
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* Vlan stripping setting */
>   	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
>   		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) @@ -522,7 +525,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_RSS_HASH;
>   	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 d74675842..8ff96a96e 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -2357,6 +2357,9 @@ ice_dev_configure(struct rte_eth_dev *dev)
>   	ad->rx_bulk_alloc_allowed = true;
>   	ad->tx_simple_allowed = true;
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	return 0;
>   }
>   
> @@ -2800,7 +2803,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>   			DEV_RX_OFFLOAD_TCP_CKSUM |
>   			DEV_RX_OFFLOAD_QINQ_STRIP |
>   			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
> -			DEV_RX_OFFLOAD_VLAN_EXTEND;
> +			DEV_RX_OFFLOAD_VLAN_EXTEND |
> +			DEV_RX_OFFLOAD_RSS_HASH;
>   		dev_info->tx_offload_capa |=
>   			DEV_TX_OFFLOAD_QINQ_INSERT |
>   			DEV_TX_OFFLOAD_IPV4_CKSUM |
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index dbce7a80e..a299c1c74 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2402,6 +2402,10 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
>   	int ret;
>   
>   	PMD_INIT_FUNC_TRACE();
> +
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* multipe queue mode checking */
>   	ret  = ixgbe_check_mq_mode(dev);
>   	if (ret != 0) {
> @@ -5140,6 +5144,9 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
>   	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
>   		     dev->data->port_id);
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/*
>   	 * VF has no ability to enable/disable HW CRC
>   	 * Keep the persistent behavior the same as Host PF diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index edcfa60ce..fa572d184 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_RSS_HASH;
>   
>   	if (hw->mac.type == ixgbe_mac_82598EB)
>   		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
> index ec01343f1..d873b6ff4 100644
> --- a/drivers/net/liquidio/lio_ethdev.c
> +++ b/drivers/net/liquidio/lio_ethdev.c
> @@ -412,7 +412,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
>   	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
>   				    DEV_RX_OFFLOAD_UDP_CKSUM		|
>   				    DEV_RX_OFFLOAD_TCP_CKSUM		|
> -				    DEV_RX_OFFLOAD_VLAN_STRIP);
> +				    DEV_RX_OFFLOAD_VLAN_STRIP		|
> +				    DEV_RX_OFFLOAD_RSS_HASH);
>   	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
>   				    DEV_TX_OFFLOAD_UDP_CKSUM		|
>   				    DEV_TX_OFFLOAD_TCP_CKSUM		|
> @@ -1735,6 +1736,10 @@ lio_dev_configure(struct rte_eth_dev *eth_dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(eth_dev->data->dev_conf.rxmode.offloads &
> +						DEV_RX_OFFLOAD_RSS_HASH))
> +		eth_dev->data->dev_conf.rxmode.offloads |=
> +						DEV_RX_OFFLOAD_RSS_HASH;
>   	/* Inform firmware about change in number of queues to use.
>   	 * Disable IO queues and reset registers for re-configuration.
>   	 */
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 931e4f4fe..6df2f6f90 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -248,6 +248,9 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
>   	struct rte_flow_error error;
>   	int ret;
>   
> +	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* Prepare internal flow rules. */
>   	ret = mlx4_flow_sync(priv, &error);
>   	if (ret) {
> diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c index f45c1ff85..4a6fbd922 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_RSS_HASH;
>   
>   	if (priv->hw_csum)
>   		offloads |= DEV_RX_OFFLOAD_CHECKSUM;
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index 2278b24c0..e87d52ea1 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -407,6 +407,10 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
>   		rte_errno = ENOMEM;
>   		return -rte_errno;
>   	}
> +
> +	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	memcpy(priv->rss_conf.rss_key,
>   	       use_app_rss_key ?
>   	       dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key :
> diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index f0ab8438d..c8e1fc4b6 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_RSS_HASH);
>   
>   	if (config->hw_fcs_strip)
>   		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
> diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index eed8dece9..5c027e1a4 100644
> --- a/drivers/net/netvsc/hn_ethdev.c
> +++ b/drivers/net/netvsc/hn_ethdev.c
> @@ -532,6 +532,9 @@ static int hn_dev_configure(struct rte_eth_dev *dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev_conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	unsupported = txmode->offloads & ~HN_TX_OFFLOAD_CAPS;
>   	if (unsupported) {
>   		PMD_DRV_LOG(NOTICE,
> diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c index a67bc7a79..2b4714042 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_RSS_HASH;
>   
>   	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 22a8b2d19..e288a7f7e 100644
> --- a/drivers/net/nfp/nfp_net.c
> +++ b/drivers/net/nfp/nfp_net.c
> @@ -407,6 +407,9 @@ nfp_net_configure(struct rte_eth_dev *dev)
>   	rxmode = &dev_conf->rxmode;
>   	txmode = &dev_conf->txmode;
>   
> +	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* Checking TX mode */
>   	if (txmode->mq_mode) {
>   		PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported"); @@ -1236,7 +1239,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_RSS_HASH;
>   
>   	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
>   		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT; diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
> index 62291c698..d6e8ae745 100644
> --- a/drivers/net/octeontx2/otx2_ethdev.c
> +++ b/drivers/net/octeontx2/otx2_ethdev.c
> @@ -575,7 +575,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
>   	struct rte_eth_rxmode *rxmode = &conf->rxmode;
>   	uint16_t flags = 0;
>   
> -	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
> +	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
> +			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
>   		flags |= NIX_RX_OFFLOAD_RSS_F;
>   
>   	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM | diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
> index 4d9ed4870..d581240fe 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	| \
> @@ -140,11 +140,12 @@
>   	DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \
>   	DEV_RX_OFFLOAD_SCATTER		| \
>   	DEV_RX_OFFLOAD_JUMBO_FRAME	PKT_RX_RSS_HASH| \
> -	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_RSS_HASH)
>   
>   #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 53fdfde9a..8cdf04eaf 100644
> --- a/drivers/net/qede/qede_ethdev.c
> +++ b/drivers/net/qede/qede_ethdev.c
> @@ -1182,6 +1182,9 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
>   
>   	PMD_INIT_FUNC_TRACE(edev);
>   
> +	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* We need to have min 1 RX queue.There is no min check in
>   	 * rte_eth_dev_configure(), so we are checking it here.
>   	 */
> @@ -1302,7 +1305,8 @@ qede_dev_info_getPKT_RX_RSS_HASH(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_RSS_HASH);
>   	dev_info->rx_queue_offload_capa = 0;
>   
>   	/* TX offloads are on a per-packet basis, so it is applicable diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
> index 63da807ea..d9d2ce6bd 100644
> --- a/drivers/net/sfc/sfc_ef10_essb_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
> @@ -715,7 +715,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
>   	},
>   	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
>   				  SFC_DP_RX_FEAT_FLOW_MARK,
> -	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
> +	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
> +				  DEV_RX_OFFLOAD_RSS_HASH,
>   	.queue_offload_capa	= 0,
>   	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
>   	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
> diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c index f2fc6e70a..9e527b7fb 100644
> --- a/drivers/net/sfc/sfc_ef10_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_rx.c
> @@ -796,7 +796,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
>   	.features		= SFC_DP_RX_FEAT_MULTI_PROCESS |
>   				  SFC_DP_RX_FEAT_INTR,
>   	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
> -				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
> +				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
> +				  DEV_RX_OFFLOAD_RSS_HASH,
>   	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
>   	.get_dev_info		= sfc_ef10_rx_get_dev_info,
>   	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
> diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index e6809bb64..10fa1e5ff 100644
> --- a/drivers/net/sfc/sfc_rx.c
> +++ b/drivers/net/sfc/sfc_rx.c
> @@ -617,7 +617,8 @@ struct sfc_dp_rx sfc_efx_rx = {
>   		.hw_fw_caps	= 0,
>   	},
>   	.features		= SFC_DP_RX_FEAT_INTR,
> -	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
> +	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
> +				  DEV_RX_OFFLOAD_RSS_HASH,
>   	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
>   	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
>   	.qcreate		= sfc_efx_rx_qcreate,
> @@ -1556,6 +1557,10 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
>   		rxmode->offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
>   	}
>   
> +	if ((offloads_supported & DEV_RX_OFFLOAD_RSS_HASH) &&
> +	    (~rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	return rc;
>   }
>   
> diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
> index b93d45712..28ee3e46d 100644
> --- a/drivers/net/thunderx/nicvf_ethdev.c
> +++ b/drivers/net/thunderx/nicvf_ethdev.c
> @@ -1920,6 +1920,9 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	if (!rte_eal_has_hugepages()) {
>   		PMD_INIT_LOG(INFO, "Huge page is not configured");
>   		return -EINVAL;
> diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
> index c0bfbf848..391411799 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_RSS_HASH)
>   
>   #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 d1faeaa81..5ef6ad43c 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -56,7 +56,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_RSS_HASH)
>   
>   static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);  static int eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev); @@ -407,6 +408,9 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	if (dev->data->nb_tx_queues > VMXNET3_MAX_TX_QUEUES ||
>   	    dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES) {
>   		PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
> --
> 2.17.1
>



^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-03  6:57                                       ` Matan Azrad
@ 2019-11-03 12:12                                         ` Andrew Rybchenko
  2019-11-03 15:16                                           ` Matan Azrad
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-03 12:12 UTC (permalink / raw)
  To: Matan Azrad, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev

On 11/3/19 9:57 AM, Matan Azrad wrote:
> Hi
>
> From: Andrew Rybchenko
>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula wrote:
>>>> From: Pavan Nikhilesh Bhagavatula
>>>>> Hi Matan,
>>>>>
>>>>>> Hi Pavan
>>>>>>
>>>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>>>>> Some PMDs cannot work when certain offloads are enable/disabled,
>>>>>>> as a workaround PMDs auto enable/disable offloads internally and
>>>>>>> expose it through dev->data->dev_conf.rxmode.offloads.
>>>>>>>
>>>>>>> After device specific dev_configure is called compare the
>>>>>>> requested offloads to the offloads exposed by the PMD and, if the
>>>>>>> PMD failed to enable a given offload then log it and return
>>>>>>> -EINVAL from rte_eth_dev_configure, else if the PMD failed to
>>>>>>> disable a given offload log and continue with rte_eth_dev_configure.
>>>>>>>
>>>>>> rte_eth_dev_configure can be called more than 1 time in the device
>>>>>> life time, How can you know what is the minimum offload
>>>>>> configurations required by the port after the first call?
>>>>>> Maybe putting it in dev info is better, what do you think?
>>>>>>
>>>>> We only return -EINVAL in the case where we enable an offload
>>>>> advertised by dev_info and the port still fails to enable it.
>>>> Are you sure it is ok that devices may disable\enable offloads under
>>>> the hood without user notification?
>>> Some devices already do it. The above check adds validation for the same.
>> The problem is that some offloads cannot be disabled.
> Yes, I understand it.
>
>> If application does not request Rx checksum offload since it does use it, it is
>> not a problem to report it.
> Yes, for RX checksum I tend to agree that application doesn't care if the PMD will calculate the checksum in spite of the offload is disabled.
>
> But what's about other offloads:
> For example in RX: LRO, CRC_KEEP, VLAN_STRIP, JUMBO
> If the PMD will stay them on while the app is disabling it, It can cause a problems to the application (affects the packet length).

Yes, I agree that some offloads are critical to be disabled, but RSS_HASH
discussed in the changeset is not critical.

> For example in TX: TSO, VLAN, MULTI_SEG.....

Tx is not that critical since application should not request
these offloads per-packet. Tx offloads are mainly required
to ensure that application may request the offload per packet
and it will be done.

>> Of course, it could be a problem if the offload is
>> used, but application wants to disable it, for example, for debugging
>> purposes.
>> In this case, the solution is to mask offloads on application level, which is not
>> ideal as well.
> Why not ideal?

It eats CPU cycles.

> If application can know the limitation of offloads disabling (for example to read capability on it)
> The application has all information to take decisions.
>
>> Anyway, the patch just tries to highlight difference of applied from
>> requested. So, it is a step forward.
>> Also, the patch will fail configure if an offload is requested, but not enabled.
>>
>>>> Can't it break applications?
>>>> Why does the device expose unsupported offloads in dev info?
>>>> Does it update the running offload usynchronically? Race?
>>>> Can you explain also your specific use case?
>>>>
>>>>
>>>>>> Matan


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [EXT] Re: [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities
  2019-11-03 12:06                               ` Andrew Rybchenko
@ 2019-11-03 14:06                                 ` Liron Himi
  0 siblings, 0 replies; 246+ messages in thread
From: Liron Himi @ 2019-11-03 14:06 UTC (permalink / raw)
  To: Andrew Rybchenko, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Ajit Khaparde, Somnath Kotur,
	Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena, Wenzhuo Lu,
	John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang, Ziyang Xuan,
	Xiaoyun Wang, Guoyang Zhou, Beilei Xing, Jingjing Wu,
	Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Kumar Dabilpuram,
	Kiran Kumar Kokkilagadda, Rasesh Mody, Shahed Shaikh,
	Maciej Czekaj, Yong Wang
  Cc: dev, Liron Himi

Hi,

Correct, I didn't notice that the patch related to the 'rss' field in mbuf.

So ignore my request.

Regards,
Liron

-----Original Message-----
From: Andrew Rybchenko <arybchenko@solarflare.com> 
Sent: Sunday, 3 November 2019 14:07
To: Liron Himi <lironh@marvell.com>; Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; ferruh.yigit@intel.com; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Ajit Khaparde <ajit.khaparde@broadcom.com>; Somnath Kotur <somnath.kotur@broadcom.com>; Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>; Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena <sachin.saxena@nxp.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>; John Daley <johndale@cisco.com>; Hyong Youb Kim <hyonkim@cisco.com>; Qi Zhang <qi.z.zhang@intel.com>; Xiao Wang <xiao.w.wang@intel.com>; Ziyang Xuan <xuanziyang2@huawei.com>; Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>; Guoyang Zhou <zhouguoyang@huawei.com>; Beilei Xing <beilei.xing@intel.com>; Jingjing Wu <jingjing.wu@intel.com>; Qiming Yang <qiming.yang@intel.com>; Konstantin Ananyev <konstantin.ananyev@intel.com>; Shijith Thotton <sthotton@marvell.com>; Srisivasubramanian Srinivasan <srinivasan@marvell.com>; Matan Azrad <matan@mellanox.com>; Shahaf Shuler <shahafs@mellanox.com>; Viacheslav Ovsiienko <viacheslavo@mellanox.com>; Stephen Hemminger <sthemmin@microsoft.com>; K. Y. Srinivasan <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; Alejandro Lucero <alejandro.lucero@netronome.com>; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Rasesh Mody <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Maciej Czekaj <mczekaj@marvell.com>; Yong Wang <yongwang@vmware.com>
Cc: dev@dpdk.org
Subject: [EXT] Re: [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities

External Email

----------------------------------------------------------------------
On 11/1/19 8:49 PM, Liron Himi wrote:
> Hi,
>
> mvpp2 and mvneta PMDs are also support RSS hash.
> Please add them to the patch.

I've failed to find where mvpp2 and mvneta set PKT_RX_RSS_HASH.


> Regards,
> Liron
>
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of pbhagavatula@marvell.com
> Sent: Tuesday, 29 October 2019 17:37
> To: ferruh.yigit@intel.com; arybchenko@solarflare.com; Jerin Jacob 
> Kollanukkaran <jerinj@marvell.com>; Ajit Khaparde 
> <ajit.khaparde@broadcom.com>; Somnath Kotur 
> <somnath.kotur@broadcom.com>; Rahul Lakkireddy 
> <rahul.lakkireddy@chelsio.com>; Hemant Agrawal 
> <hemant.agrawal@nxp.com>; Sachin Saxena <sachin.saxena@nxp.com>; 
> Wenzhuo Lu <wenzhuo.lu@intel.com>; John Daley <johndale@cisco.com>; 
> Hyong Youb Kim <hyonkim@cisco.com>; Qi Zhang <qi.z.zhang@intel.com>; 
> Xiao Wang <xiao.w.wang@intel.com>; Ziyang Xuan 
> <xuanziyang2@huawei.com>; Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>; 
> Guoyang Zhou <zhouguoyang@huawei.com>; Beilei Xing 
> <beilei.xing@intel.com>; Jingjing Wu <jingjing.wu@intel.com>; Qiming 
> Yang <qiming.yang@intel.com>; Konstantin Ananyev 
> <konstantin.ananyev@intel.com>; Shijith Thotton 
> <sthotton@marvell.com>; Srisivasubramanian Srinivasan 
> <srinivasan@marvell.com>; Matan Azrad <matan@mellanox.com>; Shahaf 
> Shuler <shahafs@mellanox.com>; Viacheslav Ovsiienko 
> <viacheslavo@mellanox.com>; Stephen Hemminger 
> <sthemmin@microsoft.com>; K. Y. Srinivasan <kys@microsoft.com>; 
> Haiyang Zhang <haiyangz@microsoft.com>; Alejandro Lucero 
> <alejandro.lucero@netronome.com>; Nithin Kumar Dabilpuram 
> <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda 
> <kirankumark@marvell.com>; Rasesh Mody <rmody@marvell.com>; Shahed 
> Shaikh <shshaikh@marvell.com>; Maciej Czekaj <mczekaj@marvell.com>; 
> Yong Wang <yongwang@vmware.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula 
> <pbhagavatula@marvell.com>
> Subject: [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash 
> offload capabilities
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash delivery.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Acked-by: Jerin Jacob <jerinj@marvell.com>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>   drivers/net/bnxt/bnxt_ethdev.c       |  8 +++++++-
>   drivers/net/cxgbe/cxgbe.h            |  3 ++-
>   drivers/net/cxgbe/cxgbe_ethdev.c     |  5 +++++
>   drivers/net/dpaa/dpaa_ethdev.c       |  3 ++-
>   drivers/net/dpaa2/dpaa2_ethdev.c     |  1 +
>   drivers/net/e1000/igb_ethdev.c       |  6 ++++++
>   drivers/net/e1000/igb_rxtx.c         |  3 ++-
>   drivers/net/enic/enic_ethdev.c       |  5 +++++
>   drivers/net/enic/enic_res.c          |  3 ++-
>   drivers/net/fm10k/fm10k_ethdev.c     |  6 +++++-
>   drivers/net/hinic/hinic_pmd_ethdev.c |  6 +++++-
>   drivers/net/i40e/i40e_ethdev.c       |  6 +++++-
>   drivers/net/iavf/iavf_ethdev.c       |  6 +++++-
>   drivers/net/ice/ice_ethdev.c         |  6 +++++-
>   drivers/net/ixgbe/ixgbe_ethdev.c     |  7 +++++++
>   drivers/net/ixgbe/ixgbe_rxtx.c       |  3 ++-
>   drivers/net/liquidio/lio_ethdev.c    |  7 ++++++-
>   drivers/net/mlx4/mlx4.c              |  3 +++
>   drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
>   drivers/net/mlx5/mlx5_ethdev.c       |  4 ++++
>   drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
>   drivers/net/netvsc/hn_ethdev.c       |  3 +++
>   drivers/net/netvsc/hn_rndis.c        |  3 ++-
>   drivers/net/nfp/nfp_net.c            |  6 +++++-
>   drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-  drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
>   drivers/net/qede/qede_ethdev.c       |  6 +++++-
>   drivers/net/sfc/sfc_ef10_essb_rx.c   |  3 ++-
>   drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
>   drivers/net/sfc/sfc_rx.c             |  7 ++++++-
>   drivers/net/thunderx/nicvf_ethdev.c  |  3 +++  drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-  drivers/net/vmxnet3/vmxnet3_ethdev.c |  6 +++++-
>   33 files changed, 128 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c 
> b/drivers/net/bnxt/bnxt_ethdev.c index 7d9459f0a..01d48f47c 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -123,7 +123,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
>   				     DEV_RX_OFFLOAD_KEEP_CRC | \
>   				     DEV_RX_OFFLOAD_VLAN_EXTEND | \
>   				     DEV_RX_OFFLOAD_TCP_LRO | \
> -				     DEV_RX_OFFLOAD_SCATTER)
> +				     DEV_RX_OFFLOAD_SCATTER | \
> +				     DEV_RX_OFFLOAD_RSS_HASH)
>   
>   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); @@ -689,6 +690,11 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
>   	bp->rx_cp_nr_rings = bp->rx_nr_rings;
>   	bp->tx_cp_nr_rings = bp->tx_nr_rings;
>   
> +	if (!(rx_offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
> +		rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +		eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
> +	}
> +
>   	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
>   		eth_dev->data->mtu =
>   			eth_dev->data->dev_conf.rxmode.max_rx_pkt_len - diff --git 
> a/drivers/net/cxgbe/cxgbe.h b/drivers/net/cxgbe/cxgbe.h index 
> ed1be3559..6c1f73ac4 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_RSS_HASH)
>   
>   
>   /* Common PF and VF devargs */
> diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c 
> b/drivers/net/cxgbe/cxgbe_ethdev.c
> index 615dda607..6df127087 100644
> --- a/drivers/net/cxgbe/cxgbe_ethdev.c
> +++ b/drivers/net/cxgbe/cxgbe_ethdev.c
> @@ -426,6 +426,11 @@ int cxgbe_dev_configure(struct rte_eth_dev 
> *eth_dev)
>   
>   	CXGBE_FUNC_TRACE();
>   
> +	if (!(eth_dev->data->dev_conf.rxmode.offloads &
> +				DEV_RX_OFFLOAD_RSS_HASH))
> +		eth_dev->data->dev_conf.rxmode.offloads |=
> +							DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	if (!(adapter->flags & FW_QUEUE_BOUND)) {
>   		err = cxgbe_setup_sge_fwevtq(adapter);
>   		if (err)
> diff --git a/drivers/net/dpaa/dpaa_ethdev.c 
> b/drivers/net/dpaa/dpaa_ethdev.c index caf255d67..096da752d 100644
> --- a/drivers/net/dpaa/dpaa_ethdev.c
> +++ b/drivers/net/dpaa/dpaa_ethdev.c
> @@ -56,7 +56,8 @@ static uint64_t dev_rx_offloads_nodis =
>   		DEV_RX_OFFLOAD_IPV4_CKSUM |
>   		DEV_RX_OFFLOAD_UDP_CKSUM |
>   		DEV_RX_OFFLOAD_TCP_CKSUM |
> -		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
> +		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
> +		DEV_RX_OFFLOAD_RSS_HASH;
>   
>   /* Supported Tx offloads */
>   static uint64_t dev_tx_offloads_sup = diff --git 
> a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
> index 03131b903..eea31f254 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.c
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c
> @@ -45,6 +45,7 @@ static uint64_t dev_rx_offloads_sup =
>   
>   /* Rx offloads which cannot be disabled */  static uint64_t 
> dev_rx_offloads_nodis =
> +		DEV_RX_OFFLOAD_RSS_HASH |
>   		DEV_RX_OFFLOAD_SCATTER;
>   
>   /* Supported Tx offloads */
> diff --git a/drivers/net/e1000/igb_ethdev.c 
> b/drivers/net/e1000/igb_ethdev.c index ce7c9e664..22665b51c 100644
> --- a/drivers/net/e1000/igb_ethdev.c
> +++ b/drivers/net/e1000/igb_ethdev.c
> @@ -1182,6 +1182,9 @@ eth_igb_configure(struct rte_eth_dev *dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* multipe queue mode checking */
>   	ret  = igb_check_mq_mode(dev);
>   	if (ret != 0) {
> @@ -3255,6 +3258,9 @@ igbvf_dev_configure(struct rte_eth_dev *dev)
>   	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
>   		     dev->data->port_id);
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/*
>   	 * VF has no ability to enable/disable HW CRC
>   	 * Keep the persistent behavior the same as Host PF diff --git 
> a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index 
> c5606de5d..684fa4ad8 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_RSS_HASH;
>   
>   	return rx_offload_capa;
>   }
> diff --git a/drivers/net/enic/enic_ethdev.c 
> b/drivers/net/enic/enic_ethdev.c index 12c59a3c5..d2d1488d9 100644
> --- a/drivers/net/enic/enic_ethdev.c
> +++ b/drivers/net/enic/enic_ethdev.c
> @@ -405,6 +405,11 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
>   		return ret;
>   	}
>   
> +	if (!(eth_dev->data->dev_conf.rxmode.offloads &
> +						DEV_RX_OFFLOAD_RSS_HASH))
> +		eth_dev->data->dev_conf.rxmode.offloads |=
> +						DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	enic->mc_count = 0;
>   	enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads &
>   				  DEV_RX_OFFLOAD_CHECKSUM);
> diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c 
> index f403a0b66..7c3c270a2 100644
> --- a/drivers/net/enic/enic_res.c
> +++ b/drivers/net/enic/enic_res.c
> @@ -205,7 +205,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_RSS_HASH;
>   	enic->tx_offload_mask =
>   		PKT_TX_IPV6 |
>   		PKT_TX_IPV4 |
> diff --git a/drivers/net/fm10k/fm10k_ethdev.c 
> b/drivers/net/fm10k/fm10k_ethdev.c
> index 99c4366e4..2e834130d 100644
> --- a/drivers/net/fm10k/fm10k_ethdev.c
> +++ b/drivers/net/fm10k/fm10k_ethdev.c
> @@ -461,6 +461,9 @@ fm10k_dev_configure(struct rte_eth_dev *dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* multipe queue mode checking */
>   	ret  = fm10k_check_mq_mode(dev);
>   	if (ret != 0) {
> @@ -1805,7 +1808,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
>   			   DEV_RX_OFFLOAD_UDP_CKSUM   |
>   			   DEV_RX_OFFLOAD_TCP_CKSUM   |
>   			   DEV_RX_OFFLOAD_JUMBO_FRAME |
> -			   DEV_RX_OFFLOAD_HEADER_SPLIT);
> +			   DEV_RX_OFFLOAD_HEADER_SPLIT |
> +			   DEV_RX_OFFLOAD_RSS_HASH);
>   }
>   
>   static int
> diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c 
> b/drivers/net/hinic/hinic_pmd_ethdev.c
> index 9f37a404b..6673777e9 100644
> --- a/drivers/net/hinic/hinic_pmd_ethdev.c
> +++ b/drivers/net/hinic/hinic_pmd_ethdev.c
> @@ -318,6 +318,9 @@ static int hinic_dev_configure(struct rte_eth_dev *dev)
>   		return -EINVAL;
>   	}
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* mtu size is 256~9600 */
>   	if (dev->data->dev_conf.rxmode.max_rx_pkt_len < HINIC_MIN_FRAME_SIZE ||
>   	    dev->data->dev_conf.rxmode.max_rx_pkt_len > @@ -740,7 +743,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
>   				DEV_RX_OFFLOAD_VLAN_FILTER |
>   				DEV_RX_OFFLOAD_SCATTER |
>   				DEV_RX_OFFLOAD_JUMBO_FRAME |
> -				DEV_RX_OFFLOAD_TCP_LRO;
> +				DEV_RX_OFFLOAD_TCP_LRO |
> +				DEV_RX_OFFLOAD_RSS_HASH;
>   
>   	info->tx_queue_offload_capa = 0;
>   	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | diff --git 
> a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c 
> index 77a46832c..78fea04f8 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -1812,6 +1812,9 @@ i40e_dev_configure(struct rte_eth_dev *dev)
>   	ad->tx_simple_allowed = true;
>   	ad->tx_vec_allowed = true;
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* Only legacy filter API needs the following fdir config. So when the
>   	 * legacy filter API is deprecated, the following codes should also be
>   	 * removed.
> @@ -3613,7 +3616,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_RSS_HASH;
>   
>   	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 eebc49ade..172c3f6ac 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -147,6 +147,9 @@ iavf_dev_configure(struct rte_eth_dev *dev)
>   	ad->rx_vec_allowed = true;
>   	ad->tx_vec_allowed = true;
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* Vlan stripping setting */
>   	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
>   		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) @@ -522,7 +525,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_RSS_HASH;
>   	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 d74675842..8ff96a96e 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -2357,6 +2357,9 @@ ice_dev_configure(struct rte_eth_dev *dev)
>   	ad->rx_bulk_alloc_allowed = true;
>   	ad->tx_simple_allowed = true;
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	return 0;
>   }
>   
> @@ -2800,7 +2803,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>   			DEV_RX_OFFLOAD_TCP_CKSUM |
>   			DEV_RX_OFFLOAD_QINQ_STRIP |
>   			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
> -			DEV_RX_OFFLOAD_VLAN_EXTEND;
> +			DEV_RX_OFFLOAD_VLAN_EXTEND |
> +			DEV_RX_OFFLOAD_RSS_HASH;
>   		dev_info->tx_offload_capa |=
>   			DEV_TX_OFFLOAD_QINQ_INSERT |
>   			DEV_TX_OFFLOAD_IPV4_CKSUM |
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c 
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index dbce7a80e..a299c1c74 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2402,6 +2402,10 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
>   	int ret;
>   
>   	PMD_INIT_FUNC_TRACE();
> +
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* multipe queue mode checking */
>   	ret  = ixgbe_check_mq_mode(dev);
>   	if (ret != 0) {
> @@ -5140,6 +5144,9 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
>   	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
>   		     dev->data->port_id);
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/*
>   	 * VF has no ability to enable/disable HW CRC
>   	 * Keep the persistent behavior the same as Host PF diff --git 
> a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c 
> index edcfa60ce..fa572d184 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_RSS_HASH;
>   
>   	if (hw->mac.type == ixgbe_mac_82598EB)
>   		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; diff --git 
> a/drivers/net/liquidio/lio_ethdev.c 
> b/drivers/net/liquidio/lio_ethdev.c
> index ec01343f1..d873b6ff4 100644
> --- a/drivers/net/liquidio/lio_ethdev.c
> +++ b/drivers/net/liquidio/lio_ethdev.c
> @@ -412,7 +412,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
>   	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
>   				    DEV_RX_OFFLOAD_UDP_CKSUM		|
>   				    DEV_RX_OFFLOAD_TCP_CKSUM		|
> -				    DEV_RX_OFFLOAD_VLAN_STRIP);
> +				    DEV_RX_OFFLOAD_VLAN_STRIP		|
> +				    DEV_RX_OFFLOAD_RSS_HASH);
>   	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
>   				    DEV_TX_OFFLOAD_UDP_CKSUM		|
>   				    DEV_TX_OFFLOAD_TCP_CKSUM		|
> @@ -1735,6 +1736,10 @@ lio_dev_configure(struct rte_eth_dev *eth_dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(eth_dev->data->dev_conf.rxmode.offloads &
> +						DEV_RX_OFFLOAD_RSS_HASH))
> +		eth_dev->data->dev_conf.rxmode.offloads |=
> +						DEV_RX_OFFLOAD_RSS_HASH;
>   	/* Inform firmware about change in number of queues to use.
>   	 * Disable IO queues and reset registers for re-configuration.
>   	 */
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 
> 931e4f4fe..6df2f6f90 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -248,6 +248,9 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
>   	struct rte_flow_error error;
>   	int ret;
>   
> +	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* Prepare internal flow rules. */
>   	ret = mlx4_flow_sync(priv, &error);
>   	if (ret) {
> diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c 
> index f45c1ff85..4a6fbd922 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_RSS_HASH;
>   
>   	if (priv->hw_csum)
>   		offloads |= DEV_RX_OFFLOAD_CHECKSUM; diff --git 
> a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c 
> index 2278b24c0..e87d52ea1 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -407,6 +407,10 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
>   		rte_errno = ENOMEM;
>   		return -rte_errno;
>   	}
> +
> +	if (!(dev->data->dev_conf.rxmode.offload & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	memcpy(priv->rss_conf.rss_key,
>   	       use_app_rss_key ?
>   	       dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key :
> diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c 
> index f0ab8438d..c8e1fc4b6 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_RSS_HASH);
>   
>   	if (config->hw_fcs_strip)
>   		offloads |= DEV_RX_OFFLOAD_KEEP_CRC; diff --git 
> a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c 
> index eed8dece9..5c027e1a4 100644
> --- a/drivers/net/netvsc/hn_ethdev.c
> +++ b/drivers/net/netvsc/hn_ethdev.c
> @@ -532,6 +532,9 @@ static int hn_dev_configure(struct rte_eth_dev 
> *dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev_conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	unsupported = txmode->offloads & ~HN_TX_OFFLOAD_CAPS;
>   	if (unsupported) {
>   		PMD_DRV_LOG(NOTICE,
> diff --git a/drivers/net/netvsc/hn_rndis.c 
> b/drivers/net/netvsc/hn_rndis.c index a67bc7a79..2b4714042 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_RSS_HASH;
>   
>   	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 
> 22a8b2d19..e288a7f7e 100644
> --- a/drivers/net/nfp/nfp_net.c
> +++ b/drivers/net/nfp/nfp_net.c
> @@ -407,6 +407,9 @@ nfp_net_configure(struct rte_eth_dev *dev)
>   	rxmode = &dev_conf->rxmode;
>   	txmode = &dev_conf->txmode;
>   
> +	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* Checking TX mode */
>   	if (txmode->mq_mode) {
>   		PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported"); @@ -1236,7 +1239,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_RSS_HASH;
>   
>   	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
>   		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT; diff --git 
> a/drivers/net/octeontx2/otx2_ethdev.c 
> b/drivers/net/octeontx2/otx2_ethdev.c
> index 62291c698..d6e8ae745 100644
> --- a/drivers/net/octeontx2/otx2_ethdev.c
> +++ b/drivers/net/octeontx2/otx2_ethdev.c
> @@ -575,7 +575,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
>   	struct rte_eth_rxmode *rxmode = &conf->rxmode;
>   	uint16_t flags = 0;
>   
> -	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
> +	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
> +			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
>   		flags |= NIX_RX_OFFLOAD_RSS_F;
>   
>   	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM | diff --git 
> a/drivers/net/octeontx2/otx2_ethdev.h 
> b/drivers/net/octeontx2/otx2_ethdev.h
> index 4d9ed4870..d581240fe 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	| \
> @@ -140,11 +140,12 @@
>   	DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \
>   	DEV_RX_OFFLOAD_SCATTER		| \
>   	DEV_RX_OFFLOAD_JUMBO_FRAME	PKT_RX_RSS_HASH| \
> -	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_RSS_HASH)
>   
>   #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 53fdfde9a..8cdf04eaf 100644
> --- a/drivers/net/qede/qede_ethdev.c
> +++ b/drivers/net/qede/qede_ethdev.c
> @@ -1182,6 +1182,9 @@ static int qede_dev_configure(struct rte_eth_dev 
> *eth_dev)
>   
>   	PMD_INIT_FUNC_TRACE(edev);
>   
> +	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	/* We need to have min 1 RX queue.There is no min check in
>   	 * rte_eth_dev_configure(), so we are checking it here.
>   	 */
> @@ -1302,7 +1305,8 @@ qede_dev_info_getPKT_RX_RSS_HASH(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_RSS_HASH);
>   	dev_info->rx_queue_offload_capa = 0;
>   
>   	/* TX offloads are on a per-packet basis, so it is applicable diff 
> --git a/drivers/net/sfc/sfc_ef10_essb_rx.c 
> b/drivers/net/sfc/sfc_ef10_essb_rx.c
> index 63da807ea..d9d2ce6bd 100644
> --- a/drivers/net/sfc/sfc_ef10_essb_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
> @@ -715,7 +715,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
>   	},
>   	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
>   				  SFC_DP_RX_FEAT_FLOW_MARK,
> -	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
> +	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
> +				  DEV_RX_OFFLOAD_RSS_HASH,
>   	.queue_offload_capa	= 0,
>   	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
>   	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
> diff --git a/drivers/net/sfc/sfc_ef10_rx.c 
> b/drivers/net/sfc/sfc_ef10_rx.c index f2fc6e70a..9e527b7fb 100644
> --- a/drivers/net/sfc/sfc_ef10_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_rx.c
> @@ -796,7 +796,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
>   	.features		= SFC_DP_RX_FEAT_MULTI_PROCESS |
>   				  SFC_DP_RX_FEAT_INTR,
>   	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
> -				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
> +				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
> +				  DEV_RX_OFFLOAD_RSS_HASH,
>   	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
>   	.get_dev_info		= sfc_ef10_rx_get_dev_info,
>   	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
> diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 
> e6809bb64..10fa1e5ff 100644
> --- a/drivers/net/sfc/sfc_rx.c
> +++ b/drivers/net/sfc/sfc_rx.c
> @@ -617,7 +617,8 @@ struct sfc_dp_rx sfc_efx_rx = {
>   		.hw_fw_caps	= 0,
>   	},
>   	.features		= SFC_DP_RX_FEAT_INTR,
> -	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
> +	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
> +				  DEV_RX_OFFLOAD_RSS_HASH,
>   	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
>   	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
>   	.qcreate		= sfc_efx_rx_qcreate,
> @@ -1556,6 +1557,10 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
>   		rxmode->offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
>   	}
>   
> +	if ((offloads_supported & DEV_RX_OFFLOAD_RSS_HASH) &&
> +	    (~rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	return rc;
>   }
>   
> diff --git a/drivers/net/thunderx/nicvf_ethdev.c 
> b/drivers/net/thunderx/nicvf_ethdev.c
> index b93d45712..28ee3e46d 100644
> --- a/drivers/net/thunderx/nicvf_ethdev.c
> +++ b/drivers/net/thunderx/nicvf_ethdev.c
> @@ -1920,6 +1920,9 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	if (!rte_eal_has_hugepages()) {
>   		PMD_INIT_LOG(INFO, "Huge page is not configured");
>   		return -EINVAL;
> diff --git a/drivers/net/thunderx/nicvf_ethdev.h 
> b/drivers/net/thunderx/nicvf_ethdev.h
> index c0bfbf848..391411799 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_RSS_HASH)
>   
>   #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 d1faeaa81..5ef6ad43c 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -56,7 +56,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_RSS_HASH)
>   
>   static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);  
> static int eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev); @@ 
> -407,6 +408,9 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH))
> +		dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>   	if (dev->data->nb_tx_queues > VMXNET3_MAX_TX_QUEUES ||
>   	    dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES) {
>   		PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
> --
> 2.17.1
>



^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-03 12:12                                         ` Andrew Rybchenko
@ 2019-11-03 15:16                                           ` Matan Azrad
  2019-11-05 12:48                                             ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Matan Azrad @ 2019-11-03 15:16 UTC (permalink / raw)
  To: Andrew Rybchenko, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev



From: Andrew Rybchenko
> On 11/3/19 9:57 AM, Matan Azrad wrote:
> > Hi
> >
> > From: Andrew Rybchenko
> >> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula wrote:
> >>>> From: Pavan Nikhilesh Bhagavatula
> >>>>> Hi Matan,
> >>>>>
> >>>>>> Hi Pavan
> >>>>>>
> >>>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >>>>>>> Some PMDs cannot work when certain offloads are
> enable/disabled,
> >>>>>>> as a workaround PMDs auto enable/disable offloads internally and
> >>>>>>> expose it through dev->data->dev_conf.rxmode.offloads.
> >>>>>>>
> >>>>>>> After device specific dev_configure is called compare the
> >>>>>>> requested offloads to the offloads exposed by the PMD and, if
> >>>>>>> the PMD failed to enable a given offload then log it and return
> >>>>>>> -EINVAL from rte_eth_dev_configure, else if the PMD failed to
> >>>>>>> disable a given offload log and continue with
> rte_eth_dev_configure.
> >>>>>>>
> >>>>>> rte_eth_dev_configure can be called more than 1 time in the
> >>>>>> device life time, How can you know what is the minimum offload
> >>>>>> configurations required by the port after the first call?
> >>>>>> Maybe putting it in dev info is better, what do you think?
> >>>>>>
> >>>>> We only return -EINVAL in the case where we enable an offload
> >>>>> advertised by dev_info and the port still fails to enable it.
> >>>> Are you sure it is ok that devices may disable\enable offloads
> >>>> under the hood without user notification?
> >>> Some devices already do it. The above check adds validation for the
> same.
> >> The problem is that some offloads cannot be disabled.
> > Yes, I understand it.
> >
> >> If application does not request Rx checksum offload since it does use
> >> it, it is not a problem to report it.
> > Yes, for RX checksum I tend to agree that application doesn't care if the
> PMD will calculate the checksum in spite of the offload is disabled.
> >
> > But what's about other offloads:
> > For example in RX: LRO, CRC_KEEP, VLAN_STRIP, JUMBO If the PMD will
> > stay them on while the app is disabling it, It can cause a problems to the
> application (affects the packet length).
> 
> Yes, I agree that some offloads are critical to be disabled, but RSS_HASH
> discussed in the changeset is not critical.

So, are you agree It should not be checked globally for all the offloads in ethdev layer?

It even be more problematic if the dynamic offload field in mbuf is not exist at all.  

> 
> > For example in TX: TSO, VLAN, MULTI_SEG.....
> 
> Tx is not that critical since application should not request these offloads per-
> packet. Tx offloads are mainly required to ensure that application may
> request the offload per packet and it will be done.

yes, you right, In TX it looks less critical (for now).

>
> >> Of course, it could be a problem if the offload is used, but
> >> application wants to disable it, for example, for debugging purposes.
> >> In this case, the solution is to mask offloads on application level,
> >> which is not ideal as well.
> > Why not ideal?
> 
> It eats CPU cycles.

Sorry, I don't understand your use case here.

> 
> > If application can know the limitation of offloads disabling (for example to
> read capability on it)
> > The application has all information to take decisions.
> >
> >> Anyway, the patch just tries to highlight difference of applied from
> >> requested. So, it is a step forward.
> >> Also, the patch will fail configure if an offload is requested, but not
> enabled.
> >>
> >>>> Can't it break applications?
> >>>> Why does the device expose unsupported offloads in dev info?
> >>>> Does it update the running offload usynchronically? Race?
> >>>> Can you explain also your specific use case?
> >>>>
> >>>>
> >>>>>> Matan


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-03 15:16                                           ` Matan Azrad
@ 2019-11-05 12:48                                             ` Andrew Rybchenko
  2019-11-05 14:05                                               ` Matan Azrad
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-05 12:48 UTC (permalink / raw)
  To: Matan Azrad, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev

On 11/3/19 6:16 PM, Matan Azrad wrote
> From: Andrew Rybchenko
>> On 11/3/19 9:57 AM, Matan Azrad wrote:
>>> Hi
>>>
>>> From: Andrew Rybchenko
>>>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula wrote:
>>>>>> From: Pavan Nikhilesh Bhagavatula
>>>>>>> Hi Matan,
>>>>>>>
>>>>>>>> Hi Pavan
>>>>>>>>
>>>>>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>>>>>>> Some PMDs cannot work when certain offloads are
>> enable/disabled,
>>>>>>>>> as a workaround PMDs auto enable/disable offloads internally and
>>>>>>>>> expose it through dev->data->dev_conf.rxmode.offloads.
>>>>>>>>>
>>>>>>>>> After device specific dev_configure is called compare the
>>>>>>>>> requested offloads to the offloads exposed by the PMD and, if
>>>>>>>>> the PMD failed to enable a given offload then log it and return
>>>>>>>>> -EINVAL from rte_eth_dev_configure, else if the PMD failed to
>>>>>>>>> disable a given offload log and continue with
>> rte_eth_dev_configure.
>>>>>>>>>
>>>>>>>> rte_eth_dev_configure can be called more than 1 time in the
>>>>>>>> device life time, How can you know what is the minimum offload
>>>>>>>> configurations required by the port after the first call?
>>>>>>>> Maybe putting it in dev info is better, what do you think?
>>>>>>>>
>>>>>>> We only return -EINVAL in the case where we enable an offload
>>>>>>> advertised by dev_info and the port still fails to enable it.
>>>>>> Are you sure it is ok that devices may disable\enable offloads
>>>>>> under the hood without user notification?
>>>>> Some devices already do it. The above check adds validation for the same.
>>>> The problem is that some offloads cannot be disabled.
>>> Yes, I understand it.
>>>
>>>> If application does not request Rx checksum offload since it does use
>>>> it, it is not a problem to report it.
>>> Yes, for RX checksum I tend to agree that application doesn't care if the
>> PMD will calculate the checksum in spite of the offload is disabled.
>>>
>>> But what's about other offloads:
>>> For example in RX: LRO, CRC_KEEP, VLAN_STRIP, JUMBO If the PMD will
>>> stay them on while the app is disabling it, It can cause a problems to the
>> application (affects the packet length).
>>
>> Yes, I agree that some offloads are critical to be disabled, but RSS_HASH
>> discussed in the changeset is not critical.
> 
> So, are you agree It should not be checked globally for all the offloads in ethdev layer?

If offload is not requested, but enabled (since PMD cannot disable it),
right not it will not fail configure, but warn about it in logs.

> It even be more problematic if the dynamic offload field in mbuf is not exist at all.  
> 
>>
>>> For example in TX: TSO, VLAN, MULTI_SEG.....
>>
>> Tx is not that critical since application should not request these offloads per-
>> packet. Tx offloads are mainly required to ensure that application may
>> request the offload per packet and it will be done.
> 
> yes, you right, In TX it looks less critical (for now).
> 
>>
>>>> Of course, it could be a problem if the offload is used, but
>>>> application wants to disable it, for example, for debugging purposes.
>>>> In this case, the solution is to mask offloads on application level,
>>>> which is not ideal as well.
>>> Why not ideal?
>>
>> It eats CPU cycles.
> 
> Sorry, I don't understand your use case here.

If application wants to try code path without, for example,
Rx checksum offload, it could be insufficient to disable
the offload right now, but also required to cleanup offload
results flags in each mbuf (if PMD does not support the
offload disabling).

>>> If application can know the limitation of offloads disabling (for example to
>> read capability on it)
>>> The application has all information to take decisions.
>>>
>>>> Anyway, the patch just tries to highlight difference of applied from
>>>> requested. So, it is a step forward.
>>>> Also, the patch will fail configure if an offload is requested, but not
>> enabled.
>>>>
>>>>>> Can't it break applications?
>>>>>> Why does the device expose unsupported offloads in dev info?
>>>>>> Does it update the running offload usynchronically? Race?
>>>>>> Can you explain also your specific use case?
>>>>>>
>>>>>>
>>>>>>>> Matan
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-05 12:48                                             ` Andrew Rybchenko
@ 2019-11-05 14:05                                               ` Matan Azrad
  2019-11-05 14:37                                                 ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Matan Azrad @ 2019-11-05 14:05 UTC (permalink / raw)
  To: Andrew Rybchenko, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev



From: Andrew Rybchenko
> On 11/3/19 6:16 PM, Matan Azrad wrote
> > From: Andrew Rybchenko
> >> On 11/3/19 9:57 AM, Matan Azrad wrote:
> >>> Hi
> >>>
> >>> From: Andrew Rybchenko
> >>>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula wrote:
> >>>>>> From: Pavan Nikhilesh Bhagavatula
> >>>>>>> Hi Matan,
> >>>>>>>
> >>>>>>>> Hi Pavan
> >>>>>>>>
> >>>>>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >>>>>>>>> Some PMDs cannot work when certain offloads are
> >> enable/disabled,
> >>>>>>>>> as a workaround PMDs auto enable/disable offloads internally
> >>>>>>>>> and expose it through dev->data->dev_conf.rxmode.offloads.
> >>>>>>>>>
> >>>>>>>>> After device specific dev_configure is called compare the
> >>>>>>>>> requested offloads to the offloads exposed by the PMD and, if
> >>>>>>>>> the PMD failed to enable a given offload then log it and
> >>>>>>>>> return -EINVAL from rte_eth_dev_configure, else if the PMD
> >>>>>>>>> failed to disable a given offload log and continue with
> >> rte_eth_dev_configure.
> >>>>>>>>>
> >>>>>>>> rte_eth_dev_configure can be called more than 1 time in the
> >>>>>>>> device life time, How can you know what is the minimum offload
> >>>>>>>> configurations required by the port after the first call?
> >>>>>>>> Maybe putting it in dev info is better, what do you think?
> >>>>>>>>
> >>>>>>> We only return -EINVAL in the case where we enable an offload
> >>>>>>> advertised by dev_info and the port still fails to enable it.
> >>>>>> Are you sure it is ok that devices may disable\enable offloads
> >>>>>> under the hood without user notification?
> >>>>> Some devices already do it. The above check adds validation for the
> same.
> >>>> The problem is that some offloads cannot be disabled.
> >>> Yes, I understand it.
> >>>
> >>>> If application does not request Rx checksum offload since it does
> >>>> use it, it is not a problem to report it.
> >>> Yes, for RX checksum I tend to agree that application doesn't care
> >>> if the
> >> PMD will calculate the checksum in spite of the offload is disabled.
> >>>
> >>> But what's about other offloads:
> >>> For example in RX: LRO, CRC_KEEP, VLAN_STRIP, JUMBO If the PMD will
> >>> stay them on while the app is disabling it, It can cause a problems
> >>> to the
> >> application (affects the packet length).
> >>
> >> Yes, I agree that some offloads are critical to be disabled, but
> >> RSS_HASH discussed in the changeset is not critical.
> >
> > So, are you agree It should not be checked globally for all the offloads in
> ethdev layer?
> 
> If offload is not requested, but enabled (since PMD cannot disable it), right
> not it will not fail configure, but warn about it in logs.
> 

In this case warning print is not enough since it can be critical for the application for some offloads.
It can be very weird for the application to see that some offload are on while the application doesn't expect them to be on.
it even can cause app crash(at least for the RX offload I wrote above).


> > It even be more problematic if the dynamic offload field in mbuf is not exist
> at all.

Any answer here?

> >>
> >>> For example in TX: TSO, VLAN, MULTI_SEG.....
> >>
> >> Tx is not that critical since application should not request these
> >> offloads per- packet. Tx offloads are mainly required to ensure that
> >> application may request the offload per packet and it will be done.
> >
> > yes, you right, In TX it looks less critical (for now).
> >
> >>
> >>>> Of course, it could be a problem if the offload is used, but
> >>>> application wants to disable it, for example, for debugging purposes.
> >>>> In this case, the solution is to mask offloads on application
> >>>> level, which is not ideal as well.
> >>> Why not ideal?
> >>
> >> It eats CPU cycles.
> >
> > Sorry, I don't understand your use case here.
> 
> If application wants to try code path without, for example, Rx checksum
> offload, it could be insufficient to disable the offload right now, but also
> required to cleanup offload results flags in each mbuf (if PMD does not
> support the offload disabling).

What is "right now"? Configuration time?

If application will know that PMD cannot disable the rx-checksum in configuration time,
It can plan to not clean this flag in mbuf for each rx mbuf.


It looks me like PMD limitation which can be solved by 2 options:
1. Capability information which say to the app what offload may not be disabled.
2. Add limitation in the PMD documentation and print warning\error massage from the PMD.
 
> >>> If application can know the limitation of offloads disabling (for
> >>> example to
> >> read capability on it)
> >>> The application has all information to take decisions.
> >>>
> >>>> Anyway, the patch just tries to highlight difference of applied
> >>>> from requested. So, it is a step forward.
> >>>> Also, the patch will fail configure if an offload is requested, but
> >>>> not
> >> enabled.
> >>>>
> >>>>>> Can't it break applications?
> >>>>>> Why does the device expose unsupported offloads in dev info?
> >>>>>> Does it update the running offload usynchronically? Race?
> >>>>>> Can you explain also your specific use case?
> >>>>>>
> >>>>>>
> >>>>>>>> Matan
> >


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-05 14:05                                               ` Matan Azrad
@ 2019-11-05 14:37                                                 ` Andrew Rybchenko
  2019-11-06  6:58                                                   ` Matan Azrad
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-05 14:37 UTC (permalink / raw)
  To: Matan Azrad, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev

On 11/5/19 5:05 PM, Matan Azrad wrote:
> From: Andrew Rybchenko
>> On 11/3/19 6:16 PM, Matan Azrad wrote
>>> From: Andrew Rybchenko
>>>> On 11/3/19 9:57 AM, Matan Azrad wrote:
>>>>> Hi
>>>>>
>>>>> From: Andrew Rybchenko
>>>>>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula wrote:
>>>>>>>> From: Pavan Nikhilesh Bhagavatula
>>>>>>>>> Hi Matan,
>>>>>>>>>
>>>>>>>>>> Hi Pavan
>>>>>>>>>>
>>>>>>>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>>>>>>>>> Some PMDs cannot work when certain offloads are enable/disabled,
>>>>>>>>>>> as a workaround PMDs auto enable/disable offloads internally
>>>>>>>>>>> and expose it through dev->data->dev_conf.rxmode.offloads.
>>>>>>>>>>>
>>>>>>>>>>> After device specific dev_configure is called compare the
>>>>>>>>>>> requested offloads to the offloads exposed by the PMD and, if
>>>>>>>>>>> the PMD failed to enable a given offload then log it and
>>>>>>>>>>> return -EINVAL from rte_eth_dev_configure, else if the PMD
>>>>>>>>>>> failed to disable a given offload log and continue with rte_eth_dev_configure.
>>>>>>>>>>>
>>>>>>>>>> rte_eth_dev_configure can be called more than 1 time in the
>>>>>>>>>> device life time, How can you know what is the minimum offload
>>>>>>>>>> configurations required by the port after the first call?
>>>>>>>>>> Maybe putting it in dev info is better, what do you think?
>>>>>>>>>>
>>>>>>>>> We only return -EINVAL in the case where we enable an offload
>>>>>>>>> advertised by dev_info and the port still fails to enable it.
>>>>>>>> Are you sure it is ok that devices may disable\enable offloads
>>>>>>>> under the hood without user notification?
>>>>>>> Some devices already do it. The above check adds validation for the same.
>>>>>> The problem is that some offloads cannot be disabled.
>>>>> Yes, I understand it.
>>>>>
>>>>>> If application does not request Rx checksum offload since it does
>>>>>> use it, it is not a problem to report it.
>>>>> Yes, for RX checksum I tend to agree that application doesn't care
>>>>> if the
>>>> PMD will calculate the checksum in spite of the offload is disabled.
>>>>>
>>>>> But what's about other offloads:
>>>>> For example in RX: LRO, CRC_KEEP, VLAN_STRIP, JUMBO If the PMD will
>>>>> stay them on while the app is disabling it, It can cause a problems
>>>>> to the
>>>> application (affects the packet length).
>>>>
>>>> Yes, I agree that some offloads are critical to be disabled, but
>>>> RSS_HASH discussed in the changeset is not critical.
>>>
>>> So, are you agree It should not be checked globally for all the offloads in
>> ethdev layer?
>>
>> If offload is not requested, but enabled (since PMD cannot disable it), right
>> not it will not fail configure, but warn about it in logs.
>>
> 
> In this case warning print is not enough since it can be critical for the application for some offloads.
> It can be very weird for the application to see that some offload are on while the application doesn't expect them to be on.
> it even can cause app crash(at least for the RX offload I wrote above).

The patch improves the situation. Earlier it was silent, now it will
be at least visible. I'm afraid that in 19.11 release cycle we cannot
change it to fail dev_configure. I think it will be too destructive.
Future improvement should be discussed separately.

>>> It even be more problematic if the dynamic offload field in mbuf is not exist at all.
> 
> Any answer here?

Please, clarify the question.

>>>>
>>>>> For example in TX: TSO, VLAN, MULTI_SEG.....
>>>>
>>>> Tx is not that critical since application should not request these
>>>> offloads per- packet. Tx offloads are mainly required to ensure that
>>>> application may request the offload per packet and it will be done.
>>>
>>> yes, you right, In TX it looks less critical (for now).
>>>
>>>>
>>>>>> Of course, it could be a problem if the offload is used, but
>>>>>> application wants to disable it, for example, for debugging purposes.
>>>>>> In this case, the solution is to mask offloads on application
>>>>>> level, which is not ideal as well.
>>>>> Why not ideal?
>>>>
>>>> It eats CPU cycles.
>>>
>>> Sorry, I don't understand your use case here.
>>
>> If application wants to try code path without, for example, Rx checksum
>> offload, it could be insufficient to disable the offload right now, but also
>> required to cleanup offload results flags in each mbuf (if PMD does not
>> support the offload disabling).
> 
> What is "right now"? Configuration time?

Right now is the current state of some drivers in DPDK tree.

> If application will know that PMD cannot disable the rx-checksum in configuration time,
> It can plan to not clean this flag in mbuf for each rx mbuf.

Yes and application has a way to know it - take a look
at dev->data->dev_conf.rxmode.offloads.

> It looks me like PMD limitation which can be solved by 2 options:
> 1. Capability information which say to the app what offload may not be disabled.
> 2. Add limitation in the PMD documentation and print warning\error massage from the PMD.

Yes, right now we are going way (2).

>>>>> If application can know the limitation of offloads disabling (for
>>>>> example to
>>>> read capability on it)
>>>>> The application has all information to take decisions.
>>>>>
>>>>>> Anyway, the patch just tries to highlight difference of applied
>>>>>> from requested. So, it is a step forward.
>>>>>> Also, the patch will fail configure if an offload is requested, but
>>>>>> not
>>>> enabled.
>>>>>>
>>>>>>>> Can't it break applications?
>>>>>>>> Why does the device expose unsupported offloads in dev info?
>>>>>>>> Does it update the running offload usynchronically? Race?
>>>>>>>> Can you explain also your specific use case?
>>>>>>>>
>>>>>>>>
>>>>>>>>>> Matan
>>>
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-05 14:37                                                 ` Andrew Rybchenko
@ 2019-11-06  6:58                                                   ` Matan Azrad
  2019-11-06  8:12                                                     ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Matan Azrad @ 2019-11-06  6:58 UTC (permalink / raw)
  To: Andrew Rybchenko, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev



From: Andrew Rybchenko
> On 11/5/19 5:05 PM, Matan Azrad wrote:
> > From: Andrew Rybchenko
> >> On 11/3/19 6:16 PM, Matan Azrad wrote
> >>> From: Andrew Rybchenko
> >>>> On 11/3/19 9:57 AM, Matan Azrad wrote:
> >>>>> Hi
> >>>>>
> >>>>> From: Andrew Rybchenko
> >>>>>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula wrote:
> >>>>>>>> From: Pavan Nikhilesh Bhagavatula
> >>>>>>>>> Hi Matan,
> >>>>>>>>>
> >>>>>>>>>> Hi Pavan
> >>>>>>>>>>
> >>>>>>>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >>>>>>>>>>> Some PMDs cannot work when certain offloads are
> >>>>>>>>>>> enable/disabled, as a workaround PMDs auto enable/disable
> >>>>>>>>>>> offloads internally and expose it through dev->data-
> >dev_conf.rxmode.offloads.
> >>>>>>>>>>>
> >>>>>>>>>>> After device specific dev_configure is called compare the
> >>>>>>>>>>> requested offloads to the offloads exposed by the PMD and,
> >>>>>>>>>>> if the PMD failed to enable a given offload then log it and
> >>>>>>>>>>> return -EINVAL from rte_eth_dev_configure, else if the PMD
> >>>>>>>>>>> failed to disable a given offload log and continue with
> rte_eth_dev_configure.
> >>>>>>>>>>>
> >>>>>>>>>> rte_eth_dev_configure can be called more than 1 time in the
> >>>>>>>>>> device life time, How can you know what is the minimum
> >>>>>>>>>> offload configurations required by the port after the first call?
> >>>>>>>>>> Maybe putting it in dev info is better, what do you think?
> >>>>>>>>>>
> >>>>>>>>> We only return -EINVAL in the case where we enable an offload
> >>>>>>>>> advertised by dev_info and the port still fails to enable it.
> >>>>>>>> Are you sure it is ok that devices may disable\enable offloads
> >>>>>>>> under the hood without user notification?
> >>>>>>> Some devices already do it. The above check adds validation for the
> same.
> >>>>>> The problem is that some offloads cannot be disabled.
> >>>>> Yes, I understand it.
> >>>>>
> >>>>>> If application does not request Rx checksum offload since it does
> >>>>>> use it, it is not a problem to report it.
> >>>>> Yes, for RX checksum I tend to agree that application doesn't care
> >>>>> if the
> >>>> PMD will calculate the checksum in spite of the offload is disabled.
> >>>>>
> >>>>> But what's about other offloads:
> >>>>> For example in RX: LRO, CRC_KEEP, VLAN_STRIP, JUMBO If the PMD
> >>>>> will stay them on while the app is disabling it, It can cause a
> >>>>> problems to the
> >>>> application (affects the packet length).
> >>>>
> >>>> Yes, I agree that some offloads are critical to be disabled, but
> >>>> RSS_HASH discussed in the changeset is not critical.
> >>>
> >>> So, are you agree It should not be checked globally for all the
> >>> offloads in
> >> ethdev layer?
> >>
> >> If offload is not requested, but enabled (since PMD cannot disable
> >> it), right not it will not fail configure, but warn about it in logs.
> >>
> >
> > In this case warning print is not enough since it can be critical for the
> application for some offloads.
> > It can be very weird for the application to see that some offload are on
> while the application doesn't expect them to be on.
> > it even can cause app crash(at least for the RX offload I wrote above).
> 
> The patch improves the situation. Earlier it was silent, now it will be at least
> visible.

We can do it visible inside the limited PMDs.

> I'm afraid that in 19.11 release cycle we cannot change it to fail
> dev_configure. I think it will be too destructive.
> Future improvement should be discussed separately.

So we can remove this ethdev patch now and let the PMD to do it until we will find better solution later.

> >>> It even be more problematic if the dynamic offload field in mbuf is not
> exist at all.
> >
> > Any answer here?

A Rx offload requires dynamic mbuf field cannot stay visible while the app disabling it.
Because the dynamic mbuf field probably is not set in the mbuf.
May cause problems.

> Please, clarify the question.
> 
> >>>>
> >>>>> For example in TX: TSO, VLAN, MULTI_SEG.....
> >>>>
> >>>> Tx is not that critical since application should not request these
> >>>> offloads per- packet. Tx offloads are mainly required to ensure
> >>>> that application may request the offload per packet and it will be done.
> >>>
> >>> yes, you right, In TX it looks less critical (for now).
> >>>
> >>>>
> >>>>>> Of course, it could be a problem if the offload is used, but
> >>>>>> application wants to disable it, for example, for debugging purposes.
> >>>>>> In this case, the solution is to mask offloads on application
> >>>>>> level, which is not ideal as well.
> >>>>> Why not ideal?
> >>>>
> >>>> It eats CPU cycles.
> >>>
> >>> Sorry, I don't understand your use case here.
> >>
> >> If application wants to try code path without, for example, Rx
> >> checksum offload, it could be insufficient to disable the offload
> >> right now, but also required to cleanup offload results flags in each
> >> mbuf (if PMD does not support the offload disabling).
> >
> > What is "right now"? Configuration time?
> 
> Right now is the current state of some drivers in DPDK tree.
> 

OK.
I think the offload configuration is in configuration time. No data-path.

> > If application will know that PMD cannot disable the rx-checksum in
> > configuration time, It can plan to not clean this flag in mbuf for each rx
> mbuf.
> 
> Yes and application has a way to know it - take a look at dev->data-
> >dev_conf.rxmode.offloads.

As I understand, before this patch, this field used for ethdev layer knowledge to track on the application Rx offload configuration.
Am I wrong?

And If the meaning is the PMD configuration set (which weirdly can be different from what application want)
I think it should be an error - because app doesn't follow the API.

> > It looks me like PMD limitation which can be solved by 2 options:
> > 1. Capability information which say to the app what offload may not be
> disabled.
> > 2. Add limitation in the PMD documentation and print warning\error
> massage from the PMD.
> 
> Yes, right now we are going way (2).
>
> >>>>> If application can know the limitation of offloads disabling (for
> >>>>> example to
> >>>> read capability on it)
> >>>>> The application has all information to take decisions.
> >>>>>
> >>>>>> Anyway, the patch just tries to highlight difference of applied
> >>>>>> from requested. So, it is a step forward.
> >>>>>> Also, the patch will fail configure if an offload is requested,
> >>>>>> but not
> >>>> enabled.
> >>>>>>
> >>>>>>>> Can't it break applications?
> >>>>>>>> Why does the device expose unsupported offloads in dev info?
> >>>>>>>> Does it update the running offload usynchronically? Race?
> >>>>>>>> Can you explain also your specific use case?
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>>> Matan
> >>>
> >


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-06  6:58                                                   ` Matan Azrad
@ 2019-11-06  8:12                                                     ` Andrew Rybchenko
  2019-11-07  6:56                                                       ` Matan Azrad
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-06  8:12 UTC (permalink / raw)
  To: Matan Azrad, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev

On 11/6/19 9:58 AM, Matan Azrad wrote:
> 
> 
> From: Andrew Rybchenko
>> On 11/5/19 5:05 PM, Matan Azrad wrote:
>>> From: Andrew Rybchenko
>>>> On 11/3/19 6:16 PM, Matan Azrad wrote
>>>>> From: Andrew Rybchenko
>>>>>> On 11/3/19 9:57 AM, Matan Azrad wrote:
>>>>>>> Hi
>>>>>>> 
>>>>>>> From: Andrew Rybchenko
>>>>>>>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula
>>>>>>>> wrote:
>>>>>>>>>> From: Pavan Nikhilesh Bhagavatula
>>>>>>>>>>> Hi Matan,
>>>>>>>>>>> 
>>>>>>>>>>>> Hi Pavan
>>>>>>>>>>>> 
>>>>>>>>>>>> From: Pavan Nikhilesh
>>>>>>>>>>>> <pbhagavatula@marvell.com>
>>>>>>>>>>>>> Some PMDs cannot work when certain offloads
>>>>>>>>>>>>> are enable/disabled, as a workaround PMDs
>>>>>>>>>>>>> auto enable/disable offloads internally and
>>>>>>>>>>>>> expose it through
>>>>>>>>>>>>> dev->data-dev_conf.rxmode.offloads.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> After device specific dev_configure is called
>>>>>>>>>>>>> compare the requested offloads to the
>>>>>>>>>>>>> offloads exposed by the PMD and, if the PMD
>>>>>>>>>>>>> failed to enable a given offload then log it
>>>>>>>>>>>>> and return -EINVAL from
>>>>>>>>>>>>> rte_eth_dev_configure, else if the PMD failed
>>>>>>>>>>>>> to disable a given offload log and continue
>>>>>>>>>>>>> with rte_eth_dev_configure.
>>>>>>>>>>>>> 
>>>>>>>>>>>> rte_eth_dev_configure can be called more than 1
>>>>>>>>>>>> time in the device life time, How can you know
>>>>>>>>>>>> what is the minimum offload configurations
>>>>>>>>>>>> required by the port after the first call? 
>>>>>>>>>>>> Maybe putting it in dev info is better, what do
>>>>>>>>>>>> you think?
>>>>>>>>>>>> 
>>>>>>>>>>> We only return -EINVAL in the case where we
>>>>>>>>>>> enable an offload advertised by dev_info and the
>>>>>>>>>>> port still fails to enable it.
>>>>>>>>>> Are you sure it is ok that devices may
>>>>>>>>>> disable\enable offloads under the hood without user
>>>>>>>>>> notification?
>>>>>>>>> Some devices already do it. The above check adds
>>>>>>>>> validation for the same.
>>>>>>>> The problem is that some offloads cannot be disabled.
>>>>>>> Yes, I understand it.
>>>>>>> 
>>>>>>>> If application does not request Rx checksum offload
>>>>>>>> since it does use it, it is not a problem to report
>>>>>>>> it.
>>>>>>> Yes, for RX checksum I tend to agree that application
>>>>>>> doesn't care if the
>>>>>> PMD will calculate the checksum in spite of the offload is
>>>>>> disabled.
>>>>>>> 
>>>>>>> But what's about other offloads: For example in RX: LRO,
>>>>>>> CRC_KEEP, VLAN_STRIP, JUMBO If the PMD will stay them on
>>>>>>> while the app is disabling it, It can cause a problems to
>>>>>>> the
>>>>>> application (affects the packet length).
>>>>>> 
>>>>>> Yes, I agree that some offloads are critical to be
>>>>>> disabled, but RSS_HASH discussed in the changeset is not
>>>>>> critical.
>>>>> 
>>>>> So, are you agree It should not be checked globally for all
>>>>> the offloads in
>>>> ethdev layer?
>>>> 
>>>> If offload is not requested, but enabled (since PMD cannot
>>>> disable it), right not it will not fail configure, but warn
>>>> about it in logs.
>>>> 
>>> 
>>> In this case warning print is not enough since it can be critical
>>> for the
>> application for some offloads.
>>> It can be very weird for the application to see that some offload
>>> are on
>> while the application doesn't expect them to be on.
>>> it even can cause app crash(at least for the RX offload I wrote
>>> above).
>> 
>> The patch improves the situation. Earlier it was silent, now it
>> will be at least visible.
> 
> We can do it visible inside the limited PMDs.

Why?

>> I'm afraid that in 19.11 release cycle we cannot change it to fail 
>> dev_configure. I think it will be too destructive. Future
>> improvement should be discussed separately.
> 
> So we can remove this ethdev patch now and let the PMD to do it until
> we will find better solution later.

Sorry, but I don't think so.

>>>>> It even be more problematic if the dynamic offload field in
>>>>> mbuf is not exist at all.
>>> 
>>> Any answer here?
> 
> A Rx offload requires dynamic mbuf field cannot stay visible while
> the app disabling it. Because the dynamic mbuf field probably is not
> set in the mbuf. May cause problems.
> 
>> Please, clarify the question.
>> 
>>>>>> 
>>>>>>> For example in TX: TSO, VLAN, MULTI_SEG.....
>>>>>> 
>>>>>> Tx is not that critical since application should not
>>>>>> request these offloads per- packet. Tx offloads are mainly
>>>>>> required to ensure that application may request the offload
>>>>>> per packet and it will be done.
>>>>> 
>>>>> yes, you right, In TX it looks less critical (for now).
>>>>> 
>>>>>> 
>>>>>>>> Of course, it could be a problem if the offload is
>>>>>>>> used, but application wants to disable it, for example,
>>>>>>>> for debugging purposes. In this case, the solution is
>>>>>>>> to mask offloads on application level, which is not
>>>>>>>> ideal as well.
>>>>>>> Why not ideal?
>>>>>> 
>>>>>> It eats CPU cycles.
>>>>> 
>>>>> Sorry, I don't understand your use case here.
>>>> 
>>>> If application wants to try code path without, for example, Rx 
>>>> checksum offload, it could be insufficient to disable the
>>>> offload right now, but also required to cleanup offload results
>>>> flags in each mbuf (if PMD does not support the offload
>>>> disabling).
>>> 
>>> What is "right now"? Configuration time?
>> 
>> Right now is the current state of some drivers in DPDK tree.
>> 
> 
> OK. I think the offload configuration is in configuration time. No
> data-path.
> 
>>> If application will know that PMD cannot disable the rx-checksum
>>> in configuration time, It can plan to not clean this flag in mbuf
>>> for each rx
>> mbuf.
>> 
>> Yes and application has a way to know it - take a look at
>> dev->data->dev_conf.rxmode.offloads.
> 
> As I understand, before this patch, this field used for ethdev layer
> knowledge to track on the application Rx offload configuration. Am I
> wrong?

I think it is just Rx offloads configuration.
It is better to have real offloads here since it is used on Rx
queue setup to mask already enabled offloads.

> And If the meaning is the PMD configuration set (which weirdly can be
> different from what application want) I think it should be an error -
> because app doesn't follow the API.

Which app? Which API?

>>> It looks me like PMD limitation which can be solved by 2
>>> options: 1. Capability information which say to the app what
>>> offload may not be disabled.
>>> 2. Add limitation in the PMD documentation and print
>>> warning\error massage from the PMD.
>> 
>> Yes, right now we are going way (2).
>> 
>>>>>>> If application can know the limitation of offloads
>>>>>>> disabling (for example to
>>>>>> read capability on it)
>>>>>>> The application has all information to take decisions.
>>>>>>> 
>>>>>>>> Anyway, the patch just tries to highlight difference of
>>>>>>>> applied from requested. So, it is a step forward. Also,
>>>>>>>> the patch will fail configure if an offload is
>>>>>>>> requested, but not
>>>>>> enabled.
>>>>>>>> 
>>>>>>>>>> Can't it break applications? Why does the device
>>>>>>>>>> expose unsupported offloads in dev info? Does it
>>>>>>>>>> update the running offload usynchronically? Race? 
>>>>>>>>>> Can you explain also your specific use case?
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>>> Matan
>>>>> 
>>> 
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to set supported ptype mask
  2019-10-31 10:33                             ` Iremonger, Bernard
@ 2019-11-06 18:13                               ` Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-11-06 18:13 UTC (permalink / raw)
  To: Iremonger, Bernard, Yigit, Ferruh, arybchenko,
	Jerin Jacob Kollanukkaran, Lu, Wenzhuo, Wu, Jingjing, Mcnamara,
	John, Kovacevic, Marko
  Cc: dev

Hi Bernard,

>Hi Pavan,
>
>> -----Original Message-----
>> From: pbhagavatula@marvell.com <pbhagavatula@marvell.com>
>> Sent: Tuesday, October 29, 2019 3:37 PM
>> To: Yigit, Ferruh <ferruh.yigit@intel.com>;
>arybchenko@solarflare.com;
>> jerinj@marvell.com; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu,
>Jingjing
>> <jingjing.wu@intel.com>; Iremonger, Bernard
>> <bernard.iremonger@intel.com>; Mcnamara, John
>> <john.mcnamara@intel.com>; Kovacevic, Marko
>> <marko.kovacevic@intel.com>
>> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@marvell.com>
>> Subject: [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to
>set
>> supported ptype mask
>>
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> Add command to set supported ptype mask.
>> Usage:
>> 	set port <port_id> ptype_mask <ptype_mask>
>>
>> Disable ptype parsing by default.
>>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> ---
>>  app/test-pmd/cmdline.c                      | 80 +++++++++++++++++++++
>>  app/test-pmd/testpmd.c                      |  6 ++
>>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
>>  3 files changed, 93 insertions(+)
>>
>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
>> 447806991..9f0356b50 100644
>> --- a/app/test-pmd/cmdline.c
>> +++ b/app/test-pmd/cmdline.c
>
>The help text should be updated to describe the new command at line
>240 in cmdline.c
>

Will add in v16.

>> @@ -18915,6 +18915,85 @@ cmdline_parse_inst_t
>> cmd_show_port_supported_ptypes = {
>>  	},
>>  };
>>
>> +/* Common result structure for set port ptypes */ struct
>> +cmd_set_port_supported_ptypes_result {
>> +	cmdline_fixed_string_t set;
>> +	cmdline_fixed_string_t port;
>> +	portid_t port_id;
>> +	cmdline_fixed_string_t ptype_mask;
>> +	uint32_t mask;
>> +};
>> +
>> +/* Common CLI fields for set port ptypes */
>> +cmdline_parse_token_string_t
>cmd_set_port_supported_ptypes_set =
>> +	TOKEN_STRING_INITIALIZER
>> +		(struct cmd_set_port_supported_ptypes_result,
>> +		 set, "set");
>> +cmdline_parse_token_string_t
>cmd_set_port_supported_ptypes_port =
>> +	TOKEN_STRING_INITIALIZER
>> +		(struct cmd_set_port_supported_ptypes_result,
>> +		 port, "port");
>> +cmdline_parse_token_num_t
>cmd_set_port_supported_ptypes_port_id =
>> +	TOKEN_NUM_INITIALIZER
>> +		(struct cmd_set_port_supported_ptypes_result,
>> +		 port_id, UINT16);
>> +cmdline_parse_token_string_t
>> cmd_set_port_supported_ptypes_mask_str =
>> +	TOKEN_STRING_INITIALIZER
>> +		(struct cmd_set_port_supported_ptypes_result,
>> +		 ptype_mask, "ptype_mask");
>> +cmdline_parse_token_num_t
>> cmd_set_port_supported_ptypes_mask_u32 =
>> +	TOKEN_NUM_INITIALIZER
>> +		(struct cmd_set_port_supported_ptypes_result,
>> +		 mask, UINT32);
>> +
>> +static void
>> +cmd_set_port_supported_ptypes_parsed(
>> +	void *parsed_result,
>> +	__attribute__((unused)) struct cmdline *cl,
>> +	__attribute__((unused)) void *data)
>> +{
>> +	struct cmd_set_port_supported_ptypes_result *res =
>> parsed_result;
>> +#define PTYPE_NAMESIZE        256
>> +	char ptype_name[PTYPE_NAMESIZE];
>> +	uint16_t port_id = res->port_id;
>> +	uint32_t ptype_mask = res->mask;
>> +	int ret, i;
>> +
>> +	ret = rte_eth_dev_get_supported_ptypes(port_id,
>ptype_mask,
>> NULL, 0);
>> +	if (ret <= 0) {
>> +		printf("Port %d doesn't support any ptypes.\n",
>port_id);
>> +		return;
>> +	}
>> +
>> +	uint32_t ptypes[ret];
>
>Might be better to move above variable declaration to top of function
>with the other declarations.

I intentionally placed it here as the array size depends on ret and there is 
no readily available macro for max number of packet types. 

>
>> +	ret = rte_eth_dev_set_supported_ptypes(port_id,
>ptype_mask,
>> ptypes,
>> +					       ret);
>> +	if (ret <= 0) {
>> +		printf("Unable to set requested ptypes for Port %d\n",
>> port_id);
>> +		return;
>> +	}
>> +
>> +	printf("Successfully set following ptypes for Port %d\n",
>port_id);
>> +	for (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {
>> +		rte_get_ptype_name(ptypes[i], ptype_name,
>> sizeof(ptype_name));
>> +		printf("%s\n", ptype_name);
>> +	}
>> +}
>> +
>> +cmdline_parse_inst_t cmd_set_port_supported_ptypes = {
>> +	.f = cmd_set_port_supported_ptypes_parsed,
>> +	.data = NULL,
>> +	.help_str = "set port <port_id> ptype_mask <mask>",
>> +	.tokens = {
>> +		(void *)&cmd_set_port_supported_ptypes_set,
>> +		(void *)&cmd_set_port_supported_ptypes_port,
>> +		(void *)&cmd_set_port_supported_ptypes_port_id,
>> +		(void *)&cmd_set_port_supported_ptypes_mask_str,
>> +		(void *)&cmd_set_port_supported_ptypes_mask_u32,
>> +		NULL,
>> +	},
>> +};
>> +
>>  /*
>>
>******************************************************
>****
>> ********************** */
>>
>>  /* list of instructions */
>> @@ -19154,6 +19233,7 @@ cmdline_parse_ctx_t main_ctx[] = {
>>  	(cmdline_parse_inst_t *)&cmd_show_vf_stats,
>>  	(cmdline_parse_inst_t *)&cmd_clear_vf_stats,
>>  	(cmdline_parse_inst_t
>*)&cmd_show_port_supported_ptypes,
>> +	(cmdline_parse_inst_t *)&cmd_set_port_supported_ptypes,
>>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
>>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
>>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset, diff --
>git
>> a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
>> 38acbc58a..fd2c04d64 100644
>> --- a/app/test-pmd/testpmd.c
>> +++ b/app/test-pmd/testpmd.c
>> @@ -2028,6 +2028,7 @@ start_port(portid_t pid)
>>  	queueid_t qi;
>>  	struct rte_port *port;
>>  	struct rte_ether_addr mac_addr;
>> +	static uint8_t clr_ptypes = 1;
>>
>>  	if (port_id_is_invalid(pid, ENABLED_WARN))
>>  		return 0;
>> @@ -2157,6 +2158,11 @@ start_port(portid_t pid)
>>  			}
>>  		}
>>  		configure_rxtx_dump_callbacks(verbose_level);
>> +		if (clr_ptypes) {
>> +			clr_ptypes = 0;
>> +			rte_eth_dev_set_supported_ptypes(pi,
>> RTE_PTYPE_UNKNOWN,
>> +					NULL, 0);
>> +		}
>>  		/* start port */
>>  		if (rte_eth_dev_start(pi) < 0) {
>>  			printf("Fail to start port %d\n", pi); diff --git
>> a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> index c68a742eb..9c4dc92aa 100644
>> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> @@ -472,6 +472,13 @@ Show ptypes supported for a specific port::
>>
>>     testpmd> show port (port_id) ptypes
>>
>> +set port supported ptypes
>> +~~~~~~~~~~~~~~~~~~~~~~~~~
>> +
>> +Inform packet types classification interested in for a specific port::
>
>The description of the command is not very clear.
>Perhaps something like the following would be better:
>
>"set packet types classification for a specific port::"

Sure will update in v16

>
>> +
>> +   testpmd> set port (port_id) ptypes_mask (mask)
>> +
>>  show device info
>>  ~~~~~~~~~~~~~~~~
>>
>> --
>> 2.17.1
>
>Regards,
>
>Bernard.

Thanks, 
Pavan.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v16 0/8] ethdev: add new Rx offload flags
  2019-10-29 15:37                         ` [dpdk-dev] [PATCH v15 0/7] ethdev: add new Rx offload flags pbhagavatula
                                             ` (6 preceding siblings ...)
  2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to set supported ptype mask pbhagavatula
@ 2019-11-06 19:17                           ` pbhagavatula
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 1/8] ethdev: add set ptype function pbhagavatula
                                               ` (8 more replies)
  7 siblings, 9 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-06 19:17 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` These flags can be used
to enable/disable PMD writes to rte_mbuf fields `hash.rss` and also
`ol_flags:PKT_RX_RSS`.

Add new packet type set function `rte_eth_dev_set_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
					  NULL, 0);

v16 Changes:
-----------
- Fix testpmd documentation(Bernard).
- s/rte_eth_dev_set_supported_ptypes/rte_eth_dev_set_ptypes.
- Fix release notes placement.
- Enhance offload validation(Andrew).
- Remove if condition in drivers/net while enabling RSS_HASH by default.
- Spilt 5/7 into two patches.

v15 Changes:
-----------
- Fix sfc RSS_HASH offload check.
- Fix ethdev RSS_HASH offload check when mq_mode is configured with
  MQ_RX_NONE.
- Extend offload validation to return error in the case where application
  has requested an offload to be enabled and PMD couldn't honor it.

v14 Changes:
-----------
- Remove log from drives
- Add log in rte_eth_dev_configure when certain offloads are requested to be
  disabled and PMD cannot honor the request.
- Make changes to default offloads in net/sfc.(Andrew)

v13 Changes:
-----------
- Remove DEV_RX_OFFLOAD_FLOW_MARK from this patchset to allow foreward
  progress will be sent as a seperate patch.
- Use set_supported function only for l2fwd and testpmd.
- Add info log in drivers which expose the DEV_RX_OFFLOAD_RSS_HASH
  indicating that disabling DEV_RX_OFFLOAD_RSS_HASH is not supported.
- Few documentation changes.

v12 Changes:
-----------
- Rebase onto next-net.

v11 Changes:
-----------
- Use RTE_DIM to get array size.
- Since we are using a list of MASKs to validate ptype_mask return -EINVAL
  if any unknown mask is set.
- Rebase to TOT.

v10 Changes:
-----------
- Modify ptype_mask validation in set_supported_ptypes.(Andrew)

v9 Changes:
----------
- Add ptype_mask validation in set_supported_ptypes.(Andrew)
- Make description more verbose.

v8 Changes:
----------
- Make description more verbose.
- Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
  is not supported by ethernet device.

v7 Changes:
----------
- Fix unused variable in net/octeontx2

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.

Pavan Nikhilesh (8):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add validation to offloads set by PMD
  drivers/net: update Rx RSS hash offload capabilities
  examples/eventdev_pipeline: split port init sequence
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples/l2fwd: disable ptype parsing
  app/testpmd: add command to set supported ptype mask

 app/test-pmd/cmdline.c                        |  83 ++++++++
 app/test-pmd/testpmd.c                        |   5 +
 doc/guides/nics/features.rst                  |   9 +-
 doc/guides/rel_notes/release_19_11.rst        |  15 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst   |   7 +
 drivers/net/bnxt/bnxt_ethdev.c                |   6 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/cxgbe/cxgbe_ethdev.c              |   2 +
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   1 +
 drivers/net/e1000/igb_ethdev.c                |   4 +
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_ethdev.c                |   2 +
 drivers/net/enic/enic_res.c                   |   3 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   5 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   5 +-
 drivers/net/i40e/i40e_ethdev.c                |   5 +-
 drivers/net/iavf/iavf_ethdev.c                |   5 +-
 drivers/net/ice/ice_ethdev.c                  |   5 +-
 drivers/net/ixgbe/ixgbe_ethdev.c              |   5 +
 drivers/net/ixgbe/ixgbe_rxtx.c                |   3 +-
 drivers/net/liquidio/lio_ethdev.c             |   5 +-
 drivers/net/mlx4/mlx4.c                       |   2 +
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_ethdev.c                |   3 +
 drivers/net/mlx5/mlx5_rxq.c                   |   3 +-
 drivers/net/netvsc/hn_ethdev.c                |   2 +
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   5 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  15 +-
 drivers/net/qede/qede_ethdev.c                |   5 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   7 +-
 drivers/net/thunderx/nicvf_ethdev.c           |   2 +
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   5 +-
 examples/eventdev_pipeline/main.c             | 128 ------------
 .../pipeline_worker_generic.c                 | 132 +++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 ++++++++++++
 examples/l2fwd/Makefile                       |   1 +
 examples/l2fwd/main.c                         |   2 +
 examples/l2fwd/meson.build                    |   1 +
 lib/librte_ethdev/rte_ethdev.c                | 184 +++++++++++++++++-
 lib/librte_ethdev/rte_ethdev.h                |  37 ++++
 lib/librte_ethdev/rte_ethdev_core.h           |  18 ++
 lib/librte_ethdev/rte_ethdev_version.map      |   1 +
 48 files changed, 715 insertions(+), 168 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v16 1/8] ethdev: add set ptype function
  2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
@ 2019-11-06 19:17                             ` pbhagavatula
  2019-11-07 18:28                               ` Ferruh Yigit
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 2/8] ethdev: add mbuf RSS update as an offload pbhagavatula
                                               ` (7 subsequent siblings)
  8 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-11-06 19:17 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, John McNamara, Marko Kovacevic
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_ptypes` function that will allow the application
to inform the PMD about reduced range of packet types to handle.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_ptypes` PMD can return
`rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst             |  7 +-
 doc/guides/rel_notes/release_19_11.rst   |  8 +++
 lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
 lib/librte_ethdev/rte_ethdev.h           | 36 ++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      | 18 +++++
 lib/librte_ethdev/rte_ethdev_version.map |  1 +
 6 files changed, 154 insertions(+), 3 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 7a31cf7c8..f33e8e6d4 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,12 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_ptypes()``, ``dev_ptypes_set``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 23182d187..2fa54aadc 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -86,6 +86,13 @@ New Features
   SET_TAG action and TAG item have been added to support transient flow
   tag.
 
+* **Added ethdev API to set supported packet types**
+
+  * Added new API ``rte_eth_dev_set_ptypes`` that allows an application to
+    inform PMD about about reduced range of packet types to handle.
+  * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+    and thereby improve Rx performance if application wishes do so.
+
 * **Updated the enic driver.**
 
   * Added support for Geneve with options offload.
@@ -258,6 +265,7 @@ New Features
   * Rx metadata is delivered to host via a dynamic field of ``rte_mbuf`` with
     PKT_RX_DYNF_METADATA.
 
+
 Removed Items
 -------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 652c369e5..13e6daaf4 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2879,6 +2879,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	const uint32_t valid_ptype_masks[] = {
+		RTE_PTYPE_L2_MASK,
+		RTE_PTYPE_L3_MASK,
+		RTE_PTYPE_L4_MASK,
+		RTE_PTYPE_TUNNEL_MASK,
+		RTE_PTYPE_INNER_L2_MASK,
+		RTE_PTYPE_INNER_L3_MASK,
+		RTE_PTYPE_INNER_L4_MASK,
+	};
+	const uint32_t *all_ptypes;
+	struct rte_eth_dev *dev;
+	uint32_t unused_mask;
+	unsigned int i, j;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
+			*dev->dev_ops->dev_ptypes_set == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	if (ptype_mask == 0) {
+		ret = (*dev->dev_ops->dev_ptypes_set)(dev,
+				ptype_mask);
+		goto ptype_unknown;
+	}
+
+	unused_mask = ptype_mask;
+	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
+		uint32_t mask = ptype_mask & valid_ptype_masks[i];
+		if (mask && mask != valid_ptype_masks[i]) {
+			ret = -EINVAL;
+			goto ptype_unknown;
+		}
+		unused_mask &= ~valid_ptype_masks[i];
+	}
+
+	if (unused_mask) {
+		ret = -EINVAL;
+		goto ptype_unknown;
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	/*
+	 * Accodommodate as many set_ptypes as possible. If the supplied
+	 * set_ptypes array is insufficient fill it partially.
+	 */
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL && j < num)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_ptypes_set)(dev, ptype_mask);
+
+ptype_unknown:
+	if (num > 0)
+		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+	return ret;
+}
+
 int
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
@@ -2891,7 +2977,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 	return 0;
 }
 
-
 int
 rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 44d77b332..a7872819d 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2604,6 +2604,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device about reduced range of packet types to handle.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
+			   uint32_t *set_ptypes, unsigned int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index f215af7c9..657c39b56 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -234,6 +234,22 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+/**
+ * @internal
+ * Inform Ethernet device about reduced range of packet types to handle.
+ *
+ * @param dev
+ *   The Ethernet device identifier.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @return
+ *   - (0) if Success.
+ *   - (-EINVAL) if *ptype_mask* is invalid.
+ */
+typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev,
+				     uint32_t ptype_mask);
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -630,6 +646,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_ptypes_set_t dev_ptypes_set;
+	/**< Inform Ethernet device about reduced range of packet types to handle. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index ee289ef13..ccfbeae23 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -292,4 +292,5 @@ EXPERIMENTAL {
 	rte_flow_dynf_metadata_offs;
 	rte_flow_dynf_metadata_mask;
 	rte_flow_dynf_metadata_register;
+	rte_eth_dev_set_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v16 2/8] ethdev: add mbuf RSS update as an offload
  2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 1/8] ethdev: add set ptype function pbhagavatula
@ 2019-11-06 19:17                             ` pbhagavatula
  2019-11-07 17:24                               ` Ferruh Yigit
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 3/8] ethdev: add validation to offloads set by PMD pbhagavatula
                                               ` (6 subsequent siblings)
  8 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-11-06 19:17 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, John McNamara, Marko Kovacevic
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           |  2 ++
 doc/guides/rel_notes/release_19_11.rst |  7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 12 ++++++++++++
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 4 files changed, 22 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f33e8e6d4..b200e72b1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 2fa54aadc..69ef83360 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -93,6 +93,13 @@ New Features
   * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
     and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  * Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+    enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  * PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+    by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 * **Updated the enic driver.**
 
   * Added support for Geneve with options offload.
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 13e6daaf4..441ed4efb 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
@@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
+	if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
+	    (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u config invalid Rx mq_mode without RSS but %s offload is requested",
+			port_id,
+			rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of RX/TX queues and reconfigure device.
 	 */
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index a7872819d..9b1a8e945 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1088,6 +1088,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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v16 3/8] ethdev: add validation to offloads set by PMD
  2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 1/8] ethdev: add set ptype function pbhagavatula
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 2/8] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-11-06 19:17                             ` pbhagavatula
  2019-11-07 16:51                               ` Ferruh Yigit
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 4/8] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                                               ` (5 subsequent siblings)
  8 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-11-06 19:17 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Some PMDs cannot work when certain offloads are enable/disabled, as a
workaround PMDs auto enable/disable offloads internally and expose it
through dev->data->dev_conf.rxmode.offloads.

After device specific dev_configure is called compare the requested
offloads to the offloads exposed by the PMD and, if the PMD failed
to enable a given offload then log it and return -EINVAL from
rte_eth_dev_configure, else if the PMD failed to disable a given offload
log and continue with rte_eth_dev_configure.

Suggested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_ethdev/rte_ethdev.c | 85 +++++++++++++++++++++++++++++++---
 1 file changed, 78 insertions(+), 7 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 441ed4efb..0a63cf93b 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1137,6 +1137,59 @@ rte_eth_dev_tx_offload_name(uint64_t offload)
 	return name;
 }
 
+/*
+ * Validate offloads that are requested through rte_eth_dev_configure against
+ * the offloads successfuly set by the ethernet device.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param req_offloads
+ *   The offloads that have been requested through `rte_eth_dev_configure`.
+ * @param set_offloads
+ *   The offloads successfuly set by the ethernet device.
+ * @param offload_type
+ *   The offload type i.e. Rx/Tx string.
+ * @param offload_name
+ *   The function that prints the offload name.
+ * @return
+ *   - (0) if validation successful.
+ *   - (-EINVAL) if requested offload has been silently disabled.
+ *
+ */
+static int
+validate_offloads(uint16_t port_id, uint64_t req_offloads,
+		  uint64_t set_offloads, const char *offload_type,
+		  const char *(*offload_name)(uint64_t))
+{
+	uint64_t offloads_diff = req_offloads ^ set_offloads;
+	uint64_t offload;
+	int ret = 0;
+
+	while (offloads_diff != 0) {
+		/* Check if any offload is requested but not enabled. */
+		offload = 1ULL << __builtin_ctzll(offloads_diff);
+		if (offload & req_offloads) {
+			RTE_ETHDEV_LOG(ERR,
+				       "Port %u failed to enable %s offload %s",
+				       port_id, offload_type,
+				       offload_name(offload));
+			ret = -EINVAL;
+		}
+
+		/* Chech if offload couldn't be disabled. */
+		if (offload & set_offloads) {
+			RTE_ETHDEV_LOG(INFO,
+				       "Port %u failed to disable %s offload %s",
+				       port_id, offload_type,
+				       offload_name(offload));
+		}
+
+		offloads_diff &= ~offload;
+	}
+
+	return ret;
+}
+
 int
 rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		      const struct rte_eth_conf *dev_conf)
@@ -1343,10 +1396,8 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 	if (diag != 0) {
 		RTE_ETHDEV_LOG(ERR, "Port%u dev_configure = %d\n",
 			port_id, diag);
-		rte_eth_dev_rx_queue_config(dev, 0);
-		rte_eth_dev_tx_queue_config(dev, 0);
 		ret = eth_err(port_id, diag);
-		goto rollback;
+		goto reset_queues;
 	}
 
 	/* Initialize Rx profiling if enabled at compilation time. */
@@ -1354,14 +1405,34 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 	if (diag != 0) {
 		RTE_ETHDEV_LOG(ERR, "Port%u __rte_eth_dev_profile_init = %d\n",
 			port_id, diag);
-		rte_eth_dev_rx_queue_config(dev, 0);
-		rte_eth_dev_tx_queue_config(dev, 0);
 		ret = eth_err(port_id, diag);
-		goto rollback;
+		goto reset_queues;
 	}
 
-	return 0;
+	/* Validate Rx offloads. */
+	diag = validate_offloads(port_id,
+			dev_conf->rxmode.offloads,
+			dev->data->dev_conf.rxmode.offloads, "Rx",
+			rte_eth_dev_rx_offload_name);
+	if (diag != 0) {
+		ret = diag;
+		goto reset_queues;
+	}
+
+	/* Validate Tx offloads. */
+	diag = validate_offloads(port_id,
+			dev_conf->txmode.offloads,
+			dev->data->dev_conf.txmode.offloads, "Tx",
+			rte_eth_dev_tx_offload_name);
+	if (diag != 0) {
+		ret = diag;
+		goto reset_queues;
+	}
 
+	return 0;
+reset_queues:
+	rte_eth_dev_rx_queue_config(dev, 0);
+	rte_eth_dev_tx_queue_config(dev, 0);
 rollback:
 	memcpy(&dev->data->dev_conf, &orig_conf, sizeof(dev->data->dev_conf));
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v16 4/8] drivers/net: update Rx RSS hash offload capabilities
  2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
                                               ` (2 preceding siblings ...)
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 3/8] ethdev: add validation to offloads set by PMD pbhagavatula
@ 2019-11-06 19:17                             ` pbhagavatula
  2019-11-07 16:48                               ` Ferruh Yigit
  2019-11-07 17:22                               ` Ferruh Yigit
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 5/8] examples/eventdev_pipeline: split port init sequence pbhagavatula
                                               ` (4 subsequent siblings)
  8 siblings, 2 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-06 19:17 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c       |  6 +++++-
 drivers/net/cxgbe/cxgbe.h            |  3 ++-
 drivers/net/cxgbe/cxgbe_ethdev.c     |  2 ++
 drivers/net/dpaa/dpaa_ethdev.c       |  3 ++-
 drivers/net/dpaa2/dpaa2_ethdev.c     |  1 +
 drivers/net/e1000/igb_ethdev.c       |  4 ++++
 drivers/net/e1000/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_ethdev.c       |  2 ++
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  5 ++++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  5 ++++-
 drivers/net/i40e/i40e_ethdev.c       |  5 ++++-
 drivers/net/iavf/iavf_ethdev.c       |  5 ++++-
 drivers/net/ice/ice_ethdev.c         |  5 ++++-
 drivers/net/ixgbe/ixgbe_ethdev.c     |  5 +++++
 drivers/net/ixgbe/ixgbe_rxtx.c       |  3 ++-
 drivers/net/liquidio/lio_ethdev.c    |  5 ++++-
 drivers/net/mlx4/mlx4.c              |  2 ++
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_ethdev.c       |  3 +++
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_ethdev.c       |  2 ++
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  5 ++++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  5 ++++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  3 ++-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  7 ++++++-
 drivers/net/thunderx/nicvf_ethdev.c  |  2 ++
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  5 ++++-
 33 files changed, 102 insertions(+), 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b9b055e71..34fe87a09 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -123,7 +123,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_VLAN_EXTEND | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_SCATTER)
+				     DEV_RX_OFFLOAD_SCATTER | \
+				     DEV_RX_OFFLOAD_RSS_HASH)
 
 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);
@@ -673,6 +674,9 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
 	bp->rx_cp_nr_rings = bp->rx_nr_rings;
 	bp->tx_cp_nr_rings = bp->tx_nr_rings;
 
+	rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
+
 	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
 		eth_dev->data->mtu =
 			eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
diff --git a/drivers/net/cxgbe/cxgbe.h b/drivers/net/cxgbe/cxgbe.h
index ed1be3559..6c1f73ac4 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_RSS_HASH)
 
 
 /* Common PF and VF devargs */
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 615dda607..3dc9351a1 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -426,6 +426,8 @@ int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)
 
 	CXGBE_FUNC_TRACE();
 
+	eth_dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (!(adapter->flags & FW_QUEUE_BOUND)) {
 		err = cxgbe_setup_sge_fwevtq(adapter);
 		if (err)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 16b52b5e1..26805f17b 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -56,7 +56,8 @@ static uint64_t dev_rx_offloads_nodis =
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+		DEV_RX_OFFLOAD_RSS_HASH;
 
 /* Supported Tx offloads */
 static uint64_t dev_tx_offloads_sup =
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 03131b903..eea31f254 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -45,6 +45,7 @@ static uint64_t dev_rx_offloads_sup =
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
+		DEV_RX_OFFLOAD_RSS_HASH |
 		DEV_RX_OFFLOAD_SCATTER;
 
 /* Supported Tx offloads */
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 53e83d5ec..369a978ad 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1182,6 +1182,8 @@ eth_igb_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = igb_check_mq_mode(dev);
 	if (ret != 0) {
@@ -3257,6 +3259,8 @@ igbvf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 12c59a3c5..b51f45698 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -405,6 +405,8 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
 		return ret;
 	}
 
+	eth_dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	enic->mc_count = 0;
 	enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads &
 				  DEV_RX_OFFLOAD_CHECKSUM);
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index f403a0b66..7c3c270a2 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -205,7 +205,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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 99c4366e4..311482522 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -461,6 +461,8 @@ fm10k_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = fm10k_check_mq_mode(dev);
 	if (ret != 0) {
@@ -1805,7 +1807,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 9f37a404b..072fec339 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -318,6 +318,8 @@ static int hinic_dev_configure(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* mtu size is 256~9600 */
 	if (dev->data->dev_conf.rxmode.max_rx_pkt_len < HINIC_MIN_FRAME_SIZE ||
 	    dev->data->dev_conf.rxmode.max_rx_pkt_len >
@@ -740,7 +742,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 				DEV_RX_OFFLOAD_VLAN_FILTER |
 				DEV_RX_OFFLOAD_SCATTER |
 				DEV_RX_OFFLOAD_JUMBO_FRAME |
-				DEV_RX_OFFLOAD_TCP_LRO;
+				DEV_RX_OFFLOAD_TCP_LRO |
+				DEV_RX_OFFLOAD_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index ed8cbd849..37df1c40a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1812,6 +1812,8 @@ i40e_dev_configure(struct rte_eth_dev *dev)
 	ad->tx_simple_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Only legacy filter API needs the following fdir config. So when the
 	 * legacy filter API is deprecated, the following codes should also be
 	 * removed.
@@ -3613,7 +3615,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_RSS_HASH;
 
 	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 eebc49ade..c23a8fc67 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -147,6 +147,8 @@ iavf_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_vec_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Vlan stripping setting */
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
 		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
@@ -522,7 +524,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_RSS_HASH;
 	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 9d2210a45..9b2083b51 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2357,6 +2357,8 @@ ice_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_bulk_alloc_allowed = true;
 	ad->tx_simple_allowed = true;
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	return 0;
 }
 
@@ -2809,7 +2811,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 30c0379d4..8c1caac18 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
 	int ret;
 
 	PMD_INIT_FUNC_TRACE();
+
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = ixgbe_check_mq_mode(dev);
 	if (ret != 0) {
@@ -5155,6 +5158,8 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index ec01343f1..cdf979edb 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -412,7 +412,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
@@ -1735,6 +1736,8 @@ lio_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	eth_dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Inform firmware about change in number of queues to use.
 	 * Disable IO queues and reset registers for re-configuration.
 	 */
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 931e4f4fe..6bc85a3d5 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -248,6 +248,8 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
 	struct rte_flow_error error;
 	int ret;
 
+	dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Prepare internal flow rules. */
 	ret = mlx4_flow_sync(priv, &error);
 	if (ret) {
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	if (priv->hw_csum)
 		offloads |= DEV_RX_OFFLOAD_CHECKSUM;
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index c2bed2f97..6ad685ecd 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -404,6 +404,9 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
 		rte_errno = ENOMEM;
 		return -rte_errno;
 	}
+
+	dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	memcpy(priv->rss_conf.rss_key,
 	       use_app_rss_key ?
 	       dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key :
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 24d0eaac9..fd1b2d873 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -372,7 +372,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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index eed8dece9..658935509 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -532,6 +532,8 @@ static int hn_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	dev_conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	unsupported = txmode->offloads & ~HN_TX_OFFLOAD_CAPS;
 	if (unsupported) {
 		PMD_DRV_LOG(NOTICE,
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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 22a8b2d19..7941248c0 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -407,6 +407,8 @@ nfp_net_configure(struct rte_eth_dev *dev)
 	rxmode = &dev_conf->rxmode;
 	txmode = &dev_conf->txmode;
 
+	rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Checking TX mode */
 	if (txmode->mq_mode) {
 		PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported");
@@ -1236,7 +1238,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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index dfa8cd205..5603b3c65 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -599,7 +599,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 4d9ed4870..d581240fe 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	| \
@@ -140,11 +140,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_RSS_HASH)
 
 #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 575982fd0..853748afe 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1186,6 +1186,8 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE(edev);
 
+	rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* We need to have min 1 RX queue.There is no min check in
 	 * rte_eth_dev_configure(), so we are checking it here.
 	 */
@@ -1306,7 +1308,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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..d9d2ce6bd 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -715,7 +715,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
-	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
+	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= 0,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..9e527b7fb 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -796,7 +796,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 	.features		= SFC_DP_RX_FEAT_MULTI_PROCESS |
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
-				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
+				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..10fa1e5ff 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -617,7 +617,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 		.hw_fw_caps	= 0,
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
-	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
+	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
@@ -1556,6 +1557,10 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
 		rxmode->offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
 	}
 
+	if ((offloads_supported & DEV_RX_OFFLOAD_RSS_HASH) &&
+	    (~rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	return rc;
 }
 
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index b93d45712..062eec3f2 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1920,6 +1920,8 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (!rte_eal_has_hugepages()) {
 		PMD_INIT_LOG(INFO, "Huge page is not configured");
 		return -EINVAL;
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 d1faeaa81..53fbd2bd0 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);
 static int eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev);
@@ -407,6 +408,8 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (dev->data->nb_tx_queues > VMXNET3_MAX_TX_QUEUES ||
 	    dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES) {
 		PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v16 5/8] examples/eventdev_pipeline: split port init sequence
  2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
                                               ` (3 preceding siblings ...)
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 4/8] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-11-06 19:17                             ` pbhagavatula
  2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 6/8] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                                               ` (3 subsequent siblings)
  8 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-06 19:17 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Harry van Haaren
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Split port initialization sequence based on event device capabilities.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 128 -----------------
 .../pipeline_worker_generic.c                 | 129 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 +++++++++++++++++
 3 files changed, 257 insertions(+), 128 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f77830282..d3ff1bbe4 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,133 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	retval = rte_eth_dev_info_get(port, &dev_info);
-	if (retval != 0) {
-		printf("Error during getting device (port %u) info: %s\n",
-				port, strerror(-retval));
-		return retval;
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	retval = rte_eth_macaddr_get(port, &addr);
-	if (retval != 0) {
-		printf("Failed to get MAC address (port %u): %s\n",
-				port, rte_strerror(-retval));
-		return retval;
-	}
-
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	retval = rte_eth_promiscuous_enable(port);
-	if (retval != 0)
-		return retval;
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
-
 static void
 do_capability_setup(uint8_t eventdev_id)
 {
@@ -515,7 +388,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..0058ba700 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,134 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +425,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index a0f40c27c..55bb2f762 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,133 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +748,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v16 6/8] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
                                               ` (4 preceding siblings ...)
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 5/8] examples/eventdev_pipeline: split port init sequence pbhagavatula
@ 2019-11-06 19:18                             ` pbhagavatula
  2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 7/8] examples/l2fwd: disable ptype parsing pbhagavatula
                                               ` (2 subsequent siblings)
  8 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-06 19:18 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Harry van Haaren
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/pipeline_worker_generic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 0058ba700..42ff4eeb9 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -314,6 +314,9 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	rx_conf = dev_info.default_rxconf;
 	rx_conf.offloads = port_conf.rxmode.offloads;
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v16 7/8] examples/l2fwd: disable ptype parsing
  2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
                                               ` (5 preceding siblings ...)
  2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 6/8] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-11-06 19:18                             ` pbhagavatula
  2019-11-07 17:59                               ` Ferruh Yigit
  2019-11-07 18:30                               ` Ferruh Yigit
  2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask pbhagavatula
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
  8 siblings, 2 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-06 19:18 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Marko Kovacevic,
	Ori Kam, Bruce Richardson, Radu Nicolau, Akhil Goyal,
	Tomasz Kantecki
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing as l2fwd doesn't rely on packet types.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/l2fwd/Makefile    | 1 +
 examples/l2fwd/main.c      | 2 ++
 examples/l2fwd/meson.build | 1 +
 3 files changed, 4 insertions(+)

diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..123e6161c 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index d7bcbfae7..3e7ad3ef1 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -713,6 +713,8 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		rte_eth_dev_set_ptypes(portid, RTE_PTYPE_UNKNOWN,
+						 NULL, 0);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..2b0a25036 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
                                               ` (6 preceding siblings ...)
  2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 7/8] examples/l2fwd: disable ptype parsing pbhagavatula
@ 2019-11-06 19:18                             ` pbhagavatula
  2019-11-07 11:57                               ` Iremonger, Bernard
  2019-11-07 18:40                               ` Ferruh Yigit
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
  8 siblings, 2 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-06 19:18 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Wenzhuo Lu,
	Jingjing Wu, Bernard Iremonger, John McNamara, Marko Kovacevic
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add command to set supported ptype mask.
Usage:
	set port <port_id> ptype_mask <ptype_mask>

Disable ptype parsing by default.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test-pmd/cmdline.c                      | 83 +++++++++++++++++++++
 app/test-pmd/testpmd.c                      |  5 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
 3 files changed, 95 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 49c45a3f0..7af2c58c3 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -668,6 +668,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n"
 			"    Update a ptype mapping item on a port\n\n"
 
+			"set port (port_id) ptype_mask (ptype_mask)\n"
+			"    set packet types classification for a specific port\n\n"
+
 			"set port (port_id) queue-region region_id (value) "
 			"queue_start_index (value) queue_num (value)\n"
 			"    Set a queue region on a port\n\n"
@@ -18916,6 +18919,85 @@ cmdline_parse_inst_t cmd_show_port_supported_ptypes = {
 	},
 };
 
+/* Common result structure for set port ptypes */
+struct cmd_set_port_ptypes_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t port;
+	portid_t port_id;
+	cmdline_fixed_string_t ptype_mask;
+	uint32_t mask;
+};
+
+/* Common CLI fields for set port ptypes */
+cmdline_parse_token_string_t cmd_set_port_ptypes_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_ptypes_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_set_port_ptypes_port =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_ptypes_result,
+		 port, "port");
+cmdline_parse_token_num_t cmd_set_port_ptypes_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_set_port_ptypes_result,
+		 port_id, UINT16);
+cmdline_parse_token_string_t cmd_set_port_ptypes_mask_str =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_ptypes_result,
+		 ptype_mask, "ptype_mask");
+cmdline_parse_token_num_t cmd_set_port_ptypes_mask_u32 =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_set_port_ptypes_result,
+		 mask, UINT32);
+
+static void
+cmd_set_port_ptypes_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_set_port_ptypes_result *res = parsed_result;
+#define PTYPE_NAMESIZE        256
+	char ptype_name[PTYPE_NAMESIZE];
+	uint16_t port_id = res->port_id;
+	uint32_t ptype_mask = res->mask;
+	int ret, i;
+
+	ret = rte_eth_dev_get_supported_ptypes(port_id, ptype_mask, NULL, 0);
+	if (ret <= 0) {
+		printf("Port %d doesn't support any ptypes.\n", port_id);
+		return;
+	}
+
+	uint32_t ptypes[ret];
+
+	ret = rte_eth_dev_set_ptypes(port_id, ptype_mask, ptypes, ret);
+	if (ret <= 0) {
+		printf("Unable to set requested ptypes for Port %d\n", port_id);
+		return;
+	}
+
+	printf("Successfully set following ptypes for Port %d\n", port_id);
+	for (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {
+		rte_get_ptype_name(ptypes[i], ptype_name, sizeof(ptype_name));
+		printf("%s\n", ptype_name);
+	}
+}
+
+cmdline_parse_inst_t cmd_set_port_ptypes = {
+	.f = cmd_set_port_ptypes_parsed,
+	.data = NULL,
+	.help_str = "set port <port_id> ptype_mask <mask>",
+	.tokens = {
+		(void *)&cmd_set_port_ptypes_set,
+		(void *)&cmd_set_port_ptypes_port,
+		(void *)&cmd_set_port_ptypes_port_id,
+		(void *)&cmd_set_port_ptypes_mask_str,
+		(void *)&cmd_set_port_ptypes_mask_u32,
+		NULL,
+	},
+};
+
 /* ******************************************************************************** */
 
 /* list of instructions */
@@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_show_vf_stats,
 	(cmdline_parse_inst_t *)&cmd_clear_vf_stats,
 	(cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
+	(cmdline_parse_inst_t *)&cmd_set_port_ptypes,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5ba974162..812aebf35 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2024,6 +2024,7 @@ start_port(portid_t pid)
 	queueid_t qi;
 	struct rte_port *port;
 	struct rte_ether_addr mac_addr;
+	static uint8_t clr_ptypes = 1;
 
 	if (port_id_is_invalid(pid, ENABLED_WARN))
 		return 0;
@@ -2153,6 +2154,10 @@ start_port(portid_t pid)
 			}
 		}
 		configure_rxtx_dump_callbacks(verbose_level);
+		if (clr_ptypes) {
+			clr_ptypes = 0;
+			rte_eth_dev_set_ptypes(pi, RTE_PTYPE_UNKNOWN, NULL, 0);
+		}
 		/* start port */
 		if (rte_eth_dev_start(pi) < 0) {
 			printf("Fail to start port %d\n", pi);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index c68a742eb..f78ac9444 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -472,6 +472,13 @@ Show ptypes supported for a specific port::
 
    testpmd> show port (port_id) ptypes
 
+set port supported ptypes
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+set packet types classification for a specific port::
+
+   testpmd> set port (port_id) ptypes_mask (mask)
+
 show device info
 ~~~~~~~~~~~~~~~~
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-06  8:12                                                     ` Andrew Rybchenko
@ 2019-11-07  6:56                                                       ` Matan Azrad
  2019-11-08 10:12                                                         ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Matan Azrad @ 2019-11-07  6:56 UTC (permalink / raw)
  To: Andrew Rybchenko, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev

Hi

From: Andrew Rybchenko
> On 11/6/19 9:58 AM, Matan Azrad wrote:
> >
> >
> > From: Andrew Rybchenko
> >> On 11/5/19 5:05 PM, Matan Azrad wrote:
> >>> From: Andrew Rybchenko
> >>>> On 11/3/19 6:16 PM, Matan Azrad wrote
> >>>>> From: Andrew Rybchenko
> >>>>>> On 11/3/19 9:57 AM, Matan Azrad wrote:
> >>>>>>> Hi
> >>>>>>>
> >>>>>>> From: Andrew Rybchenko
> >>>>>>>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula
> >>>>>>>> wrote:
> >>>>>>>>>> From: Pavan Nikhilesh Bhagavatula
> >>>>>>>>>>> Hi Matan,
> >>>>>>>>>>>
> >>>>>>>>>>>> Hi Pavan
> >>>>>>>>>>>>
> >>>>>>>>>>>> From: Pavan Nikhilesh
> >>>>>>>>>>>> <pbhagavatula@marvell.com>
> >>>>>>>>>>>>> Some PMDs cannot work when certain offloads are
> >>>>>>>>>>>>> enable/disabled, as a workaround PMDs auto
> enable/disable
> >>>>>>>>>>>>> offloads internally and expose it through
> >>>>>>>>>>>>> dev->data-dev_conf.rxmode.offloads.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> After device specific dev_configure is called compare the
> >>>>>>>>>>>>> requested offloads to the offloads exposed by the PMD
> and,
> >>>>>>>>>>>>> if the PMD failed to enable a given offload then log it
> >>>>>>>>>>>>> and return -EINVAL from rte_eth_dev_configure, else if
> the
> >>>>>>>>>>>>> PMD failed to disable a given offload log and continue
> >>>>>>>>>>>>> with rte_eth_dev_configure.
> >>>>>>>>>>>>>
> >>>>>>>>>>>> rte_eth_dev_configure can be called more than 1 time in the
> >>>>>>>>>>>> device life time, How can you know what is the minimum
> >>>>>>>>>>>> offload configurations required by the port after the first
> >>>>>>>>>>>> call?
> >>>>>>>>>>>> Maybe putting it in dev info is better, what do you think?
> >>>>>>>>>>>>
> >>>>>>>>>>> We only return -EINVAL in the case where we enable an
> >>>>>>>>>>> offload advertised by dev_info and the port still fails to
> >>>>>>>>>>> enable it.
> >>>>>>>>>> Are you sure it is ok that devices may disable\enable
> >>>>>>>>>> offloads under the hood without user notification?
> >>>>>>>>> Some devices already do it. The above check adds validation
> >>>>>>>>> for the same.
> >>>>>>>> The problem is that some offloads cannot be disabled.
> >>>>>>> Yes, I understand it.
> >>>>>>>
> >>>>>>>> If application does not request Rx checksum offload since it
> >>>>>>>> does use it, it is not a problem to report it.
> >>>>>>> Yes, for RX checksum I tend to agree that application doesn't
> >>>>>>> care if the
> >>>>>> PMD will calculate the checksum in spite of the offload is
> >>>>>> disabled.
> >>>>>>>
> >>>>>>> But what's about other offloads: For example in RX: LRO,
> >>>>>>> CRC_KEEP, VLAN_STRIP, JUMBO If the PMD will stay them on while
> >>>>>>> the app is disabling it, It can cause a problems to the
> >>>>>> application (affects the packet length).
> >>>>>>
> >>>>>> Yes, I agree that some offloads are critical to be disabled, but
> >>>>>> RSS_HASH discussed in the changeset is not critical.
> >>>>>
> >>>>> So, are you agree It should not be checked globally for all the
> >>>>> offloads in
> >>>> ethdev layer?
> >>>>
> >>>> If offload is not requested, but enabled (since PMD cannot disable
> >>>> it), right not it will not fail configure, but warn about it in
> >>>> logs.
> >>>>
> >>>
> >>> In this case warning print is not enough since it can be critical
> >>> for the
> >> application for some offloads.
> >>> It can be very weird for the application to see that some offload
> >>> are on
> >> while the application doesn't expect them to be on.
> >>> it even can cause app crash(at least for the RX offload I wrote
> >>> above).
> >>
> >> The patch improves the situation. Earlier it was silent, now it will
> >> be at least visible.
> >
> > We can do it visible inside the limited PMDs.
> 
> Why?

Because this is not according to what application should understand from the ethdev API. 

> >> I'm afraid that in 19.11 release cycle we cannot change it to fail
> >> dev_configure. I think it will be too destructive. Future improvement
> >> should be discussed separately.
> >
> > So we can remove this ethdev patch now and let the PMD to do it until
> > we will find better solution later.
> 
> Sorry, but I don't think so.
> 
> >>>>> It even be more problematic if the dynamic offload field in mbuf
> >>>>> is not exist at all.
> >>>
> >>> Any answer here?
> >
> > A Rx offload requires dynamic mbuf field cannot stay visible while the
> > app disabling it. Because the dynamic mbuf field probably is not set
> > in the mbuf. May cause problems.
> >
> >> Please, clarify the question.
> >>

No answer here.

> >>>>>>
> >>>>>>> For example in TX: TSO, VLAN, MULTI_SEG.....
> >>>>>>
> >>>>>> Tx is not that critical since application should not request
> >>>>>> these offloads per- packet. Tx offloads are mainly required to
> >>>>>> ensure that application may request the offload per packet and it
> >>>>>> will be done.
> >>>>>
> >>>>> yes, you right, In TX it looks less critical (for now).
> >>>>>
> >>>>>>
> >>>>>>>> Of course, it could be a problem if the offload is used, but
> >>>>>>>> application wants to disable it, for example, for debugging
> >>>>>>>> purposes. In this case, the solution is to mask offloads on
> >>>>>>>> application level, which is not ideal as well.
> >>>>>>> Why not ideal?
> >>>>>>
> >>>>>> It eats CPU cycles.
> >>>>>
> >>>>> Sorry, I don't understand your use case here.
> >>>>
> >>>> If application wants to try code path without, for example, Rx
> >>>> checksum offload, it could be insufficient to disable the offload
> >>>> right now, but also required to cleanup offload results flags in
> >>>> each mbuf (if PMD does not support the offload disabling).
> >>>
> >>> What is "right now"? Configuration time?
> >>
> >> Right now is the current state of some drivers in DPDK tree.
> >>
> >
> > OK. I think the offload configuration is in configuration time. No
> > data-path.
> >
> >>> If application will know that PMD cannot disable the rx-checksum in
> >>> configuration time, It can plan to not clean this flag in mbuf for
> >>> each rx
> >> mbuf.
> >>
> >> Yes and application has a way to know it - take a look at
> >> dev->data->dev_conf.rxmode.offloads.
> >
> > As I understand, before this patch, this field used for ethdev layer
> > knowledge to track on the application Rx offload configuration. Am I
> > wrong?
> 
> I think it is just Rx offloads configuration.
> It is better to have real offloads here since it is used on Rx queue setup to
> mask already enabled offloads.

And in DPDK or any SW management controls a device, the configuration must be set by the user.
So, it should reflect the user configuration as is.

 
> > And If the meaning is the PMD configuration set (which weirdly can be
> > different from what application want) I think it should be an error -
> > because app doesn't follow the API.
> 
> Which app? Which API?

App - the dpdk application which configures an offload that cannot be masked.
API - The Rx offload field in the ethdev data (which weirdly means what was configured by the PMD).

> 
> >>> It looks me like PMD limitation which can be solved by 2
> >>> options: 1. Capability information which say to the app what offload
> >>> may not be disabled.
> >>> 2. Add limitation in the PMD documentation and print warning\error
> >>> massage from the PMD.
> >>
> >> Yes, right now we are going way (2).
> >>
> >>>>>>> If application can know the limitation of offloads disabling
> >>>>>>> (for example to
> >>>>>> read capability on it)
> >>>>>>> The application has all information to take decisions.
> >>>>>>>
> >>>>>>>> Anyway, the patch just tries to highlight difference of applied
> >>>>>>>> from requested. So, it is a step forward. Also, the patch will
> >>>>>>>> fail configure if an offload is requested, but not
> >>>>>> enabled.
> >>>>>>>>
> >>>>>>>>>> Can't it break applications? Why does the device expose
> >>>>>>>>>> unsupported offloads in dev info? Does it update the running
> >>>>>>>>>> offload usynchronically? Race?
> >>>>>>>>>> Can you explain also your specific use case?
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>>> Matan
> >>>>>
> >>>
> >


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask pbhagavatula
@ 2019-11-07 11:57                               ` Iremonger, Bernard
  2019-11-07 12:27                                 ` Iremonger, Bernard
  2019-11-07 18:40                               ` Ferruh Yigit
  1 sibling, 1 reply; 246+ messages in thread
From: Iremonger, Bernard @ 2019-11-07 11:57 UTC (permalink / raw)
  To: pbhagavatula, Yigit, Ferruh, arybchenko, jerinj, thomas, Lu,
	Wenzhuo, Wu, Jingjing, Mcnamara, John, Kovacevic, Marko
  Cc: dev

Hi Pavan,

> -----Original Message-----
> From: pbhagavatula@marvell.com <pbhagavatula@marvell.com>
> Sent: Wednesday, November 6, 2019 7:18 PM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>; arybchenko@solarflare.com;
> jerinj@marvell.com; thomas@monjalon.net; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Iremonger,
> Bernard <bernard.iremonger@intel.com>; Mcnamara, John
> <john.mcnamara@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@marvell.com>
> Subject: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set
> supported ptype mask
> 
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Add command to set supported ptype mask.
> Usage:
> 	set port <port_id> ptype_mask <ptype_mask>
> 
> Disable ptype parsing by default.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  app/test-pmd/cmdline.c                      | 83 +++++++++++++++++++++
>  app/test-pmd/testpmd.c                      |  5 ++
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
>  3 files changed, 95 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 49c45a3f0..7af2c58c3 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c

The help text should be updated to describe the new command at line 240 in cmdline.c

> @@ -668,6 +668,9 @@ static void cmd_help_long_parsed(void
> *parsed_result,
>  			"ptype mapping update (port_id) (hw_ptype)
> (sw_ptype)\n"
>  			"    Update a ptype mapping item on a port\n\n"
> 
> +			"set port (port_id) ptype_mask (ptype_mask)\n"
> +			"    set packet types classification for a specific
> port\n\n"
> +
>  			"set port (port_id) queue-region region_id (value) "
>  			"queue_start_index (value) queue_num (value)\n"
>  			"    Set a queue region on a port\n\n"
> @@ -18916,6 +18919,85 @@ cmdline_parse_inst_t
> cmd_show_port_supported_ptypes = {
>  	},
>  };
> 
> +/* Common result structure for set port ptypes */ struct
> +cmd_set_port_ptypes_result {
> +	cmdline_fixed_string_t set;
> +	cmdline_fixed_string_t port;
> +	portid_t port_id;
> +	cmdline_fixed_string_t ptype_mask;
> +	uint32_t mask;
> +};
> +
> +/* Common CLI fields for set port ptypes */
> +cmdline_parse_token_string_t cmd_set_port_ptypes_set =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_set_port_ptypes_result,
> +		 set, "set");
> +cmdline_parse_token_string_t cmd_set_port_ptypes_port =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_set_port_ptypes_result,
> +		 port, "port");
> +cmdline_parse_token_num_t cmd_set_port_ptypes_port_id =
> +	TOKEN_NUM_INITIALIZER
> +		(struct cmd_set_port_ptypes_result,
> +		 port_id, UINT16);
> +cmdline_parse_token_string_t cmd_set_port_ptypes_mask_str =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_set_port_ptypes_result,
> +		 ptype_mask, "ptype_mask");
> +cmdline_parse_token_num_t cmd_set_port_ptypes_mask_u32 =
> +	TOKEN_NUM_INITIALIZER
> +		(struct cmd_set_port_ptypes_result,
> +		 mask, UINT32);
> +
> +static void
> +cmd_set_port_ptypes_parsed(
> +	void *parsed_result,
> +	__attribute__((unused)) struct cmdline *cl,
> +	__attribute__((unused)) void *data)
> +{
> +	struct cmd_set_port_ptypes_result *res = parsed_result;
> +#define PTYPE_NAMESIZE        256
> +	char ptype_name[PTYPE_NAMESIZE];
> +	uint16_t port_id = res->port_id;
> +	uint32_t ptype_mask = res->mask;
> +	int ret, i;
> +
> +	ret = rte_eth_dev_get_supported_ptypes(port_id, ptype_mask,
> NULL, 0);
> +	if (ret <= 0) {
> +		printf("Port %d doesn't support any ptypes.\n", port_id);
> +		return;
> +	}
> +
> +	uint32_t ptypes[ret];
> +
> +	ret = rte_eth_dev_set_ptypes(port_id, ptype_mask, ptypes, ret);
> +	if (ret <= 0) {
> +		printf("Unable to set requested ptypes for Port %d\n",
> port_id);
> +		return;
> +	}
> +
> +	printf("Successfully set following ptypes for Port %d\n", port_id);
> +	for (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {
> +		rte_get_ptype_name(ptypes[i], ptype_name,
> sizeof(ptype_name));
> +		printf("%s\n", ptype_name);
> +	}
> +}
> +
> +cmdline_parse_inst_t cmd_set_port_ptypes = {
> +	.f = cmd_set_port_ptypes_parsed,
> +	.data = NULL,
> +	.help_str = "set port <port_id> ptype_mask <mask>",
> +	.tokens = {
> +		(void *)&cmd_set_port_ptypes_set,
> +		(void *)&cmd_set_port_ptypes_port,
> +		(void *)&cmd_set_port_ptypes_port_id,
> +		(void *)&cmd_set_port_ptypes_mask_str,
> +		(void *)&cmd_set_port_ptypes_mask_u32,
> +		NULL,
> +	},
> +};
> +
>  /*
> **********************************************************
> ********************** */
> 
>  /* list of instructions */
> @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] = {
>  	(cmdline_parse_inst_t *)&cmd_show_vf_stats,
>  	(cmdline_parse_inst_t *)&cmd_clear_vf_stats,
>  	(cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
> +	(cmdline_parse_inst_t *)&cmd_set_port_ptypes,
>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset, diff --git
> a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> 5ba974162..812aebf35 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
>  	queueid_t qi;
>  	struct rte_port *port;
>  	struct rte_ether_addr mac_addr;
> +	static uint8_t clr_ptypes = 1;
> 
>  	if (port_id_is_invalid(pid, ENABLED_WARN))
>  		return 0;
> @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
>  			}
>  		}
>  		configure_rxtx_dump_callbacks(verbose_level);
> +		if (clr_ptypes) {
> +			clr_ptypes = 0;
> +			rte_eth_dev_set_ptypes(pi,
> RTE_PTYPE_UNKNOWN, NULL, 0);
> +		}
>  		/* start port */
>  		if (rte_eth_dev_start(pi) < 0) {
>  			printf("Fail to start port %d\n", pi); diff --git
> a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index c68a742eb..f78ac9444 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -472,6 +472,13 @@ Show ptypes supported for a specific port::
> 
>     testpmd> show port (port_id) ptypes
> 
> +set port supported ptypes
> +~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +set packet types classification for a specific port::
> +
> +   testpmd> set port (port_id) ptypes_mask (mask)
> +
>  show device info
>  ~~~~~~~~~~~~~~~~
> 
> --
> 2.17.1
Regards,

Bernard.


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-07 11:57                               ` Iremonger, Bernard
@ 2019-11-07 12:27                                 ` Iremonger, Bernard
  2019-11-07 14:36                                   ` Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 246+ messages in thread
From: Iremonger, Bernard @ 2019-11-07 12:27 UTC (permalink / raw)
  To: Iremonger, Bernard, pbhagavatula, Yigit, Ferruh, arybchenko,
	jerinj, thomas, Lu, Wenzhuo, Wu, Jingjing, Mcnamara, John,
	Kovacevic, Marko
  Cc: dev

Hi Pavin,

<snip>

> > Subject: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set
> > supported ptype mask
> >
> > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >
> > Add command to set supported ptype mask.
> > Usage:
> > 	set port <port_id> ptype_mask <ptype_mask>
> >
> > Disable ptype parsing by default.
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > ---
> >  app/test-pmd/cmdline.c                      | 83 +++++++++++++++++++++
> >  app/test-pmd/testpmd.c                      |  5 ++
> >  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
> >  3 files changed, 95 insertions(+)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > 49c45a3f0..7af2c58c3 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> 
> The help text should be updated to describe the new command at line 240 in
> cmdline.c
> 
> > @@ -668,6 +668,9 @@ static void cmd_help_long_parsed(void
> > *parsed_result,
> >  			"ptype mapping update (port_id) (hw_ptype)
> (sw_ptype)\n"
> >  			"    Update a ptype mapping item on a port\n\n"
> >
> > +			"set port (port_id) ptype_mask (ptype_mask)\n"
> > +			"    set packet types classification for a specific
> > port\n\n"
> > +
> >  			"set port (port_id) queue-region region_id (value) "
> >  			"queue_start_index (value) queue_num (value)\n"
> >  			"    Set a queue region on a port\n\n"
> > @@ -18916,6 +18919,85 @@ cmdline_parse_inst_t
> > cmd_show_port_supported_ptypes = {
> >  	},
> >  };
> >
> > +/* Common result structure for set port ptypes */ struct
> > +cmd_set_port_ptypes_result {
> > +	cmdline_fixed_string_t set;
> > +	cmdline_fixed_string_t port;
> > +	portid_t port_id;
> > +	cmdline_fixed_string_t ptype_mask;
> > +	uint32_t mask;
> > +};
> > +
> > +/* Common CLI fields for set port ptypes */
> > +cmdline_parse_token_string_t cmd_set_port_ptypes_set =
> > +	TOKEN_STRING_INITIALIZER
> > +		(struct cmd_set_port_ptypes_result,
> > +		 set, "set");
> > +cmdline_parse_token_string_t cmd_set_port_ptypes_port =
> > +	TOKEN_STRING_INITIALIZER
> > +		(struct cmd_set_port_ptypes_result,
> > +		 port, "port");
> > +cmdline_parse_token_num_t cmd_set_port_ptypes_port_id =
> > +	TOKEN_NUM_INITIALIZER
> > +		(struct cmd_set_port_ptypes_result,
> > +		 port_id, UINT16);
> > +cmdline_parse_token_string_t cmd_set_port_ptypes_mask_str =
> > +	TOKEN_STRING_INITIALIZER
> > +		(struct cmd_set_port_ptypes_result,
> > +		 ptype_mask, "ptype_mask");
> > +cmdline_parse_token_num_t cmd_set_port_ptypes_mask_u32 =
> > +	TOKEN_NUM_INITIALIZER
> > +		(struct cmd_set_port_ptypes_result,
> > +		 mask, UINT32);
> > +
> > +static void
> > +cmd_set_port_ptypes_parsed(
> > +	void *parsed_result,
> > +	__attribute__((unused)) struct cmdline *cl,
> > +	__attribute__((unused)) void *data)
> > +{
> > +	struct cmd_set_port_ptypes_result *res = parsed_result;
> > +#define PTYPE_NAMESIZE        256
> > +	char ptype_name[PTYPE_NAMESIZE];
> > +	uint16_t port_id = res->port_id;
> > +	uint32_t ptype_mask = res->mask;
> > +	int ret, i;
> > +
> > +	ret = rte_eth_dev_get_supported_ptypes(port_id, ptype_mask,
> > NULL, 0);

The last 2 parameters to the above function do not look correct, here is the function declaration:
int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,  uint32_t *ptypes, int num);

ptypes should be a pointer to an array to hold the ptypes, and num should be the size of the array.

> > +	if (ret <= 0) {
> > +		printf("Port %d doesn't support any ptypes.\n", port_id);
> > +		return;
> > +	}
> > +
> > +	uint32_t ptypes[ret];

The above declaration can then be moved to the top of the function with the other declarations.

> > +
> > +	ret = rte_eth_dev_set_ptypes(port_id, ptype_mask, ptypes, ret);
> > +	if (ret <= 0) {
> > +		printf("Unable to set requested ptypes for Port %d\n",
> > port_id);
> > +		return;
> > +	}
> > +
> > +	printf("Successfully set following ptypes for Port %d\n", port_id);
> > +	for (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {
> > +		rte_get_ptype_name(ptypes[i], ptype_name,
> > sizeof(ptype_name));
> > +		printf("%s\n", ptype_name);
> > +	}
> > +}
> > +
> > +cmdline_parse_inst_t cmd_set_port_ptypes = {
> > +	.f = cmd_set_port_ptypes_parsed,
> > +	.data = NULL,
> > +	.help_str = "set port <port_id> ptype_mask <mask>",
> > +	.tokens = {
> > +		(void *)&cmd_set_port_ptypes_set,
> > +		(void *)&cmd_set_port_ptypes_port,
> > +		(void *)&cmd_set_port_ptypes_port_id,
> > +		(void *)&cmd_set_port_ptypes_mask_str,
> > +		(void *)&cmd_set_port_ptypes_mask_u32,
> > +		NULL,
> > +	},
> > +};
> > +
> >  /*
> >
> **********************************************************
> > ********************** */
> >
> >  /* list of instructions */
> > @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] = {
> >  	(cmdline_parse_inst_t *)&cmd_show_vf_stats,
> >  	(cmdline_parse_inst_t *)&cmd_clear_vf_stats,
> >  	(cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
> > +	(cmdline_parse_inst_t *)&cmd_set_port_ptypes,
> >  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
> >  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
> >  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset, diff --git
> > a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> > 5ba974162..812aebf35 100644
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
> >  	queueid_t qi;
> >  	struct rte_port *port;
> >  	struct rte_ether_addr mac_addr;
> > +	static uint8_t clr_ptypes = 1;
> >
> >  	if (port_id_is_invalid(pid, ENABLED_WARN))
> >  		return 0;
> > @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
> >  			}
> >  		}
> >  		configure_rxtx_dump_callbacks(verbose_level);
> > +		if (clr_ptypes) {
> > +			clr_ptypes = 0;
> > +			rte_eth_dev_set_ptypes(pi,
> > RTE_PTYPE_UNKNOWN, NULL, 0);
> > +		}
> >  		/* start port */
> >  		if (rte_eth_dev_start(pi) < 0) {
> >  			printf("Fail to start port %d\n", pi); diff --git
> > a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > index c68a742eb..f78ac9444 100644
> > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > @@ -472,6 +472,13 @@ Show ptypes supported for a specific port::
> >
> >     testpmd> show port (port_id) ptypes
> >
> > +set port supported ptypes
> > +~~~~~~~~~~~~~~~~~~~~~~~~~
> > +
> > +set packet types classification for a specific port::
> > +
> > +   testpmd> set port (port_id) ptypes_mask (mask)
> > +
> >  show device info
> >  ~~~~~~~~~~~~~~~~
> >
> > --
> > 2.17.1
 Regards,
 
 Bernard.


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-07 12:27                                 ` Iremonger, Bernard
@ 2019-11-07 14:36                                   ` Pavan Nikhilesh Bhagavatula
  2019-11-07 15:00                                     ` Iremonger, Bernard
  0 siblings, 1 reply; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-11-07 14:36 UTC (permalink / raw)
  To: Iremonger, Bernard, Yigit, Ferruh, arybchenko,
	Jerin Jacob Kollanukkaran, thomas, Lu, Wenzhuo, Wu, Jingjing,
	Mcnamara, John, Kovacevic, Marko
  Cc: dev


Hi Bernard,

>Hi Pavin,
>
><snip>
>
>> > Subject: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command
>to set
>> > supported ptype mask
>> >
>> > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> >
>> > Add command to set supported ptype mask.
>> > Usage:
>> > 	set port <port_id> ptype_mask <ptype_mask>
>> >
>> > Disable ptype parsing by default.
>> >
>> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> > ---
>> >  app/test-pmd/cmdline.c                      | 83 +++++++++++++++++++++
>> >  app/test-pmd/testpmd.c                      |  5 ++
>> >  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
>> >  3 files changed, 95 insertions(+)
>> >
>> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
>index
>> > 49c45a3f0..7af2c58c3 100644
>> > --- a/app/test-pmd/cmdline.c
>> > +++ b/app/test-pmd/cmdline.c
>>
>> The help text should be updated to describe the new command at
>line 240 in
>> cmdline.c
>>
>> > @@ -668,6 +668,9 @@ static void cmd_help_long_parsed(void
>> > *parsed_result,
>> >  			"ptype mapping update (port_id) (hw_ptype)
>> (sw_ptype)\n"
>> >  			"    Update a ptype mapping item on a port\n\n"
>> >
>> > +			"set port (port_id) ptype_mask
>(ptype_mask)\n"
>> > +			"    set packet types classification for a specific
>> > port\n\n"
>> > +
>> >  			"set port (port_id) queue-region region_id
>(value) "
>> >  			"queue_start_index (value) queue_num
>(value)\n"
>> >  			"    Set a queue region on a port\n\n"
>> > @@ -18916,6 +18919,85 @@ cmdline_parse_inst_t
>> > cmd_show_port_supported_ptypes = {
>> >  	},
>> >  };
>> >
>> > +/* Common result structure for set port ptypes */ struct
>> > +cmd_set_port_ptypes_result {
>> > +	cmdline_fixed_string_t set;
>> > +	cmdline_fixed_string_t port;
>> > +	portid_t port_id;
>> > +	cmdline_fixed_string_t ptype_mask;
>> > +	uint32_t mask;
>> > +};
>> > +
>> > +/* Common CLI fields for set port ptypes */
>> > +cmdline_parse_token_string_t cmd_set_port_ptypes_set =
>> > +	TOKEN_STRING_INITIALIZER
>> > +		(struct cmd_set_port_ptypes_result,
>> > +		 set, "set");
>> > +cmdline_parse_token_string_t cmd_set_port_ptypes_port =
>> > +	TOKEN_STRING_INITIALIZER
>> > +		(struct cmd_set_port_ptypes_result,
>> > +		 port, "port");
>> > +cmdline_parse_token_num_t cmd_set_port_ptypes_port_id =
>> > +	TOKEN_NUM_INITIALIZER
>> > +		(struct cmd_set_port_ptypes_result,
>> > +		 port_id, UINT16);
>> > +cmdline_parse_token_string_t cmd_set_port_ptypes_mask_str =
>> > +	TOKEN_STRING_INITIALIZER
>> > +		(struct cmd_set_port_ptypes_result,
>> > +		 ptype_mask, "ptype_mask");
>> > +cmdline_parse_token_num_t cmd_set_port_ptypes_mask_u32 =
>> > +	TOKEN_NUM_INITIALIZER
>> > +		(struct cmd_set_port_ptypes_result,
>> > +		 mask, UINT32);
>> > +
>> > +static void
>> > +cmd_set_port_ptypes_parsed(
>> > +	void *parsed_result,
>> > +	__attribute__((unused)) struct cmdline *cl,
>> > +	__attribute__((unused)) void *data)
>> > +{
>> > +	struct cmd_set_port_ptypes_result *res = parsed_result;
>> > +#define PTYPE_NAMESIZE        256
>> > +	char ptype_name[PTYPE_NAMESIZE];
>> > +	uint16_t port_id = res->port_id;
>> > +	uint32_t ptype_mask = res->mask;
>> > +	int ret, i;
>> > +
>> > +	ret = rte_eth_dev_get_supported_ptypes(port_id,
>ptype_mask,
>> > NULL, 0);
>
>The last 2 parameters to the above function do not look correct, here is
>the function declaration:
>int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t
>ptype_mask,  uint32_t *ptypes, int num);
>
>ptypes should be a pointer to an array to hold the ptypes, and num
>should be the size of the array.

We can use the same API to get the number of ptypes supported to initialize the 
array below.

@see examples/l3fwd/l3fwd_lpm.c +424

>
>> > +	if (ret <= 0) {
>> > +		printf("Port %d doesn't support any ptypes.\n",
>port_id);
>> > +		return;
>> > +	}
>> > +
>> > +	uint32_t ptypes[ret];
>
>The above declaration can then be moved to the top of the function
>with the other declarations.


I intentionally placed it here as the array size depends on ret and there is 
no readily available macro for max number of packet types.


Thanks,
Pavan.

>
>> > +
>> > +	ret = rte_eth_dev_set_ptypes(port_id, ptype_mask, ptypes,
>ret);
>> > +	if (ret <= 0) {
>> > +		printf("Unable to set requested ptypes for Port %d\n",
>> > port_id);
>> > +		return;
>> > +	}
>> > +
>> > +	printf("Successfully set following ptypes for Port %d\n",
>port_id);
>> > +	for (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {
>> > +		rte_get_ptype_name(ptypes[i], ptype_name,
>> > sizeof(ptype_name));
>> > +		printf("%s\n", ptype_name);
>> > +	}
>> > +}
>> > +
>> > +cmdline_parse_inst_t cmd_set_port_ptypes = {
>> > +	.f = cmd_set_port_ptypes_parsed,
>> > +	.data = NULL,
>> > +	.help_str = "set port <port_id> ptype_mask <mask>",
>> > +	.tokens = {
>> > +		(void *)&cmd_set_port_ptypes_set,
>> > +		(void *)&cmd_set_port_ptypes_port,
>> > +		(void *)&cmd_set_port_ptypes_port_id,
>> > +		(void *)&cmd_set_port_ptypes_mask_str,
>> > +		(void *)&cmd_set_port_ptypes_mask_u32,
>> > +		NULL,
>> > +	},
>> > +};
>> > +
>> >  /*
>> >
>>
>******************************************************
>****
>> > ********************** */
>> >
>> >  /* list of instructions */
>> > @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] = {
>> >  	(cmdline_parse_inst_t *)&cmd_show_vf_stats,
>> >  	(cmdline_parse_inst_t *)&cmd_clear_vf_stats,
>> >  	(cmdline_parse_inst_t
>*)&cmd_show_port_supported_ptypes,
>> > +	(cmdline_parse_inst_t *)&cmd_set_port_ptypes,
>> >  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
>> >  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
>> >  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset, diff --
>git
>> > a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
>> > 5ba974162..812aebf35 100644
>> > --- a/app/test-pmd/testpmd.c
>> > +++ b/app/test-pmd/testpmd.c
>> > @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
>> >  	queueid_t qi;
>> >  	struct rte_port *port;
>> >  	struct rte_ether_addr mac_addr;
>> > +	static uint8_t clr_ptypes = 1;
>> >
>> >  	if (port_id_is_invalid(pid, ENABLED_WARN))
>> >  		return 0;
>> > @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
>> >  			}
>> >  		}
>> >  		configure_rxtx_dump_callbacks(verbose_level);
>> > +		if (clr_ptypes) {
>> > +			clr_ptypes = 0;
>> > +			rte_eth_dev_set_ptypes(pi,
>> > RTE_PTYPE_UNKNOWN, NULL, 0);
>> > +		}
>> >  		/* start port */
>> >  		if (rte_eth_dev_start(pi) < 0) {
>> >  			printf("Fail to start port %d\n", pi); diff --git
>> > a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> > index c68a742eb..f78ac9444 100644
>> > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> > @@ -472,6 +472,13 @@ Show ptypes supported for a specific port::
>> >
>> >     testpmd> show port (port_id) ptypes
>> >
>> > +set port supported ptypes
>> > +~~~~~~~~~~~~~~~~~~~~~~~~~
>> > +
>> > +set packet types classification for a specific port::
>> > +
>> > +   testpmd> set port (port_id) ptypes_mask (mask)
>> > +
>> >  show device info
>> >  ~~~~~~~~~~~~~~~~
>> >
>> > --
>> > 2.17.1
> Regards,
>
> Bernard.


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-07 14:36                                   ` Pavan Nikhilesh Bhagavatula
@ 2019-11-07 15:00                                     ` Iremonger, Bernard
  0 siblings, 0 replies; 246+ messages in thread
From: Iremonger, Bernard @ 2019-11-07 15:00 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula, Yigit, Ferruh, arybchenko,
	Jerin Jacob Kollanukkaran, thomas, Lu, Wenzhuo, Wu, Jingjing,
	Mcnamara, John, Kovacevic, Marko
  Cc: dev

Hi Pavin,

<snip>

> >> > Subject: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command
> >to set
> >> > supported ptype mask
> >> >
> >> > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >> >
> >> > Add command to set supported ptype mask.
> >> > Usage:
> >> > 	set port <port_id> ptype_mask <ptype_mask>
> >> >
> >> > Disable ptype parsing by default.
> >> >
> >> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >> > ---
> >> >  app/test-pmd/cmdline.c                      | 83 +++++++++++++++++++++
> >> >  app/test-pmd/testpmd.c                      |  5 ++
> >> >  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
> >> >  3 files changed, 95 insertions(+)
> >> >
> >> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> >index
> >> > 49c45a3f0..7af2c58c3 100644
> >> > --- a/app/test-pmd/cmdline.c
> >> > +++ b/app/test-pmd/cmdline.c
> >>
> >> The help text should be updated to describe the new command at
> >line 240 in
> >> cmdline.c
> >>
> >> > @@ -668,6 +668,9 @@ static void cmd_help_long_parsed(void
> >> > *parsed_result,
> >> >  			"ptype mapping update (port_id) (hw_ptype)
> >> (sw_ptype)\n"
> >> >  			"    Update a ptype mapping item on a port\n\n"
> >> >
> >> > +			"set port (port_id) ptype_mask
> >(ptype_mask)\n"
> >> > +			"    set packet types classification for a specific
> >> > port\n\n"
> >> > +
> >> >  			"set port (port_id) queue-region region_id
> >(value) "
> >> >  			"queue_start_index (value) queue_num
> >(value)\n"
> >> >  			"    Set a queue region on a port\n\n"
> >> > @@ -18916,6 +18919,85 @@ cmdline_parse_inst_t
> >> > cmd_show_port_supported_ptypes = {
> >> >  	},
> >> >  };
> >> >
> >> > +/* Common result structure for set port ptypes */ struct
> >> > +cmd_set_port_ptypes_result {
> >> > +	cmdline_fixed_string_t set;
> >> > +	cmdline_fixed_string_t port;
> >> > +	portid_t port_id;
> >> > +	cmdline_fixed_string_t ptype_mask;
> >> > +	uint32_t mask;
> >> > +};
> >> > +
> >> > +/* Common CLI fields for set port ptypes */
> >> > +cmdline_parse_token_string_t cmd_set_port_ptypes_set =
> >> > +	TOKEN_STRING_INITIALIZER
> >> > +		(struct cmd_set_port_ptypes_result,
> >> > +		 set, "set");
> >> > +cmdline_parse_token_string_t cmd_set_port_ptypes_port =
> >> > +	TOKEN_STRING_INITIALIZER
> >> > +		(struct cmd_set_port_ptypes_result,
> >> > +		 port, "port");
> >> > +cmdline_parse_token_num_t cmd_set_port_ptypes_port_id =
> >> > +	TOKEN_NUM_INITIALIZER
> >> > +		(struct cmd_set_port_ptypes_result,
> >> > +		 port_id, UINT16);
> >> > +cmdline_parse_token_string_t cmd_set_port_ptypes_mask_str =
> >> > +	TOKEN_STRING_INITIALIZER
> >> > +		(struct cmd_set_port_ptypes_result,
> >> > +		 ptype_mask, "ptype_mask");
> >> > +cmdline_parse_token_num_t cmd_set_port_ptypes_mask_u32 =
> >> > +	TOKEN_NUM_INITIALIZER
> >> > +		(struct cmd_set_port_ptypes_result,
> >> > +		 mask, UINT32);
> >> > +
> >> > +static void
> >> > +cmd_set_port_ptypes_parsed(
> >> > +	void *parsed_result,
> >> > +	__attribute__((unused)) struct cmdline *cl,
> >> > +	__attribute__((unused)) void *data) {
> >> > +	struct cmd_set_port_ptypes_result *res = parsed_result;
> >> > +#define PTYPE_NAMESIZE        256
> >> > +	char ptype_name[PTYPE_NAMESIZE];
> >> > +	uint16_t port_id = res->port_id;
> >> > +	uint32_t ptype_mask = res->mask;
> >> > +	int ret, i;
> >> > +
> >> > +	ret = rte_eth_dev_get_supported_ptypes(port_id,
> >ptype_mask,
> >> > NULL, 0);
> >
> >The last 2 parameters to the above function do not look correct, here
> >is the function declaration:
> >int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t
> >ptype_mask,  uint32_t *ptypes, int num);
> >
> >ptypes should be a pointer to an array to hold the ptypes, and num
> >should be the size of the array.
> 
> We can use the same API to get the number of ptypes supported to initialize
> the array below.
> 
> @see examples/l3fwd/l3fwd_lpm.c +424

Yes, you are correct, sorry for the noise.

> >> > +	if (ret <= 0) {
> >> > +		printf("Port %d doesn't support any ptypes.\n",
> >port_id);
> >> > +		return;
> >> > +	}
> >> > +
> >> > +	uint32_t ptypes[ret];
> >
> >The above declaration can then be moved to the top of the function with
> >the other declarations.
> 
> 
> I intentionally placed it here as the array size depends on ret and there is no
> readily available macro for max number of packet types.

Yes, this is correct too

<snip>

Regards,

Bernard.


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 4/8] drivers/net: update Rx RSS hash offload capabilities
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 4/8] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-11-07 16:48                               ` Ferruh Yigit
  2019-11-07 17:22                               ` Ferruh Yigit
  1 sibling, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-07 16:48 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev

On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
> index 931e4f4fe..6bc85a3d5 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -248,6 +248,8 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
>  	struct rte_flow_error error;
>  	int ret;
>  
> +	dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>  	/* Prepare internal flow rules. */
>  	ret = mlx4_flow_sync(priv, &error);
>  	if (ret) {
> diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
> index f45c1ff85..4a6fbd922 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_RSS_HASH;
>  
>  	if (priv->hw_csum)
>  		offloads |= DEV_RX_OFFLOAD_CHECKSUM;
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
> index c2bed2f97..6ad685ecd 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -404,6 +404,9 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
>  		rte_errno = ENOMEM;
>  		return -rte_errno;
>  	}
> +
> +	dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
> +

s/offload/offloads/

I can fix this while merging if this is the only issue.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 3/8] ethdev: add validation to offloads set by PMD
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 3/8] ethdev: add validation to offloads set by PMD pbhagavatula
@ 2019-11-07 16:51                               ` Ferruh Yigit
  0 siblings, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-07 16:51 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas; +Cc: dev

On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
> +static int
> +validate_offloads(uint16_t port_id, uint64_t req_offloads,
> +		  uint64_t set_offloads, const char *offload_type,
> +		  const char *(*offload_name)(uint64_t))
> +{
> +	uint64_t offloads_diff = req_offloads ^ set_offloads;
> +	uint64_t offload;
> +	int ret = 0;
> +
> +	while (offloads_diff != 0) {
> +		/* Check if any offload is requested but not enabled. */
> +		offload = 1ULL << __builtin_ctzll(offloads_diff);
> +		if (offload & req_offloads) {
> +			RTE_ETHDEV_LOG(ERR,
> +				       "Port %u failed to enable %s offload %s",
> +				       port_id, offload_type,
> +				       offload_name(offload));
> +			ret = -EINVAL;
> +		}
> +
> +		/* Chech if offload couldn't be disabled. */
> +		if (offload & set_offloads) {
> +			RTE_ETHDEV_LOG(INFO,
> +				       "Port %u failed to disable %s offload %s",
> +				       port_id, offload_type,
> +				       offload_name(offload));


"\n" missed in logs.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 4/8] drivers/net: update Rx RSS hash offload capabilities
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 4/8] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
  2019-11-07 16:48                               ` Ferruh Yigit
@ 2019-11-07 17:22                               ` Ferruh Yigit
  2019-11-08  8:48                                 ` Andrew Rybchenko
  1 sibling, 1 reply; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-07 17:22 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev

On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index ed8cbd849..37df1c40a 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -1812,6 +1812,8 @@ i40e_dev_configure(struct rte_eth_dev *dev)
>  	ad->tx_simple_allowed = true;
>  	ad->tx_vec_allowed = true;
>  
> +	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
>  	/* Only legacy filter API needs the following fdir config. So when the
>  	 * legacy filter API is deprecated, the following codes should also be
>  	 * removed.

When I checked with "show port 0 rx_offload configuration" testpmd command, I
don't see that "RSS_HASH" is shown as enabled, do you know why it doesn't show up?

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 2/8] ethdev: add mbuf RSS update as an offload
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 2/8] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-11-07 17:24                               ` Ferruh Yigit
  2019-11-10 14:43                                 ` Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-07 17:24 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, John McNamara, Marko Kovacevic
  Cc: dev

On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
> enable/disable PMDs write to `rte_mbuf::hash::rss`.
> PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
> by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

testpmd support to enable the rx_offload seems missing, can you please check
"port config 0 rx_offload ... " command, I think we should have following too:
"port config 0 rx_offload rss_hash"

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 7/8] examples/l2fwd: disable ptype parsing
  2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 7/8] examples/l2fwd: disable ptype parsing pbhagavatula
@ 2019-11-07 17:59                               ` Ferruh Yigit
  2019-11-07 18:30                               ` Ferruh Yigit
  1 sibling, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-07 17:59 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, Marko Kovacevic,
	Ori Kam, Bruce Richardson, Radu Nicolau, Akhil Goyal,
	Tomasz Kantecki
  Cc: dev

On 11/6/2019 7:18 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Disable packet type parsing as l2fwd doesn't rely on packet types.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  examples/l2fwd/Makefile    | 1 +
>  examples/l2fwd/main.c      | 2 ++
>  examples/l2fwd/meson.build | 1 +
>  3 files changed, 4 insertions(+)
> 
> diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
> index 230352093..123e6161c 100644
> --- a/examples/l2fwd/Makefile
> +++ b/examples/l2fwd/Makefile
> @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
>  
>  include $(RTE_SDK)/mk/rte.extapp.mk
>  endif
> diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
> index d7bcbfae7..3e7ad3ef1 100644
> --- a/examples/l2fwd/main.c
> +++ b/examples/l2fwd/main.c
> @@ -713,6 +713,8 @@ main(int argc, char **argv)
>  			"Cannot set error callback for tx buffer on port %u\n",
>  				 portid);
>  
> +		rte_eth_dev_set_ptypes(portid, RTE_PTYPE_UNKNOWN,
> +						 NULL, 0);

Should we use the return value, and print a log perhaps, my concern is static
analysis tools will complain about unchecked return value.

And to prevent the noise, don't log on -ENOTSUP error, wdyt?

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 1/8] ethdev: add set ptype function
  2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 1/8] ethdev: add set ptype function pbhagavatula
@ 2019-11-07 18:28                               ` Ferruh Yigit
  2019-11-08  9:05                                 ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-07 18:28 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, John McNamara, Marko Kovacevic
  Cc: dev

On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Add `rte_eth_dev_set_ptypes` function that will allow the application
> to inform the PMD about reduced range of packet types to handle.
> Based on the ptypes set PMDs can optimize their Rx path.
> 
> -If application doesn’t want any ptype information it can call
> `rte_eth_dev_set_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
> and PMD may skip packet type processing and set rte_mbuf::packet_type to
> RTE_PTYPE_UNKNOWN.
> 
> -If application doesn’t call `rte_eth_dev_set_ptypes` PMD can return
> `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
> 
> -If application is interested only in L2/L3 layer, it can inform the PMD
> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
> `rte_eth_dev_set_ptypes(ethdev_id,
> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
> 
> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
>  doc/guides/nics/features.rst             |  7 +-
>  doc/guides/rel_notes/release_19_11.rst   |  8 +++
>  lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
>  lib/librte_ethdev/rte_ethdev.h           | 36 ++++++++++
>  lib/librte_ethdev/rte_ethdev_core.h      | 18 +++++
>  lib/librte_ethdev/rte_ethdev_version.map |  1 +
>  6 files changed, 154 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
> index 7a31cf7c8..f33e8e6d4 100644
> --- a/doc/guides/nics/features.rst
> +++ b/doc/guides/nics/features.rst
> @@ -583,9 +583,12 @@ Packet type parsing
>  -------------------
>  
>  Supports packet type parsing and returns a list of supported types.
> +Allows application to set ptypes it is interested in.
>  
> -* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
> -* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
> +* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
> +* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
> +  ``rte_eth_dev_set_ptypes()``, ``dev_ptypes_set``.
> +* **[provides]   mbuf**: ``mbuf.packet_type``.
>  
>  
>  .. _nic_features_timesync:
> diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
> index 23182d187..2fa54aadc 100644
> --- a/doc/guides/rel_notes/release_19_11.rst
> +++ b/doc/guides/rel_notes/release_19_11.rst
> @@ -86,6 +86,13 @@ New Features
>    SET_TAG action and TAG item have been added to support transient flow
>    tag.
>  
> +* **Added ethdev API to set supported packet types**
> +
> +  * Added new API ``rte_eth_dev_set_ptypes`` that allows an application to
> +    inform PMD about about reduced range of packet types to handle.
> +  * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
> +    and thereby improve Rx performance if application wishes do so.
> +
>  * **Updated the enic driver.**
>  
>    * Added support for Geneve with options offload.
> @@ -258,6 +265,7 @@ New Features
>    * Rx metadata is delivered to host via a dynamic field of ``rte_mbuf`` with
>      PKT_RX_DYNF_METADATA.
>  
> +
>  Removed Items
>  -------------
>  
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 652c369e5..13e6daaf4 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -2879,6 +2879,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>  	return j;
>  }
>  
> +int
> +rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
> +				 uint32_t *set_ptypes, unsigned int num)
> +{
> +	const uint32_t valid_ptype_masks[] = {
> +		RTE_PTYPE_L2_MASK,
> +		RTE_PTYPE_L3_MASK,
> +		RTE_PTYPE_L4_MASK,
> +		RTE_PTYPE_TUNNEL_MASK,
> +		RTE_PTYPE_INNER_L2_MASK,
> +		RTE_PTYPE_INNER_L3_MASK,
> +		RTE_PTYPE_INNER_L4_MASK,
> +	};
> +	const uint32_t *all_ptypes;
> +	struct rte_eth_dev *dev;
> +	uint32_t unused_mask;
> +	unsigned int i, j;
> +	int ret;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +	dev = &rte_eth_devices[port_id];
> +
> +	if (num > 0 && set_ptypes == NULL)
> +		return -EINVAL;
> +
> +	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
> +			*dev->dev_ops->dev_ptypes_set == NULL) {
> +		ret = 0;
> +		goto ptype_unknown;
> +	}

Hi Pavan, Andrew,

Why API is not returning "-ENOTSUP" id dev_ops is not provided as done it other
APIs?

> +
> +	if (ptype_mask == 0) {
> +		ret = (*dev->dev_ops->dev_ptypes_set)(dev,
> +				ptype_mask);
> +		goto ptype_unknown;
> +	}
> +
> +	unused_mask = ptype_mask;
> +	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
> +		uint32_t mask = ptype_mask & valid_ptype_masks[i];
> +		if (mask && mask != valid_ptype_masks[i]) {
> +			ret = -EINVAL;
> +			goto ptype_unknown;
> +		}
> +		unused_mask &= ~valid_ptype_masks[i];
> +	}

What does above block does?
Does it mean 'ptype_mask' only can be combination of 'valid_ptype_masks' items?
Let's say can't I set only 'RTE_PTYPE_L2_ETHER' as requested ptype?
Why this limitation and is it documented anywhere, like the API documentation?

> +
> +	if (unused_mask) {
> +		ret = -EINVAL;
> +		goto ptype_unknown;
> +	}
> +
> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
> +	if (all_ptypes == NULL) {
> +		ret = 0;
> +		goto ptype_unknown;
> +	}
> +
> +	/*
> +	 * Accodommodate as many set_ptypes as possible. If the supplied

s/Accodommodate/Accommodate

> +	 * set_ptypes array is insufficient fill it partially.
> +	 */
> +	for (i = 0, j = 0; set_ptypes != NULL &&
> +				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
> +		if (ptype_mask & all_ptypes[i]) {
> +			if (j < num - 1) {
> +				set_ptypes[j] = all_ptypes[i];
> +				j++;
> +				continue;
> +			}
> +			break;
> +		}
> +	}
> +
> +	if (set_ptypes != NULL && j < num)
> +		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
> +
> +	return (*dev->dev_ops->dev_ptypes_set)(dev, ptype_mask);

Only a question, at this stage API knows the supported ptypes by device, does it
make sense to check if 'ptype_mask' has anything unsupported instead of passing
it to the driver and expect driver to check it?

> +
> +ptype_unknown:
> +	if (num > 0)
> +		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
> +
> +	return ret;
> +}
> +
>  int
>  rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>  {
> @@ -2891,7 +2977,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>  	return 0;
>  }
>  
> -
>  int
>  rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
>  {
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 44d77b332..a7872819d 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -2604,6 +2604,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
>   */
>  int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>  				     uint32_t *ptypes, int num);
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Inform Ethernet device about reduced range of packet types to handle.
> + *
> + * Application can use this function to set only specific ptypes that it's
> + * interested. This information can be used by the PMD to optimize Rx path.
> + *
> + * The function accepts an array `set_ptypes` allocated by the caller to
> + * store the packet types set by the driver, the last element of the array
> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
> + * partially.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param ptype_mask
> + *   The ptype family that application is interested in should be bitwise OR of
> + *   RTE_PTYPE_*_MASK or 0.

No strong opinion but is it really a mask? it doesn't used to mask any value,
but it is list of ptypes that application requests, in a bitwise ORed form, so I
this it can be ptypes.

> + * @param set_ptypes
> + *   An array pointer to store set packet types, allocated by caller. The
> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.

Not for this patch, but is an API also required to get current supported ptypes
from the driver? Even application keeps this list, something can reset in the
device/driver, supported pytpe list can be changed and it can differ with what
application knows.

> + * @param num
> + *   Size of the array pointed by param ptypes.
> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
> + *   set ptypes.
> + * @return
> + *   - (0) if Success.
> + *   - (-ENODEV) if *port_id* invalid.
> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
> + *     num > 0.
> + */
> +__rte_experimental
> +int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
> +			   uint32_t *set_ptypes, unsigned int num);
>  
>  /**
>   * Retrieve the MTU of an Ethernet device.
> diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
> index f215af7c9..657c39b56 100644
> --- a/lib/librte_ethdev/rte_ethdev_core.h
> +++ b/lib/librte_ethdev/rte_ethdev_core.h
> @@ -234,6 +234,22 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
>  typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
>  /**< @internal Get supported ptypes of an Ethernet device. */
>  
> +/**
> + * @internal
> + * Inform Ethernet device about reduced range of packet types to handle.
> + *
> + * @param dev
> + *   The Ethernet device identifier.
> + * @param ptype_mask
> + *   The ptype family that application is interested in should be bitwise OR of
> + *   RTE_PTYPE_*_MASK or 0.
> + * @return
> + *   - (0) if Success.
> + *   - (-EINVAL) if *ptype_mask* is invalid.
> + */
> +typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev,
> +				     uint32_t ptype_mask);
> +
>  typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
>  				    uint16_t queue_id);
>  /**< @internal Start rx and tx of a queue of an Ethernet device. */
> @@ -630,6 +646,8 @@ struct eth_dev_ops {
>  	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
>  	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
>  	/**< Get packet types supported and identified by device. */
> +	eth_dev_ptypes_set_t dev_ptypes_set;
> +	/**< Inform Ethernet device about reduced range of packet types to handle. */
>  
>  	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
>  	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
> diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
> index ee289ef13..ccfbeae23 100644
> --- a/lib/librte_ethdev/rte_ethdev_version.map
> +++ b/lib/librte_ethdev/rte_ethdev_version.map
> @@ -292,4 +292,5 @@ EXPERIMENTAL {
>  	rte_flow_dynf_metadata_offs;
>  	rte_flow_dynf_metadata_mask;
>  	rte_flow_dynf_metadata_register;
> +	rte_eth_dev_set_ptypes;
>  };
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 7/8] examples/l2fwd: disable ptype parsing
  2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 7/8] examples/l2fwd: disable ptype parsing pbhagavatula
  2019-11-07 17:59                               ` Ferruh Yigit
@ 2019-11-07 18:30                               ` Ferruh Yigit
  1 sibling, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-07 18:30 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, Marko Kovacevic,
	Ori Kam, Bruce Richardson, Radu Nicolau, Akhil Goyal,
	Tomasz Kantecki
  Cc: dev

On 11/6/2019 7:18 PM, pbhagavatula@marvell.com wrote:
> diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
> index 230352093..123e6161c 100644
> --- a/examples/l2fwd/Makefile
> +++ b/examples/l2fwd/Makefile
> @@ -51,6 +51,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API

Can you please add the experimental API as comment, it may help removing these
flags when APIs becomes non-experimental.

Some thing for meson.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask pbhagavatula
  2019-11-07 11:57                               ` Iremonger, Bernard
@ 2019-11-07 18:40                               ` Ferruh Yigit
  2019-11-07 18:55                                 ` Jerin Jacob
  1 sibling, 1 reply; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-07 18:40 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, Wenzhuo Lu,
	Jingjing Wu, Bernard Iremonger, John McNamara, Marko Kovacevic
  Cc: dev

On 11/6/2019 7:18 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Add command to set supported ptype mask.
> Usage:
> 	set port <port_id> ptype_mask <ptype_mask>
> 
> Disable ptype parsing by default.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  app/test-pmd/cmdline.c                      | 83 +++++++++++++++++++++
>  app/test-pmd/testpmd.c                      |  5 ++
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
>  3 files changed, 95 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 49c45a3f0..7af2c58c3 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -668,6 +668,9 @@ static void cmd_help_long_parsed(void *parsed_result,
>  			"ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n"
>  			"    Update a ptype mapping item on a port\n\n"
>  
> +			"set port (port_id) ptype_mask (ptype_mask)\n"
> +			"    set packet types classification for a specific port\n\n"
> +
>  			"set port (port_id) queue-region region_id (value) "
>  			"queue_start_index (value) queue_num (value)\n"
>  			"    Set a queue region on a port\n\n"
> @@ -18916,6 +18919,85 @@ cmdline_parse_inst_t cmd_show_port_supported_ptypes = {
>  	},
>  };
>  
> +/* Common result structure for set port ptypes */
> +struct cmd_set_port_ptypes_result {
> +	cmdline_fixed_string_t set;
> +	cmdline_fixed_string_t port;
> +	portid_t port_id;
> +	cmdline_fixed_string_t ptype_mask;
> +	uint32_t mask;
> +};
> +
> +/* Common CLI fields for set port ptypes */
> +cmdline_parse_token_string_t cmd_set_port_ptypes_set =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_set_port_ptypes_result,
> +		 set, "set");
> +cmdline_parse_token_string_t cmd_set_port_ptypes_port =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_set_port_ptypes_result,
> +		 port, "port");
> +cmdline_parse_token_num_t cmd_set_port_ptypes_port_id =
> +	TOKEN_NUM_INITIALIZER
> +		(struct cmd_set_port_ptypes_result,
> +		 port_id, UINT16);
> +cmdline_parse_token_string_t cmd_set_port_ptypes_mask_str =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_set_port_ptypes_result,
> +		 ptype_mask, "ptype_mask");
> +cmdline_parse_token_num_t cmd_set_port_ptypes_mask_u32 =
> +	TOKEN_NUM_INITIALIZER
> +		(struct cmd_set_port_ptypes_result,
> +		 mask, UINT32);
> +
> +static void
> +cmd_set_port_ptypes_parsed(
> +	void *parsed_result,
> +	__attribute__((unused)) struct cmdline *cl,
> +	__attribute__((unused)) void *data)
> +{
> +	struct cmd_set_port_ptypes_result *res = parsed_result;
> +#define PTYPE_NAMESIZE        256
> +	char ptype_name[PTYPE_NAMESIZE];
> +	uint16_t port_id = res->port_id;
> +	uint32_t ptype_mask = res->mask;
> +	int ret, i;
> +
> +	ret = rte_eth_dev_get_supported_ptypes(port_id, ptype_mask, NULL, 0);
> +	if (ret <= 0) {
> +		printf("Port %d doesn't support any ptypes.\n", port_id);
> +		return;

"ptype_mask" is the list of ptypes that we are interested right, having it 0
means we are not interested with any. But using "ptype_mask" as mask in
'rte_eth_dev_get_supported_ptypes()' will cause this API return 0 and it will
fails this command.
Why not use 'RTE_PTYPE_ALL_MASK' as mask value?

> +	}
> +
> +	uint32_t ptypes[ret];
> +
> +	ret = rte_eth_dev_set_ptypes(port_id, ptype_mask, ptypes, ret);
> +	if (ret <= 0) {
> +		printf("Unable to set requested ptypes for Port %d\n", port_id);
> +		return;
> +	}
> +
> +	printf("Successfully set following ptypes for Port %d\n", port_id);
> +	for (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {
> +		rte_get_ptype_name(ptypes[i], ptype_name, sizeof(ptype_name));
> +		printf("%s\n", ptype_name);
> +	}
> +}
> +
> +cmdline_parse_inst_t cmd_set_port_ptypes = {
> +	.f = cmd_set_port_ptypes_parsed,
> +	.data = NULL,
> +	.help_str = "set port <port_id> ptype_mask <mask>",
> +	.tokens = {
> +		(void *)&cmd_set_port_ptypes_set,
> +		(void *)&cmd_set_port_ptypes_port,
> +		(void *)&cmd_set_port_ptypes_port_id,
> +		(void *)&cmd_set_port_ptypes_mask_str,
> +		(void *)&cmd_set_port_ptypes_mask_u32,
> +		NULL,
> +	},
> +};
> +
>  /* ******************************************************************************** */
>  
>  /* list of instructions */
> @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] = {
>  	(cmdline_parse_inst_t *)&cmd_show_vf_stats,
>  	(cmdline_parse_inst_t *)&cmd_clear_vf_stats,
>  	(cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
> +	(cmdline_parse_inst_t *)&cmd_set_port_ptypes,
>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
>  	(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 5ba974162..812aebf35 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
>  	queueid_t qi;
>  	struct rte_port *port;
>  	struct rte_ether_addr mac_addr;
> +	static uint8_t clr_ptypes = 1;
>  
>  	if (port_id_is_invalid(pid, ENABLED_WARN))
>  		return 0;
> @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
>  			}
>  		}
>  		configure_rxtx_dump_callbacks(verbose_level);
> +		if (clr_ptypes) {
> +			clr_ptypes = 0;
> +			rte_eth_dev_set_ptypes(pi, RTE_PTYPE_UNKNOWN, NULL, 0);
> +		}

I am not sure about this command, we have now capability to set/disable ptypes
on demand, why disabling them by default?


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-07 18:40                               ` Ferruh Yigit
@ 2019-11-07 18:55                                 ` Jerin Jacob
  2019-11-07 19:40                                   ` Ferruh Yigit
  0 siblings, 1 reply; 246+ messages in thread
From: Jerin Jacob @ 2019-11-07 18:55 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Pavan Nikhilesh, Andrew Rybchenko, jerinj, thomas, Wenzhuo Lu,
	Jingjing Wu, Bernard Iremonger, John McNamara, Marko Kovacevic,
	dev

On Fri, 8 Nov, 2019, 12:10 am Ferruh Yigit, <ferruh.yigit@intel.com> wrote:

> On 11/6/2019 7:18 PM, pbhagavatula@marvell.com wrote:
> > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >
> > Add command to set supported ptype mask.
> > Usage:
> >       set port <port_id> ptype_mask >  /* ***************
> >
> >  /* list of instructions */
> > @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] = {
> >       (cmdline_parse_inst_t *)&cmd_show_vf_stats,
> >       (cmdline_parse_inst_t *)&cmd_clear_vf_stats,
> >       (cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
> > +     (cmdline_parse_inst_t *)&cmd_set_port_ptypes,
> >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
> >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
> >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
> > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> > index 5ba974162..812aebf35 100644
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
> >       queueid_t qi;
> >       struct rte_port *port;
> >       struct rte_ether_addr mac_addr;
> > +     static uint8_t clr_ptypes = 1;
> >
> >       if (port_id_is_invalid(pid, ENABLED_WARN))
> >               return 0;
> > @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
> >                       }
> >               }
> >               configure_rxtx_dump_callbacks(verbose_level);
> > +             if (clr_ptypes) {
> > +                     clr_ptypes = 0;
> > +                     rte_eth_dev_set_ptypes(pi, RTE_PTYPE_UNKNOWN,
> NULL, 0);
> > +             }
>
> I am not sure about this command, we have now capability to set/disable
> ptypes
> on demand, why disabling them by default?
>

As forward engines are not using the ptype offload. If a specific forward
mode need the offload, it can be enabled.



>

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-07 18:55                                 ` Jerin Jacob
@ 2019-11-07 19:40                                   ` Ferruh Yigit
  2019-11-08  4:13                                     ` Jerin Jacob
  2019-11-08 13:54                                     ` Ananyev, Konstantin
  0 siblings, 2 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-07 19:40 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Pavan Nikhilesh, Andrew Rybchenko, jerinj, thomas, Wenzhuo Lu,
	Jingjing Wu, Bernard Iremonger, John McNamara, Marko Kovacevic,
	dev

On 11/7/2019 6:55 PM, Jerin Jacob wrote:
> 
> 
> On Fri, 8 Nov, 2019, 12:10 am Ferruh Yigit, <ferruh.yigit@intel.com
> <mailto:ferruh.yigit@intel.com>> wrote:
> 
>     On 11/6/2019 7:18 PM, pbhagavatula@marvell.com
>     <mailto:pbhagavatula@marvell.com> wrote:
>     > From: Pavan Nikhilesh <pbhagavatula@marvell.com
>     <mailto:pbhagavatula@marvell.com>>
>     >
>     > Add command to set supported ptype mask.
>     > Usage:
>     >       set port <port_id> ptype_mask >  /* ***************
>     > 
>     >  /* list of instructions */
>     > @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] = {
>     >       (cmdline_parse_inst_t *)&cmd_show_vf_stats,
>     >       (cmdline_parse_inst_t *)&cmd_clear_vf_stats,
>     >       (cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
>     > +     (cmdline_parse_inst_t *)&cmd_set_port_ptypes,
>     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
>     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
>     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
>     > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
>     > index 5ba974162..812aebf35 100644
>     > --- a/app/test-pmd/testpmd.c
>     > +++ b/app/test-pmd/testpmd.c
>     > @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
>     >       queueid_t qi;
>     >       struct rte_port *port;
>     >       struct rte_ether_addr mac_addr;
>     > +     static uint8_t clr_ptypes = 1;
>     > 
>     >       if (port_id_is_invalid(pid, ENABLED_WARN))
>     >               return 0;
>     > @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
>     >                       }
>     >               }
>     >               configure_rxtx_dump_callbacks(verbose_level);
>     > +             if (clr_ptypes) {
>     > +                     clr_ptypes = 0;
>     > +                     rte_eth_dev_set_ptypes(pi, RTE_PTYPE_UNKNOWN, NULL, 0);
>     > +             }
> 
>     I am not sure about this command, we have now capability to set/disable ptypes
>     on demand, why disabling them by default?
> 
> 
> As forward engines are not using the ptype offload. If a specific forward mode
> need the offload, it can be enabled.
> 

OK, I am still not sure but I understand your reasoning.

But this is a behavior change and it may caught people, what about following
more operational updates:
- Separate this into its own patch, this is different than adding new command
- move "clr_ptypes" next to other static global variables, to make this
selection more obvious, and those global variables tend to have some comments,
we can add comment to this one as well.
- print a log when "rte_eth_dev_set_ptypes()" returns success, to say packets
types parsing is disabled, to help user to understand what is happening. Because
currently there is no other way to get the current configured ptypes from PMD.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-07 19:40                                   ` Ferruh Yigit
@ 2019-11-08  4:13                                     ` Jerin Jacob
  2019-11-08 13:54                                     ` Ananyev, Konstantin
  1 sibling, 0 replies; 246+ messages in thread
From: Jerin Jacob @ 2019-11-08  4:13 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Pavan Nikhilesh, Andrew Rybchenko, Jerin Jacob, Thomas Monjalon,
	Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, dpdk-dev

On Fri, Nov 8, 2019 at 1:11 AM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 11/7/2019 6:55 PM, Jerin Jacob wrote:
> >
> >
> > On Fri, 8 Nov, 2019, 12:10 am Ferruh Yigit, <ferruh.yigit@intel.com
> > <mailto:ferruh.yigit@intel.com>> wrote:
> >
> >     On 11/6/2019 7:18 PM, pbhagavatula@marvell.com
> >     <mailto:pbhagavatula@marvell.com> wrote:
> >     > From: Pavan Nikhilesh <pbhagavatula@marvell.com
> >     <mailto:pbhagavatula@marvell.com>>
> >     >
> >     > Add command to set supported ptype mask.
> >     > Usage:
> >     >       set port <port_id> ptype_mask >  /* ***************
> >     >
> >     >  /* list of instructions */
> >     > @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] = {
> >     >       (cmdline_parse_inst_t *)&cmd_show_vf_stats,
> >     >       (cmdline_parse_inst_t *)&cmd_clear_vf_stats,
> >     >       (cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
> >     > +     (cmdline_parse_inst_t *)&cmd_set_port_ptypes,
> >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
> >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
> >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
> >     > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> >     > index 5ba974162..812aebf35 100644
> >     > --- a/app/test-pmd/testpmd.c
> >     > +++ b/app/test-pmd/testpmd.c
> >     > @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
> >     >       queueid_t qi;
> >     >       struct rte_port *port;
> >     >       struct rte_ether_addr mac_addr;
> >     > +     static uint8_t clr_ptypes = 1;
> >     >
> >     >       if (port_id_is_invalid(pid, ENABLED_WARN))
> >     >               return 0;
> >     > @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
> >     >                       }
> >     >               }
> >     >               configure_rxtx_dump_callbacks(verbose_level);
> >     > +             if (clr_ptypes) {
> >     > +                     clr_ptypes = 0;
> >     > +                     rte_eth_dev_set_ptypes(pi, RTE_PTYPE_UNKNOWN, NULL, 0);
> >     > +             }
> >
> >     I am not sure about this command, we have now capability to set/disable ptypes
> >     on demand, why disabling them by default?
> >
> >
> > As forward engines are not using the ptype offload. If a specific forward mode
> > need the offload, it can be enabled.
> >
>
> OK, I am still not sure but I understand your reasoning.
>
> But this is a behavior change and it may caught people, what about following
> more operational updates:
> - Separate this into its own patch, this is different than adding new command
> - move "clr_ptypes" next to other static global variables, to make this
> selection more obvious, and those global variables tend to have some comments,
> we can add comment to this one as well.
> - print a log when "rte_eth_dev_set_ptypes()" returns success, to say packets
> types parsing is disabled, to help user to understand what is happening. Because
> currently there is no other way to get the current configured ptypes from PMD.

+1 for operational updates.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 4/8] drivers/net: update Rx RSS hash offload capabilities
  2019-11-07 17:22                               ` Ferruh Yigit
@ 2019-11-08  8:48                                 ` Andrew Rybchenko
  2019-11-14 14:01                                   ` Ferruh Yigit
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-08  8:48 UTC (permalink / raw)
  To: Ferruh Yigit, pbhagavatula, jerinj, thomas, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev

On 11/7/19 8:22 PM, Ferruh Yigit wrote:
> On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
>> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
>> index ed8cbd849..37df1c40a 100644
>> --- a/drivers/net/i40e/i40e_ethdev.c
>> +++ b/drivers/net/i40e/i40e_ethdev.c
>> @@ -1812,6 +1812,8 @@ i40e_dev_configure(struct rte_eth_dev *dev)
>>  	ad->tx_simple_allowed = true;
>>  	ad->tx_vec_allowed = true;
>>  
>> +	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
>> +
>>  	/* Only legacy filter API needs the following fdir config. So when the
>>  	 * legacy filter API is deprecated, the following codes should also be
>>  	 * removed.
> 
> When I checked with "show port 0 rx_offload configuration" testpmd command, I
> don't see that "RSS_HASH" is shown as enabled, do you know why it doesn't show up?

As I understand testpmd uses its own internal dev_conf copy,
not dev->data->dev_conf.


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 1/8] ethdev: add set ptype function
  2019-11-07 18:28                               ` Ferruh Yigit
@ 2019-11-08  9:05                                 ` Andrew Rybchenko
  2019-11-08  9:52                                   ` Ferruh Yigit
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-08  9:05 UTC (permalink / raw)
  To: Ferruh Yigit, pbhagavatula, arybchenko, jerinj, thomas,
	John McNamara, Marko Kovacevic
  Cc: dev

On 11/7/19 9:28 PM, Ferruh Yigit wrote:
> On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> Add `rte_eth_dev_set_ptypes` function that will allow the application
>> to inform the PMD about reduced range of packet types to handle.
>> Based on the ptypes set PMDs can optimize their Rx path.
>>
>> -If application doesn’t want any ptype information it can call
>> `rte_eth_dev_set_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
>> and PMD may skip packet type processing and set rte_mbuf::packet_type to
>> RTE_PTYPE_UNKNOWN.
>>
>> -If application doesn’t call `rte_eth_dev_set_ptypes` PMD can return
>> `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>>
>> -If application is interested only in L2/L3 layer, it can inform the PMD
>> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
>> `rte_eth_dev_set_ptypes(ethdev_id,
>> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>>
>> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>> ---
>>  doc/guides/nics/features.rst             |  7 +-
>>  doc/guides/rel_notes/release_19_11.rst   |  8 +++
>>  lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
>>  lib/librte_ethdev/rte_ethdev.h           | 36 ++++++++++
>>  lib/librte_ethdev/rte_ethdev_core.h      | 18 +++++
>>  lib/librte_ethdev/rte_ethdev_version.map |  1 +
>>  6 files changed, 154 insertions(+), 3 deletions(-)
>>
>> diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
>> index 7a31cf7c8..f33e8e6d4 100644
>> --- a/doc/guides/nics/features.rst
>> +++ b/doc/guides/nics/features.rst
>> @@ -583,9 +583,12 @@ Packet type parsing
>>  -------------------
>>  
>>  Supports packet type parsing and returns a list of supported types.
>> +Allows application to set ptypes it is interested in.
>>  
>> -* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
>> -* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
>> +* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
>> +* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
>> +  ``rte_eth_dev_set_ptypes()``, ``dev_ptypes_set``.
>> +* **[provides]   mbuf**: ``mbuf.packet_type``.
>>  
>>  
>>  .. _nic_features_timesync:
>> diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
>> index 23182d187..2fa54aadc 100644
>> --- a/doc/guides/rel_notes/release_19_11.rst
>> +++ b/doc/guides/rel_notes/release_19_11.rst
>> @@ -86,6 +86,13 @@ New Features
>>    SET_TAG action and TAG item have been added to support transient flow
>>    tag.
>>  
>> +* **Added ethdev API to set supported packet types**
>> +
>> +  * Added new API ``rte_eth_dev_set_ptypes`` that allows an application to
>> +    inform PMD about about reduced range of packet types to handle.
>> +  * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
>> +    and thereby improve Rx performance if application wishes do so.
>> +
>>  * **Updated the enic driver.**
>>  
>>    * Added support for Geneve with options offload.
>> @@ -258,6 +265,7 @@ New Features
>>    * Rx metadata is delivered to host via a dynamic field of ``rte_mbuf`` with
>>      PKT_RX_DYNF_METADATA.
>>  
>> +
>>  Removed Items
>>  -------------
>>  
>> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
>> index 652c369e5..13e6daaf4 100644
>> --- a/lib/librte_ethdev/rte_ethdev.c
>> +++ b/lib/librte_ethdev/rte_ethdev.c
>> @@ -2879,6 +2879,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>  	return j;
>>  }
>>  
>> +int
>> +rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
>> +				 uint32_t *set_ptypes, unsigned int num)
>> +{
>> +	const uint32_t valid_ptype_masks[] = {
>> +		RTE_PTYPE_L2_MASK,
>> +		RTE_PTYPE_L3_MASK,
>> +		RTE_PTYPE_L4_MASK,
>> +		RTE_PTYPE_TUNNEL_MASK,
>> +		RTE_PTYPE_INNER_L2_MASK,
>> +		RTE_PTYPE_INNER_L3_MASK,
>> +		RTE_PTYPE_INNER_L4_MASK,
>> +	};
>> +	const uint32_t *all_ptypes;
>> +	struct rte_eth_dev *dev;
>> +	uint32_t unused_mask;
>> +	unsigned int i, j;
>> +	int ret;
>> +
>> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>> +	dev = &rte_eth_devices[port_id];
>> +
>> +	if (num > 0 && set_ptypes == NULL)
>> +		return -EINVAL;
>> +
>> +	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
>> +			*dev->dev_ops->dev_ptypes_set == NULL) {
>> +		ret = 0;
>> +		goto ptype_unknown;
>> +	}
> 
> Hi Pavan, Andrew,
> 
> Why API is not returning "-ENOTSUP" id dev_ops is not provided as done it other
> APIs?

As I understand the reason behind it is an optional nature
of the callback. It is just an optimization and there is no
point to complicate applications code to check and treat
-ENOTSUP is OK.

>> +
>> +	if (ptype_mask == 0) {
>> +		ret = (*dev->dev_ops->dev_ptypes_set)(dev,
>> +				ptype_mask);
>> +		goto ptype_unknown;
>> +	}
>> +
>> +	unused_mask = ptype_mask;
>> +	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
>> +		uint32_t mask = ptype_mask & valid_ptype_masks[i];
>> +		if (mask && mask != valid_ptype_masks[i]) {
>> +			ret = -EINVAL;
>> +			goto ptype_unknown;
>> +		}
>> +		unused_mask &= ~valid_ptype_masks[i];
>> +	}
> 
> What does above block does?
> Does it mean 'ptype_mask' only can be combination of 'valid_ptype_masks' items?

Yes.

> Let's say can't I set only 'RTE_PTYPE_L2_ETHER' as requested ptype?

Yes

> Why this limitation and is it documented anywhere, like the API documentation?

It is simply incorrect to have non-mask bits here.
RTE_PTYPE_L2_ETHER & RTE_PTYPE_L2_ETHER_ARP != 0
It is documented in the ptype_mask parameter description.

>> +
>> +	if (unused_mask) {
>> +		ret = -EINVAL;
>> +		goto ptype_unknown;
>> +	}
>> +
>> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
>> +	if (all_ptypes == NULL) {
>> +		ret = 0;
>> +		goto ptype_unknown;
>> +	}
>> +
>> +	/*
>> +	 * Accodommodate as many set_ptypes as possible. If the supplied
> 
> s/Accodommodate/Accommodate
> 
>> +	 * set_ptypes array is insufficient fill it partially.
>> +	 */
>> +	for (i = 0, j = 0; set_ptypes != NULL &&
>> +				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
>> +		if (ptype_mask & all_ptypes[i]) {
>> +			if (j < num - 1) {
>> +				set_ptypes[j] = all_ptypes[i];
>> +				j++;
>> +				continue;
>> +			}
>> +			break;
>> +		}
>> +	}
>> +
>> +	if (set_ptypes != NULL && j < num)
>> +		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
>> +
>> +	return (*dev->dev_ops->dev_ptypes_set)(dev, ptype_mask);
> 
> Only a question, at this stage API knows the supported ptypes by device, does it
> make sense to check if 'ptype_mask' has anything unsupported instead of passing
> it to the driver and expect driver to check it?

It is also explained by the nature of the API. Application says:
I'm interested in the following ptypes only to let PMD know that
it could drop classification behind it. If PMD does not support
some layers, it will not provide classification anyway.

>> +
>> +ptype_unknown:
>> +	if (num > 0)
>> +		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>> +
>> +	return ret;
>> +}
>> +
>>  int
>>  rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>>  {
>> @@ -2891,7 +2977,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>>  	return 0;
>>  }
>>  
>> -
>>  int
>>  rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
>>  {
>> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>> index 44d77b332..a7872819d 100644
>> --- a/lib/librte_ethdev/rte_ethdev.h
>> +++ b/lib/librte_ethdev/rte_ethdev.h
>> @@ -2604,6 +2604,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
>>   */
>>  int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>  				     uint32_t *ptypes, int num);
>> +/**
>> + * @warning
>> + * @b EXPERIMENTAL: this API may change without prior notice.
>> + *
>> + * Inform Ethernet device about reduced range of packet types to handle.
>> + *
>> + * Application can use this function to set only specific ptypes that it's
>> + * interested. This information can be used by the PMD to optimize Rx path.
>> + *
>> + * The function accepts an array `set_ptypes` allocated by the caller to
>> + * store the packet types set by the driver, the last element of the array
>> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
>> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
>> + * partially.
>> + *
>> + * @param port_id
>> + *   The port identifier of the Ethernet device.
>> + * @param ptype_mask
>> + *   The ptype family that application is interested in should be bitwise OR of
>> + *   RTE_PTYPE_*_MASK or 0.
> 
> No strong opinion but is it really a mask? it doesn't used to mask any value,
> but it is list of ptypes that application requests, in a bitwise ORed form, so I
> this it can be ptypes.

See above.

>> + * @param set_ptypes
>> + *   An array pointer to store set packet types, allocated by caller. The
>> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
> 
> Not for this patch, but is an API also required to get current supported ptypes
> from the driver? Even application keeps this list, something can reset in the
> device/driver, supported pytpe list can be changed and it can differ with what
> application knows.

I would say that set_ptypes should not affected supported_ptypes.

>> + * @param num
>> + *   Size of the array pointed by param ptypes.
>> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
>> + *   set ptypes.
>> + * @return
>> + *   - (0) if Success.
>> + *   - (-ENODEV) if *port_id* invalid.
>> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
>> + *     num > 0.
>> + */
>> +__rte_experimental
>> +int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
>> +			   uint32_t *set_ptypes, unsigned int num);
>>  
>>  /**
>>   * Retrieve the MTU of an Ethernet device.
>> diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
>> index f215af7c9..657c39b56 100644
>> --- a/lib/librte_ethdev/rte_ethdev_core.h
>> +++ b/lib/librte_ethdev/rte_ethdev_core.h
>> @@ -234,6 +234,22 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
>>  typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
>>  /**< @internal Get supported ptypes of an Ethernet device. */
>>  
>> +/**
>> + * @internal
>> + * Inform Ethernet device about reduced range of packet types to handle.
>> + *
>> + * @param dev
>> + *   The Ethernet device identifier.
>> + * @param ptype_mask
>> + *   The ptype family that application is interested in should be bitwise OR of
>> + *   RTE_PTYPE_*_MASK or 0.
>> + * @return
>> + *   - (0) if Success.
>> + *   - (-EINVAL) if *ptype_mask* is invalid.
>> + */
>> +typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev,
>> +				     uint32_t ptype_mask);
>> +
>>  typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
>>  				    uint16_t queue_id);
>>  /**< @internal Start rx and tx of a queue of an Ethernet device. */
>> @@ -630,6 +646,8 @@ struct eth_dev_ops {
>>  	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
>>  	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
>>  	/**< Get packet types supported and identified by device. */
>> +	eth_dev_ptypes_set_t dev_ptypes_set;
>> +	/**< Inform Ethernet device about reduced range of packet types to handle. */
>>  
>>  	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
>>  	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
>> diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
>> index ee289ef13..ccfbeae23 100644
>> --- a/lib/librte_ethdev/rte_ethdev_version.map
>> +++ b/lib/librte_ethdev/rte_ethdev_version.map
>> @@ -292,4 +292,5 @@ EXPERIMENTAL {
>>  	rte_flow_dynf_metadata_offs;
>>  	rte_flow_dynf_metadata_mask;
>>  	rte_flow_dynf_metadata_register;
>> +	rte_eth_dev_set_ptypes;
>>  };
>>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 1/8] ethdev: add set ptype function
  2019-11-08  9:05                                 ` Andrew Rybchenko
@ 2019-11-08  9:52                                   ` Ferruh Yigit
  2019-11-08 10:24                                     ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-08  9:52 UTC (permalink / raw)
  To: Andrew Rybchenko, pbhagavatula, jerinj, thomas, John McNamara,
	Marko Kovacevic
  Cc: dev

On 11/8/2019 9:05 AM, Andrew Rybchenko wrote:
> On 11/7/19 9:28 PM, Ferruh Yigit wrote:
>> On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>
>>> Add `rte_eth_dev_set_ptypes` function that will allow the application
>>> to inform the PMD about reduced range of packet types to handle.
>>> Based on the ptypes set PMDs can optimize their Rx path.
>>>
>>> -If application doesn’t want any ptype information it can call
>>> `rte_eth_dev_set_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
>>> and PMD may skip packet type processing and set rte_mbuf::packet_type to
>>> RTE_PTYPE_UNKNOWN.
>>>
>>> -If application doesn’t call `rte_eth_dev_set_ptypes` PMD can return
>>> `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>>>
>>> -If application is interested only in L2/L3 layer, it can inform the PMD
>>> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
>>> `rte_eth_dev_set_ptypes(ethdev_id,
>>> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>>>
>>> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>> ---
>>>  doc/guides/nics/features.rst             |  7 +-
>>>  doc/guides/rel_notes/release_19_11.rst   |  8 +++
>>>  lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
>>>  lib/librte_ethdev/rte_ethdev.h           | 36 ++++++++++
>>>  lib/librte_ethdev/rte_ethdev_core.h      | 18 +++++
>>>  lib/librte_ethdev/rte_ethdev_version.map |  1 +
>>>  6 files changed, 154 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
>>> index 7a31cf7c8..f33e8e6d4 100644
>>> --- a/doc/guides/nics/features.rst
>>> +++ b/doc/guides/nics/features.rst
>>> @@ -583,9 +583,12 @@ Packet type parsing
>>>  -------------------
>>>  
>>>  Supports packet type parsing and returns a list of supported types.
>>> +Allows application to set ptypes it is interested in.
>>>  
>>> -* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
>>> -* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
>>> +* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
>>> +* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
>>> +  ``rte_eth_dev_set_ptypes()``, ``dev_ptypes_set``.
>>> +* **[provides]   mbuf**: ``mbuf.packet_type``.
>>>  
>>>  
>>>  .. _nic_features_timesync:
>>> diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
>>> index 23182d187..2fa54aadc 100644
>>> --- a/doc/guides/rel_notes/release_19_11.rst
>>> +++ b/doc/guides/rel_notes/release_19_11.rst
>>> @@ -86,6 +86,13 @@ New Features
>>>    SET_TAG action and TAG item have been added to support transient flow
>>>    tag.
>>>  
>>> +* **Added ethdev API to set supported packet types**
>>> +
>>> +  * Added new API ``rte_eth_dev_set_ptypes`` that allows an application to
>>> +    inform PMD about about reduced range of packet types to handle.
>>> +  * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
>>> +    and thereby improve Rx performance if application wishes do so.
>>> +
>>>  * **Updated the enic driver.**
>>>  
>>>    * Added support for Geneve with options offload.
>>> @@ -258,6 +265,7 @@ New Features
>>>    * Rx metadata is delivered to host via a dynamic field of ``rte_mbuf`` with
>>>      PKT_RX_DYNF_METADATA.
>>>  
>>> +
>>>  Removed Items
>>>  -------------
>>>  
>>> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
>>> index 652c369e5..13e6daaf4 100644
>>> --- a/lib/librte_ethdev/rte_ethdev.c
>>> +++ b/lib/librte_ethdev/rte_ethdev.c
>>> @@ -2879,6 +2879,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>  	return j;
>>>  }
>>>  
>>> +int
>>> +rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>> +				 uint32_t *set_ptypes, unsigned int num)
>>> +{
>>> +	const uint32_t valid_ptype_masks[] = {
>>> +		RTE_PTYPE_L2_MASK,
>>> +		RTE_PTYPE_L3_MASK,
>>> +		RTE_PTYPE_L4_MASK,
>>> +		RTE_PTYPE_TUNNEL_MASK,
>>> +		RTE_PTYPE_INNER_L2_MASK,
>>> +		RTE_PTYPE_INNER_L3_MASK,
>>> +		RTE_PTYPE_INNER_L4_MASK,
>>> +	};
>>> +	const uint32_t *all_ptypes;
>>> +	struct rte_eth_dev *dev;
>>> +	uint32_t unused_mask;
>>> +	unsigned int i, j;
>>> +	int ret;
>>> +
>>> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>>> +	dev = &rte_eth_devices[port_id];
>>> +
>>> +	if (num > 0 && set_ptypes == NULL)
>>> +		return -EINVAL;
>>> +
>>> +	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
>>> +			*dev->dev_ops->dev_ptypes_set == NULL) {
>>> +		ret = 0;
>>> +		goto ptype_unknown;
>>> +	}
>>
>> Hi Pavan, Andrew,
>>
>> Why API is not returning "-ENOTSUP" id dev_ops is not provided as done it other
>> APIs?
> 
> As I understand the reason behind it is an optional nature
> of the callback. It is just an optimization and there is no
> point to complicate applications code to check and treat
> -ENOTSUP is OK.

I was also thinking this is just an optimization but Jerin wants to call it
default in all samples first, now in testpmd by default.

Although it makes simple to ignore the error this way, I think it can be good to
differentiate the success, not implemented and failed cases.

> 
>>> +
>>> +	if (ptype_mask == 0) {
>>> +		ret = (*dev->dev_ops->dev_ptypes_set)(dev,
>>> +				ptype_mask);
>>> +		goto ptype_unknown;
>>> +	}
>>> +
>>> +	unused_mask = ptype_mask;
>>> +	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
>>> +		uint32_t mask = ptype_mask & valid_ptype_masks[i];
>>> +		if (mask && mask != valid_ptype_masks[i]) {
>>> +			ret = -EINVAL;
>>> +			goto ptype_unknown;
>>> +		}
>>> +		unused_mask &= ~valid_ptype_masks[i];
>>> +	}
>>
>> What does above block does?
>> Does it mean 'ptype_mask' only can be combination of 'valid_ptype_masks' items?
> 
> Yes.
> 
>> Let's say can't I set only 'RTE_PTYPE_L2_ETHER' as requested ptype?
> 
> Yes
> 
>> Why this limitation and is it documented anywhere, like the API documentation?
> 
> It is simply incorrect to have non-mask bits here.
> RTE_PTYPE_L2_ETHER & RTE_PTYPE_L2_ETHER_ARP != 0

Right.

> It is documented in the ptype_mask parameter description.

OK, I missed it in ptype_mask description.

> 
>>> +
>>> +	if (unused_mask) {
>>> +		ret = -EINVAL;
>>> +		goto ptype_unknown;
>>> +	}
>>> +
>>> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
>>> +	if (all_ptypes == NULL) {
>>> +		ret = 0;
>>> +		goto ptype_unknown;
>>> +	}
>>> +
>>> +	/*
>>> +	 * Accodommodate as many set_ptypes as possible. If the supplied
>>
>> s/Accodommodate/Accommodate
>>
>>> +	 * set_ptypes array is insufficient fill it partially.
>>> +	 */
>>> +	for (i = 0, j = 0; set_ptypes != NULL &&
>>> +				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
>>> +		if (ptype_mask & all_ptypes[i]) {
>>> +			if (j < num - 1) {
>>> +				set_ptypes[j] = all_ptypes[i];
>>> +				j++;
>>> +				continue;
>>> +			}
>>> +			break;
>>> +		}
>>> +	}
>>> +
>>> +	if (set_ptypes != NULL && j < num)
>>> +		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
>>> +
>>> +	return (*dev->dev_ops->dev_ptypes_set)(dev, ptype_mask);
>>
>> Only a question, at this stage API knows the supported ptypes by device, does it
>> make sense to check if 'ptype_mask' has anything unsupported instead of passing
>> it to the driver and expect driver to check it?
> 
> It is also explained by the nature of the API. Application says:
> I'm interested in the following ptypes only to let PMD know that
> it could drop classification behind it. If PMD does not support
> some layers, it will not provide classification anyway.

in "eth_dev_ptypes_set_t" documentation, it says:
 "- (-EINVAL) if *ptype_mask* is invalid."
I thought PMD does a check on received 'ptype_mask', if expectation is PMD will
do the check, why not do the check in API commonly instead of each PMD.
What is the documented case "*ptype_mask* is invalid."?

> 
>>> +
>>> +ptype_unknown:
>>> +	if (num > 0)
>>> +		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>>> +
>>> +	return ret;
>>> +}
>>> +
>>>  int
>>>  rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>>>  {
>>> @@ -2891,7 +2977,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>>>  	return 0;
>>>  }
>>>  
>>> -
>>>  int
>>>  rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
>>>  {
>>> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>>> index 44d77b332..a7872819d 100644
>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>> @@ -2604,6 +2604,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
>>>   */
>>>  int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>  				     uint32_t *ptypes, int num);
>>> +/**
>>> + * @warning
>>> + * @b EXPERIMENTAL: this API may change without prior notice.
>>> + *
>>> + * Inform Ethernet device about reduced range of packet types to handle.
>>> + *
>>> + * Application can use this function to set only specific ptypes that it's
>>> + * interested. This information can be used by the PMD to optimize Rx path.
>>> + *
>>> + * The function accepts an array `set_ptypes` allocated by the caller to
>>> + * store the packet types set by the driver, the last element of the array
>>> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
>>> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
>>> + * partially.
>>> + *
>>> + * @param port_id
>>> + *   The port identifier of the Ethernet device.
>>> + * @param ptype_mask
>>> + *   The ptype family that application is interested in should be bitwise OR of
>>> + *   RTE_PTYPE_*_MASK or 0.
>>
>> No strong opinion but is it really a mask? it doesn't used to mask any value,
>> but it is list of ptypes that application requests, in a bitwise ORed form, so I
>> this it can be ptypes.
> 
> See above.

OK, it is a mask really.

> 
>>> + * @param set_ptypes
>>> + *   An array pointer to store set packet types, allocated by caller. The
>>> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
>>
>> Not for this patch, but is an API also required to get current supported ptypes
>> from the driver? Even application keeps this list, something can reset in the
>> device/driver, supported pytpe list can be changed and it can differ with what
>> application knows.
> 
> I would say that set_ptypes should not affected supported_ptypes.

I expect same. I was asking should we have an API that returns list of ptypes
returned by PMD after 'rte_eth_dev_set_ptypes()' call? Can we know that list
without a new API?

> 
>>> + * @param num
>>> + *   Size of the array pointed by param ptypes.
>>> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
>>> + *   set ptypes.
>>> + * @return
>>> + *   - (0) if Success.
>>> + *   - (-ENODEV) if *port_id* invalid.
>>> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
>>> + *     num > 0.
>>> + */
>>> +__rte_experimental
>>> +int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>> +			   uint32_t *set_ptypes, unsigned int num);
>>>  
>>>  /**
>>>   * Retrieve the MTU of an Ethernet device.
>>> diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
>>> index f215af7c9..657c39b56 100644
>>> --- a/lib/librte_ethdev/rte_ethdev_core.h
>>> +++ b/lib/librte_ethdev/rte_ethdev_core.h
>>> @@ -234,6 +234,22 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
>>>  typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
>>>  /**< @internal Get supported ptypes of an Ethernet device. */
>>>  
>>> +/**
>>> + * @internal
>>> + * Inform Ethernet device about reduced range of packet types to handle.
>>> + *
>>> + * @param dev
>>> + *   The Ethernet device identifier.
>>> + * @param ptype_mask
>>> + *   The ptype family that application is interested in should be bitwise OR of
>>> + *   RTE_PTYPE_*_MASK or 0.
>>> + * @return
>>> + *   - (0) if Success.
>>> + *   - (-EINVAL) if *ptype_mask* is invalid.
>>> + */
>>> +typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev,
>>> +				     uint32_t ptype_mask);
>>> +
>>>  typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
>>>  				    uint16_t queue_id);
>>>  /**< @internal Start rx and tx of a queue of an Ethernet device. */
>>> @@ -630,6 +646,8 @@ struct eth_dev_ops {
>>>  	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
>>>  	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
>>>  	/**< Get packet types supported and identified by device. */
>>> +	eth_dev_ptypes_set_t dev_ptypes_set;
>>> +	/**< Inform Ethernet device about reduced range of packet types to handle. */
>>>  
>>>  	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
>>>  	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
>>> diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
>>> index ee289ef13..ccfbeae23 100644
>>> --- a/lib/librte_ethdev/rte_ethdev_version.map
>>> +++ b/lib/librte_ethdev/rte_ethdev_version.map
>>> @@ -292,4 +292,5 @@ EXPERIMENTAL {
>>>  	rte_flow_dynf_metadata_offs;
>>>  	rte_flow_dynf_metadata_mask;
>>>  	rte_flow_dynf_metadata_register;
>>> +	rte_eth_dev_set_ptypes;
>>>  };
>>>
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-07  6:56                                                       ` Matan Azrad
@ 2019-11-08 10:12                                                         ` Andrew Rybchenko
  2019-11-08 10:29                                                           ` Matan Azrad
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-08 10:12 UTC (permalink / raw)
  To: Matan Azrad, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev

On 11/7/19 9:56 AM, Matan Azrad wrote:
> Hi
> 
> From: Andrew Rybchenko
>> On 11/6/19 9:58 AM, Matan Azrad wrote:
>>>
>>>
>>> From: Andrew Rybchenko
>>>> On 11/5/19 5:05 PM, Matan Azrad wrote:
>>>>> From: Andrew Rybchenko
>>>>>> On 11/3/19 6:16 PM, Matan Azrad wrote
>>>>>>> From: Andrew Rybchenko
>>>>>>>> On 11/3/19 9:57 AM, Matan Azrad wrote:
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> From: Andrew Rybchenko
>>>>>>>>>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula
>>>>>>>>>> wrote:
>>>>>>>>>>>> From: Pavan Nikhilesh Bhagavatula
>>>>>>>>>>>>> Hi Matan,
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi Pavan
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> From: Pavan Nikhilesh
>>>>>>>>>>>>>> <pbhagavatula@marvell.com>
>>>>>>>>>>>>>>> Some PMDs cannot work when certain offloads are
>>>>>>>>>>>>>>> enable/disabled, as a workaround PMDs auto enable/disable
>>>>>>>>>>>>>>> offloads internally and expose it through
>>>>>>>>>>>>>>> dev->data-dev_conf.rxmode.offloads.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> After device specific dev_configure is called compare the
>>>>>>>>>>>>>>> requested offloads to the offloads exposed by the PMD and,
>>>>>>>>>>>>>>> if the PMD failed to enable a given offload then log it
>>>>>>>>>>>>>>> and return -EINVAL from rte_eth_dev_configure, else if the
>>>>>>>>>>>>>>> PMD failed to disable a given offload log and continue
>>>>>>>>>>>>>>> with rte_eth_dev_configure.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> rte_eth_dev_configure can be called more than 1 time in the
>>>>>>>>>>>>>> device life time, How can you know what is the minimum
>>>>>>>>>>>>>> offload configurations required by the port after the first
>>>>>>>>>>>>>> call?
>>>>>>>>>>>>>> Maybe putting it in dev info is better, what do you think?
>>>>>>>>>>>>>>
>>>>>>>>>>>>> We only return -EINVAL in the case where we enable an
>>>>>>>>>>>>> offload advertised by dev_info and the port still fails to
>>>>>>>>>>>>> enable it.
>>>>>>>>>>>> Are you sure it is ok that devices may disable\enable
>>>>>>>>>>>> offloads under the hood without user notification?
>>>>>>>>>>> Some devices already do it. The above check adds validation
>>>>>>>>>>> for the same.
>>>>>>>>>> The problem is that some offloads cannot be disabled.
>>>>>>>>> Yes, I understand it.
>>>>>>>>>
>>>>>>>>>> If application does not request Rx checksum offload since it
>>>>>>>>>> does use it, it is not a problem to report it.
>>>>>>>>> Yes, for RX checksum I tend to agree that application doesn't
>>>>>>>>> care if the
>>>>>>>> PMD will calculate the checksum in spite of the offload is
>>>>>>>> disabled.
>>>>>>>>>
>>>>>>>>> But what's about other offloads: For example in RX: LRO,
>>>>>>>>> CRC_KEEP, VLAN_STRIP, JUMBO If the PMD will stay them on while
>>>>>>>>> the app is disabling it, It can cause a problems to the
>>>>>>>> application (affects the packet length).
>>>>>>>>
>>>>>>>> Yes, I agree that some offloads are critical to be disabled, but
>>>>>>>> RSS_HASH discussed in the changeset is not critical.
>>>>>>>
>>>>>>> So, are you agree It should not be checked globally for all the
>>>>>>> offloads in
>>>>>> ethdev layer?
>>>>>>
>>>>>> If offload is not requested, but enabled (since PMD cannot disable
>>>>>> it), right not it will not fail configure, but warn about it in
>>>>>> logs.
>>>>>>
>>>>>
>>>>> In this case warning print is not enough since it can be critical
>>>>> for the
>>>> application for some offloads.
>>>>> It can be very weird for the application to see that some offload
>>>>> are on
>>>> while the application doesn't expect them to be on.
>>>>> it even can cause app crash(at least for the RX offload I wrote
>>>>> above).
>>>>
>>>> The patch improves the situation. Earlier it was silent, now it will
>>>> be at least visible.
>>>
>>> We can do it visible inside the limited PMDs.
>>
>> Why?
> 
> Because this is not according to what application should understand from the ethdev API. 

It does not answer why it should be inside the limited PMDs instead
of ethdev layer.

>>>> I'm afraid that in 19.11 release cycle we cannot change it to fail
>>>> dev_configure. I think it will be too destructive. Future improvement
>>>> should be discussed separately.
>>>
>>> So we can remove this ethdev patch now and let the PMD to do it until
>>> we will find better solution later.
>>
>> Sorry, but I don't think so.
>>
>>>>>>> It even be more problematic if the dynamic offload field in mbuf
>>>>>>> is not exist at all.
>>>>>
>>>>> Any answer here?
>>>
>>> A Rx offload requires dynamic mbuf field cannot stay visible while the
>>> app disabling it. Because the dynamic mbuf field probably is not set
>>> in the mbuf. May cause problems.
>>>
>>>> Please, clarify the question.
>>>>
> 
> No answer here.

Sorry, but I don't understand the problem.
If there is no dynamic field, it will not be set.
If there is dynamic field, it is the same as regular fields.

>>>>>>>>
>>>>>>>>> For example in TX: TSO, VLAN, MULTI_SEG.....
>>>>>>>>
>>>>>>>> Tx is not that critical since application should not request
>>>>>>>> these offloads per- packet. Tx offloads are mainly required to
>>>>>>>> ensure that application may request the offload per packet and it
>>>>>>>> will be done.
>>>>>>>
>>>>>>> yes, you right, In TX it looks less critical (for now).
>>>>>>>
>>>>>>>>
>>>>>>>>>> Of course, it could be a problem if the offload is used, but
>>>>>>>>>> application wants to disable it, for example, for debugging
>>>>>>>>>> purposes. In this case, the solution is to mask offloads on
>>>>>>>>>> application level, which is not ideal as well.
>>>>>>>>> Why not ideal?
>>>>>>>>
>>>>>>>> It eats CPU cycles.
>>>>>>>
>>>>>>> Sorry, I don't understand your use case here.
>>>>>>
>>>>>> If application wants to try code path without, for example, Rx
>>>>>> checksum offload, it could be insufficient to disable the offload
>>>>>> right now, but also required to cleanup offload results flags in
>>>>>> each mbuf (if PMD does not support the offload disabling).
>>>>>
>>>>> What is "right now"? Configuration time?
>>>>
>>>> Right now is the current state of some drivers in DPDK tree.
>>>>
>>>
>>> OK. I think the offload configuration is in configuration time. No
>>> data-path.
>>>
>>>>> If application will know that PMD cannot disable the rx-checksum in
>>>>> configuration time, It can plan to not clean this flag in mbuf for
>>>>> each rx
>>>> mbuf.
>>>>
>>>> Yes and application has a way to know it - take a look at
>>>> dev->data->dev_conf.rxmode.offloads.
>>>
>>> As I understand, before this patch, this field used for ethdev layer
>>> knowledge to track on the application Rx offload configuration. Am I
>>> wrong?
>>
>> I think it is just Rx offloads configuration.
>> It is better to have real offloads here since it is used on Rx queue setup to
>> mask already enabled offloads.
> 
> And in DPDK or any SW management controls a device, the configuration must be set by the user.
> So, it should reflect the user configuration as is.

It is ideal world which is unfortunately too far from real life.
There is always a trade off. It is possible to define too restrictive
interface which will enforce complicated implementation with bad
performance characteristics for no real value.

In any case, the patch simply makes the difference visible.
It does not enforce any rules except to fail configure if
requested offload is not enabled which is a strong violation
of the interface. If you don't like it, we can discuss
the point. In the area of not requested but enabled offloads,
it just adds logs. No changes in behaviour. I'm strongly
against making it hard failure in 19.11 since it is too late
for the decision. We can discuss it later separately from
the patch.

>>> And If the meaning is the PMD configuration set (which weirdly can be
>>> different from what application want) I think it should be an error -
>>> because app doesn't follow the API.
>>
>> Which app? Which API?
> 
> App - the dpdk application which configures an offload that cannot be masked.
> API - The Rx offload field in the ethdev data (which weirdly means what was configured by the PMD).

See above.

>>>>> It looks me like PMD limitation which can be solved by 2
>>>>> options: 1. Capability information which say to the app what offload
>>>>> may not be disabled.
>>>>> 2. Add limitation in the PMD documentation and print warning\error
>>>>> massage from the PMD.
>>>>
>>>> Yes, right now we are going way (2).
>>>>
>>>>>>>>> If application can know the limitation of offloads disabling
>>>>>>>>> (for example to
>>>>>>>> read capability on it)
>>>>>>>>> The application has all information to take decisions.
>>>>>>>>>
>>>>>>>>>> Anyway, the patch just tries to highlight difference of applied
>>>>>>>>>> from requested. So, it is a step forward. Also, the patch will
>>>>>>>>>> fail configure if an offload is requested, but not
>>>>>>>> enabled.
>>>>>>>>>>
>>>>>>>>>>>> Can't it break applications? Why does the device expose
>>>>>>>>>>>> unsupported offloads in dev info? Does it update the running
>>>>>>>>>>>> offload usynchronically? Race?
>>>>>>>>>>>> Can you explain also your specific use case?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>> Matan
>>>>>>>
>>>>>
>>>
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 1/8] ethdev: add set ptype function
  2019-11-08  9:52                                   ` Ferruh Yigit
@ 2019-11-08 10:24                                     ` Andrew Rybchenko
  2019-11-08 11:05                                       ` Ferruh Yigit
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-08 10:24 UTC (permalink / raw)
  To: Ferruh Yigit, pbhagavatula, jerinj, thomas, John McNamara,
	Marko Kovacevic
  Cc: dev

On 11/8/19 12:52 PM, Ferruh Yigit wrote:
> On 11/8/2019 9:05 AM, Andrew Rybchenko wrote:
>> On 11/7/19 9:28 PM, Ferruh Yigit wrote:
>>> On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>>
>>>> Add `rte_eth_dev_set_ptypes` function that will allow the application
>>>> to inform the PMD about reduced range of packet types to handle.
>>>> Based on the ptypes set PMDs can optimize their Rx path.
>>>>
>>>> -If application doesn’t want any ptype information it can call
>>>> `rte_eth_dev_set_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
>>>> and PMD may skip packet type processing and set rte_mbuf::packet_type to
>>>> RTE_PTYPE_UNKNOWN.
>>>>
>>>> -If application doesn’t call `rte_eth_dev_set_ptypes` PMD can return
>>>> `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>>>>
>>>> -If application is interested only in L2/L3 layer, it can inform the PMD
>>>> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
>>>> `rte_eth_dev_set_ptypes(ethdev_id,
>>>> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>>>>
>>>> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>>>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>>> ---
>>>>  doc/guides/nics/features.rst             |  7 +-
>>>>  doc/guides/rel_notes/release_19_11.rst   |  8 +++
>>>>  lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
>>>>  lib/librte_ethdev/rte_ethdev.h           | 36 ++++++++++
>>>>  lib/librte_ethdev/rte_ethdev_core.h      | 18 +++++
>>>>  lib/librte_ethdev/rte_ethdev_version.map |  1 +
>>>>  6 files changed, 154 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
>>>> index 7a31cf7c8..f33e8e6d4 100644
>>>> --- a/doc/guides/nics/features.rst
>>>> +++ b/doc/guides/nics/features.rst
>>>> @@ -583,9 +583,12 @@ Packet type parsing
>>>>  -------------------
>>>>  
>>>>  Supports packet type parsing and returns a list of supported types.
>>>> +Allows application to set ptypes it is interested in.
>>>>  
>>>> -* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
>>>> -* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
>>>> +* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
>>>> +* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
>>>> +  ``rte_eth_dev_set_ptypes()``, ``dev_ptypes_set``.
>>>> +* **[provides]   mbuf**: ``mbuf.packet_type``.
>>>>  
>>>>  
>>>>  .. _nic_features_timesync:
>>>> diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
>>>> index 23182d187..2fa54aadc 100644
>>>> --- a/doc/guides/rel_notes/release_19_11.rst
>>>> +++ b/doc/guides/rel_notes/release_19_11.rst
>>>> @@ -86,6 +86,13 @@ New Features
>>>>    SET_TAG action and TAG item have been added to support transient flow
>>>>    tag.
>>>>  
>>>> +* **Added ethdev API to set supported packet types**
>>>> +
>>>> +  * Added new API ``rte_eth_dev_set_ptypes`` that allows an application to
>>>> +    inform PMD about about reduced range of packet types to handle.
>>>> +  * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
>>>> +    and thereby improve Rx performance if application wishes do so.
>>>> +
>>>>  * **Updated the enic driver.**
>>>>  
>>>>    * Added support for Geneve with options offload.
>>>> @@ -258,6 +265,7 @@ New Features
>>>>    * Rx metadata is delivered to host via a dynamic field of ``rte_mbuf`` with
>>>>      PKT_RX_DYNF_METADATA.
>>>>  
>>>> +
>>>>  Removed Items
>>>>  -------------
>>>>  
>>>> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
>>>> index 652c369e5..13e6daaf4 100644
>>>> --- a/lib/librte_ethdev/rte_ethdev.c
>>>> +++ b/lib/librte_ethdev/rte_ethdev.c
>>>> @@ -2879,6 +2879,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>>  	return j;
>>>>  }
>>>>  
>>>> +int
>>>> +rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>> +				 uint32_t *set_ptypes, unsigned int num)
>>>> +{
>>>> +	const uint32_t valid_ptype_masks[] = {
>>>> +		RTE_PTYPE_L2_MASK,
>>>> +		RTE_PTYPE_L3_MASK,
>>>> +		RTE_PTYPE_L4_MASK,
>>>> +		RTE_PTYPE_TUNNEL_MASK,
>>>> +		RTE_PTYPE_INNER_L2_MASK,
>>>> +		RTE_PTYPE_INNER_L3_MASK,
>>>> +		RTE_PTYPE_INNER_L4_MASK,
>>>> +	};
>>>> +	const uint32_t *all_ptypes;
>>>> +	struct rte_eth_dev *dev;
>>>> +	uint32_t unused_mask;
>>>> +	unsigned int i, j;
>>>> +	int ret;
>>>> +
>>>> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>>>> +	dev = &rte_eth_devices[port_id];
>>>> +
>>>> +	if (num > 0 && set_ptypes == NULL)
>>>> +		return -EINVAL;
>>>> +
>>>> +	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
>>>> +			*dev->dev_ops->dev_ptypes_set == NULL) {
>>>> +		ret = 0;
>>>> +		goto ptype_unknown;
>>>> +	}
>>>
>>> Hi Pavan, Andrew,
>>>
>>> Why API is not returning "-ENOTSUP" id dev_ops is not provided as done it other
>>> APIs?
>>
>> As I understand the reason behind it is an optional nature
>> of the callback. It is just an optimization and there is no
>> point to complicate applications code to check and treat
>> -ENOTSUP is OK.
> 
> I was also thinking this is just an optimization but Jerin wants to call it
> default in all samples first, now in testpmd by default.

Why the optimization should not be applied in all samples?
If sample does not use ptype information it may and should
be applied since we are all keen for the best possible
performance.

> Although it makes simple to ignore the error this way, I think it can be good to
> differentiate the success, not implemented and failed cases.

No, it simplifies error tracking. We can check return value and
if it is not zero say that it goes wrong (instead of not zero and
not -ENOTSUP).

>>
>>>> +
>>>> +	if (ptype_mask == 0) {
>>>> +		ret = (*dev->dev_ops->dev_ptypes_set)(dev,
>>>> +				ptype_mask);
>>>> +		goto ptype_unknown;
>>>> +	}
>>>> +
>>>> +	unused_mask = ptype_mask;
>>>> +	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
>>>> +		uint32_t mask = ptype_mask & valid_ptype_masks[i];
>>>> +		if (mask && mask != valid_ptype_masks[i]) {
>>>> +			ret = -EINVAL;
>>>> +			goto ptype_unknown;
>>>> +		}
>>>> +		unused_mask &= ~valid_ptype_masks[i];
>>>> +	}
>>>
>>> What does above block does?
>>> Does it mean 'ptype_mask' only can be combination of 'valid_ptype_masks' items?
>>
>> Yes.
>>
>>> Let's say can't I set only 'RTE_PTYPE_L2_ETHER' as requested ptype?
>>
>> Yes
>>
>>> Why this limitation and is it documented anywhere, like the API documentation?
>>
>> It is simply incorrect to have non-mask bits here.
>> RTE_PTYPE_L2_ETHER & RTE_PTYPE_L2_ETHER_ARP != 0
> 
> Right.
> 
>> It is documented in the ptype_mask parameter description.
> 
> OK, I missed it in ptype_mask description.
> 
>>
>>>> +
>>>> +	if (unused_mask) {
>>>> +		ret = -EINVAL;
>>>> +		goto ptype_unknown;
>>>> +	}
>>>> +
>>>> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
>>>> +	if (all_ptypes == NULL) {
>>>> +		ret = 0;
>>>> +		goto ptype_unknown;
>>>> +	}
>>>> +
>>>> +	/*
>>>> +	 * Accodommodate as many set_ptypes as possible. If the supplied
>>>
>>> s/Accodommodate/Accommodate
>>>
>>>> +	 * set_ptypes array is insufficient fill it partially.
>>>> +	 */
>>>> +	for (i = 0, j = 0; set_ptypes != NULL &&
>>>> +				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
>>>> +		if (ptype_mask & all_ptypes[i]) {
>>>> +			if (j < num - 1) {
>>>> +				set_ptypes[j] = all_ptypes[i];
>>>> +				j++;
>>>> +				continue;
>>>> +			}
>>>> +			break;
>>>> +		}
>>>> +	}
>>>> +
>>>> +	if (set_ptypes != NULL && j < num)
>>>> +		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
>>>> +
>>>> +	return (*dev->dev_ops->dev_ptypes_set)(dev, ptype_mask);
>>>
>>> Only a question, at this stage API knows the supported ptypes by device, does it
>>> make sense to check if 'ptype_mask' has anything unsupported instead of passing
>>> it to the driver and expect driver to check it?
>>
>> It is also explained by the nature of the API. Application says:
>> I'm interested in the following ptypes only to let PMD know that
>> it could drop classification behind it. If PMD does not support
>> some layers, it will not provide classification anyway.
> 
> in "eth_dev_ptypes_set_t" documentation, it says:
>  "- (-EINVAL) if *ptype_mask* is invalid."
> I thought PMD does a check on received 'ptype_mask', if expectation is PMD will
> do the check, why not do the check in API commonly instead of each PMD.
> What is the documented case "*ptype_mask* is invalid."?

Not a combination of RTE_PTYPE_*_MASK.
There are few cases above where -EINVAL is returned includes failed
validation of ptype_mask.

>>
>>>> +
>>>> +ptype_unknown:
>>>> +	if (num > 0)
>>>> +		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>>>> +
>>>> +	return ret;
>>>> +}
>>>> +
>>>>  int
>>>>  rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>>>>  {
>>>> @@ -2891,7 +2977,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>>>>  	return 0;
>>>>  }
>>>>  
>>>> -
>>>>  int
>>>>  rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
>>>>  {
>>>> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>>>> index 44d77b332..a7872819d 100644
>>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>>> @@ -2604,6 +2604,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
>>>>   */
>>>>  int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>>  				     uint32_t *ptypes, int num);
>>>> +/**
>>>> + * @warning
>>>> + * @b EXPERIMENTAL: this API may change without prior notice.
>>>> + *
>>>> + * Inform Ethernet device about reduced range of packet types to handle.
>>>> + *
>>>> + * Application can use this function to set only specific ptypes that it's
>>>> + * interested. This information can be used by the PMD to optimize Rx path.
>>>> + *
>>>> + * The function accepts an array `set_ptypes` allocated by the caller to
>>>> + * store the packet types set by the driver, the last element of the array
>>>> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
>>>> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
>>>> + * partially.
>>>> + *
>>>> + * @param port_id
>>>> + *   The port identifier of the Ethernet device.
>>>> + * @param ptype_mask
>>>> + *   The ptype family that application is interested in should be bitwise OR of
>>>> + *   RTE_PTYPE_*_MASK or 0.
>>>
>>> No strong opinion but is it really a mask? it doesn't used to mask any value,
>>> but it is list of ptypes that application requests, in a bitwise ORed form, so I
>>> this it can be ptypes.
>>
>> See above.
> 
> OK, it is a mask really.
> 
>>
>>>> + * @param set_ptypes
>>>> + *   An array pointer to store set packet types, allocated by caller. The
>>>> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
>>>
>>> Not for this patch, but is an API also required to get current supported ptypes
>>> from the driver? Even application keeps this list, something can reset in the
>>> device/driver, supported pytpe list can be changed and it can differ with what
>>> application knows.
>>
>> I would say that set_ptypes should not affected supported_ptypes.
> 
> I expect same. I was asking should we have an API that returns list of ptypes
> returned by PMD after 'rte_eth_dev_set_ptypes()' call? Can we know that list
> without a new API?

As I understand the only way right now is to get on when ptypes are set.
I would add _get_ptypes() function when it is really required only.

>>
>>>> + * @param num
>>>> + *   Size of the array pointed by param ptypes.
>>>> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
>>>> + *   set ptypes.
>>>> + * @return
>>>> + *   - (0) if Success.
>>>> + *   - (-ENODEV) if *port_id* invalid.
>>>> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
>>>> + *     num > 0.
>>>> + */
>>>> +__rte_experimental
>>>> +int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>> +			   uint32_t *set_ptypes, unsigned int num);
>>>>  
>>>>  /**
>>>>   * Retrieve the MTU of an Ethernet device.
>>>> diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
>>>> index f215af7c9..657c39b56 100644
>>>> --- a/lib/librte_ethdev/rte_ethdev_core.h
>>>> +++ b/lib/librte_ethdev/rte_ethdev_core.h
>>>> @@ -234,6 +234,22 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
>>>>  typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
>>>>  /**< @internal Get supported ptypes of an Ethernet device. */
>>>>  
>>>> +/**
>>>> + * @internal
>>>> + * Inform Ethernet device about reduced range of packet types to handle.
>>>> + *
>>>> + * @param dev
>>>> + *   The Ethernet device identifier.
>>>> + * @param ptype_mask
>>>> + *   The ptype family that application is interested in should be bitwise OR of
>>>> + *   RTE_PTYPE_*_MASK or 0.
>>>> + * @return
>>>> + *   - (0) if Success.
>>>> + *   - (-EINVAL) if *ptype_mask* is invalid.
>>>> + */
>>>> +typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev,
>>>> +				     uint32_t ptype_mask);
>>>> +
>>>>  typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
>>>>  				    uint16_t queue_id);
>>>>  /**< @internal Start rx and tx of a queue of an Ethernet device. */
>>>> @@ -630,6 +646,8 @@ struct eth_dev_ops {
>>>>  	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
>>>>  	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
>>>>  	/**< Get packet types supported and identified by device. */
>>>> +	eth_dev_ptypes_set_t dev_ptypes_set;
>>>> +	/**< Inform Ethernet device about reduced range of packet types to handle. */
>>>>  
>>>>  	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
>>>>  	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
>>>> diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
>>>> index ee289ef13..ccfbeae23 100644
>>>> --- a/lib/librte_ethdev/rte_ethdev_version.map
>>>> +++ b/lib/librte_ethdev/rte_ethdev_version.map
>>>> @@ -292,4 +292,5 @@ EXPERIMENTAL {
>>>>  	rte_flow_dynf_metadata_offs;
>>>>  	rte_flow_dynf_metadata_mask;
>>>>  	rte_flow_dynf_metadata_register;
>>>> +	rte_eth_dev_set_ptypes;
>>>>  };
>>>>
>>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-08 10:12                                                         ` Andrew Rybchenko
@ 2019-11-08 10:29                                                           ` Matan Azrad
  2019-11-08 11:24                                                             ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Matan Azrad @ 2019-11-08 10:29 UTC (permalink / raw)
  To: Andrew Rybchenko, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev



From: Andrew Rybchenko
> Sent: Friday, November 8, 2019 12:12 PM
> To: Matan Azrad <matan@mellanox.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>; ferruh.yigit@intel.com; Jerin Jacob
> Kollanukkaran <jerinj@marvell.com>; Thomas Monjalon
> <thomas@monjalon.net>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads
> set by PMD
> 
> On 11/7/19 9:56 AM, Matan Azrad wrote:
> > Hi
> >
> > From: Andrew Rybchenko
> >> On 11/6/19 9:58 AM, Matan Azrad wrote:
> >>>
> >>>
> >>> From: Andrew Rybchenko
> >>>> On 11/5/19 5:05 PM, Matan Azrad wrote:
> >>>>> From: Andrew Rybchenko
> >>>>>> On 11/3/19 6:16 PM, Matan Azrad wrote
> >>>>>>> From: Andrew Rybchenko
> >>>>>>>> On 11/3/19 9:57 AM, Matan Azrad wrote:
> >>>>>>>>> Hi
> >>>>>>>>>
> >>>>>>>>> From: Andrew Rybchenko
> >>>>>>>>>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula
> >>>>>>>>>> wrote:
> >>>>>>>>>>>> From: Pavan Nikhilesh Bhagavatula
> >>>>>>>>>>>>> Hi Matan,
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>> Hi Pavan
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> From: Pavan Nikhilesh
> >>>>>>>>>>>>>> <pbhagavatula@marvell.com>
> >>>>>>>>>>>>>>> Some PMDs cannot work when certain offloads are
> >>>>>>>>>>>>>>> enable/disabled, as a workaround PMDs auto
> >>>>>>>>>>>>>>> enable/disable offloads internally and expose it through
> >>>>>>>>>>>>>>> dev->data-dev_conf.rxmode.offloads.
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> After device specific dev_configure is called compare
> >>>>>>>>>>>>>>> the requested offloads to the offloads exposed by the
> >>>>>>>>>>>>>>> PMD and, if the PMD failed to enable a given offload
> >>>>>>>>>>>>>>> then log it and return -EINVAL from
> >>>>>>>>>>>>>>> rte_eth_dev_configure, else if the PMD failed to disable
> >>>>>>>>>>>>>>> a given offload log and continue with
> rte_eth_dev_configure.
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>> rte_eth_dev_configure can be called more than 1 time in
> >>>>>>>>>>>>>> the device life time, How can you know what is the
> >>>>>>>>>>>>>> minimum offload configurations required by the port after
> >>>>>>>>>>>>>> the first call?
> >>>>>>>>>>>>>> Maybe putting it in dev info is better, what do you think?
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>> We only return -EINVAL in the case where we enable an
> >>>>>>>>>>>>> offload advertised by dev_info and the port still fails to
> >>>>>>>>>>>>> enable it.
> >>>>>>>>>>>> Are you sure it is ok that devices may disable\enable
> >>>>>>>>>>>> offloads under the hood without user notification?
> >>>>>>>>>>> Some devices already do it. The above check adds validation
> >>>>>>>>>>> for the same.
> >>>>>>>>>> The problem is that some offloads cannot be disabled.
> >>>>>>>>> Yes, I understand it.
> >>>>>>>>>
> >>>>>>>>>> If application does not request Rx checksum offload since it
> >>>>>>>>>> does use it, it is not a problem to report it.
> >>>>>>>>> Yes, for RX checksum I tend to agree that application doesn't
> >>>>>>>>> care if the
> >>>>>>>> PMD will calculate the checksum in spite of the offload is
> >>>>>>>> disabled.
> >>>>>>>>>
> >>>>>>>>> But what's about other offloads: For example in RX: LRO,
> >>>>>>>>> CRC_KEEP, VLAN_STRIP, JUMBO If the PMD will stay them on
> while
> >>>>>>>>> the app is disabling it, It can cause a problems to the
> >>>>>>>> application (affects the packet length).
> >>>>>>>>
> >>>>>>>> Yes, I agree that some offloads are critical to be disabled,
> >>>>>>>> but RSS_HASH discussed in the changeset is not critical.
> >>>>>>>
> >>>>>>> So, are you agree It should not be checked globally for all the
> >>>>>>> offloads in
> >>>>>> ethdev layer?
> >>>>>>
> >>>>>> If offload is not requested, but enabled (since PMD cannot
> >>>>>> disable it), right not it will not fail configure, but warn about
> >>>>>> it in logs.
> >>>>>>
> >>>>>
> >>>>> In this case warning print is not enough since it can be critical
> >>>>> for the
> >>>> application for some offloads.
> >>>>> It can be very weird for the application to see that some offload
> >>>>> are on
> >>>> while the application doesn't expect them to be on.
> >>>>> it even can cause app crash(at least for the RX offload I wrote
> >>>>> above).
> >>>>
> >>>> The patch improves the situation. Earlier it was silent, now it
> >>>> will be at least visible.
> >>>
> >>> We can do it visible inside the limited PMDs.
> >>
> >> Why?
> >
> > Because this is not according to what application should understand from
> the ethdev API.
> 
> It does not answer why it should be inside the limited PMDs instead of
> ethdev layer.

Why not?
Application doesn't expect to it and it may affect it.

> >>>> I'm afraid that in 19.11 release cycle we cannot change it to fail
> >>>> dev_configure. I think it will be too destructive. Future
> >>>> improvement should be discussed separately.
> >>>
> >>> So we can remove this ethdev patch now and let the PMD to do it
> >>> until we will find better solution later.
> >>
> >> Sorry, but I don't think so.
> >>
> >>>>>>> It even be more problematic if the dynamic offload field in mbuf
> >>>>>>> is not exist at all.
> >>>>>
> >>>>> Any answer here?
> >>>
> >>> A Rx offload requires dynamic mbuf field cannot stay visible while
> >>> the app disabling it. Because the dynamic mbuf field probably is not
> >>> set in the mbuf. May cause problems.
> >>>
> >>>> Please, clarify the question.
> >>>>
> >
> > No answer here.
> 
> Sorry, but I don't understand the problem.
> If there is no dynamic field, it will not be set.
Why not? The offload is enabled for the PMD perspective.

> If there is dynamic field, it is the same as regular fields.
> 
> >>>>>>>>
> >>>>>>>>> For example in TX: TSO, VLAN, MULTI_SEG.....
> >>>>>>>>
> >>>>>>>> Tx is not that critical since application should not request
> >>>>>>>> these offloads per- packet. Tx offloads are mainly required to
> >>>>>>>> ensure that application may request the offload per packet and
> >>>>>>>> it will be done.
> >>>>>>>
> >>>>>>> yes, you right, In TX it looks less critical (for now).
> >>>>>>>
> >>>>>>>>
> >>>>>>>>>> Of course, it could be a problem if the offload is used, but
> >>>>>>>>>> application wants to disable it, for example, for debugging
> >>>>>>>>>> purposes. In this case, the solution is to mask offloads on
> >>>>>>>>>> application level, which is not ideal as well.
> >>>>>>>>> Why not ideal?
> >>>>>>>>
> >>>>>>>> It eats CPU cycles.
> >>>>>>>
> >>>>>>> Sorry, I don't understand your use case here.
> >>>>>>
> >>>>>> If application wants to try code path without, for example, Rx
> >>>>>> checksum offload, it could be insufficient to disable the offload
> >>>>>> right now, but also required to cleanup offload results flags in
> >>>>>> each mbuf (if PMD does not support the offload disabling).
> >>>>>
> >>>>> What is "right now"? Configuration time?
> >>>>
> >>>> Right now is the current state of some drivers in DPDK tree.
> >>>>
> >>>
> >>> OK. I think the offload configuration is in configuration time. No
> >>> data-path.
> >>>
> >>>>> If application will know that PMD cannot disable the rx-checksum
> >>>>> in configuration time, It can plan to not clean this flag in mbuf
> >>>>> for each rx
> >>>> mbuf.
> >>>>
> >>>> Yes and application has a way to know it - take a look at
> >>>> dev->data->dev_conf.rxmode.offloads.
> >>>
> >>> As I understand, before this patch, this field used for ethdev layer
> >>> knowledge to track on the application Rx offload configuration. Am I
> >>> wrong?
> >>
> >> I think it is just Rx offloads configuration.
> >> It is better to have real offloads here since it is used on Rx queue
> >> setup to mask already enabled offloads.
> >
> > And in DPDK or any SW management controls a device, the configuration
> must be set by the user.
> > So, it should reflect the user configuration as is.
> 
> It is ideal world which is unfortunately too far from real life.
> There is always a trade off. It is possible to define too restrictive interface
> which will enforce complicated implementation with bad performance
> characteristics for no real value.
> 
> In any case, the patch simply makes the difference visible.
> It does not enforce any rules except to fail configure if requested offload is
> not enabled which is a strong violation of the interface. If you don't like it, we
> can discuss the point. In the area of not requested but enabled offloads, it
> just adds logs. No changes in behaviour. I'm strongly against making it hard
> failure in 19.11 since it is too late for the decision. We can discuss it later
> separately from the patch.
> 
While I don't agree with the patch and the idea here,  we can continue discuss later.
I think we understand the ideas of both of us and we can dig to it later. 


> >>> And If the meaning is the PMD configuration set (which weirdly can
> >>> be different from what application want) I think it should be an
> >>> error - because app doesn't follow the API.
> >>
> >> Which app? Which API?
> >
> > App - the dpdk application which configures an offload that cannot be
> masked.
> > API - The Rx offload field in the ethdev data (which weirdly means what
> was configured by the PMD).
> 
> See above.
> 
> >>>>> It looks me like PMD limitation which can be solved by 2
> >>>>> options: 1. Capability information which say to the app what
> >>>>> offload may not be disabled.
> >>>>> 2. Add limitation in the PMD documentation and print warning\error
> >>>>> massage from the PMD.
> >>>>
> >>>> Yes, right now we are going way (2).
> >>>>
> >>>>>>>>> If application can know the limitation of offloads disabling
> >>>>>>>>> (for example to
> >>>>>>>> read capability on it)
> >>>>>>>>> The application has all information to take decisions.
> >>>>>>>>>
> >>>>>>>>>> Anyway, the patch just tries to highlight difference of
> >>>>>>>>>> applied from requested. So, it is a step forward. Also, the
> >>>>>>>>>> patch will fail configure if an offload is requested, but not
> >>>>>>>> enabled.
> >>>>>>>>>>
> >>>>>>>>>>>> Can't it break applications? Why does the device expose
> >>>>>>>>>>>> unsupported offloads in dev info? Does it update the
> >>>>>>>>>>>> running offload usynchronically? Race?
> >>>>>>>>>>>> Can you explain also your specific use case?
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>>> Matan
> >>>>>>>
> >>>>>
> >>>
> >


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 1/8] ethdev: add set ptype function
  2019-11-08 10:24                                     ` Andrew Rybchenko
@ 2019-11-08 11:05                                       ` Ferruh Yigit
  2019-11-08 11:40                                         ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-08 11:05 UTC (permalink / raw)
  To: Andrew Rybchenko, pbhagavatula, jerinj, thomas, John McNamara,
	Marko Kovacevic
  Cc: dev

On 11/8/2019 10:24 AM, Andrew Rybchenko wrote:
> On 11/8/19 12:52 PM, Ferruh Yigit wrote:
>> On 11/8/2019 9:05 AM, Andrew Rybchenko wrote:
>>> On 11/7/19 9:28 PM, Ferruh Yigit wrote:
>>>> On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
>>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>>>
>>>>> Add `rte_eth_dev_set_ptypes` function that will allow the application
>>>>> to inform the PMD about reduced range of packet types to handle.
>>>>> Based on the ptypes set PMDs can optimize their Rx path.
>>>>>
>>>>> -If application doesn’t want any ptype information it can call
>>>>> `rte_eth_dev_set_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
>>>>> and PMD may skip packet type processing and set rte_mbuf::packet_type to
>>>>> RTE_PTYPE_UNKNOWN.
>>>>>
>>>>> -If application doesn’t call `rte_eth_dev_set_ptypes` PMD can return
>>>>> `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>>>>>
>>>>> -If application is interested only in L2/L3 layer, it can inform the PMD
>>>>> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
>>>>> `rte_eth_dev_set_ptypes(ethdev_id,
>>>>> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>>>>>
>>>>> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>>>>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>>>> ---
>>>>>  doc/guides/nics/features.rst             |  7 +-
>>>>>  doc/guides/rel_notes/release_19_11.rst   |  8 +++
>>>>>  lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
>>>>>  lib/librte_ethdev/rte_ethdev.h           | 36 ++++++++++
>>>>>  lib/librte_ethdev/rte_ethdev_core.h      | 18 +++++
>>>>>  lib/librte_ethdev/rte_ethdev_version.map |  1 +
>>>>>  6 files changed, 154 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
>>>>> index 7a31cf7c8..f33e8e6d4 100644
>>>>> --- a/doc/guides/nics/features.rst
>>>>> +++ b/doc/guides/nics/features.rst
>>>>> @@ -583,9 +583,12 @@ Packet type parsing
>>>>>  -------------------
>>>>>  
>>>>>  Supports packet type parsing and returns a list of supported types.
>>>>> +Allows application to set ptypes it is interested in.
>>>>>  
>>>>> -* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
>>>>> -* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
>>>>> +* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
>>>>> +* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
>>>>> +  ``rte_eth_dev_set_ptypes()``, ``dev_ptypes_set``.
>>>>> +* **[provides]   mbuf**: ``mbuf.packet_type``.
>>>>>  
>>>>>  
>>>>>  .. _nic_features_timesync:
>>>>> diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
>>>>> index 23182d187..2fa54aadc 100644
>>>>> --- a/doc/guides/rel_notes/release_19_11.rst
>>>>> +++ b/doc/guides/rel_notes/release_19_11.rst
>>>>> @@ -86,6 +86,13 @@ New Features
>>>>>    SET_TAG action and TAG item have been added to support transient flow
>>>>>    tag.
>>>>>  
>>>>> +* **Added ethdev API to set supported packet types**
>>>>> +
>>>>> +  * Added new API ``rte_eth_dev_set_ptypes`` that allows an application to
>>>>> +    inform PMD about about reduced range of packet types to handle.
>>>>> +  * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
>>>>> +    and thereby improve Rx performance if application wishes do so.
>>>>> +
>>>>>  * **Updated the enic driver.**
>>>>>  
>>>>>    * Added support for Geneve with options offload.
>>>>> @@ -258,6 +265,7 @@ New Features
>>>>>    * Rx metadata is delivered to host via a dynamic field of ``rte_mbuf`` with
>>>>>      PKT_RX_DYNF_METADATA.
>>>>>  
>>>>> +
>>>>>  Removed Items
>>>>>  -------------
>>>>>  
>>>>> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
>>>>> index 652c369e5..13e6daaf4 100644
>>>>> --- a/lib/librte_ethdev/rte_ethdev.c
>>>>> +++ b/lib/librte_ethdev/rte_ethdev.c
>>>>> @@ -2879,6 +2879,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>>>  	return j;
>>>>>  }
>>>>>  
>>>>> +int
>>>>> +rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>>> +				 uint32_t *set_ptypes, unsigned int num)
>>>>> +{
>>>>> +	const uint32_t valid_ptype_masks[] = {
>>>>> +		RTE_PTYPE_L2_MASK,
>>>>> +		RTE_PTYPE_L3_MASK,
>>>>> +		RTE_PTYPE_L4_MASK,
>>>>> +		RTE_PTYPE_TUNNEL_MASK,
>>>>> +		RTE_PTYPE_INNER_L2_MASK,
>>>>> +		RTE_PTYPE_INNER_L3_MASK,
>>>>> +		RTE_PTYPE_INNER_L4_MASK,
>>>>> +	};
>>>>> +	const uint32_t *all_ptypes;
>>>>> +	struct rte_eth_dev *dev;
>>>>> +	uint32_t unused_mask;
>>>>> +	unsigned int i, j;
>>>>> +	int ret;
>>>>> +
>>>>> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>>>>> +	dev = &rte_eth_devices[port_id];
>>>>> +
>>>>> +	if (num > 0 && set_ptypes == NULL)
>>>>> +		return -EINVAL;
>>>>> +
>>>>> +	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
>>>>> +			*dev->dev_ops->dev_ptypes_set == NULL) {
>>>>> +		ret = 0;
>>>>> +		goto ptype_unknown;
>>>>> +	}
>>>>
>>>> Hi Pavan, Andrew,
>>>>
>>>> Why API is not returning "-ENOTSUP" id dev_ops is not provided as done it other
>>>> APIs?
>>>
>>> As I understand the reason behind it is an optional nature
>>> of the callback. It is just an optimization and there is no
>>> point to complicate applications code to check and treat
>>> -ENOTSUP is OK.
>>
>> I was also thinking this is just an optimization but Jerin wants to call it
>> default in all samples first, now in testpmd by default.
> 
> Why the optimization should not be applied in all samples?
> If sample does not use ptype information it may and should
> be applied since we are all keen for the best possible
> performance.
> 
>> Although it makes simple to ignore the error this way, I think it can be good to
>> differentiate the success, not implemented and failed cases.
> 
> No, it simplifies error tracking. We can check return value and
> if it is not zero say that it goes wrong (instead of not zero and
> not -ENOTSUP).

Right now it is not clear if API successfully run or not supported at all, also
there is no API to get list of ptypes API reports after this API call, so there
is no way to know what is current reported ptypes after this API return success

For example, for the tespmd call, I suggest printing a log saying that supported
ptypes has been reduced if the API returns successfully, but with current API we
can't really say if it was successful or not.

> 
>>>
>>>>> +
>>>>> +	if (ptype_mask == 0) {
>>>>> +		ret = (*dev->dev_ops->dev_ptypes_set)(dev,
>>>>> +				ptype_mask);
>>>>> +		goto ptype_unknown;
>>>>> +	}
>>>>> +
>>>>> +	unused_mask = ptype_mask;
>>>>> +	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
>>>>> +		uint32_t mask = ptype_mask & valid_ptype_masks[i];
>>>>> +		if (mask && mask != valid_ptype_masks[i]) {
>>>>> +			ret = -EINVAL;
>>>>> +			goto ptype_unknown;
>>>>> +		}
>>>>> +		unused_mask &= ~valid_ptype_masks[i];
>>>>> +	}
>>>>
>>>> What does above block does?
>>>> Does it mean 'ptype_mask' only can be combination of 'valid_ptype_masks' items?
>>>
>>> Yes.
>>>
>>>> Let's say can't I set only 'RTE_PTYPE_L2_ETHER' as requested ptype?
>>>
>>> Yes
>>>
>>>> Why this limitation and is it documented anywhere, like the API documentation?
>>>
>>> It is simply incorrect to have non-mask bits here.
>>> RTE_PTYPE_L2_ETHER & RTE_PTYPE_L2_ETHER_ARP != 0
>>
>> Right.
>>
>>> It is documented in the ptype_mask parameter description.
>>
>> OK, I missed it in ptype_mask description.
>>
>>>
>>>>> +
>>>>> +	if (unused_mask) {
>>>>> +		ret = -EINVAL;
>>>>> +		goto ptype_unknown;
>>>>> +	}
>>>>> +
>>>>> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
>>>>> +	if (all_ptypes == NULL) {
>>>>> +		ret = 0;
>>>>> +		goto ptype_unknown;
>>>>> +	}
>>>>> +
>>>>> +	/*
>>>>> +	 * Accodommodate as many set_ptypes as possible. If the supplied
>>>>
>>>> s/Accodommodate/Accommodate
>>>>
>>>>> +	 * set_ptypes array is insufficient fill it partially.
>>>>> +	 */
>>>>> +	for (i = 0, j = 0; set_ptypes != NULL &&
>>>>> +				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
>>>>> +		if (ptype_mask & all_ptypes[i]) {
>>>>> +			if (j < num - 1) {
>>>>> +				set_ptypes[j] = all_ptypes[i];
>>>>> +				j++;
>>>>> +				continue;
>>>>> +			}
>>>>> +			break;
>>>>> +		}
>>>>> +	}
>>>>> +
>>>>> +	if (set_ptypes != NULL && j < num)
>>>>> +		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
>>>>> +
>>>>> +	return (*dev->dev_ops->dev_ptypes_set)(dev, ptype_mask);
>>>>
>>>> Only a question, at this stage API knows the supported ptypes by device, does it
>>>> make sense to check if 'ptype_mask' has anything unsupported instead of passing
>>>> it to the driver and expect driver to check it?
>>>
>>> It is also explained by the nature of the API. Application says:
>>> I'm interested in the following ptypes only to let PMD know that
>>> it could drop classification behind it. If PMD does not support
>>> some layers, it will not provide classification anyway.
>>
>> in "eth_dev_ptypes_set_t" documentation, it says:
>>  "- (-EINVAL) if *ptype_mask* is invalid."
>> I thought PMD does a check on received 'ptype_mask', if expectation is PMD will
>> do the check, why not do the check in API commonly instead of each PMD.
>> What is the documented case "*ptype_mask* is invalid."?
> 
> Not a combination of RTE_PTYPE_*_MASK.
> There are few cases above where -EINVAL is returned includes failed
> validation of ptype_mask.

OK, let me try to again,
according API, *PMD* can return error if 'ptype_mask' is not valid,
a) what is that validity check in PMD?
b) if it is a common check can we move if from PMD to the API?

> 
>>>
>>>>> +
>>>>> +ptype_unknown:
>>>>> +	if (num > 0)
>>>>> +		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>>>>> +
>>>>> +	return ret;
>>>>> +}
>>>>> +
>>>>>  int
>>>>>  rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>>>>>  {
>>>>> @@ -2891,7 +2977,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>>>>>  	return 0;
>>>>>  }
>>>>>  
>>>>> -
>>>>>  int
>>>>>  rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
>>>>>  {
>>>>> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>>>>> index 44d77b332..a7872819d 100644
>>>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>>>> @@ -2604,6 +2604,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
>>>>>   */
>>>>>  int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>>>  				     uint32_t *ptypes, int num);
>>>>> +/**
>>>>> + * @warning
>>>>> + * @b EXPERIMENTAL: this API may change without prior notice.
>>>>> + *
>>>>> + * Inform Ethernet device about reduced range of packet types to handle.
>>>>> + *
>>>>> + * Application can use this function to set only specific ptypes that it's
>>>>> + * interested. This information can be used by the PMD to optimize Rx path.
>>>>> + *
>>>>> + * The function accepts an array `set_ptypes` allocated by the caller to
>>>>> + * store the packet types set by the driver, the last element of the array
>>>>> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
>>>>> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
>>>>> + * partially.
>>>>> + *
>>>>> + * @param port_id
>>>>> + *   The port identifier of the Ethernet device.
>>>>> + * @param ptype_mask
>>>>> + *   The ptype family that application is interested in should be bitwise OR of
>>>>> + *   RTE_PTYPE_*_MASK or 0.
>>>>
>>>> No strong opinion but is it really a mask? it doesn't used to mask any value,
>>>> but it is list of ptypes that application requests, in a bitwise ORed form, so I
>>>> this it can be ptypes.
>>>
>>> See above.
>>
>> OK, it is a mask really.
>>
>>>
>>>>> + * @param set_ptypes
>>>>> + *   An array pointer to store set packet types, allocated by caller. The
>>>>> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
>>>>
>>>> Not for this patch, but is an API also required to get current supported ptypes
>>>> from the driver? Even application keeps this list, something can reset in the
>>>> device/driver, supported pytpe list can be changed and it can differ with what
>>>> application knows.
>>>
>>> I would say that set_ptypes should not affected supported_ptypes.
>>
>> I expect same. I was asking should we have an API that returns list of ptypes
>> returned by PMD after 'rte_eth_dev_set_ptypes()' call? Can we know that list
>> without a new API?
> 
> As I understand the only way right now is to get on when ptypes are set.

That is what I am saying, assuming application storing this ptype list and
driver did a reset or something can make application list invalid/wrong, so a
better way to get the list can be required.

> I would add _get_ptypes() function when it is really required only.

OK, I don't know if application may need to know it.

> 
>>>
>>>>> + * @param num
>>>>> + *   Size of the array pointed by param ptypes.
>>>>> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
>>>>> + *   set ptypes.
>>>>> + * @return
>>>>> + *   - (0) if Success.
>>>>> + *   - (-ENODEV) if *port_id* invalid.
>>>>> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
>>>>> + *     num > 0.
>>>>> + */
>>>>> +__rte_experimental
>>>>> +int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>>> +			   uint32_t *set_ptypes, unsigned int num);
>>>>>  
>>>>>  /**
>>>>>   * Retrieve the MTU of an Ethernet device.
>>>>> diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
>>>>> index f215af7c9..657c39b56 100644
>>>>> --- a/lib/librte_ethdev/rte_ethdev_core.h
>>>>> +++ b/lib/librte_ethdev/rte_ethdev_core.h
>>>>> @@ -234,6 +234,22 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
>>>>>  typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
>>>>>  /**< @internal Get supported ptypes of an Ethernet device. */
>>>>>  
>>>>> +/**
>>>>> + * @internal
>>>>> + * Inform Ethernet device about reduced range of packet types to handle.
>>>>> + *
>>>>> + * @param dev
>>>>> + *   The Ethernet device identifier.
>>>>> + * @param ptype_mask
>>>>> + *   The ptype family that application is interested in should be bitwise OR of
>>>>> + *   RTE_PTYPE_*_MASK or 0.
>>>>> + * @return
>>>>> + *   - (0) if Success.
>>>>> + *   - (-EINVAL) if *ptype_mask* is invalid.
>>>>> + */
>>>>> +typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev,
>>>>> +				     uint32_t ptype_mask);
>>>>> +
>>>>>  typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
>>>>>  				    uint16_t queue_id);
>>>>>  /**< @internal Start rx and tx of a queue of an Ethernet device. */
>>>>> @@ -630,6 +646,8 @@ struct eth_dev_ops {
>>>>>  	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
>>>>>  	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
>>>>>  	/**< Get packet types supported and identified by device. */
>>>>> +	eth_dev_ptypes_set_t dev_ptypes_set;
>>>>> +	/**< Inform Ethernet device about reduced range of packet types to handle. */
>>>>>  
>>>>>  	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
>>>>>  	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
>>>>> diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
>>>>> index ee289ef13..ccfbeae23 100644
>>>>> --- a/lib/librte_ethdev/rte_ethdev_version.map
>>>>> +++ b/lib/librte_ethdev/rte_ethdev_version.map
>>>>> @@ -292,4 +292,5 @@ EXPERIMENTAL {
>>>>>  	rte_flow_dynf_metadata_offs;
>>>>>  	rte_flow_dynf_metadata_mask;
>>>>>  	rte_flow_dynf_metadata_register;
>>>>> +	rte_eth_dev_set_ptypes;
>>>>>  };
>>>>>
>>>
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-08 10:29                                                           ` Matan Azrad
@ 2019-11-08 11:24                                                             ` Andrew Rybchenko
  2019-11-08 11:48                                                               ` Matan Azrad
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-08 11:24 UTC (permalink / raw)
  To: Matan Azrad, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev

On 11/8/19 1:29 PM, Matan Azrad wrote:
> 
> 
> From: Andrew Rybchenko
>> Sent: Friday, November 8, 2019 12:12 PM
>> To: Matan Azrad <matan@mellanox.com>; Pavan Nikhilesh Bhagavatula
>> <pbhagavatula@marvell.com>; ferruh.yigit@intel.com; Jerin Jacob
>> Kollanukkaran <jerinj@marvell.com>; Thomas Monjalon
>> <thomas@monjalon.net>
>> Cc: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads
>> set by PMD
>>
>> On 11/7/19 9:56 AM, Matan Azrad wrote:
>>> Hi
>>>
>>> From: Andrew Rybchenko
>>>> On 11/6/19 9:58 AM, Matan Azrad wrote:
>>>>>
>>>>>
>>>>> From: Andrew Rybchenko
>>>>>> On 11/5/19 5:05 PM, Matan Azrad wrote:
>>>>>>> From: Andrew Rybchenko
>>>>>>>> On 11/3/19 6:16 PM, Matan Azrad wrote
>>>>>>>>> From: Andrew Rybchenko
>>>>>>>>>> On 11/3/19 9:57 AM, Matan Azrad wrote:
>>>>>>>>>>> Hi
>>>>>>>>>>>
>>>>>>>>>>> From: Andrew Rybchenko
>>>>>>>>>>>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>> From: Pavan Nikhilesh Bhagavatula
>>>>>>>>>>>>>>> Hi Matan,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hi Pavan
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> From: Pavan Nikhilesh
>>>>>>>>>>>>>>>> <pbhagavatula@marvell.com>
>>>>>>>>>>>>>>>>> Some PMDs cannot work when certain offloads are
>>>>>>>>>>>>>>>>> enable/disabled, as a workaround PMDs auto
>>>>>>>>>>>>>>>>> enable/disable offloads internally and expose it through
>>>>>>>>>>>>>>>>> dev->data-dev_conf.rxmode.offloads.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> After device specific dev_configure is called compare
>>>>>>>>>>>>>>>>> the requested offloads to the offloads exposed by the
>>>>>>>>>>>>>>>>> PMD and, if the PMD failed to enable a given offload
>>>>>>>>>>>>>>>>> then log it and return -EINVAL from
>>>>>>>>>>>>>>>>> rte_eth_dev_configure, else if the PMD failed to disable
>>>>>>>>>>>>>>>>> a given offload log and continue with rte_eth_dev_configure.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> rte_eth_dev_configure can be called more than 1 time in
>>>>>>>>>>>>>>>> the device life time, How can you know what is the
>>>>>>>>>>>>>>>> minimum offload configurations required by the port after
>>>>>>>>>>>>>>>> the first call?
>>>>>>>>>>>>>>>> Maybe putting it in dev info is better, what do you think?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> We only return -EINVAL in the case where we enable an
>>>>>>>>>>>>>>> offload advertised by dev_info and the port still fails to
>>>>>>>>>>>>>>> enable it.
>>>>>>>>>>>>>> Are you sure it is ok that devices may disable\enable
>>>>>>>>>>>>>> offloads under the hood without user notification?
>>>>>>>>>>>>> Some devices already do it. The above check adds validation
>>>>>>>>>>>>> for the same.
>>>>>>>>>>>> The problem is that some offloads cannot be disabled.
>>>>>>>>>>> Yes, I understand it.
>>>>>>>>>>>
>>>>>>>>>>>> If application does not request Rx checksum offload since it
>>>>>>>>>>>> does use it, it is not a problem to report it.
>>>>>>>>>>> Yes, for RX checksum I tend to agree that application doesn't
>>>>>>>>>>> care if the
>>>>>>>>>> PMD will calculate the checksum in spite of the offload is
>>>>>>>>>> disabled.
>>>>>>>>>>>
>>>>>>>>>>> But what's about other offloads: For example in RX: LRO,
>>>>>>>>>>> CRC_KEEP, VLAN_STRIP, JUMBO If the PMD will stay them on while
>>>>>>>>>>> the app is disabling it, It can cause a problems to the
>>>>>>>>>> application (affects the packet length).
>>>>>>>>>>
>>>>>>>>>> Yes, I agree that some offloads are critical to be disabled,
>>>>>>>>>> but RSS_HASH discussed in the changeset is not critical.
>>>>>>>>>
>>>>>>>>> So, are you agree It should not be checked globally for all the
>>>>>>>>> offloads in
>>>>>>>> ethdev layer?
>>>>>>>>
>>>>>>>> If offload is not requested, but enabled (since PMD cannot
>>>>>>>> disable it), right not it will not fail configure, but warn about
>>>>>>>> it in logs.
>>>>>>>>
>>>>>>>
>>>>>>> In this case warning print is not enough since it can be critical
>>>>>>> for the
>>>>>> application for some offloads.
>>>>>>> It can be very weird for the application to see that some offload
>>>>>>> are on
>>>>>> while the application doesn't expect them to be on.
>>>>>>> it even can cause app crash(at least for the RX offload I wrote
>>>>>>> above).
>>>>>>
>>>>>> The patch improves the situation. Earlier it was silent, now it
>>>>>> will be at least visible.
>>>>>
>>>>> We can do it visible inside the limited PMDs.
>>>>
>>>> Why?
>>>
>>> Because this is not according to what application should understand from
>> the ethdev API.
>>
>> It does not answer why it should be inside the limited PMDs instead of
>> ethdev layer.
> 
> Why not?
> Application doesn't expect to it and it may affect it.
> 
>>>>>> I'm afraid that in 19.11 release cycle we cannot change it to fail
>>>>>> dev_configure. I think it will be too destructive. Future
>>>>>> improvement should be discussed separately.
>>>>>
>>>>> So we can remove this ethdev patch now and let the PMD to do it
>>>>> until we will find better solution later.
>>>>
>>>> Sorry, but I don't think so.
>>>>
>>>>>>>>> It even be more problematic if the dynamic offload field in mbuf
>>>>>>>>> is not exist at all.
>>>>>>>
>>>>>>> Any answer here?
>>>>>
>>>>> A Rx offload requires dynamic mbuf field cannot stay visible while
>>>>> the app disabling it. Because the dynamic mbuf field probably is not
>>>>> set in the mbuf. May cause problems.
>>>>>
>>>>>> Please, clarify the question.
>>>>>>
>>>
>>> No answer here.
>>
>> Sorry, but I don't understand the problem.
>> If there is no dynamic field, it will not be set.
> Why not? The offload is enabled for the PMD perspective.
> 
>> If there is dynamic field, it is the same as regular fields.
>>
>>>>>>>>>>
>>>>>>>>>>> For example in TX: TSO, VLAN, MULTI_SEG.....
>>>>>>>>>>
>>>>>>>>>> Tx is not that critical since application should not request
>>>>>>>>>> these offloads per- packet. Tx offloads are mainly required to
>>>>>>>>>> ensure that application may request the offload per packet and
>>>>>>>>>> it will be done.
>>>>>>>>>
>>>>>>>>> yes, you right, In TX it looks less critical (for now).
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>> Of course, it could be a problem if the offload is used, but
>>>>>>>>>>>> application wants to disable it, for example, for debugging
>>>>>>>>>>>> purposes. In this case, the solution is to mask offloads on
>>>>>>>>>>>> application level, which is not ideal as well.
>>>>>>>>>>> Why not ideal?
>>>>>>>>>>
>>>>>>>>>> It eats CPU cycles.
>>>>>>>>>
>>>>>>>>> Sorry, I don't understand your use case here.
>>>>>>>>
>>>>>>>> If application wants to try code path without, for example, Rx
>>>>>>>> checksum offload, it could be insufficient to disable the offload
>>>>>>>> right now, but also required to cleanup offload results flags in
>>>>>>>> each mbuf (if PMD does not support the offload disabling).
>>>>>>>
>>>>>>> What is "right now"? Configuration time?
>>>>>>
>>>>>> Right now is the current state of some drivers in DPDK tree.
>>>>>>
>>>>>
>>>>> OK. I think the offload configuration is in configuration time. No
>>>>> data-path.
>>>>>
>>>>>>> If application will know that PMD cannot disable the rx-checksum
>>>>>>> in configuration time, It can plan to not clean this flag in mbuf
>>>>>>> for each rx
>>>>>> mbuf.
>>>>>>
>>>>>> Yes and application has a way to know it - take a look at
>>>>>> dev->data->dev_conf.rxmode.offloads.
>>>>>
>>>>> As I understand, before this patch, this field used for ethdev layer
>>>>> knowledge to track on the application Rx offload configuration. Am I
>>>>> wrong?
>>>>
>>>> I think it is just Rx offloads configuration.
>>>> It is better to have real offloads here since it is used on Rx queue
>>>> setup to mask already enabled offloads.
>>>
>>> And in DPDK or any SW management controls a device, the configuration
>> must be set by the user.
>>> So, it should reflect the user configuration as is.
>>
>> It is ideal world which is unfortunately too far from real life.
>> There is always a trade off. It is possible to define too restrictive interface
>> which will enforce complicated implementation with bad performance
>> characteristics for no real value.
>>
>> In any case, the patch simply makes the difference visible.
>> It does not enforce any rules except to fail configure if requested offload is
>> not enabled which is a strong violation of the interface. If you don't like it, we
>> can discuss the point. In the area of not requested but enabled offloads, it
>> just adds logs. No changes in behaviour. I'm strongly against making it hard
>> failure in 19.11 since it is too late for the decision. We can discuss it later
>> separately from the patch.
>>
> While I don't agree with the patch and the idea here,  we can continue discuss later.
> I think we understand the ideas of both of us and we can dig to it later. 

I agree that it is time to wrap the discussion.
Could you make it clear what you don't like in the patch and why.

It does 3 things for all port at the end of rte_eth_dev_configure()
based on dev->data->dev_conf (if PMD updates it in the case of
violations).

1. If requested offload is not enabled, log error message.

2. If requested offload is not enabled, fail dev_configure by
   returning error and deconfiguring all queues.

3. If not requested offload is enabled, log info message.

Above is done for Rx and Tx offloads.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 1/8] ethdev: add set ptype function
  2019-11-08 11:05                                       ` Ferruh Yigit
@ 2019-11-08 11:40                                         ` Andrew Rybchenko
  0 siblings, 0 replies; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-08 11:40 UTC (permalink / raw)
  To: Ferruh Yigit, pbhagavatula, jerinj, thomas, John McNamara,
	Marko Kovacevic
  Cc: dev

On 11/8/19 2:05 PM, Ferruh Yigit wrote:
> On 11/8/2019 10:24 AM, Andrew Rybchenko wrote:
>> On 11/8/19 12:52 PM, Ferruh Yigit wrote:
>>> On 11/8/2019 9:05 AM, Andrew Rybchenko wrote:
>>>> On 11/7/19 9:28 PM, Ferruh Yigit wrote:
>>>>> On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
>>>>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>>>>
>>>>>> Add `rte_eth_dev_set_ptypes` function that will allow the application
>>>>>> to inform the PMD about reduced range of packet types to handle.
>>>>>> Based on the ptypes set PMDs can optimize their Rx path.
>>>>>>
>>>>>> -If application doesn’t want any ptype information it can call
>>>>>> `rte_eth_dev_set_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
>>>>>> and PMD may skip packet type processing and set rte_mbuf::packet_type to
>>>>>> RTE_PTYPE_UNKNOWN.
>>>>>>
>>>>>> -If application doesn’t call `rte_eth_dev_set_ptypes` PMD can return
>>>>>> `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.
>>>>>>
>>>>>> -If application is interested only in L2/L3 layer, it can inform the PMD
>>>>>> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
>>>>>> `rte_eth_dev_set_ptypes(ethdev_id,
>>>>>> 		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>>>>>>
>>>>>> Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>>>>>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>>>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>>>>> ---
>>>>>>  doc/guides/nics/features.rst             |  7 +-
>>>>>>  doc/guides/rel_notes/release_19_11.rst   |  8 +++
>>>>>>  lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
>>>>>>  lib/librte_ethdev/rte_ethdev.h           | 36 ++++++++++
>>>>>>  lib/librte_ethdev/rte_ethdev_core.h      | 18 +++++
>>>>>>  lib/librte_ethdev/rte_ethdev_version.map |  1 +
>>>>>>  6 files changed, 154 insertions(+), 3 deletions(-)
>>>>>>
>>>>>> diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
>>>>>> index 7a31cf7c8..f33e8e6d4 100644
>>>>>> --- a/doc/guides/nics/features.rst
>>>>>> +++ b/doc/guides/nics/features.rst
>>>>>> @@ -583,9 +583,12 @@ Packet type parsing
>>>>>>  -------------------
>>>>>>  
>>>>>>  Supports packet type parsing and returns a list of supported types.
>>>>>> +Allows application to set ptypes it is interested in.
>>>>>>  
>>>>>> -* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
>>>>>> -* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
>>>>>> +* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
>>>>>> +* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
>>>>>> +  ``rte_eth_dev_set_ptypes()``, ``dev_ptypes_set``.
>>>>>> +* **[provides]   mbuf**: ``mbuf.packet_type``.
>>>>>>  
>>>>>>  
>>>>>>  .. _nic_features_timesync:
>>>>>> diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
>>>>>> index 23182d187..2fa54aadc 100644
>>>>>> --- a/doc/guides/rel_notes/release_19_11.rst
>>>>>> +++ b/doc/guides/rel_notes/release_19_11.rst
>>>>>> @@ -86,6 +86,13 @@ New Features
>>>>>>    SET_TAG action and TAG item have been added to support transient flow
>>>>>>    tag.
>>>>>>  
>>>>>> +* **Added ethdev API to set supported packet types**
>>>>>> +
>>>>>> +  * Added new API ``rte_eth_dev_set_ptypes`` that allows an application to
>>>>>> +    inform PMD about about reduced range of packet types to handle.
>>>>>> +  * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
>>>>>> +    and thereby improve Rx performance if application wishes do so.
>>>>>> +
>>>>>>  * **Updated the enic driver.**
>>>>>>  
>>>>>>    * Added support for Geneve with options offload.
>>>>>> @@ -258,6 +265,7 @@ New Features
>>>>>>    * Rx metadata is delivered to host via a dynamic field of ``rte_mbuf`` with
>>>>>>      PKT_RX_DYNF_METADATA.
>>>>>>  
>>>>>> +
>>>>>>  Removed Items
>>>>>>  -------------
>>>>>>  
>>>>>> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
>>>>>> index 652c369e5..13e6daaf4 100644
>>>>>> --- a/lib/librte_ethdev/rte_ethdev.c
>>>>>> +++ b/lib/librte_ethdev/rte_ethdev.c
>>>>>> @@ -2879,6 +2879,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>>>>  	return j;
>>>>>>  }
>>>>>>  
>>>>>> +int
>>>>>> +rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>>>> +				 uint32_t *set_ptypes, unsigned int num)
>>>>>> +{
>>>>>> +	const uint32_t valid_ptype_masks[] = {
>>>>>> +		RTE_PTYPE_L2_MASK,
>>>>>> +		RTE_PTYPE_L3_MASK,
>>>>>> +		RTE_PTYPE_L4_MASK,
>>>>>> +		RTE_PTYPE_TUNNEL_MASK,
>>>>>> +		RTE_PTYPE_INNER_L2_MASK,
>>>>>> +		RTE_PTYPE_INNER_L3_MASK,
>>>>>> +		RTE_PTYPE_INNER_L4_MASK,
>>>>>> +	};
>>>>>> +	const uint32_t *all_ptypes;
>>>>>> +	struct rte_eth_dev *dev;
>>>>>> +	uint32_t unused_mask;
>>>>>> +	unsigned int i, j;
>>>>>> +	int ret;
>>>>>> +
>>>>>> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>>>>>> +	dev = &rte_eth_devices[port_id];
>>>>>> +
>>>>>> +	if (num > 0 && set_ptypes == NULL)
>>>>>> +		return -EINVAL;
>>>>>> +
>>>>>> +	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
>>>>>> +			*dev->dev_ops->dev_ptypes_set == NULL) {
>>>>>> +		ret = 0;
>>>>>> +		goto ptype_unknown;
>>>>>> +	}
>>>>>
>>>>> Hi Pavan, Andrew,
>>>>>
>>>>> Why API is not returning "-ENOTSUP" id dev_ops is not provided as done it other
>>>>> APIs?
>>>>
>>>> As I understand the reason behind it is an optional nature
>>>> of the callback. It is just an optimization and there is no
>>>> point to complicate applications code to check and treat
>>>> -ENOTSUP is OK.
>>>
>>> I was also thinking this is just an optimization but Jerin wants to call it
>>> default in all samples first, now in testpmd by default.
>>
>> Why the optimization should not be applied in all samples?
>> If sample does not use ptype information it may and should
>> be applied since we are all keen for the best possible
>> performance.
>>
>>> Although it makes simple to ignore the error this way, I think it can be good to
>>> differentiate the success, not implemented and failed cases.
>>
>> No, it simplifies error tracking. We can check return value and
>> if it is not zero say that it goes wrong (instead of not zero and
>> not -ENOTSUP).
> 
> Right now it is not clear if API successfully run or not supported at all,

Why is it important? I think it is not important.

> also there is no API to get list of ptypes API reports after this API call,
> so there is no way to know what is current reported ptypes after this API
> return success

Yes, that's true. As I understand it possible to obtain the information
at the type of set_types only.

> For example, for the tespmd call, I suggest printing a log saying that supported
> ptypes has been reduced if the API returns successfully, but with current API we
> can't really say if it was successful or not.

Fair and makes sense. We can dump returned set_ptypes.
Anyway saying if it is *reduced* or not is impossible
without explicit indication and I'm not sure that the
information required (worse efforts to provide it).

>>>>
>>>>>> +
>>>>>> +	if (ptype_mask == 0) {
>>>>>> +		ret = (*dev->dev_ops->dev_ptypes_set)(dev,
>>>>>> +				ptype_mask);
>>>>>> +		goto ptype_unknown;
>>>>>> +	}
>>>>>> +
>>>>>> +	unused_mask = ptype_mask;
>>>>>> +	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
>>>>>> +		uint32_t mask = ptype_mask & valid_ptype_masks[i];
>>>>>> +		if (mask && mask != valid_ptype_masks[i]) {
>>>>>> +			ret = -EINVAL;
>>>>>> +			goto ptype_unknown;
>>>>>> +		}
>>>>>> +		unused_mask &= ~valid_ptype_masks[i];
>>>>>> +	}
>>>>>
>>>>> What does above block does?
>>>>> Does it mean 'ptype_mask' only can be combination of 'valid_ptype_masks' items?
>>>>
>>>> Yes.
>>>>
>>>>> Let's say can't I set only 'RTE_PTYPE_L2_ETHER' as requested ptype?
>>>>
>>>> Yes
>>>>
>>>>> Why this limitation and is it documented anywhere, like the API documentation?
>>>>
>>>> It is simply incorrect to have non-mask bits here.
>>>> RTE_PTYPE_L2_ETHER & RTE_PTYPE_L2_ETHER_ARP != 0
>>>
>>> Right.
>>>
>>>> It is documented in the ptype_mask parameter description.
>>>
>>> OK, I missed it in ptype_mask description.
>>>
>>>>
>>>>>> +
>>>>>> +	if (unused_mask) {
>>>>>> +		ret = -EINVAL;
>>>>>> +		goto ptype_unknown;
>>>>>> +	}
>>>>>> +
>>>>>> +	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
>>>>>> +	if (all_ptypes == NULL) {
>>>>>> +		ret = 0;
>>>>>> +		goto ptype_unknown;
>>>>>> +	}
>>>>>> +
>>>>>> +	/*
>>>>>> +	 * Accodommodate as many set_ptypes as possible. If the supplied
>>>>>
>>>>> s/Accodommodate/Accommodate
>>>>>
>>>>>> +	 * set_ptypes array is insufficient fill it partially.
>>>>>> +	 */
>>>>>> +	for (i = 0, j = 0; set_ptypes != NULL &&
>>>>>> +				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
>>>>>> +		if (ptype_mask & all_ptypes[i]) {
>>>>>> +			if (j < num - 1) {
>>>>>> +				set_ptypes[j] = all_ptypes[i];
>>>>>> +				j++;
>>>>>> +				continue;
>>>>>> +			}
>>>>>> +			break;
>>>>>> +		}
>>>>>> +	}
>>>>>> +
>>>>>> +	if (set_ptypes != NULL && j < num)
>>>>>> +		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
>>>>>> +
>>>>>> +	return (*dev->dev_ops->dev_ptypes_set)(dev, ptype_mask);
>>>>>
>>>>> Only a question, at this stage API knows the supported ptypes by device, does it
>>>>> make sense to check if 'ptype_mask' has anything unsupported instead of passing
>>>>> it to the driver and expect driver to check it?
>>>>
>>>> It is also explained by the nature of the API. Application says:
>>>> I'm interested in the following ptypes only to let PMD know that
>>>> it could drop classification behind it. If PMD does not support
>>>> some layers, it will not provide classification anyway.
>>>
>>> in "eth_dev_ptypes_set_t" documentation, it says:
>>>  "- (-EINVAL) if *ptype_mask* is invalid."
>>> I thought PMD does a check on received 'ptype_mask', if expectation is PMD will
>>> do the check, why not do the check in API commonly instead of each PMD.
>>> What is the documented case "*ptype_mask* is invalid."?
>>
>> Not a combination of RTE_PTYPE_*_MASK.
>> There are few cases above where -EINVAL is returned includes failed
>> validation of ptype_mask.
> 
> OK, let me try to again,
> according API, *PMD* can return error if 'ptype_mask' is not valid,

Ah, it is rather a comment related to eth_dev_ptypes_set_t prototype
description. I'd remove -EINVAL description from the prototype
description.

> a) what is that validity check in PMD?
> b) if it is a common check can we move if from PMD to the API?
>
>>
>>>>
>>>>>> +
>>>>>> +ptype_unknown:
>>>>>> +	if (num > 0)
>>>>>> +		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>>>>>> +
>>>>>> +	return ret;
>>>>>> +}
>>>>>> +
>>>>>>  int
>>>>>>  rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>>>>>>  {
>>>>>> @@ -2891,7 +2977,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
>>>>>>  	return 0;
>>>>>>  }
>>>>>>  
>>>>>> -
>>>>>>  int
>>>>>>  rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
>>>>>>  {
>>>>>> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>>>>>> index 44d77b332..a7872819d 100644
>>>>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>>>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>>>>> @@ -2604,6 +2604,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
>>>>>>   */
>>>>>>  int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>>>>  				     uint32_t *ptypes, int num);
>>>>>> +/**
>>>>>> + * @warning
>>>>>> + * @b EXPERIMENTAL: this API may change without prior notice.
>>>>>> + *
>>>>>> + * Inform Ethernet device about reduced range of packet types to handle.
>>>>>> + *
>>>>>> + * Application can use this function to set only specific ptypes that it's
>>>>>> + * interested. This information can be used by the PMD to optimize Rx path.
>>>>>> + *
>>>>>> + * The function accepts an array `set_ptypes` allocated by the caller to
>>>>>> + * store the packet types set by the driver, the last element of the array
>>>>>> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
>>>>>> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
>>>>>> + * partially.
>>>>>> + *
>>>>>> + * @param port_id
>>>>>> + *   The port identifier of the Ethernet device.
>>>>>> + * @param ptype_mask
>>>>>> + *   The ptype family that application is interested in should be bitwise OR of
>>>>>> + *   RTE_PTYPE_*_MASK or 0.
>>>>>
>>>>> No strong opinion but is it really a mask? it doesn't used to mask any value,
>>>>> but it is list of ptypes that application requests, in a bitwise ORed form, so I
>>>>> this it can be ptypes.
>>>>
>>>> See above.
>>>
>>> OK, it is a mask really.
>>>
>>>>
>>>>>> + * @param set_ptypes
>>>>>> + *   An array pointer to store set packet types, allocated by caller. The
>>>>>> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
>>>>>
>>>>> Not for this patch, but is an API also required to get current supported ptypes
>>>>> from the driver? Even application keeps this list, something can reset in the
>>>>> device/driver, supported pytpe list can be changed and it can differ with what
>>>>> application knows.
>>>>
>>>> I would say that set_ptypes should not affected supported_ptypes.
>>>
>>> I expect same. I was asking should we have an API that returns list of ptypes
>>> returned by PMD after 'rte_eth_dev_set_ptypes()' call? Can we know that list
>>> without a new API?
>>
>> As I understand the only way right now is to get on when ptypes are set.
> 
> That is what I am saying, assuming application storing this ptype list and
> driver did a reset or something can make application list invalid/wrong, so a
> better way to get the list can be required.

Yes, that's true. I have no strong opinion.

>> I would add _get_ptypes() function when it is really required only.
> 
> OK, I don't know if application may need to know it.

I suggest to wait with it. It is an experimental API and
usage will show if _get_ptypes() is required or not.

Many thanks.

>>
>>>>
>>>>>> + * @param num
>>>>>> + *   Size of the array pointed by param ptypes.
>>>>>> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
>>>>>> + *   set ptypes.
>>>>>> + * @return
>>>>>> + *   - (0) if Success.
>>>>>> + *   - (-ENODEV) if *port_id* invalid.
>>>>>> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
>>>>>> + *     num > 0.
>>>>>> + */
>>>>>> +__rte_experimental
>>>>>> +int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
>>>>>> +			   uint32_t *set_ptypes, unsigned int num);
>>>>>>  
>>>>>>  /**
>>>>>>   * Retrieve the MTU of an Ethernet device.
>>>>>> diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
>>>>>> index f215af7c9..657c39b56 100644
>>>>>> --- a/lib/librte_ethdev/rte_ethdev_core.h
>>>>>> +++ b/lib/librte_ethdev/rte_ethdev_core.h
>>>>>> @@ -234,6 +234,22 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
>>>>>>  typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
>>>>>>  /**< @internal Get supported ptypes of an Ethernet device. */
>>>>>>  
>>>>>> +/**
>>>>>> + * @internal
>>>>>> + * Inform Ethernet device about reduced range of packet types to handle.
>>>>>> + *
>>>>>> + * @param dev
>>>>>> + *   The Ethernet device identifier.
>>>>>> + * @param ptype_mask
>>>>>> + *   The ptype family that application is interested in should be bitwise OR of
>>>>>> + *   RTE_PTYPE_*_MASK or 0.
>>>>>> + * @return
>>>>>> + *   - (0) if Success.
>>>>>> + *   - (-EINVAL) if *ptype_mask* is invalid.
>>>>>> + */
>>>>>> +typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev,
>>>>>> +				     uint32_t ptype_mask);
>>>>>> +
>>>>>>  typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
>>>>>>  				    uint16_t queue_id);
>>>>>>  /**< @internal Start rx and tx of a queue of an Ethernet device. */
>>>>>> @@ -630,6 +646,8 @@ struct eth_dev_ops {
>>>>>>  	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
>>>>>>  	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
>>>>>>  	/**< Get packet types supported and identified by device. */
>>>>>> +	eth_dev_ptypes_set_t dev_ptypes_set;
>>>>>> +	/**< Inform Ethernet device about reduced range of packet types to handle. */
>>>>>>  
>>>>>>  	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
>>>>>>  	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
>>>>>> diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
>>>>>> index ee289ef13..ccfbeae23 100644
>>>>>> --- a/lib/librte_ethdev/rte_ethdev_version.map
>>>>>> +++ b/lib/librte_ethdev/rte_ethdev_version.map
>>>>>> @@ -292,4 +292,5 @@ EXPERIMENTAL {
>>>>>>  	rte_flow_dynf_metadata_offs;
>>>>>>  	rte_flow_dynf_metadata_mask;
>>>>>>  	rte_flow_dynf_metadata_register;
>>>>>> +	rte_eth_dev_set_ptypes;
>>>>>>  };
>>>>>>
>>>>
>>
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-08 11:24                                                             ` Andrew Rybchenko
@ 2019-11-08 11:48                                                               ` Matan Azrad
  2019-11-08 12:09                                                                 ` Andrew Rybchenko
  0 siblings, 1 reply; 246+ messages in thread
From: Matan Azrad @ 2019-11-08 11:48 UTC (permalink / raw)
  To: Andrew Rybchenko, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev



From: Andrew Rybchenko
> On 11/8/19 1:29 PM, Matan Azrad wrote:
> >
> >
> > From: Andrew Rybchenko
> >> Sent: Friday, November 8, 2019 12:12 PM
> >> To: Matan Azrad <matan@mellanox.com>; Pavan Nikhilesh Bhagavatula
> >> <pbhagavatula@marvell.com>; ferruh.yigit@intel.com; Jerin Jacob
> >> Kollanukkaran <jerinj@marvell.com>; Thomas Monjalon
> >> <thomas@monjalon.net>
> >> Cc: dev@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to
> >> offloads set by PMD
> >>
> >> On 11/7/19 9:56 AM, Matan Azrad wrote:
> >>> Hi
> >>>
> >>> From: Andrew Rybchenko
> >>>> On 11/6/19 9:58 AM, Matan Azrad wrote:
> >>>>>
> >>>>>
> >>>>> From: Andrew Rybchenko
> >>>>>> On 11/5/19 5:05 PM, Matan Azrad wrote:
> >>>>>>> From: Andrew Rybchenko
> >>>>>>>> On 11/3/19 6:16 PM, Matan Azrad wrote
> >>>>>>>>> From: Andrew Rybchenko
> >>>>>>>>>> On 11/3/19 9:57 AM, Matan Azrad wrote:
> >>>>>>>>>>> Hi
> >>>>>>>>>>>
> >>>>>>>>>>> From: Andrew Rybchenko
> >>>>>>>>>>>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula
> >>>>>>>>>>>> wrote:
> >>>>>>>>>>>>>> From: Pavan Nikhilesh Bhagavatula
> >>>>>>>>>>>>>>> Hi Matan,
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> Hi Pavan
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> From: Pavan Nikhilesh
> >>>>>>>>>>>>>>>> <pbhagavatula@marvell.com>
> >>>>>>>>>>>>>>>>> Some PMDs cannot work when certain offloads are
> >>>>>>>>>>>>>>>>> enable/disabled, as a workaround PMDs auto
> >>>>>>>>>>>>>>>>> enable/disable offloads internally and expose it
> >>>>>>>>>>>>>>>>> through
> >>>>>>>>>>>>>>>>> dev->data-dev_conf.rxmode.offloads.
> >>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>> After device specific dev_configure is called compare
> >>>>>>>>>>>>>>>>> the requested offloads to the offloads exposed by
> the
> >>>>>>>>>>>>>>>>> PMD and, if the PMD failed to enable a given offload
> >>>>>>>>>>>>>>>>> then log it and return -EINVAL from
> >>>>>>>>>>>>>>>>> rte_eth_dev_configure, else if the PMD failed to
> >>>>>>>>>>>>>>>>> disable a given offload log and continue with
> rte_eth_dev_configure.
> >>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> rte_eth_dev_configure can be called more than 1 time
> in
> >>>>>>>>>>>>>>>> the device life time, How can you know what is the
> >>>>>>>>>>>>>>>> minimum offload configurations required by the port
> >>>>>>>>>>>>>>>> after the first call?
> >>>>>>>>>>>>>>>> Maybe putting it in dev info is better, what do you
> think?
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> We only return -EINVAL in the case where we enable an
> >>>>>>>>>>>>>>> offload advertised by dev_info and the port still fails
> >>>>>>>>>>>>>>> to enable it.
> >>>>>>>>>>>>>> Are you sure it is ok that devices may disable\enable
> >>>>>>>>>>>>>> offloads under the hood without user notification?
> >>>>>>>>>>>>> Some devices already do it. The above check adds
> >>>>>>>>>>>>> validation for the same.
> >>>>>>>>>>>> The problem is that some offloads cannot be disabled.
> >>>>>>>>>>> Yes, I understand it.
> >>>>>>>>>>>
> >>>>>>>>>>>> If application does not request Rx checksum offload since
> >>>>>>>>>>>> it does use it, it is not a problem to report it.
> >>>>>>>>>>> Yes, for RX checksum I tend to agree that application
> >>>>>>>>>>> doesn't care if the
> >>>>>>>>>> PMD will calculate the checksum in spite of the offload is
> >>>>>>>>>> disabled.
> >>>>>>>>>>>
> >>>>>>>>>>> But what's about other offloads: For example in RX: LRO,
> >>>>>>>>>>> CRC_KEEP, VLAN_STRIP, JUMBO If the PMD will stay them on
> >>>>>>>>>>> while the app is disabling it, It can cause a problems to
> >>>>>>>>>>> the
> >>>>>>>>>> application (affects the packet length).
> >>>>>>>>>>
> >>>>>>>>>> Yes, I agree that some offloads are critical to be disabled,
> >>>>>>>>>> but RSS_HASH discussed in the changeset is not critical.
> >>>>>>>>>
> >>>>>>>>> So, are you agree It should not be checked globally for all
> >>>>>>>>> the offloads in
> >>>>>>>> ethdev layer?
> >>>>>>>>
> >>>>>>>> If offload is not requested, but enabled (since PMD cannot
> >>>>>>>> disable it), right not it will not fail configure, but warn
> >>>>>>>> about it in logs.
> >>>>>>>>
> >>>>>>>
> >>>>>>> In this case warning print is not enough since it can be
> >>>>>>> critical for the
> >>>>>> application for some offloads.
> >>>>>>> It can be very weird for the application to see that some
> >>>>>>> offload are on
> >>>>>> while the application doesn't expect them to be on.
> >>>>>>> it even can cause app crash(at least for the RX offload I wrote
> >>>>>>> above).
> >>>>>>
> >>>>>> The patch improves the situation. Earlier it was silent, now it
> >>>>>> will be at least visible.
> >>>>>
> >>>>> We can do it visible inside the limited PMDs.
> >>>>
> >>>> Why?
> >>>
> >>> Because this is not according to what application should understand
> >>> from
> >> the ethdev API.
> >>
> >> It does not answer why it should be inside the limited PMDs instead
> >> of ethdev layer.
> >
> > Why not?
> > Application doesn't expect to it and it may affect it.
> >
> >>>>>> I'm afraid that in 19.11 release cycle we cannot change it to
> >>>>>> fail dev_configure. I think it will be too destructive. Future
> >>>>>> improvement should be discussed separately.
> >>>>>
> >>>>> So we can remove this ethdev patch now and let the PMD to do it
> >>>>> until we will find better solution later.
> >>>>
> >>>> Sorry, but I don't think so.
> >>>>
> >>>>>>>>> It even be more problematic if the dynamic offload field in
> >>>>>>>>> mbuf is not exist at all.
> >>>>>>>
> >>>>>>> Any answer here?
> >>>>>
> >>>>> A Rx offload requires dynamic mbuf field cannot stay visible while
> >>>>> the app disabling it. Because the dynamic mbuf field probably is
> >>>>> not set in the mbuf. May cause problems.
> >>>>>
> >>>>>> Please, clarify the question.
> >>>>>>
> >>>
> >>> No answer here.
> >>
> >> Sorry, but I don't understand the problem.
> >> If there is no dynamic field, it will not be set.
> > Why not? The offload is enabled for the PMD perspective.
> >
> >> If there is dynamic field, it is the same as regular fields.
> >>
> >>>>>>>>>>
> >>>>>>>>>>> For example in TX: TSO, VLAN, MULTI_SEG.....
> >>>>>>>>>>
> >>>>>>>>>> Tx is not that critical since application should not request
> >>>>>>>>>> these offloads per- packet. Tx offloads are mainly required
> >>>>>>>>>> to ensure that application may request the offload per packet
> >>>>>>>>>> and it will be done.
> >>>>>>>>>
> >>>>>>>>> yes, you right, In TX it looks less critical (for now).
> >>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>>> Of course, it could be a problem if the offload is used,
> >>>>>>>>>>>> but application wants to disable it, for example, for
> >>>>>>>>>>>> debugging purposes. In this case, the solution is to mask
> >>>>>>>>>>>> offloads on application level, which is not ideal as well.
> >>>>>>>>>>> Why not ideal?
> >>>>>>>>>>
> >>>>>>>>>> It eats CPU cycles.
> >>>>>>>>>
> >>>>>>>>> Sorry, I don't understand your use case here.
> >>>>>>>>
> >>>>>>>> If application wants to try code path without, for example, Rx
> >>>>>>>> checksum offload, it could be insufficient to disable the
> >>>>>>>> offload right now, but also required to cleanup offload results
> >>>>>>>> flags in each mbuf (if PMD does not support the offload disabling).
> >>>>>>>
> >>>>>>> What is "right now"? Configuration time?
> >>>>>>
> >>>>>> Right now is the current state of some drivers in DPDK tree.
> >>>>>>
> >>>>>
> >>>>> OK. I think the offload configuration is in configuration time. No
> >>>>> data-path.
> >>>>>
> >>>>>>> If application will know that PMD cannot disable the rx-checksum
> >>>>>>> in configuration time, It can plan to not clean this flag in
> >>>>>>> mbuf for each rx
> >>>>>> mbuf.
> >>>>>>
> >>>>>> Yes and application has a way to know it - take a look at
> >>>>>> dev->data->dev_conf.rxmode.offloads.
> >>>>>
> >>>>> As I understand, before this patch, this field used for ethdev
> >>>>> layer knowledge to track on the application Rx offload
> >>>>> configuration. Am I wrong?
> >>>>
> >>>> I think it is just Rx offloads configuration.
> >>>> It is better to have real offloads here since it is used on Rx
> >>>> queue setup to mask already enabled offloads.
> >>>
> >>> And in DPDK or any SW management controls a device, the
> >>> configuration
> >> must be set by the user.
> >>> So, it should reflect the user configuration as is.
> >>
> >> It is ideal world which is unfortunately too far from real life.
> >> There is always a trade off. It is possible to define too restrictive
> >> interface which will enforce complicated implementation with bad
> >> performance characteristics for no real value.
> >>
> >> In any case, the patch simply makes the difference visible.
> >> It does not enforce any rules except to fail configure if requested
> >> offload is not enabled which is a strong violation of the interface.
> >> If you don't like it, we can discuss the point. In the area of not
> >> requested but enabled offloads, it just adds logs. No changes in
> >> behaviour. I'm strongly against making it hard failure in 19.11 since
> >> it is too late for the decision. We can discuss it later separately from the
> patch.
> >>
> > While I don't agree with the patch and the idea here,  we can continue
> discuss later.
> > I think we understand the ideas of both of us and we can dig to it later.
> 
> I agree that it is time to wrap the discussion.
> Could you make it clear what you don't like in the patch and why.
> 
> It does 3 things for all port at the end of rte_eth_dev_configure() based on
> dev->data->dev_conf (if PMD updates it in the case of violations).
> 
> 1. If requested offload is not enabled, log error message.
> 
> 2. If requested offload is not enabled, fail dev_configure by
>    returning error and deconfiguring all queues.
> 
> 3. If not requested offload is enabled, log info message.
> 
> Above is done for Rx and Tx offloads.

Agree with your summary.

My problem in this patch is part 3:
This part implies by a formal way(ethdev) that there are 2 configurations:
1. The application configuration.
2. The actual device configuration.

I think that formally if there is a difference between both, an error must be returned.
Informally, PMD can do whatever it want with good documentation in its doc file.   


Matan.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-08 11:48                                                               ` Matan Azrad
@ 2019-11-08 12:09                                                                 ` Andrew Rybchenko
  2019-11-08 12:59                                                                   ` Thomas Monjalon
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-08 12:09 UTC (permalink / raw)
  To: Matan Azrad, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, Thomas Monjalon
  Cc: dev

On 11/8/19 2:48 PM, Matan Azrad wrote:
> 
> 
> From: Andrew Rybchenko
>> On 11/8/19 1:29 PM, Matan Azrad wrote:
>>>
>>>
>>> From: Andrew Rybchenko
>>>> Sent: Friday, November 8, 2019 12:12 PM
>>>> To: Matan Azrad <matan@mellanox.com>; Pavan Nikhilesh Bhagavatula
>>>> <pbhagavatula@marvell.com>; ferruh.yigit@intel.com; Jerin Jacob
>>>> Kollanukkaran <jerinj@marvell.com>; Thomas Monjalon
>>>> <thomas@monjalon.net>
>>>> Cc: dev@dpdk.org
>>>> Subject: Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to
>>>> offloads set by PMD
>>>>
>>>> On 11/7/19 9:56 AM, Matan Azrad wrote:
>>>>> Hi
>>>>>
>>>>> From: Andrew Rybchenko
>>>>>> On 11/6/19 9:58 AM, Matan Azrad wrote:
>>>>>>>
>>>>>>>
>>>>>>> From: Andrew Rybchenko
>>>>>>>> On 11/5/19 5:05 PM, Matan Azrad wrote:
>>>>>>>>> From: Andrew Rybchenko
>>>>>>>>>> On 11/3/19 6:16 PM, Matan Azrad wrote
>>>>>>>>>>> From: Andrew Rybchenko
>>>>>>>>>>>> On 11/3/19 9:57 AM, Matan Azrad wrote:
>>>>>>>>>>>>> Hi
>>>>>>>>>>>>>
>>>>>>>>>>>>> From: Andrew Rybchenko
>>>>>>>>>>>>>> On 10/31/19 7:33 PM, Pavan Nikhilesh Bhagavatula
>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>> From: Pavan Nikhilesh Bhagavatula
>>>>>>>>>>>>>>>>> Hi Matan,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Hi Pavan
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> From: Pavan Nikhilesh
>>>>>>>>>>>>>>>>>> <pbhagavatula@marvell.com>
>>>>>>>>>>>>>>>>>>> Some PMDs cannot work when certain offloads are
>>>>>>>>>>>>>>>>>>> enable/disabled, as a workaround PMDs auto
>>>>>>>>>>>>>>>>>>> enable/disable offloads internally and expose it
>>>>>>>>>>>>>>>>>>> through
>>>>>>>>>>>>>>>>>>> dev->data-dev_conf.rxmode.offloads.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> After device specific dev_configure is called compare
>>>>>>>>>>>>>>>>>>> the requested offloads to the offloads exposed by the
>>>>>>>>>>>>>>>>>>> PMD and, if the PMD failed to enable a given offload
>>>>>>>>>>>>>>>>>>> then log it and return -EINVAL from
>>>>>>>>>>>>>>>>>>> rte_eth_dev_configure, else if the PMD failed to
>>>>>>>>>>>>>>>>>>> disable a given offload log and continue with rte_eth_dev_configure.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> rte_eth_dev_configure can be called more than 1 time in
>>>>>>>>>>>>>>>>>> the device life time, How can you know what is the
>>>>>>>>>>>>>>>>>> minimum offload configurations required by the port
>>>>>>>>>>>>>>>>>> after the first call?
>>>>>>>>>>>>>>>>>> Maybe putting it in dev info is better, what do you think?
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> We only return -EINVAL in the case where we enable an
>>>>>>>>>>>>>>>>> offload advertised by dev_info and the port still fails
>>>>>>>>>>>>>>>>> to enable it.
>>>>>>>>>>>>>>>> Are you sure it is ok that devices may disable\enable
>>>>>>>>>>>>>>>> offloads under the hood without user notification?
>>>>>>>>>>>>>>> Some devices already do it. The above check adds
>>>>>>>>>>>>>>> validation for the same.
>>>>>>>>>>>>>> The problem is that some offloads cannot be disabled.
>>>>>>>>>>>>> Yes, I understand it.
>>>>>>>>>>>>>
>>>>>>>>>>>>>> If application does not request Rx checksum offload since
>>>>>>>>>>>>>> it does use it, it is not a problem to report it.
>>>>>>>>>>>>> Yes, for RX checksum I tend to agree that application
>>>>>>>>>>>>> doesn't care if the
>>>>>>>>>>>> PMD will calculate the checksum in spite of the offload is
>>>>>>>>>>>> disabled.
>>>>>>>>>>>>>
>>>>>>>>>>>>> But what's about other offloads: For example in RX: LRO,
>>>>>>>>>>>>> CRC_KEEP, VLAN_STRIP, JUMBO If the PMD will stay them on
>>>>>>>>>>>>> while the app is disabling it, It can cause a problems to
>>>>>>>>>>>>> the
>>>>>>>>>>>> application (affects the packet length).
>>>>>>>>>>>>
>>>>>>>>>>>> Yes, I agree that some offloads are critical to be disabled,
>>>>>>>>>>>> but RSS_HASH discussed in the changeset is not critical.
>>>>>>>>>>>
>>>>>>>>>>> So, are you agree It should not be checked globally for all
>>>>>>>>>>> the offloads in
>>>>>>>>>> ethdev layer?
>>>>>>>>>>
>>>>>>>>>> If offload is not requested, but enabled (since PMD cannot
>>>>>>>>>> disable it), right not it will not fail configure, but warn
>>>>>>>>>> about it in logs.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> In this case warning print is not enough since it can be
>>>>>>>>> critical for the
>>>>>>>> application for some offloads.
>>>>>>>>> It can be very weird for the application to see that some
>>>>>>>>> offload are on
>>>>>>>> while the application doesn't expect them to be on.
>>>>>>>>> it even can cause app crash(at least for the RX offload I wrote
>>>>>>>>> above).
>>>>>>>>
>>>>>>>> The patch improves the situation. Earlier it was silent, now it
>>>>>>>> will be at least visible.
>>>>>>>
>>>>>>> We can do it visible inside the limited PMDs.
>>>>>>
>>>>>> Why?
>>>>>
>>>>> Because this is not according to what application should understand
>>>>> from
>>>> the ethdev API.
>>>>
>>>> It does not answer why it should be inside the limited PMDs instead
>>>> of ethdev layer.
>>>
>>> Why not?
>>> Application doesn't expect to it and it may affect it.
>>>
>>>>>>>> I'm afraid that in 19.11 release cycle we cannot change it to
>>>>>>>> fail dev_configure. I think it will be too destructive. Future
>>>>>>>> improvement should be discussed separately.
>>>>>>>
>>>>>>> So we can remove this ethdev patch now and let the PMD to do it
>>>>>>> until we will find better solution later.
>>>>>>
>>>>>> Sorry, but I don't think so.
>>>>>>
>>>>>>>>>>> It even be more problematic if the dynamic offload field in
>>>>>>>>>>> mbuf is not exist at all.
>>>>>>>>>
>>>>>>>>> Any answer here?
>>>>>>>
>>>>>>> A Rx offload requires dynamic mbuf field cannot stay visible while
>>>>>>> the app disabling it. Because the dynamic mbuf field probably is
>>>>>>> not set in the mbuf. May cause problems.
>>>>>>>
>>>>>>>> Please, clarify the question.
>>>>>>>>
>>>>>
>>>>> No answer here.
>>>>
>>>> Sorry, but I don't understand the problem.
>>>> If there is no dynamic field, it will not be set.
>>> Why not? The offload is enabled for the PMD perspective.
>>>
>>>> If there is dynamic field, it is the same as regular fields.
>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> For example in TX: TSO, VLAN, MULTI_SEG.....
>>>>>>>>>>>>
>>>>>>>>>>>> Tx is not that critical since application should not request
>>>>>>>>>>>> these offloads per- packet. Tx offloads are mainly required
>>>>>>>>>>>> to ensure that application may request the offload per packet
>>>>>>>>>>>> and it will be done.
>>>>>>>>>>>
>>>>>>>>>>> yes, you right, In TX it looks less critical (for now).
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>> Of course, it could be a problem if the offload is used,
>>>>>>>>>>>>>> but application wants to disable it, for example, for
>>>>>>>>>>>>>> debugging purposes. In this case, the solution is to mask
>>>>>>>>>>>>>> offloads on application level, which is not ideal as well.
>>>>>>>>>>>>> Why not ideal?
>>>>>>>>>>>>
>>>>>>>>>>>> It eats CPU cycles.
>>>>>>>>>>>
>>>>>>>>>>> Sorry, I don't understand your use case here.
>>>>>>>>>>
>>>>>>>>>> If application wants to try code path without, for example, Rx
>>>>>>>>>> checksum offload, it could be insufficient to disable the
>>>>>>>>>> offload right now, but also required to cleanup offload results
>>>>>>>>>> flags in each mbuf (if PMD does not support the offload disabling).
>>>>>>>>>
>>>>>>>>> What is "right now"? Configuration time?
>>>>>>>>
>>>>>>>> Right now is the current state of some drivers in DPDK tree.
>>>>>>>>
>>>>>>>
>>>>>>> OK. I think the offload configuration is in configuration time. No
>>>>>>> data-path.
>>>>>>>
>>>>>>>>> If application will know that PMD cannot disable the rx-checksum
>>>>>>>>> in configuration time, It can plan to not clean this flag in
>>>>>>>>> mbuf for each rx
>>>>>>>> mbuf.
>>>>>>>>
>>>>>>>> Yes and application has a way to know it - take a look at
>>>>>>>> dev->data->dev_conf.rxmode.offloads.
>>>>>>>
>>>>>>> As I understand, before this patch, this field used for ethdev
>>>>>>> layer knowledge to track on the application Rx offload
>>>>>>> configuration. Am I wrong?
>>>>>>
>>>>>> I think it is just Rx offloads configuration.
>>>>>> It is better to have real offloads here since it is used on Rx
>>>>>> queue setup to mask already enabled offloads.
>>>>>
>>>>> And in DPDK or any SW management controls a device, the
>>>>> configuration
>>>> must be set by the user.
>>>>> So, it should reflect the user configuration as is.
>>>>
>>>> It is ideal world which is unfortunately too far from real life.
>>>> There is always a trade off. It is possible to define too restrictive
>>>> interface which will enforce complicated implementation with bad
>>>> performance characteristics for no real value.
>>>>
>>>> In any case, the patch simply makes the difference visible.
>>>> It does not enforce any rules except to fail configure if requested
>>>> offload is not enabled which is a strong violation of the interface.
>>>> If you don't like it, we can discuss the point. In the area of not
>>>> requested but enabled offloads, it just adds logs. No changes in
>>>> behaviour. I'm strongly against making it hard failure in 19.11 since
>>>> it is too late for the decision. We can discuss it later separately from the patch.
>>>>
>>> While I don't agree with the patch and the idea here,  we can continue discuss later.
>>> I think we understand the ideas of both of us and we can dig to it later.
>>
>> I agree that it is time to wrap the discussion.
>> Could you make it clear what you don't like in the patch and why.
>>
>> It does 3 things for all port at the end of rte_eth_dev_configure() based on
>> dev->data->dev_conf (if PMD updates it in the case of violations).
>>
>> 1. If requested offload is not enabled, log error message.
>>
>> 2. If requested offload is not enabled, fail dev_configure by
>>    returning error and deconfiguring all queues.
>>
>> 3. If not requested offload is enabled, log info message.
>>
>> Above is done for Rx and Tx offloads.
> 
> Agree with your summary.
> 
> My problem in this patch is part 3:
> This part implies by a formal way(ethdev) that there are 2 configurations:
> 1. The application configuration.
> 2. The actual device configuration.
> 
> I think that formally if there is a difference between both, an error must be returned.
> Informally, PMD can do whatever it want with good documentation in its doc file.   

OK I see. The problem that you'd like make (3) stronger
check to log and return error.

Above discussion cover it. We can discuss it later, but
right now it cannot be done (at least from my point of
view) as I said above.

Many thanks.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD
  2019-11-08 12:09                                                                 ` Andrew Rybchenko
@ 2019-11-08 12:59                                                                   ` Thomas Monjalon
  0 siblings, 0 replies; 246+ messages in thread
From: Thomas Monjalon @ 2019-11-08 12:59 UTC (permalink / raw)
  To: Matan Azrad
  Cc: Andrew Rybchenko, Pavan Nikhilesh Bhagavatula, ferruh.yigit,
	Jerin Jacob Kollanukkaran, dev

08/11/2019 13:09, Andrew Rybchenko:
> On 11/8/19 2:48 PM, Matan Azrad wrote:
> > From: Andrew Rybchenko
> >> It does 3 things for all port at the end of rte_eth_dev_configure() based on
> >> dev->data->dev_conf (if PMD updates it in the case of violations).
> >>
> >> 1. If requested offload is not enabled, log error message.
> >>
> >> 2. If requested offload is not enabled, fail dev_configure by
> >>    returning error and deconfiguring all queues.
> >>
> >> 3. If not requested offload is enabled, log info message.
> >>
> >> Above is done for Rx and Tx offloads.
> > 
> > Agree with your summary.
> > 
> > My problem in this patch is part 3:
> > This part implies by a formal way(ethdev) that there are 2 configurations:
> > 1. The application configuration.
> > 2. The actual device configuration.
> > 
> > I think that formally if there is a difference between both, an error must be returned.
> > Informally, PMD can do whatever it want with good documentation in its doc file.   
> 
> OK I see. The problem that you'd like make (3) stronger
> check to log and return error.
> 
> Above discussion cover it. We can discuss it later, but
> right now it cannot be done (at least from my point of
> view) as I said above.

Yes, making checks stronger can always be done later.
It looks a step is done in this patch.

In general, the gap between app needs and PMD support
needs to be better handled in ethdev.

Matan, I suggest you submit a patch for next release,
so it will be a base for continuing this discussion.



^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-07 19:40                                   ` Ferruh Yigit
  2019-11-08  4:13                                     ` Jerin Jacob
@ 2019-11-08 13:54                                     ` Ananyev, Konstantin
  2019-11-08 15:01                                       ` Jerin Jacob
  1 sibling, 1 reply; 246+ messages in thread
From: Ananyev, Konstantin @ 2019-11-08 13:54 UTC (permalink / raw)
  To: Yigit, Ferruh, Jerin Jacob
  Cc: Pavan Nikhilesh, Andrew Rybchenko, jerinj, thomas, Lu, Wenzhuo,
	Wu, Jingjing, Iremonger, Bernard, Mcnamara, John, Kovacevic,
	Marko, dev



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
> Sent: Thursday, November 7, 2019 7:41 PM
> To: Jerin Jacob <jerinjacobk@gmail.com>
> Cc: Pavan Nikhilesh <pbhagavatula@marvell.com>; Andrew Rybchenko <arybchenko@solarflare.com>; jerinj@marvell.com;
> thomas@monjalon.net; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>;
> dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
> 
> On 11/7/2019 6:55 PM, Jerin Jacob wrote:
> >
> >
> > On Fri, 8 Nov, 2019, 12:10 am Ferruh Yigit, <ferruh.yigit@intel.com
> > <mailto:ferruh.yigit@intel.com>> wrote:
> >
> >     On 11/6/2019 7:18 PM, pbhagavatula@marvell.com
> >     <mailto:pbhagavatula@marvell.com> wrote:
> >     > From: Pavan Nikhilesh <pbhagavatula@marvell.com
> >     <mailto:pbhagavatula@marvell.com>>
> >     >
> >     > Add command to set supported ptype mask.
> >     > Usage:
> >     >       set port <port_id> ptype_mask >  /* ***************
> >     >
> >     >  /* list of instructions */
> >     > @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] = {
> >     >       (cmdline_parse_inst_t *)&cmd_show_vf_stats,
> >     >       (cmdline_parse_inst_t *)&cmd_clear_vf_stats,
> >     >       (cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
> >     > +     (cmdline_parse_inst_t *)&cmd_set_port_ptypes,
> >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
> >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
> >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
> >     > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> >     > index 5ba974162..812aebf35 100644
> >     > --- a/app/test-pmd/testpmd.c
> >     > +++ b/app/test-pmd/testpmd.c
> >     > @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
> >     >       queueid_t qi;
> >     >       struct rte_port *port;
> >     >       struct rte_ether_addr mac_addr;
> >     > +     static uint8_t clr_ptypes = 1;
> >     >
> >     >       if (port_id_is_invalid(pid, ENABLED_WARN))
> >     >               return 0;
> >     > @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
> >     >                       }
> >     >               }
> >     >               configure_rxtx_dump_callbacks(verbose_level);
> >     > +             if (clr_ptypes) {
> >     > +                     clr_ptypes = 0;
> >     > +                     rte_eth_dev_set_ptypes(pi, RTE_PTYPE_UNKNOWN, NULL, 0);
> >     > +             }
> >
> >     I am not sure about this command, we have now capability to set/disable ptypes
> >     on demand, why disabling them by default?
> >
> >
> > As forward engines are not using the ptype offload. If a specific forward mode
> > need the offload, it can be enabled.

Well, at least now user can see ptype in pkt dump with 'set verbose > 0'
It's definitely looks loke a a behavior change. 
Wonder why it can't be done visa-versa?
Keep current behavior as default one (all ptypes are un-masked) and
have special command to disable/enable ptypes.
as I understand such command was added by these series. correct? 
Konstantin 	

> >
> 
> OK, I am still not sure but I understand your reasoning.
> 
> But this is a behavior change and it may caught people, what about following
> more operational updates:
> - Separate this into its own patch, this is different than adding new command
> - move "clr_ptypes" next to other static global variables, to make this
> selection more obvious, and those global variables tend to have some comments,
> we can add comment to this one as well.
> - print a log when "rte_eth_dev_set_ptypes()" returns success, to say packets
> types parsing is disabled, to help user to understand what is happening. Because
> currently there is no other way to get the current configured ptypes from PMD.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-08 13:54                                     ` Ananyev, Konstantin
@ 2019-11-08 15:01                                       ` Jerin Jacob
  2019-11-11  4:56                                         ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 246+ messages in thread
From: Jerin Jacob @ 2019-11-08 15:01 UTC (permalink / raw)
  To: Ananyev, Konstantin
  Cc: Yigit, Ferruh, Pavan Nikhilesh, Andrew Rybchenko, jerinj, thomas,
	Lu, Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara, John,
	Kovacevic, Marko, dev

On Fri, Nov 8, 2019 at 7:24 PM Ananyev, Konstantin
<konstantin.ananyev@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
> > Sent: Thursday, November 7, 2019 7:41 PM
> > To: Jerin Jacob <jerinjacobk@gmail.com>
> > Cc: Pavan Nikhilesh <pbhagavatula@marvell.com>; Andrew Rybchenko <arybchenko@solarflare.com>; jerinj@marvell.com;
> > thomas@monjalon.net; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard
> > <bernard.iremonger@intel.com>; Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>;
> > dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
> >
> > On 11/7/2019 6:55 PM, Jerin Jacob wrote:
> > >
> > >
> > > On Fri, 8 Nov, 2019, 12:10 am Ferruh Yigit, <ferruh.yigit@intel.com
> > > <mailto:ferruh.yigit@intel.com>> wrote:
> > >
> > >     On 11/6/2019 7:18 PM, pbhagavatula@marvell.com
> > >     <mailto:pbhagavatula@marvell.com> wrote:
> > >     > From: Pavan Nikhilesh <pbhagavatula@marvell.com
> > >     <mailto:pbhagavatula@marvell.com>>
> > >     >
> > >     > Add command to set supported ptype mask.
> > >     > Usage:
> > >     >       set port <port_id> ptype_mask >  /* ***************
> > >     >
> > >     >  /* list of instructions */
> > >     > @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] = {
> > >     >       (cmdline_parse_inst_t *)&cmd_show_vf_stats,
> > >     >       (cmdline_parse_inst_t *)&cmd_clear_vf_stats,
> > >     >       (cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
> > >     > +     (cmdline_parse_inst_t *)&cmd_set_port_ptypes,
> > >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
> > >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
> > >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
> > >     > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> > >     > index 5ba974162..812aebf35 100644
> > >     > --- a/app/test-pmd/testpmd.c
> > >     > +++ b/app/test-pmd/testpmd.c
> > >     > @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
> > >     >       queueid_t qi;
> > >     >       struct rte_port *port;
> > >     >       struct rte_ether_addr mac_addr;
> > >     > +     static uint8_t clr_ptypes = 1;
> > >     >
> > >     >       if (port_id_is_invalid(pid, ENABLED_WARN))
> > >     >               return 0;
> > >     > @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
> > >     >                       }
> > >     >               }
> > >     >               configure_rxtx_dump_callbacks(verbose_level);
> > >     > +             if (clr_ptypes) {
> > >     > +                     clr_ptypes = 0;
> > >     > +                     rte_eth_dev_set_ptypes(pi, RTE_PTYPE_UNKNOWN, NULL, 0);
> > >     > +             }
> > >
> > >     I am not sure about this command, we have now capability to set/disable ptypes
> > >     on demand, why disabling them by default?
> > >
> > >
> > > As forward engines are not using the ptype offload. If a specific forward mode
> > > need the offload, it can be enabled.
>
> Well, at least now user can see ptype in pkt dump with 'set verbose > 0'
> It's definitely looks loke a a behavior change.
> Wonder why it can't be done visa-versa?
> Keep current behavior as default one (all ptypes are un-masked) and
> have special command to disable/enable ptypes.
> as I understand such command was added by these series. correct?

IMO, we are following the principle that by default all offloads are
disabled and enable it
based on the need to have optimal performance across the DPDK. This
change will be
on the same theme.

Regarding the verbose > 0 cases, I think, we can call
rte_eth_dev_set_ptypes() to all PTYPES on
the setting verbose callback.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 2/8] ethdev: add mbuf RSS update as an offload
  2019-11-07 17:24                               ` Ferruh Yigit
@ 2019-11-10 14:43                                 ` Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-11-10 14:43 UTC (permalink / raw)
  To: Ferruh Yigit, arybchenko, Jerin Jacob Kollanukkaran, thomas,
	John McNamara, Marko Kovacevic
  Cc: dev



>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
>Sent: Thursday, November 7, 2019 10:55 PM
>To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>;
>arybchenko@solarflare.com; Jerin Jacob Kollanukkaran
><jerinj@marvell.com>; thomas@monjalon.net; John McNamara
><john.mcnamara@intel.com>; Marko Kovacevic
><marko.kovacevic@intel.com>
>Cc: dev@dpdk.org
>Subject: Re: [dpdk-dev] [PATCH v16 2/8] ethdev: add mbuf RSS update
>as an offload
>
>On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be
>used to
>> enable/disable PMDs write to `rte_mbuf::hash::rss`.
>> PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
>> by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
>>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>
>testpmd support to enable the rx_offload seems missing, can you
>please check
>"port config 0 rx_offload ... " command, I think we should have
>following too:
>"port config 0 rx_offload rss_hash"

I will add this in the next version.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [EXT] Re: [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-08 15:01                                       ` Jerin Jacob
@ 2019-11-11  4:56                                         ` Pavan Nikhilesh Bhagavatula
  2019-11-11  5:02                                           ` Jerin Jacob
  0 siblings, 1 reply; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-11-11  4:56 UTC (permalink / raw)
  To: Jerin Jacob, Ananyev, Konstantin
  Cc: Yigit, Ferruh, Andrew Rybchenko, Jerin Jacob Kollanukkaran,
	thomas, Lu, Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara,
	John, Kovacevic, Marko, dev

>On Fri, Nov 8, 2019 at 7:24 PM Ananyev, Konstantin
><konstantin.ananyev@intel.com> wrote:
>>
>>
>>
>> > -----Original Message-----
>> > From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
>> > Sent: Thursday, November 7, 2019 7:41 PM
>> > To: Jerin Jacob <jerinjacobk@gmail.com>
>> > Cc: Pavan Nikhilesh <pbhagavatula@marvell.com>; Andrew
>Rybchenko <arybchenko@solarflare.com>; jerinj@marvell.com;
>> > thomas@monjalon.net; Lu, Wenzhuo <wenzhuo.lu@intel.com>;
>Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard
>> > <bernard.iremonger@intel.com>; Mcnamara, John
><john.mcnamara@intel.com>; Kovacevic, Marko
><marko.kovacevic@intel.com>;
>> > dev@dpdk.org
>> > Subject: Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add
>command to set supported ptype mask
>> >
>> > On 11/7/2019 6:55 PM, Jerin Jacob wrote:
>> > >
>> > >
>> > > On Fri, 8 Nov, 2019, 12:10 am Ferruh Yigit, <ferruh.yigit@intel.com
>> > > <mailto:ferruh.yigit@intel.com>> wrote:
>> > >
>> > >     On 11/6/2019 7:18 PM, pbhagavatula@marvell.com
>> > >     <mailto:pbhagavatula@marvell.com> wrote:
>> > >     > From: Pavan Nikhilesh <pbhagavatula@marvell.com
>> > >     <mailto:pbhagavatula@marvell.com>>
>> > >     >
>> > >     > Add command to set supported ptype mask.
>> > >     > Usage:
>> > >     >       set port <port_id> ptype_mask >  /* ***************
>> > >     >
>> > >     >  /* list of instructions */
>> > >     > @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] =
>{
>> > >     >       (cmdline_parse_inst_t *)&cmd_show_vf_stats,
>> > >     >       (cmdline_parse_inst_t *)&cmd_clear_vf_stats,
>> > >     >       (cmdline_parse_inst_t
>*)&cmd_show_port_supported_ptypes,
>> > >     > +     (cmdline_parse_inst_t *)&cmd_set_port_ptypes,
>> > >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
>> > >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
>> > >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
>> > >     > diff --git a/app/test-pmd/testpmd.c b/app/test-
>pmd/testpmd.c
>> > >     > index 5ba974162..812aebf35 100644
>> > >     > --- a/app/test-pmd/testpmd.c
>> > >     > +++ b/app/test-pmd/testpmd.c
>> > >     > @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
>> > >     >       queueid_t qi;
>> > >     >       struct rte_port *port;
>> > >     >       struct rte_ether_addr mac_addr;
>> > >     > +     static uint8_t clr_ptypes = 1;
>> > >     >
>> > >     >       if (port_id_is_invalid(pid, ENABLED_WARN))
>> > >     >               return 0;
>> > >     > @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
>> > >     >                       }
>> > >     >               }
>> > >     >               configure_rxtx_dump_callbacks(verbose_level);
>> > >     > +             if (clr_ptypes) {
>> > >     > +                     clr_ptypes = 0;
>> > >     > +                     rte_eth_dev_set_ptypes(pi,
>RTE_PTYPE_UNKNOWN, NULL, 0);
>> > >     > +             }
>> > >
>> > >     I am not sure about this command, we have now capability to
>set/disable ptypes
>> > >     on demand, why disabling them by default?
>> > >
>> > >
>> > > As forward engines are not using the ptype offload. If a specific
>forwa
>> > > need the offload, it can be enabled.
>>
>> Well, at least now user can see ptype in pkt dump with 'set verbose >
>0'
>> It's definitely looks loke a a behavior change.
>> Wonder why it can't be done visa-versa?
>> Keep current behavior as default one (all ptypes are un-masked) and
>> have special command to disable/enable ptypes.
>> as I understand such command was added by these series. correct?
>
>IMO, we are following the principle that by default all offloads are
>disabled and enable it
>based on the need to have optimal performance across the DPDK. This
>change will be
>on the same theme.
>
>Regarding the verbose > 0 cases, I think, we can call
>rte_eth_dev_set_ptypes() to all PTYPES on
>the setting verbose callback.

Agree verbose > 0 case we can do set_ptypes with 
RTE_PTYPE_ALL_MASK. But what if the user wants to verify 
rte_eth_dev_set_ptypes() call itself in verbose mode?. 
Example:

	set port 0 ptype_mask RTE_PTYPE_L3_MASK
	set verbose 1

In this case user expects to see only L3 mask set. Wouldn’t it be confusing if
we set RTE_PTYPE_ALL_MASK under the hood when verbose level is increased?

Pavan.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [EXT] Re: [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-11  4:56                                         ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
@ 2019-11-11  5:02                                           ` Jerin Jacob
  2019-11-11 10:44                                             ` Ferruh Yigit
  0 siblings, 1 reply; 246+ messages in thread
From: Jerin Jacob @ 2019-11-11  5:02 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula
  Cc: Ananyev, Konstantin, Yigit, Ferruh, Andrew Rybchenko,
	Jerin Jacob Kollanukkaran, thomas, Lu, Wenzhuo, Wu, Jingjing,
	Iremonger, Bernard, Mcnamara, John, Kovacevic, Marko, dev

On Mon, Nov 11, 2019 at 10:26 AM Pavan Nikhilesh Bhagavatula
<pbhagavatula@marvell.com> wrote:
>
> >On Fri, Nov 8, 2019 at 7:24 PM Ananyev, Konstantin
> ><konstantin.ananyev@intel.com> wrote:
> >>
> >>
> >>
> >> > -----Original Message-----
> >> > From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
> >> > Sent: Thursday, November 7, 2019 7:41 PM
> >> > To: Jerin Jacob <jerinjacobk@gmail.com>
> >> > Cc: Pavan Nikhilesh <pbhagavatula@marvell.com>; Andrew
> >Rybchenko <arybchenko@solarflare.com>; jerinj@marvell.com;
> >> > thomas@monjalon.net; Lu, Wenzhuo <wenzhuo.lu@intel.com>;
> >Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard
> >> > <bernard.iremonger@intel.com>; Mcnamara, John
> ><john.mcnamara@intel.com>; Kovacevic, Marko
> ><marko.kovacevic@intel.com>;
> >> > dev@dpdk.org
> >> > Subject: Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add
> >command to set supported ptype mask
> >> >
> >> > On 11/7/2019 6:55 PM, Jerin Jacob wrote:
> >> > >
> >> > >
> >> > > On Fri, 8 Nov, 2019, 12:10 am Ferruh Yigit, <ferruh.yigit@intel.com
> >> > > <mailto:ferruh.yigit@intel.com>> wrote:
> >> > >
> >> > >     On 11/6/2019 7:18 PM, pbhagavatula@marvell.com
> >> > >     <mailto:pbhagavatula@marvell.com> wrote:
> >> > >     > From: Pavan Nikhilesh <pbhagavatula@marvell.com
> >> > >     <mailto:pbhagavatula@marvell.com>>
> >> > >     >
> >> > >     > Add command to set supported ptype mask.
> >> > >     > Usage:
> >> > >     >       set port <port_id> ptype_mask >  /* ***************
> >> > >     >
> >> > >     >  /* list of instructions */
> >> > >     > @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] =
> >{
> >> > >     >       (cmdline_parse_inst_t *)&cmd_show_vf_stats,
> >> > >     >       (cmdline_parse_inst_t *)&cmd_clear_vf_stats,
> >> > >     >       (cmdline_parse_inst_t
> >*)&cmd_show_port_supported_ptypes,
> >> > >     > +     (cmdline_parse_inst_t *)&cmd_set_port_ptypes,
> >> > >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
> >> > >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
> >> > >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
> >> > >     > diff --git a/app/test-pmd/testpmd.c b/app/test-
> >pmd/testpmd.c
> >> > >     > index 5ba974162..812aebf35 100644
> >> > >     > --- a/app/test-pmd/testpmd.c
> >> > >     > +++ b/app/test-pmd/testpmd.c
> >> > >     > @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
> >> > >     >       queueid_t qi;
> >> > >     >       struct rte_port *port;
> >> > >     >       struct rte_ether_addr mac_addr;
> >> > >     > +     static uint8_t clr_ptypes = 1;
> >> > >     >
> >> > >     >       if (port_id_is_invalid(pid, ENABLED_WARN))
> >> > >     >               return 0;
> >> > >     > @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
> >> > >     >                       }
> >> > >     >               }
> >> > >     >               configure_rxtx_dump_callbacks(verbose_level);
> >> > >     > +             if (clr_ptypes) {
> >> > >     > +                     clr_ptypes = 0;
> >> > >     > +                     rte_eth_dev_set_ptypes(pi,
> >RTE_PTYPE_UNKNOWN, NULL, 0);
> >> > >     > +             }
> >> > >
> >> > >     I am not sure about this command, we have now capability to
> >set/disable ptypes
> >> > >     on demand, why disabling them by default?
> >> > >
> >> > >
> >> > > As forward engines are not using the ptype offload. If a specific
> >forwa
> >> > > need the offload, it can be enabled.
> >>
> >> Well, at least now user can see ptype in pkt dump with 'set verbose >
> >0'
> >> It's definitely looks loke a a behavior change.
> >> Wonder why it can't be done visa-versa?
> >> Keep current behavior as default one (all ptypes are un-masked) and
> >> have special command to disable/enable ptypes.
> >> as I understand such command was added by these series. correct?
> >
> >IMO, we are following the principle that by default all offloads are
> >disabled and enable it
> >based on the need to have optimal performance across the DPDK. This
> >change will be
> >on the same theme.
> >
> >Regarding the verbose > 0 cases, I think, we can call
> >rte_eth_dev_set_ptypes() to all PTYPES on
> >the setting verbose callback.
>
> Agree verbose > 0 case we can do set_ptypes with
> RTE_PTYPE_ALL_MASK. But what if the user wants to verify
> rte_eth_dev_set_ptypes() call itself in verbose mode?.
> Example:
>
>         set port 0 ptype_mask RTE_PTYPE_L3_MASK
>         set verbose 1
>
> In this case user expects to see only L3 mask set. Wouldn’t it be confusing if
> we set RTE_PTYPE_ALL_MASK under the hood when verbose level is increased?

I thought of adding RTE_PTYPE_ALL_MASK in the callback to maintain the
existing behavior
if there is any concern in that area.

Either way is fine with me. (implicit RTE_PTYPE_ALL_MASK  in a
callback or explicit mask set in command line)

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [EXT] Re: [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask
  2019-11-11  5:02                                           ` Jerin Jacob
@ 2019-11-11 10:44                                             ` Ferruh Yigit
  0 siblings, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-11 10:44 UTC (permalink / raw)
  To: Jerin Jacob, Pavan Nikhilesh Bhagavatula
  Cc: Ananyev, Konstantin, Andrew Rybchenko, Jerin Jacob Kollanukkaran,
	thomas, Lu, Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara,
	John, Kovacevic, Marko, dev

On 11/11/2019 5:02 AM, Jerin Jacob wrote:
> On Mon, Nov 11, 2019 at 10:26 AM Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com> wrote:
>>
>>> On Fri, Nov 8, 2019 at 7:24 PM Ananyev, Konstantin
>>> <konstantin.ananyev@intel.com> wrote:
>>>>
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
>>>>> Sent: Thursday, November 7, 2019 7:41 PM
>>>>> To: Jerin Jacob <jerinjacobk@gmail.com>
>>>>> Cc: Pavan Nikhilesh <pbhagavatula@marvell.com>; Andrew
>>> Rybchenko <arybchenko@solarflare.com>; jerinj@marvell.com;
>>>>> thomas@monjalon.net; Lu, Wenzhuo <wenzhuo.lu@intel.com>;
>>> Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard
>>>>> <bernard.iremonger@intel.com>; Mcnamara, John
>>> <john.mcnamara@intel.com>; Kovacevic, Marko
>>> <marko.kovacevic@intel.com>;
>>>>> dev@dpdk.org
>>>>> Subject: Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add
>>> command to set supported ptype mask
>>>>>
>>>>> On 11/7/2019 6:55 PM, Jerin Jacob wrote:
>>>>>>
>>>>>>
>>>>>> On Fri, 8 Nov, 2019, 12:10 am Ferruh Yigit, <ferruh.yigit@intel.com
>>>>>> <mailto:ferruh.yigit@intel.com>> wrote:
>>>>>>
>>>>>>     On 11/6/2019 7:18 PM, pbhagavatula@marvell.com
>>>>>>     <mailto:pbhagavatula@marvell.com> wrote:
>>>>>>     > From: Pavan Nikhilesh <pbhagavatula@marvell.com
>>>>>>     <mailto:pbhagavatula@marvell.com>>
>>>>>>     >
>>>>>>     > Add command to set supported ptype mask.
>>>>>>     > Usage:
>>>>>>     >       set port <port_id> ptype_mask >  /* ***************
>>>>>>     >
>>>>>>     >  /* list of instructions */
>>>>>>     > @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] =
>>> {
>>>>>>     >       (cmdline_parse_inst_t *)&cmd_show_vf_stats,
>>>>>>     >       (cmdline_parse_inst_t *)&cmd_clear_vf_stats,
>>>>>>     >       (cmdline_parse_inst_t
>>> *)&cmd_show_port_supported_ptypes,
>>>>>>     > +     (cmdline_parse_inst_t *)&cmd_set_port_ptypes,
>>>>>>     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
>>>>>>     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
>>>>>>     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
>>>>>>     > diff --git a/app/test-pmd/testpmd.c b/app/test-
>>> pmd/testpmd.c
>>>>>>     > index 5ba974162..812aebf35 100644
>>>>>>     > --- a/app/test-pmd/testpmd.c
>>>>>>     > +++ b/app/test-pmd/testpmd.c
>>>>>>     > @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
>>>>>>     >       queueid_t qi;
>>>>>>     >       struct rte_port *port;
>>>>>>     >       struct rte_ether_addr mac_addr;
>>>>>>     > +     static uint8_t clr_ptypes = 1;
>>>>>>     >
>>>>>>     >       if (port_id_is_invalid(pid, ENABLED_WARN))
>>>>>>     >               return 0;
>>>>>>     > @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
>>>>>>     >                       }
>>>>>>     >               }
>>>>>>     >               configure_rxtx_dump_callbacks(verbose_level);
>>>>>>     > +             if (clr_ptypes) {
>>>>>>     > +                     clr_ptypes = 0;
>>>>>>     > +                     rte_eth_dev_set_ptypes(pi,
>>> RTE_PTYPE_UNKNOWN, NULL, 0);
>>>>>>     > +             }
>>>>>>
>>>>>>     I am not sure about this command, we have now capability to
>>> set/disable ptypes
>>>>>>     on demand, why disabling them by default?
>>>>>>
>>>>>>
>>>>>> As forward engines are not using the ptype offload. If a specific
>>> forwa
>>>>>> need the offload, it can be enabled.
>>>>
>>>> Well, at least now user can see ptype in pkt dump with 'set verbose >
>>> 0'
>>>> It's definitely looks loke a a behavior change.
>>>> Wonder why it can't be done visa-versa?
>>>> Keep current behavior as default one (all ptypes are un-masked) and
>>>> have special command to disable/enable ptypes.
>>>> as I understand such command was added by these series. correct?
>>>
>>> IMO, we are following the principle that by default all offloads are
>>> disabled and enable it
>>> based on the need to have optimal performance across the DPDK. This
>>> change will be
>>> on the same theme.
>>>
>>> Regarding the verbose > 0 cases, I think, we can call
>>> rte_eth_dev_set_ptypes() to all PTYPES on
>>> the setting verbose callback.
>>
>> Agree verbose > 0 case we can do set_ptypes with
>> RTE_PTYPE_ALL_MASK. But what if the user wants to verify
>> rte_eth_dev_set_ptypes() call itself in verbose mode?.
>> Example:
>>
>>         set port 0 ptype_mask RTE_PTYPE_L3_MASK
>>         set verbose 1
>>
>> In this case user expects to see only L3 mask set. Wouldn’t it be confusing if
>> we set RTE_PTYPE_ALL_MASK under the hood when verbose level is increased?
> 
> I thought of adding RTE_PTYPE_ALL_MASK in the callback to maintain the
> existing behavior
> if there is any concern in that area.
> 
> Either way is fine with me. (implicit RTE_PTYPE_ALL_MASK  in a
> callback or explicit mask set in command line)
> 

I think explicit set in command line is better, setting in the callback can be
confusing.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v17 00/10] ethdev: add new Rx offload flags
  2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
                                               ` (7 preceding siblings ...)
  2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask pbhagavatula
@ 2019-11-11 13:19                             ` pbhagavatula
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 01/10] ethdev: add set ptype function pbhagavatula
                                                 ` (10 more replies)
  8 siblings, 11 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-11 13:19 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` These flags can be used
to enable/disable PMD writes to rte_mbuf fields `hash.rss` and also
`ol_flags:PKT_RX_RSS`.

Add new packet type set function `rte_eth_dev_set_ptypes`,
allows application to inform PMDs about the packet types it is interested
in. Based on ptypes requested by application PMDs can optimize the Rx path.

For example, if a given PMD doesn't support any packet types that the
application is interested in then the application can disable[1] writes to
`mbuf.packet_type` done by the PMD and use a software ptype parser.
     [1] rte_eth_dev_set_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
					  NULL, 0);

v17 Changes:
-----------
- Split 8/8 into two patches.
- Add rss_hash to port rx_offloads in testpmd.
- Add log when set_ptype fails.
- Fix few spell check.

v16 Changes:
-----------
- Fix testpmd documentation(Bernard).
- s/rte_eth_dev_set_supported_ptypes/rte_eth_dev_set_ptypes.
- Fix release notes placement.
- Enhance offload validation(Andrew).
- Remove if condition in drivers/net while enabling RSS_HASH by default.
- Spilt 5/7 into two patches.

v15 Changes:
-----------
- Fix sfc RSS_HASH offload check.
- Fix ethdev RSS_HASH offload check when mq_mode is configured with
  MQ_RX_NONE.
- Extend offload validation to return error in the case where application
  has requested an offload to be enabled and PMD couldn't honor it.

v14 Changes:
-----------
- Remove log from drives
- Add log in rte_eth_dev_configure when certain offloads are requested to be
  disabled and PMD cannot honor the request.
- Make changes to default offloads in net/sfc.(Andrew)

v13 Changes:
-----------
- Remove DEV_RX_OFFLOAD_FLOW_MARK from this patchset to allow foreward
  progress will be sent as a seperate patch.
- Use set_supported function only for l2fwd and testpmd.
- Add info log in drivers which expose the DEV_RX_OFFLOAD_RSS_HASH
  indicating that disabling DEV_RX_OFFLOAD_RSS_HASH is not supported.
- Few documentation changes.

v12 Changes:
-----------
- Rebase onto next-net.

v11 Changes:
-----------
- Use RTE_DIM to get array size.
- Since we are using a list of MASKs to validate ptype_mask return -EINVAL
  if any unknown mask is set.
- Rebase to TOT.

v10 Changes:
-----------
- Modify ptype_mask validation in set_supported_ptypes.(Andrew)

v9 Changes:
----------
- Add ptype_mask validation in set_supported_ptypes.(Andrew)
- Make description more verbose.

v8 Changes:
----------
- Make description more verbose.
- Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
  is not supported by ethernet device.

v7 Changes:
----------
- Fix unused variable in net/octeontx2

v6 Changes:
----------
- Add additional checks for set supported ptypes.(Andrew)
- Clarify `rte_eth_dev_set_supported_ptypes` documentation.
- Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.

v5 Changes:
----------
- Fix typos.

v4 Changes:
----------
- Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
  of array.
- Fix invalid set ptype function call in examples.
- Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.

v3 Changes:
----------
- Add missing release notes. (Andrew)
- Re-word various descriptions.
- Fix ptype set logic.

v2 Changes:
----------
- Update release notes. (Andrew)
- Redo commit logs. (Andrew)
- Disable ptype parsing for unsupported examples. (Jerin)
- Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
- Modify set_supported_ptypes function to return successfuly set mask
  instead of failure.
- Dropped set_supported_ptypes to drivers by handling in library
  layer, interested PMD can add it in.

Pavan Nikhilesh (10):
  ethdev: add set ptype function
  ethdev: add mbuf RSS update as an offload
  ethdev: add validation to offloads set by PMD
  drivers/net: update Rx RSS hash offload capabilities
  examples/eventdev_pipeline: split port init sequence
  examples/eventdev_pipeline: add new Rx RSS hash offload
  examples/l2fwd: disable ptype parsing
  app/testpmd: add command to set supported ptype mask
  app/testpmd: disable packet type parsing by default
  app/testpmd: add RSS hash offload to port Rx offload cmd

 app/test-pmd/cmdline.c                        |  90 ++++++++-
 app/test-pmd/testpmd.c                        |  12 ++
 app/test-pmd/testpmd.h                        |   1 +
 doc/guides/nics/features.rst                  |   9 +-
 doc/guides/rel_notes/release_19_11.rst        |  15 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst   |   9 +-
 drivers/net/bnxt/bnxt_ethdev.c                |   6 +-
 drivers/net/cxgbe/cxgbe.h                     |   3 +-
 drivers/net/cxgbe/cxgbe_ethdev.c              |   2 +
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |   1 +
 drivers/net/e1000/igb_ethdev.c                |   4 +
 drivers/net/e1000/igb_rxtx.c                  |   3 +-
 drivers/net/enic/enic_ethdev.c                |   2 +
 drivers/net/enic/enic_res.c                   |   3 +-
 drivers/net/fm10k/fm10k_ethdev.c              |   5 +-
 drivers/net/hinic/hinic_pmd_ethdev.c          |   5 +-
 drivers/net/i40e/i40e_ethdev.c                |   5 +-
 drivers/net/iavf/iavf_ethdev.c                |   5 +-
 drivers/net/ice/ice_ethdev.c                  |   5 +-
 drivers/net/ixgbe/ixgbe_ethdev.c              |   5 +
 drivers/net/ixgbe/ixgbe_rxtx.c                |   3 +-
 drivers/net/liquidio/lio_ethdev.c             |   5 +-
 drivers/net/mlx4/mlx4.c                       |   2 +
 drivers/net/mlx4/mlx4_rxq.c                   |   3 +-
 drivers/net/mlx5/mlx5_ethdev.c                |   3 +
 drivers/net/mlx5/mlx5_rxq.c                   |   3 +-
 drivers/net/netvsc/hn_ethdev.c                |   2 +
 drivers/net/netvsc/hn_rndis.c                 |   3 +-
 drivers/net/nfp/nfp_net.c                     |   5 +-
 drivers/net/octeontx2/otx2_ethdev.c           |   3 +-
 drivers/net/octeontx2/otx2_ethdev.h           |  15 +-
 drivers/net/qede/qede_ethdev.c                |   5 +-
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   3 +-
 drivers/net/sfc/sfc_ef10_rx.c                 |   3 +-
 drivers/net/sfc/sfc_rx.c                      |   7 +-
 drivers/net/thunderx/nicvf_ethdev.c           |   2 +
 drivers/net/thunderx/nicvf_ethdev.h           |   3 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   5 +-
 examples/eventdev_pipeline/main.c             | 128 ------------
 .../pipeline_worker_generic.c                 | 132 +++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 ++++++++++++
 examples/l2fwd/Makefile                       |   2 +
 examples/l2fwd/main.c                         |   5 +
 examples/l2fwd/meson.build                    |   2 +
 lib/librte_ethdev/rte_ethdev.c                | 182 +++++++++++++++++-
 lib/librte_ethdev/rte_ethdev.h                |  37 ++++
 lib/librte_ethdev/rte_ethdev_core.h           |  17 ++
 lib/librte_ethdev/rte_ethdev_version.map      |   1 +
 49 files changed, 731 insertions(+), 171 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev]  [PATCH v17 01/10] ethdev: add set ptype function
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
@ 2019-11-11 13:19                               ` pbhagavatula
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 02/10] ethdev: add mbuf RSS update as an offload pbhagavatula
                                                 ` (9 subsequent siblings)
  10 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-11 13:19 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, John McNamara, Marko Kovacevic
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add `rte_eth_dev_set_ptypes` function that will allow the application
to inform the PMD about reduced range of packet types to handle.
Based on the ptypes set PMDs can optimize their Rx path.

-If application doesn’t want any ptype information it can call
`rte_eth_dev_set_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`
and PMD may skip packet type processing and set rte_mbuf::packet_type to
RTE_PTYPE_UNKNOWN.

-If application doesn’t call `rte_eth_dev_set_ptypes` PMD can return
`rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.

-If application is interested only in L2/L3 layer, it can inform the PMD
to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
`rte_eth_dev_set_ptypes(ethdev_id,
		RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst             |  7 +-
 doc/guides/rel_notes/release_19_11.rst   |  8 +++
 lib/librte_ethdev/rte_ethdev.c           | 87 +++++++++++++++++++++++-
 lib/librte_ethdev/rte_ethdev.h           | 36 ++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      | 17 +++++
 lib/librte_ethdev/rte_ethdev_version.map |  1 +
 6 files changed, 153 insertions(+), 3 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 7a31cf7c8..f33e8e6d4 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -583,9 +583,12 @@ Packet type parsing
 -------------------
 
 Supports packet type parsing and returns a list of supported types.
+Allows application to set ptypes it is interested in.
 
-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.
-* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``.
+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,
+* **[related]    API**: ``rte_eth_dev_get_supported_ptypes()``,
+  ``rte_eth_dev_set_ptypes()``, ``dev_ptypes_set``.
+* **[provides]   mbuf**: ``mbuf.packet_type``.
 
 
 .. _nic_features_timesync:
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 669e69966..f10acc288 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -94,6 +94,13 @@ New Features
   * Rx metadata is delivered to host via a dynamic field of ``rte_mbuf`` with
     PKT_RX_DYNF_METADATA.
 
+* **Added ethdev API to set supported packet types**
+
+  * Added new API ``rte_eth_dev_set_ptypes`` that allows an application to
+    inform PMD about about reduced range of packet types to handle.
+  * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
+    and thereby improve Rx performance if application wishes do so.
+
 * **Updated the enic driver.**
 
   * Added support for Geneve with options offload.
@@ -280,6 +287,7 @@ New Features
   See :doc:`../prog_guide/lto` for more information:
 
 
+
 Removed Items
 -------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 652c369e5..d5c4865ba 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2879,6 +2879,92 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 	return j;
 }
 
+int
+rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
+				 uint32_t *set_ptypes, unsigned int num)
+{
+	const uint32_t valid_ptype_masks[] = {
+		RTE_PTYPE_L2_MASK,
+		RTE_PTYPE_L3_MASK,
+		RTE_PTYPE_L4_MASK,
+		RTE_PTYPE_TUNNEL_MASK,
+		RTE_PTYPE_INNER_L2_MASK,
+		RTE_PTYPE_INNER_L3_MASK,
+		RTE_PTYPE_INNER_L4_MASK,
+	};
+	const uint32_t *all_ptypes;
+	struct rte_eth_dev *dev;
+	uint32_t unused_mask;
+	unsigned int i, j;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (num > 0 && set_ptypes == NULL)
+		return -EINVAL;
+
+	if (*dev->dev_ops->dev_supported_ptypes_get == NULL ||
+			*dev->dev_ops->dev_ptypes_set == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	if (ptype_mask == 0) {
+		ret = (*dev->dev_ops->dev_ptypes_set)(dev,
+				ptype_mask);
+		goto ptype_unknown;
+	}
+
+	unused_mask = ptype_mask;
+	for (i = 0; i < RTE_DIM(valid_ptype_masks); i++) {
+		uint32_t mask = ptype_mask & valid_ptype_masks[i];
+		if (mask && mask != valid_ptype_masks[i]) {
+			ret = -EINVAL;
+			goto ptype_unknown;
+		}
+		unused_mask &= ~valid_ptype_masks[i];
+	}
+
+	if (unused_mask) {
+		ret = -EINVAL;
+		goto ptype_unknown;
+	}
+
+	all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
+	if (all_ptypes == NULL) {
+		ret = 0;
+		goto ptype_unknown;
+	}
+
+	/*
+	 * Accommodate as many set_ptypes as possible. If the supplied
+	 * set_ptypes array is insufficient fill it partially.
+	 */
+	for (i = 0, j = 0; set_ptypes != NULL &&
+				(all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
+		if (ptype_mask & all_ptypes[i]) {
+			if (j < num - 1) {
+				set_ptypes[j] = all_ptypes[i];
+				j++;
+				continue;
+			}
+			break;
+		}
+	}
+
+	if (set_ptypes != NULL && j < num)
+		set_ptypes[j] = RTE_PTYPE_UNKNOWN;
+
+	return (*dev->dev_ops->dev_ptypes_set)(dev, ptype_mask);
+
+ptype_unknown:
+	if (num > 0)
+		set_ptypes[0] = RTE_PTYPE_UNKNOWN;
+
+	return ret;
+}
+
 int
 rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 {
@@ -2891,7 +2977,6 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
 	return 0;
 }
 
-
 int
 rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
 {
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 44d77b332..a7872819d 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2604,6 +2604,42 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,
  */
 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
 				     uint32_t *ptypes, int num);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Inform Ethernet device about reduced range of packet types to handle.
+ *
+ * Application can use this function to set only specific ptypes that it's
+ * interested. This information can be used by the PMD to optimize Rx path.
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @param set_ptypes
+ *   An array pointer to store set packet types, allocated by caller. The
+ *   function marks the end of array with RTE_PTYPE_UNKNOWN.
+ * @param num
+ *   Size of the array pointed by param ptypes.
+ *   Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the
+ *   set ptypes.
+ * @return
+ *   - (0) if Success.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL and
+ *     num > 0.
+ */
+__rte_experimental
+int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
+			   uint32_t *set_ptypes, unsigned int num);
 
 /**
  * Retrieve the MTU of an Ethernet device.
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index f215af7c9..9588fe7d8 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -234,6 +234,21 @@ typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
 /**< @internal Get supported ptypes of an Ethernet device. */
 
+/**
+ * @internal
+ * Inform Ethernet device about reduced range of packet types to handle.
+ *
+ * @param dev
+ *   The Ethernet device identifier.
+ * @param ptype_mask
+ *   The ptype family that application is interested in should be bitwise OR of
+ *   RTE_PTYPE_*_MASK or 0.
+ * @return
+ *   - (0) if Success.
+ */
+typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev,
+				     uint32_t ptype_mask);
+
 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
 				    uint16_t queue_id);
 /**< @internal Start rx and tx of a queue of an Ethernet device. */
@@ -630,6 +645,8 @@ struct eth_dev_ops {
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
+	eth_dev_ptypes_set_t dev_ptypes_set;
+	/**< Inform Ethernet device about reduced range of packet types to handle. */
 
 	vlan_filter_set_t          vlan_filter_set; /**< Filter VLAN Setup. */
 	vlan_tpid_set_t            vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index ee289ef13..ccfbeae23 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -292,4 +292,5 @@ EXPERIMENTAL {
 	rte_flow_dynf_metadata_offs;
 	rte_flow_dynf_metadata_mask;
 	rte_flow_dynf_metadata_register;
+	rte_eth_dev_set_ptypes;
 };
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v17 02/10] ethdev: add mbuf RSS update as an offload
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 01/10] ethdev: add set ptype function pbhagavatula
@ 2019-11-11 13:19                               ` pbhagavatula
  2019-11-13 18:04                                 ` Ferruh Yigit
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 03/10] ethdev: add validation to offloads set by PMD pbhagavatula
                                                 ` (8 subsequent siblings)
  10 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-11-11 13:19 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, John McNamara, Marko Kovacevic
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           |  2 ++
 doc/guides/rel_notes/release_19_11.rst |  7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 12 ++++++++++++
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 4 files changed, 22 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f33e8e6d4..b200e72b1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index f10acc288..fa2b8c3ba 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -101,6 +101,13 @@ New Features
   * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
     and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  * Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+    enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  * PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+    by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 * **Updated the enic driver.**
 
   * Added support for Geneve with options offload.
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index d5c4865ba..153d50e9a 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
@@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
+	if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
+	    (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u config invalid Rx mq_mode without RSS but %s offload is requested",
+			port_id,
+			rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of RX/TX queues and reconfigure device.
 	 */
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index a7872819d..9b1a8e945 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1088,6 +1088,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_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v17 03/10] ethdev: add validation to offloads set by PMD
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 01/10] ethdev: add set ptype function pbhagavatula
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 02/10] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-11-11 13:19                               ` pbhagavatula
  2019-11-13 18:10                                 ` Ferruh Yigit
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
                                                 ` (7 subsequent siblings)
  10 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-11-11 13:19 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Some PMDs cannot work when certain offloads are enable/disabled, as a
workaround PMDs auto enable/disable offloads internally and expose it
through dev->data->dev_conf.rxmode.offloads.

After device specific dev_configure is called compare the requested
offloads to the offloads exposed by the PMD and, if the PMD failed
to enable a given offload then log it and return -EINVAL from
rte_eth_dev_configure, else if the PMD failed to disable a given offload
log and continue with rte_eth_dev_configure.

Suggested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_ethdev/rte_ethdev.c | 83 +++++++++++++++++++++++++++++++---
 1 file changed, 76 insertions(+), 7 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 153d50e9a..bebd52231 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1137,6 +1137,57 @@ rte_eth_dev_tx_offload_name(uint64_t offload)
 	return name;
 }
 
+/*
+ * Validate offloads that are requested through rte_eth_dev_configure against
+ * the offloads successfuly set by the ethernet device.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param req_offloads
+ *   The offloads that have been requested through `rte_eth_dev_configure`.
+ * @param set_offloads
+ *   The offloads successfuly set by the ethernet device.
+ * @param offload_type
+ *   The offload type i.e. Rx/Tx string.
+ * @param offload_name
+ *   The function that prints the offload name.
+ * @return
+ *   - (0) if validation successful.
+ *   - (-EINVAL) if requested offload has been silently disabled.
+ *
+ */
+static int
+validate_offloads(uint16_t port_id, uint64_t req_offloads,
+		  uint64_t set_offloads, const char *offload_type,
+		  const char *(*offload_name)(uint64_t))
+{
+	uint64_t offloads_diff = req_offloads ^ set_offloads;
+	uint64_t offload;
+	int ret = 0;
+
+	while (offloads_diff != 0) {
+		/* Check if any offload is requested but not enabled. */
+		offload = 1ULL << __builtin_ctzll(offloads_diff);
+		if (offload & req_offloads) {
+			RTE_ETHDEV_LOG(ERR,
+				"Port %u failed to enable %s offload %s\n",
+				port_id, offload_type, offload_name(offload));
+			ret = -EINVAL;
+		}
+
+		/* Chech if offload couldn't be disabled. */
+		if (offload & set_offloads) {
+			RTE_ETHDEV_LOG(INFO,
+				"Port %u failed to disable %s offload %s\n",
+				port_id, offload_type, offload_name(offload));
+		}
+
+		offloads_diff &= ~offload;
+	}
+
+	return ret;
+}
+
 int
 rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		      const struct rte_eth_conf *dev_conf)
@@ -1343,10 +1394,8 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 	if (diag != 0) {
 		RTE_ETHDEV_LOG(ERR, "Port%u dev_configure = %d\n",
 			port_id, diag);
-		rte_eth_dev_rx_queue_config(dev, 0);
-		rte_eth_dev_tx_queue_config(dev, 0);
 		ret = eth_err(port_id, diag);
-		goto rollback;
+		goto reset_queues;
 	}
 
 	/* Initialize Rx profiling if enabled at compilation time. */
@@ -1354,14 +1403,34 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 	if (diag != 0) {
 		RTE_ETHDEV_LOG(ERR, "Port%u __rte_eth_dev_profile_init = %d\n",
 			port_id, diag);
-		rte_eth_dev_rx_queue_config(dev, 0);
-		rte_eth_dev_tx_queue_config(dev, 0);
 		ret = eth_err(port_id, diag);
-		goto rollback;
+		goto reset_queues;
 	}
 
-	return 0;
+	/* Validate Rx offloads. */
+	diag = validate_offloads(port_id,
+			dev_conf->rxmode.offloads,
+			dev->data->dev_conf.rxmode.offloads, "Rx",
+			rte_eth_dev_rx_offload_name);
+	if (diag != 0) {
+		ret = diag;
+		goto reset_queues;
+	}
+
+	/* Validate Tx offloads. */
+	diag = validate_offloads(port_id,
+			dev_conf->txmode.offloads,
+			dev->data->dev_conf.txmode.offloads, "Tx",
+			rte_eth_dev_tx_offload_name);
+	if (diag != 0) {
+		ret = diag;
+		goto reset_queues;
+	}
 
+	return 0;
+reset_queues:
+	rte_eth_dev_rx_queue_config(dev, 0);
+	rte_eth_dev_tx_queue_config(dev, 0);
 rollback:
 	memcpy(&dev->data->dev_conf, &orig_conf, sizeof(dev->data->dev_conf));
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
                                                 ` (2 preceding siblings ...)
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 03/10] ethdev: add validation to offloads set by PMD pbhagavatula
@ 2019-11-11 13:19                               ` pbhagavatula
  2019-11-11 15:05                                 ` Ferruh Yigit
  2019-11-13 18:02                                 ` Ferruh Yigit
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 05/10] examples/eventdev_pipeline: split port init sequence pbhagavatula
                                                 ` (6 subsequent siblings)
  10 siblings, 2 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-11 13:19 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c       |  6 +++++-
 drivers/net/cxgbe/cxgbe.h            |  3 ++-
 drivers/net/cxgbe/cxgbe_ethdev.c     |  2 ++
 drivers/net/dpaa/dpaa_ethdev.c       |  3 ++-
 drivers/net/dpaa2/dpaa2_ethdev.c     |  1 +
 drivers/net/e1000/igb_ethdev.c       |  4 ++++
 drivers/net/e1000/igb_rxtx.c         |  3 ++-
 drivers/net/enic/enic_ethdev.c       |  2 ++
 drivers/net/enic/enic_res.c          |  3 ++-
 drivers/net/fm10k/fm10k_ethdev.c     |  5 ++++-
 drivers/net/hinic/hinic_pmd_ethdev.c |  5 ++++-
 drivers/net/i40e/i40e_ethdev.c       |  5 ++++-
 drivers/net/iavf/iavf_ethdev.c       |  5 ++++-
 drivers/net/ice/ice_ethdev.c         |  5 ++++-
 drivers/net/ixgbe/ixgbe_ethdev.c     |  5 +++++
 drivers/net/ixgbe/ixgbe_rxtx.c       |  3 ++-
 drivers/net/liquidio/lio_ethdev.c    |  5 ++++-
 drivers/net/mlx4/mlx4.c              |  2 ++
 drivers/net/mlx4/mlx4_rxq.c          |  3 ++-
 drivers/net/mlx5/mlx5_ethdev.c       |  3 +++
 drivers/net/mlx5/mlx5_rxq.c          |  3 ++-
 drivers/net/netvsc/hn_ethdev.c       |  2 ++
 drivers/net/netvsc/hn_rndis.c        |  3 ++-
 drivers/net/nfp/nfp_net.c            |  5 ++++-
 drivers/net/octeontx2/otx2_ethdev.c  |  3 ++-
 drivers/net/octeontx2/otx2_ethdev.h  | 15 ++++++++-------
 drivers/net/qede/qede_ethdev.c       |  5 ++++-
 drivers/net/sfc/sfc_ef10_essb_rx.c   |  3 ++-
 drivers/net/sfc/sfc_ef10_rx.c        |  3 ++-
 drivers/net/sfc/sfc_rx.c             |  7 ++++++-
 drivers/net/thunderx/nicvf_ethdev.c  |  2 ++
 drivers/net/thunderx/nicvf_ethdev.h  |  3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.c |  5 ++++-
 33 files changed, 102 insertions(+), 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 74388f2c8..e39b87365 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -123,7 +123,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_RX_OFFLOAD_KEEP_CRC | \
 				     DEV_RX_OFFLOAD_VLAN_EXTEND | \
 				     DEV_RX_OFFLOAD_TCP_LRO | \
-				     DEV_RX_OFFLOAD_SCATTER)
+				     DEV_RX_OFFLOAD_SCATTER | \
+				     DEV_RX_OFFLOAD_RSS_HASH)
 
 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);
@@ -673,6 +674,9 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
 	bp->rx_cp_nr_rings = bp->rx_nr_rings;
 	bp->tx_cp_nr_rings = bp->tx_nr_rings;
 
+	rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+	eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
+
 	if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
 		eth_dev->data->mtu =
 			eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
diff --git a/drivers/net/cxgbe/cxgbe.h b/drivers/net/cxgbe/cxgbe.h
index ed1be3559..6c1f73ac4 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_RSS_HASH)
 
 
 /* Common PF and VF devargs */
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 615dda607..3dc9351a1 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -426,6 +426,8 @@ int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)
 
 	CXGBE_FUNC_TRACE();
 
+	eth_dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (!(adapter->flags & FW_QUEUE_BOUND)) {
 		err = cxgbe_setup_sge_fwevtq(adapter);
 		if (err)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 16b52b5e1..26805f17b 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -56,7 +56,8 @@ static uint64_t dev_rx_offloads_nodis =
 		DEV_RX_OFFLOAD_IPV4_CKSUM |
 		DEV_RX_OFFLOAD_UDP_CKSUM |
 		DEV_RX_OFFLOAD_TCP_CKSUM |
-		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+		DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+		DEV_RX_OFFLOAD_RSS_HASH;
 
 /* Supported Tx offloads */
 static uint64_t dev_tx_offloads_sup =
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 03131b903..eea31f254 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -45,6 +45,7 @@ static uint64_t dev_rx_offloads_sup =
 
 /* Rx offloads which cannot be disabled */
 static uint64_t dev_rx_offloads_nodis =
+		DEV_RX_OFFLOAD_RSS_HASH |
 		DEV_RX_OFFLOAD_SCATTER;
 
 /* Supported Tx offloads */
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 53e83d5ec..369a978ad 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -1182,6 +1182,8 @@ eth_igb_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = igb_check_mq_mode(dev);
 	if (ret != 0) {
@@ -3257,6 +3259,8 @@ igbvf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index c5606de5d..684fa4ad8 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_RSS_HASH;
 
 	return rx_offload_capa;
 }
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 8ad976d3c..683fed28b 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -405,6 +405,8 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
 		return ret;
 	}
 
+	eth_dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	enic->mc_count = 0;
 	enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads &
 				  DEV_RX_OFFLOAD_CHECKSUM);
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index f403a0b66..7c3c270a2 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -205,7 +205,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_RSS_HASH;
 	enic->tx_offload_mask =
 		PKT_TX_IPV6 |
 		PKT_TX_IPV4 |
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 99c4366e4..311482522 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -461,6 +461,8 @@ fm10k_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = fm10k_check_mq_mode(dev);
 	if (ret != 0) {
@@ -1805,7 +1807,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 			   DEV_RX_OFFLOAD_UDP_CKSUM   |
 			   DEV_RX_OFFLOAD_TCP_CKSUM   |
 			   DEV_RX_OFFLOAD_JUMBO_FRAME |
-			   DEV_RX_OFFLOAD_HEADER_SPLIT);
+			   DEV_RX_OFFLOAD_HEADER_SPLIT |
+			   DEV_RX_OFFLOAD_RSS_HASH);
 }
 
 static int
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 9f37a404b..072fec339 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -318,6 +318,8 @@ static int hinic_dev_configure(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* mtu size is 256~9600 */
 	if (dev->data->dev_conf.rxmode.max_rx_pkt_len < HINIC_MIN_FRAME_SIZE ||
 	    dev->data->dev_conf.rxmode.max_rx_pkt_len >
@@ -740,7 +742,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 				DEV_RX_OFFLOAD_VLAN_FILTER |
 				DEV_RX_OFFLOAD_SCATTER |
 				DEV_RX_OFFLOAD_JUMBO_FRAME |
-				DEV_RX_OFFLOAD_TCP_LRO;
+				DEV_RX_OFFLOAD_TCP_LRO |
+				DEV_RX_OFFLOAD_RSS_HASH;
 
 	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5abf60e36..27d2c0e6c 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1812,6 +1812,8 @@ i40e_dev_configure(struct rte_eth_dev *dev)
 	ad->tx_simple_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Only legacy filter API needs the following fdir config. So when the
 	 * legacy filter API is deprecated, the following codes should also be
 	 * removed.
@@ -3613,7 +3615,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_RSS_HASH;
 
 	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 eebc49ade..c23a8fc67 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -147,6 +147,8 @@ iavf_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_vec_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Vlan stripping setting */
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
 		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
@@ -522,7 +524,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_RSS_HASH;
 	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 34d126342..711a5339c 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2357,6 +2357,8 @@ ice_dev_configure(struct rte_eth_dev *dev)
 	ad->rx_bulk_alloc_allowed = true;
 	ad->tx_simple_allowed = true;
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	return 0;
 }
 
@@ -2809,7 +2811,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			DEV_RX_OFFLOAD_TCP_CKSUM |
 			DEV_RX_OFFLOAD_QINQ_STRIP |
 			DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
-			DEV_RX_OFFLOAD_VLAN_EXTEND;
+			DEV_RX_OFFLOAD_VLAN_EXTEND |
+			DEV_RX_OFFLOAD_RSS_HASH;
 		dev_info->tx_offload_capa |=
 			DEV_TX_OFFLOAD_QINQ_INSERT |
 			DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 30c0379d4..8c1caac18 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
 	int ret;
 
 	PMD_INIT_FUNC_TRACE();
+
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* multipe queue mode checking */
 	ret  = ixgbe_check_mq_mode(dev);
 	if (ret != 0) {
@@ -5155,6 +5158,8 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
 	PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
 		     dev->data->port_id);
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/*
 	 * VF has no ability to enable/disable HW CRC
 	 * Keep the persistent behavior the same as Host PF
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index edcfa60ce..fa572d184 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_RSS_HASH;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index ec01343f1..cdf979edb 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -412,7 +412,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
 	devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_RX_OFFLOAD_UDP_CKSUM		|
 				    DEV_RX_OFFLOAD_TCP_CKSUM		|
-				    DEV_RX_OFFLOAD_VLAN_STRIP);
+				    DEV_RX_OFFLOAD_VLAN_STRIP		|
+				    DEV_RX_OFFLOAD_RSS_HASH);
 	devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM		|
 				    DEV_TX_OFFLOAD_UDP_CKSUM		|
 				    DEV_TX_OFFLOAD_TCP_CKSUM		|
@@ -1735,6 +1736,8 @@ lio_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	eth_dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Inform firmware about change in number of queues to use.
 	 * Disable IO queues and reset registers for re-configuration.
 	 */
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 931e4f4fe..6bc85a3d5 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -248,6 +248,8 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
 	struct rte_flow_error error;
 	int ret;
 
+	dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Prepare internal flow rules. */
 	ret = mlx4_flow_sync(priv, &error);
 	if (ret) {
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index f45c1ff85..4a6fbd922 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_RSS_HASH;
 
 	if (priv->hw_csum)
 		offloads |= DEV_RX_OFFLOAD_CHECKSUM;
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 2b7c867e5..1c37980a4 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -404,6 +404,9 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
 		rte_errno = ENOMEM;
 		return -rte_errno;
 	}
+
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	memcpy(priv->rss_conf.rss_key,
 	       use_app_rss_key ?
 	       dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key :
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 24d0eaac9..fd1b2d873 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -372,7 +372,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_RSS_HASH);
 
 	if (config->hw_fcs_strip)
 		offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index eed8dece9..658935509 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -532,6 +532,8 @@ static int hn_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	dev_conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	unsupported = txmode->offloads & ~HN_TX_OFFLOAD_CAPS;
 	if (unsupported) {
 		PMD_DRV_LOG(NOTICE,
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index a67bc7a79..2b4714042 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_RSS_HASH;
 
 	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 22a8b2d19..7941248c0 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -407,6 +407,8 @@ nfp_net_configure(struct rte_eth_dev *dev)
 	rxmode = &dev_conf->rxmode;
 	txmode = &dev_conf->txmode;
 
+	rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* Checking TX mode */
 	if (txmode->mq_mode) {
 		PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported");
@@ -1236,7 +1238,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_RSS_HASH;
 
 	if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
 		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index aab34dbcf..be6ff71b3 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -599,7 +599,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
 	struct rte_eth_rxmode *rxmode = &conf->rxmode;
 	uint16_t flags = 0;
 
-	if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+	if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+			(dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
 		flags |= NIX_RX_OFFLOAD_RSS_F;
 
 	if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index b49e309fd..ba66dbb74 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	| \
@@ -140,11 +140,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_RSS_HASH)
 
 #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 575982fd0..853748afe 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1186,6 +1186,8 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE(edev);
 
+	rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	/* We need to have min 1 RX queue.There is no min check in
 	 * rte_eth_dev_configure(), so we are checking it here.
 	 */
@@ -1306,7 +1308,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_RSS_HASH);
 	dev_info->rx_queue_offload_capa = 0;
 
 	/* TX offloads are on a per-packet basis, so it is applicable
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 63da807ea..d9d2ce6bd 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -715,7 +715,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 	},
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
 				  SFC_DP_RX_FEAT_FLOW_MARK,
-	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
+	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= 0,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index f2fc6e70a..9e527b7fb 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -796,7 +796,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 	.features		= SFC_DP_RX_FEAT_MULTI_PROCESS |
 				  SFC_DP_RX_FEAT_INTR,
 	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
-				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
+				  DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
 	.get_dev_info		= sfc_ef10_rx_get_dev_info,
 	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e6809bb64..10fa1e5ff 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -617,7 +617,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 		.hw_fw_caps	= 0,
 	},
 	.features		= SFC_DP_RX_FEAT_INTR,
-	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM,
+	.dev_offload_capa	= DEV_RX_OFFLOAD_CHECKSUM |
+				  DEV_RX_OFFLOAD_RSS_HASH,
 	.queue_offload_capa	= DEV_RX_OFFLOAD_SCATTER,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
@@ -1556,6 +1557,10 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
 		rxmode->offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
 	}
 
+	if ((offloads_supported & DEV_RX_OFFLOAD_RSS_HASH) &&
+	    (~rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+		rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	return rc;
 }
 
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index b93d45712..062eec3f2 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1920,6 +1920,8 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (!rte_eal_has_hugepages()) {
 		PMD_INIT_LOG(INFO, "Huge page is not configured");
 		return -EINVAL;
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index c0bfbf848..391411799 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_RSS_HASH)
 
 #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 d1faeaa81..53fbd2bd0 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,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_RSS_HASH)
 
 static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);
 static int eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev);
@@ -407,6 +408,8 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	if (dev->data->nb_tx_queues > VMXNET3_MAX_TX_QUEUES ||
 	    dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES) {
 		PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v17 05/10] examples/eventdev_pipeline: split port init sequence
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
                                                 ` (3 preceding siblings ...)
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-11-11 13:19                               ` pbhagavatula
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 06/10] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
                                                 ` (5 subsequent siblings)
  10 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-11 13:19 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Harry van Haaren
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Split port initialization sequence based on event device capabilities.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c             | 128 -----------------
 .../pipeline_worker_generic.c                 | 129 ++++++++++++++++++
 .../eventdev_pipeline/pipeline_worker_tx.c    | 128 +++++++++++++++++
 3 files changed, 257 insertions(+), 128 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f77830282..d3ff1bbe4 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -242,133 +242,6 @@ parse_app_args(int argc, char **argv)
 	}
 }
 
-/*
- * Initializes a given port using global settings and with the RX buffers
- * coming from the mbuf_pool passed as a parameter.
- */
-static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
-{
-	struct rte_eth_rxconf rx_conf;
-	static const struct rte_eth_conf port_conf_default = {
-		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
-		},
-		.rx_adv_conf = {
-			.rss_conf = {
-				.rss_hf = ETH_RSS_IP |
-					  ETH_RSS_TCP |
-					  ETH_RSS_UDP,
-			}
-		}
-	};
-	const uint16_t rx_rings = 1, tx_rings = 1;
-	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
-	struct rte_eth_conf port_conf = port_conf_default;
-	int retval;
-	uint16_t q;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_txconf txconf;
-
-	if (!rte_eth_dev_is_valid_port(port))
-		return -1;
-
-	retval = rte_eth_dev_info_get(port, &dev_info);
-	if (retval != 0) {
-		printf("Error during getting device (port %u) info: %s\n",
-				port, strerror(-retval));
-		return retval;
-	}
-
-	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-		port_conf.txmode.offloads |=
-			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-	rx_conf = dev_info.default_rxconf;
-	rx_conf.offloads = port_conf.rxmode.offloads;
-
-	port_conf.rx_adv_conf.rss_conf.rss_hf &=
-		dev_info.flow_type_rss_offloads;
-	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
-		printf("Port %u modified RSS hash function based on hardware support,"
-			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
-			port,
-			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
-			port_conf.rx_adv_conf.rss_conf.rss_hf);
-	}
-
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
-	if (retval != 0)
-		return retval;
-
-	/* Allocate and set up 1 RX queue per Ethernet port. */
-	for (q = 0; q < rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), &rx_conf,
-				mbuf_pool);
-		if (retval < 0)
-			return retval;
-	}
-
-	txconf = dev_info.default_txconf;
-	txconf.offloads = port_conf_default.txmode.offloads;
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), &txconf);
-		if (retval < 0)
-			return retval;
-	}
-
-	/* Display the port MAC address. */
-	struct rte_ether_addr addr;
-	retval = rte_eth_macaddr_get(port, &addr);
-	if (retval != 0) {
-		printf("Failed to get MAC address (port %u): %s\n",
-				port, rte_strerror(-retval));
-		return retval;
-	}
-
-	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
-			   " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
-			(unsigned int)port,
-			addr.addr_bytes[0], addr.addr_bytes[1],
-			addr.addr_bytes[2], addr.addr_bytes[3],
-			addr.addr_bytes[4], addr.addr_bytes[5]);
-
-	/* Enable RX in promiscuous mode for the Ethernet device. */
-	retval = rte_eth_promiscuous_enable(port);
-	if (retval != 0)
-		return retval;
-
-	return 0;
-}
-
-static int
-init_ports(uint16_t num_ports)
-{
-	uint16_t portid;
-
-	if (!cdata.num_mbuf)
-		cdata.num_mbuf = 16384 * num_ports;
-
-	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
-			/* mbufs */ cdata.num_mbuf,
-			/* cache_size */ 512,
-			/* priv_size*/ 0,
-			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
-			rte_socket_id());
-
-	RTE_ETH_FOREACH_DEV(portid)
-		if (port_init(portid, mp) != 0)
-			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
-					portid);
-
-	return 0;
-}
-
 static void
 do_capability_setup(uint8_t eventdev_id)
 {
@@ -515,7 +388,6 @@ main(int argc, char **argv)
 	if (dev_id < 0)
 		rte_exit(EXIT_FAILURE, "Error setting up eventdev\n");
 
-	init_ports(num_ports);
 	fdata->cap.adptr_setup(num_ports);
 
 	/* Start the Ethernet port. */
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 766c8e958..0058ba700 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -271,6 +271,134 @@ setup_eventdev_generic(struct worker_data *worker_data)
 	return dev_id;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -297,6 +425,7 @@ init_adapters(uint16_t nb_ports)
 		adptr_p_conf.enqueue_depth =
 			dev_info.max_event_port_enqueue_depth;
 
+	init_ports(nb_ports);
 	/* Create one adapter for all the ethernet ports. */
 	ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id,
 			&adptr_p_conf);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index a0f40c27c..55bb2f762 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -603,6 +603,133 @@ service_rx_adapter(void *arg)
 	return 0;
 }
 
+/*
+ * Initializes a given port using global settings and with the RX buffers
+ * coming from the mbuf_pool passed as a parameter.
+ */
+static inline int
+port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+{
+	struct rte_eth_rxconf rx_conf;
+	static const struct rte_eth_conf port_conf_default = {
+		.rxmode = {
+			.mq_mode = ETH_MQ_RX_RSS,
+			.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+		},
+		.rx_adv_conf = {
+			.rss_conf = {
+				.rss_hf = ETH_RSS_IP |
+					  ETH_RSS_TCP |
+					  ETH_RSS_UDP,
+			}
+		}
+	};
+	const uint16_t rx_rings = 1, tx_rings = 1;
+	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
+	struct rte_eth_conf port_conf = port_conf_default;
+	int retval;
+	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+
+	if (!rte_eth_dev_is_valid_port(port))
+		return -1;
+
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	rx_conf = dev_info.default_rxconf;
+	rx_conf.offloads = port_conf.rxmode.offloads;
+
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+		dev_info.flow_type_rss_offloads;
+	if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+		printf("Port %u modified RSS hash function based on hardware support,"
+			"requested:%#"PRIx64" configured:%#"PRIx64"\n",
+			port,
+			port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+			port_conf.rx_adv_conf.rss_conf.rss_hf);
+	}
+
+	/* Configure the Ethernet device. */
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	if (retval != 0)
+		return retval;
+
+	/* Allocate and set up 1 RX queue per Ethernet port. */
+	for (q = 0; q < rx_rings; q++) {
+		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+				rte_eth_dev_socket_id(port), &rx_conf,
+				mbuf_pool);
+		if (retval < 0)
+			return retval;
+	}
+
+	txconf = dev_info.default_txconf;
+	txconf.offloads = port_conf_default.txmode.offloads;
+	/* Allocate and set up 1 TX queue per Ethernet port. */
+	for (q = 0; q < tx_rings; q++) {
+		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+				rte_eth_dev_socket_id(port), &txconf);
+		if (retval < 0)
+			return retval;
+	}
+
+	/* Display the port MAC address. */
+	struct rte_ether_addr addr;
+	retval = rte_eth_macaddr_get(port, &addr);
+	if (retval != 0) {
+		printf("Failed to get MAC address (port %u): %s\n",
+				port, rte_strerror(-retval));
+		return retval;
+	}
+
+	printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
+			" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
+			(unsigned int)port,
+			addr.addr_bytes[0], addr.addr_bytes[1],
+			addr.addr_bytes[2], addr.addr_bytes[3],
+			addr.addr_bytes[4], addr.addr_bytes[5]);
+
+	/* Enable RX in promiscuous mode for the Ethernet device. */
+	retval = rte_eth_promiscuous_enable(port);
+	if (retval != 0)
+		return retval;
+
+	return 0;
+}
+
+static int
+init_ports(uint16_t num_ports)
+{
+	uint16_t portid;
+
+	if (!cdata.num_mbuf)
+		cdata.num_mbuf = 16384 * num_ports;
+
+	struct rte_mempool *mp = rte_pktmbuf_pool_create("packet_pool",
+			/* mbufs */ cdata.num_mbuf,
+			/* cache_size */ 512,
+			/* priv_size*/ 0,
+			/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
+			rte_socket_id());
+
+	RTE_ETH_FOREACH_DEV(portid)
+		if (port_init(portid, mp) != 0)
+			rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
+					portid);
+
+	return 0;
+}
+
 static void
 init_adapters(uint16_t nb_ports)
 {
@@ -621,6 +748,7 @@ init_adapters(uint16_t nb_ports)
 		.new_event_threshold = 4096,
 	};
 
+	init_ports(nb_ports);
 	if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
 		adptr_p_conf.new_event_threshold = dev_info.max_num_events;
 	if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v17 06/10] examples/eventdev_pipeline: add new Rx RSS hash offload
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
                                                 ` (4 preceding siblings ...)
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 05/10] examples/eventdev_pipeline: split port init sequence pbhagavatula
@ 2019-11-11 13:19                               ` pbhagavatula
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 07/10] examples/l2fwd: disable ptype parsing pbhagavatula
                                                 ` (4 subsequent siblings)
  10 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-11 13:19 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Harry van Haaren
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/pipeline_worker_generic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 0058ba700..42ff4eeb9 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -314,6 +314,9 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	rx_conf = dev_info.default_rxconf;
 	rx_conf.offloads = port_conf.rxmode.offloads;
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v17 07/10] examples/l2fwd: disable ptype parsing
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
                                                 ` (5 preceding siblings ...)
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 06/10] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
@ 2019-11-11 13:19                               ` pbhagavatula
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 08/10] app/testpmd: add command to set supported ptype mask pbhagavatula
                                                 ` (3 subsequent siblings)
  10 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-11 13:19 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Marko Kovacevic,
	Ori Kam, Bruce Richardson, Radu Nicolau, Akhil Goyal,
	Tomasz Kantecki, Sunil Kumar Kori, Pavan Nikhilesh
  Cc: dev

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packet type parsing as l2fwd doesn't rely on packet types.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/l2fwd/Makefile    | 2 ++
 examples/l2fwd/main.c      | 5 +++++
 examples/l2fwd/meson.build | 2 ++
 3 files changed, 9 insertions(+)

diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 230352093..59b2b4ab4 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -51,6 +51,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+# Add flag to allow experimental API as l2fwd uses rte_ethdev_set_ptype API
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 include $(RTE_SDK)/mk/rte.extapp.mk
 endif
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index d7bcbfae7..09257aab1 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -713,6 +713,11 @@ main(int argc, char **argv)
 			"Cannot set error callback for tx buffer on port %u\n",
 				 portid);
 
+		ret = rte_eth_dev_set_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL,
+					     0);
+		if (ret < 0)
+			printf("Port %u, Failed to disable Ptype parsing\n",
+					portid);
 		/* Start device */
 		ret = rte_eth_dev_start(portid);
 		if (ret < 0)
diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build
index c34e11e36..50d88caa0 100644
--- a/examples/l2fwd/meson.build
+++ b/examples/l2fwd/meson.build
@@ -6,6 +6,8 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+# Enable experimental API flag as l2fwd uses rte_ethdev_set_ptype API
+allow_experimental_apis = true
 sources = files(
 	'main.c'
 )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v17 08/10] app/testpmd: add command to set supported ptype mask
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
                                                 ` (6 preceding siblings ...)
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 07/10] examples/l2fwd: disable ptype parsing pbhagavatula
@ 2019-11-11 13:19                               ` pbhagavatula
  2019-11-11 14:51                                 ` Ferruh Yigit
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 09/10] app/testpmd: disable packet type parsing by default pbhagavatula
                                                 ` (2 subsequent siblings)
  10 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-11-11 13:19 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Wenzhuo Lu,
	Jingjing Wu, Bernard Iremonger, John McNamara, Marko Kovacevic
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add command to set supported ptype mask.
Usage:
	set port <port_id> ptype_mask <ptype_mask>

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test-pmd/cmdline.c                      | 84 +++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
 2 files changed, 91 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 48627c8aa..da556f91e 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -671,6 +671,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n"
 			"    Update a ptype mapping item on a port\n\n"
 
+			"set port (port_id) ptype_mask (ptype_mask)\n"
+			"    set packet types classification for a specific port\n\n"
+
 			"set port (port_id) queue-region region_id (value) "
 			"queue_start_index (value) queue_num (value)\n"
 			"    Set a queue region on a port\n\n"
@@ -19015,6 +19018,86 @@ cmdline_parse_inst_t cmd_show_rx_tx_desc_status = {
 	},
 };
 
+/* Common result structure for set port ptypes */
+struct cmd_set_port_ptypes_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t port;
+	portid_t port_id;
+	cmdline_fixed_string_t ptype_mask;
+	uint32_t mask;
+};
+
+/* Common CLI fields for set port ptypes */
+cmdline_parse_token_string_t cmd_set_port_ptypes_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_ptypes_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_set_port_ptypes_port =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_ptypes_result,
+		 port, "port");
+cmdline_parse_token_num_t cmd_set_port_ptypes_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_set_port_ptypes_result,
+		 port_id, UINT16);
+cmdline_parse_token_string_t cmd_set_port_ptypes_mask_str =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_set_port_ptypes_result,
+		 ptype_mask, "ptype_mask");
+cmdline_parse_token_num_t cmd_set_port_ptypes_mask_u32 =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_set_port_ptypes_result,
+		 mask, UINT32);
+
+static void
+cmd_set_port_ptypes_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_set_port_ptypes_result *res = parsed_result;
+#define PTYPE_NAMESIZE        256
+	char ptype_name[PTYPE_NAMESIZE];
+	uint16_t port_id = res->port_id;
+	uint32_t ptype_mask = res->mask;
+	int ret, i;
+
+	ret = rte_eth_dev_get_supported_ptypes(port_id, RTE_PTYPE_ALL_MASK,
+					       NULL, 0);
+	if (ret <= 0) {
+		printf("Port %d doesn't support any ptypes.\n", port_id);
+		return;
+	}
+
+	uint32_t ptypes[ret];
+
+	ret = rte_eth_dev_set_ptypes(port_id, ptype_mask, ptypes, ret);
+	if (ret < 0) {
+		printf("Unable to set requested ptypes for Port %d\n", port_id);
+		return;
+	}
+
+	printf("Successfully set following ptypes for Port %d\n", port_id);
+	for (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {
+		rte_get_ptype_name(ptypes[i], ptype_name, sizeof(ptype_name));
+		printf("%s\n", ptype_name);
+	}
+}
+
+cmdline_parse_inst_t cmd_set_port_ptypes = {
+	.f = cmd_set_port_ptypes_parsed,
+	.data = NULL,
+	.help_str = "set port <port_id> ptype_mask <mask>",
+	.tokens = {
+		(void *)&cmd_set_port_ptypes_set,
+		(void *)&cmd_set_port_ptypes_port,
+		(void *)&cmd_set_port_ptypes_port_id,
+		(void *)&cmd_set_port_ptypes_mask_str,
+		(void *)&cmd_set_port_ptypes_mask_u32,
+		NULL,
+	},
+};
+
 /* ******************************************************************************** */
 
 /* list of instructions */
@@ -19254,6 +19337,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_show_vf_stats,
 	(cmdline_parse_inst_t *)&cmd_clear_vf_stats,
 	(cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
+	(cmdline_parse_inst_t *)&cmd_set_port_ptypes,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
 	(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 9a5e5cb05..c331b4d90 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -480,6 +480,13 @@ Show ptypes supported for a specific port::
 
    testpmd> show port (port_id) ptypes
 
+set port supported ptypes
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+set packet types classification for a specific port::
+
+   testpmd> set port (port_id) ptypes_mask (mask)
+
 show device info
 ~~~~~~~~~~~~~~~~
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v17 09/10] app/testpmd: disable packet type parsing by default
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
                                                 ` (7 preceding siblings ...)
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 08/10] app/testpmd: add command to set supported ptype mask pbhagavatula
@ 2019-11-11 13:19                               ` pbhagavatula
  2019-11-11 14:54                                 ` Ferruh Yigit
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 10/10] app/testpmd: add RSS hash offload to port Rx offload cmd pbhagavatula
  2019-11-11 15:45                               ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags Ferruh Yigit
  10 siblings, 1 reply; 246+ messages in thread
From: pbhagavatula @ 2019-11-11 13:19 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Wenzhuo Lu,
	Jingjing Wu, Bernard Iremonger
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Disable packey type parsing on port init, user can enable ptype parsing
by issuing set ptype command.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test-pmd/cmdline.c |  2 ++
 app/test-pmd/testpmd.c | 12 ++++++++++++
 app/test-pmd/testpmd.h |  1 +
 3 files changed, 15 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index da556f91e..bd056033c 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -19082,6 +19082,8 @@ cmd_set_port_ptypes_parsed(
 		rte_get_ptype_name(ptypes[i], ptype_name, sizeof(ptype_name));
 		printf("%s\n", ptype_name);
 	}
+
+	clear_ptypes = false;
 }
 
 cmdline_parse_inst_t cmd_set_port_ptypes = {
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 44443469a..446da3623 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -359,6 +359,9 @@ uint8_t hot_plug = 0; /**< hotplug disabled by default. */
 /* After attach, port setup is called on event or by iterator */
 bool setup_on_probe_event = true;
 
+/* Clear ptypes on port initialization. */
+uint8_t clear_ptypes = true;
+
 /* Pretty printing of ethdev events */
 static const char * const eth_event_desc[] = {
 	[RTE_ETH_EVENT_UNKNOWN] = "unknown",
@@ -2269,6 +2272,15 @@ start_port(portid_t pid)
 				return -1;
 		}
 		configure_rxtx_dump_callbacks(verbose_level);
+		if (clear_ptypes) {
+			diag = rte_eth_dev_set_ptypes(pi, RTE_PTYPE_UNKNOWN,
+					NULL, 0);
+			if (diag < 0)
+				printf(
+				"Port %d: Failed to disable Ptype parsing\n",
+				pi);
+		}
+
 		/* start port */
 		if (rte_eth_dev_start(pi) < 0) {
 			printf("Fail to start port %d\n", pi);
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index caabf3254..90694a330 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -334,6 +334,7 @@ extern uint32_t event_print_mask;
 extern bool setup_on_probe_event; /**< disabled by port setup-on iterator */
 extern uint8_t hot_plug; /**< enable by "--hot-plug" parameter */
 extern int do_mlockall; /**< set by "--mlockall" or "--no-mlockall" parameter */
+extern uint8_t clear_ptypes; /**< disabled by set ptype cmd */
 
 #ifdef RTE_LIBRTE_IXGBE_BYPASS
 extern uint32_t bypass_timeout; /**< Store the NIC bypass watchdog timeout */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* [dpdk-dev] [PATCH v17 10/10] app/testpmd: add RSS hash offload to port Rx offload cmd
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
                                                 ` (8 preceding siblings ...)
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 09/10] app/testpmd: disable packet type parsing by default pbhagavatula
@ 2019-11-11 13:19                               ` pbhagavatula
  2019-11-11 15:45                               ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags Ferruh Yigit
  10 siblings, 0 replies; 246+ messages in thread
From: pbhagavatula @ 2019-11-11 13:19 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, thomas, Wenzhuo Lu,
	Jingjing Wu, Bernard Iremonger, John McNamara, Marko Kovacevic
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Update port rx_offload command to include RSS_HASH

	testpmd> port config 0 rx_offload rss_hash on

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test-pmd/cmdline.c                      | 4 ++--
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index bd056033c..ff2d18f5b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -18087,7 +18087,7 @@ cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_offload =
 		 offload, "vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#"
 			   "qinq_strip#outer_ipv4_cksum#macsec_strip#"
 			   "header_split#vlan_filter#vlan_extend#jumbo_frame#"
-			   "scatter#timestamp#security#keep_crc");
+			   "scatter#timestamp#security#keep_crc#rss_hash");
 cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_on_off =
 	TOKEN_STRING_INITIALIZER
 		(struct cmd_config_per_port_rx_offload_result,
@@ -18167,7 +18167,7 @@ cmdline_parse_inst_t cmd_config_per_port_rx_offload = {
 	.help_str = "port config <port_id> rx_offload vlan_strip|ipv4_cksum|"
 		    "udp_cksum|tcp_cksum|tcp_lro|qinq_strip|outer_ipv4_cksum|"
 		    "macsec_strip|header_split|vlan_filter|vlan_extend|"
-		    "jumbo_frame|scatter|timestamp|security|keep_crc "
+		    "jumbo_frame|scatter|timestamp|security|keep_crc|rss_hash "
 		    "on|off",
 	.tokens = {
 		(void *)&cmd_config_per_port_rx_offload_result_port,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index c331b4d90..f09fa3fee 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1687,7 +1687,7 @@ Enable or disable a per port Rx offloading on all Rx queues of a port::
                   vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro,
                   qinq_strip, outer_ipv4_cksum, macsec_strip,
                   header_split, vlan_filter, vlan_extend, jumbo_frame,
-                  scatter, timestamp, security, keep_crc
+                  scatter, timestamp, security, keep_crc, rss_hash
 
 This command should be run when the port is stopped, or else it will fail.
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 08/10] app/testpmd: add command to set supported ptype mask
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 08/10] app/testpmd: add command to set supported ptype mask pbhagavatula
@ 2019-11-11 14:51                                 ` Ferruh Yigit
  0 siblings, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-11 14:51 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, Wenzhuo Lu,
	Jingjing Wu, Bernard Iremonger, John McNamara, Marko Kovacevic
  Cc: dev

On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Add command to set supported ptype mask.
> Usage:
> 	set port <port_id> ptype_mask <ptype_mask>
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

<...>

> +set port supported ptypes
> +~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +set packet types classification for a specific port::
> +
> +   testpmd> set port (port_id) ptypes_mask (mask)
> +
>  show device info
>  ~~~~~~~~~~~~~~~~
>  

When I run the command [1] on a device that doesn't support it, I am getting:
"Successfully set following ptypes for Port 0"

I still think this is wrong and we should fix it, and introduce '-ENOTSUP' to
'rte_eth_dev_set_ptypes()' as other APIs. Since the API is experimental we can
do it later for sake of making the set for rc2.

Can we please keep tracing the discussion for this one for rc3?

[1]
testpmd> set port 0 ptype_mask 0

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 09/10] app/testpmd: disable packet type parsing by default
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 09/10] app/testpmd: disable packet type parsing by default pbhagavatula
@ 2019-11-11 14:54                                 ` Ferruh Yigit
  0 siblings, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-11 14:54 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, Wenzhuo Lu,
	Jingjing Wu, Bernard Iremonger
  Cc: dev

On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Disable packey type parsing on port init, user can enable ptype parsing
> by issuing set ptype command.

I will update release notes to add one line sentences to document the behavior
change while merging, please shout if you have any objection.

> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

<...>


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
@ 2019-11-11 15:05                                 ` Ferruh Yigit
  2019-11-11 15:10                                   ` Pavan Nikhilesh Bhagavatula
  2019-11-13 18:02                                 ` Ferruh Yigit
  1 sibling, 1 reply; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-11 15:05 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev

On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
> index 931e4f4fe..6bc85a3d5 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -248,6 +248,8 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
>  	struct rte_flow_error error;
>  	int ret;
>  
> +	dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
> +

Build still fails because of this change, s/offload/offloads, I can fix it while
merging if this is the only issue.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities
  2019-11-11 15:05                                 ` Ferruh Yigit
@ 2019-11-11 15:10                                   ` Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-11-11 15:10 UTC (permalink / raw)
  To: Ferruh Yigit, arybchenko, Jerin Jacob Kollanukkaran, thomas,
	Ajit Khaparde, Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal,
	Sachin Saxena, Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang,
	Xiao Wang, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Kumar Dabilpuram,
	Kiran Kumar Kokkilagadda, Rasesh Mody, Shahed Shaikh,
	Maciej Czekaj, Yong Wang
  Cc: dev

>On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
>> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
>> index 931e4f4fe..6bc85a3d5 100644
>> --- a/drivers/net/mlx4/mlx4.c
>> +++ b/drivers/net/mlx4/mlx4.c
>> @@ -248,6 +248,8 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
>>  	struct rte_flow_error error;
>>  	int ret;
>>
>> +	dev->data->dev_conf.rxmode.offload |=
>DEV_RX_OFFLOAD_RSS_HASH;
>> +
>
>Build still fails because of this change, s/offload/offloads, I can fix it
>while
>merging if this is the only issue.

My bad since MLX4 and MLX5 are disabled by default normal build script don’t catch the errors

# Compile burst-oriented Mellanox ConnectX-3 (MLX4) PMD
CONFIG_RTE_LIBRTE_MLX4_PMD=n
CONFIG_RTE_LIBRTE_MLX4_DEBUG=y
# Compile burst-oriented Mellanox ConnectX-4, ConnectX-5,
# ConnectX-6 & Bluefield (MLX5) PMD
CONFIG_RTE_LIBRTE_MLX5_PMD=n
CONFIG_RTE_LIBRTE_MLX5_DEBUG=y

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags
  2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
                                                 ` (9 preceding siblings ...)
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 10/10] app/testpmd: add RSS hash offload to port Rx offload cmd pbhagavatula
@ 2019-11-11 15:45                               ` Ferruh Yigit
  10 siblings, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-11 15:45 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas; +Cc: dev

On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Add new Rx offload flags `DEV_RX_OFFLOAD_RSS_HASH` These flags can be used
> to enable/disable PMD writes to rte_mbuf fields `hash.rss` and also
> `ol_flags:PKT_RX_RSS`.
> 
> Add new packet type set function `rte_eth_dev_set_ptypes`,
> allows application to inform PMDs about the packet types it is interested
> in. Based on ptypes requested by application PMDs can optimize the Rx path.
> 
> For example, if a given PMD doesn't support any packet types that the
> application is interested in then the application can disable[1] writes to
> `mbuf.packet_type` done by the PMD and use a software ptype parser.
>      [1] rte_eth_dev_set_ptypes(*port_id*, RTE_PTYPE_UNKNOWN,
> 					  NULL, 0);
> 
> v17 Changes:
> -----------
> - Split 8/8 into two patches.
> - Add rss_hash to port rx_offloads in testpmd.
> - Add log when set_ptype fails.
> - Fix few spell check.
> 
> v16 Changes:
> -----------
> - Fix testpmd documentation(Bernard).
> - s/rte_eth_dev_set_supported_ptypes/rte_eth_dev_set_ptypes.
> - Fix release notes placement.
> - Enhance offload validation(Andrew).
> - Remove if condition in drivers/net while enabling RSS_HASH by default.
> - Spilt 5/7 into two patches.
> 
> v15 Changes:
> -----------
> - Fix sfc RSS_HASH offload check.
> - Fix ethdev RSS_HASH offload check when mq_mode is configured with
>   MQ_RX_NONE.
> - Extend offload validation to return error in the case where application
>   has requested an offload to be enabled and PMD couldn't honor it.
> 
> v14 Changes:
> -----------
> - Remove log from drives
> - Add log in rte_eth_dev_configure when certain offloads are requested to be
>   disabled and PMD cannot honor the request.
> - Make changes to default offloads in net/sfc.(Andrew)
> 
> v13 Changes:
> -----------
> - Remove DEV_RX_OFFLOAD_FLOW_MARK from this patchset to allow foreward
>   progress will be sent as a seperate patch.
> - Use set_supported function only for l2fwd and testpmd.
> - Add info log in drivers which expose the DEV_RX_OFFLOAD_RSS_HASH
>   indicating that disabling DEV_RX_OFFLOAD_RSS_HASH is not supported.
> - Few documentation changes.
> 
> v12 Changes:
> -----------
> - Rebase onto next-net.
> 
> v11 Changes:
> -----------
> - Use RTE_DIM to get array size.
> - Since we are using a list of MASKs to validate ptype_mask return -EINVAL
>   if any unknown mask is set.
> - Rebase to TOT.
> 
> v10 Changes:
> -----------
> - Modify ptype_mask validation in set_supported_ptypes.(Andrew)
> 
> v9 Changes:
> ----------
> - Add ptype_mask validation in set_supported_ptypes.(Andrew)
> - Make description more verbose.
> 
> v8 Changes:
> ----------
> - Make description more verbose.
> - Set RTE_PTYPE_UNKNOWN in set_ptypes array when either get ot set ptypes
>   is not supported by ethernet device.
> 
> v7 Changes:
> ----------
> - Fix unused variable in net/octeontx2
> 
> v6 Changes:
> ----------
> - Add additional checks for set supported ptypes.(Andrew)
> - Clarify `rte_eth_dev_set_supported_ptypes` documentation.
> - Remove DEV_RX_OFFLOAD_FLOW_MARK emulation from net/octeontx2.
> 
> v5 Changes:
> ----------
> - Fix typos.
> 
> v4 Changes:
> ----------
> - Set the last element in set_ptype array as RTE_PTYPE_UNKNOWN to mark the end
>   of array.
> - Fix invalid set ptype function call in examples.
> - Remove setting rte_eth_dev_set_supported_ptypes to UNKNOWN in l3fwd-power.
> 
> v3 Changes:
> ----------
> - Add missing release notes. (Andrew)
> - Re-word various descriptions.
> - Fix ptype set logic.
> 
> v2 Changes:
> ----------
> - Update release notes. (Andrew)
> - Redo commit logs. (Andrew)
> - Disable ptype parsing for unsupported examples. (Jerin)
> - Disable RSS write only in generic mode eventdev_pipeline. (Jerin)
> - Modify set_supported_ptypes function to return successfuly set mask
>   instead of failure.
> - Dropped set_supported_ptypes to drivers by handling in library
>   layer, interested PMD can add it in.
> 
> Pavan Nikhilesh (10):
>   ethdev: add set ptype function
>   ethdev: add mbuf RSS update as an offload
>   ethdev: add validation to offloads set by PMD
>   drivers/net: update Rx RSS hash offload capabilities
>   examples/eventdev_pipeline: split port init sequence
>   examples/eventdev_pipeline: add new Rx RSS hash offload
>   examples/l2fwd: disable ptype parsing
>   app/testpmd: add command to set supported ptype mask
>   app/testpmd: disable packet type parsing by default
>   app/testpmd: add RSS hash offload to port Rx offload cmd

For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Series applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
  2019-11-11 15:05                                 ` Ferruh Yigit
@ 2019-11-13 18:02                                 ` Ferruh Yigit
  2019-11-14 12:52                                   ` Ferruh Yigit
  2019-11-14 12:57                                   ` Jerin Jacob
  1 sibling, 2 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-13 18:02 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev

On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 30c0379d4..8c1caac18 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
>  	int ret;
>  
>  	PMD_INIT_FUNC_TRACE();
> +
> +	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +

Hi Pavan, Andrew, Jerin,

This is causing trouble when device is re-configured with its existing data,
because of the check in the ethdev [1].

This is for the case device configuration get, a few thing changed and
re-configured case, this is what is done in bonding and it is failing now.

Do you have any suggestion for the solution?

We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
but reconfigure is not.

Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?



[1]

 @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
nb_rx_q, uint16_t nb_tx_q,
  		goto rollback;
  	}

 +	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
 +	if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
 +	    (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
 +		RTE_ETHDEV_LOG(ERR,
 +			"Ethdev port_id=%u config invalid Rx mq_mode without RSS  but %s offload is
requested",
 +			port_id,
 +			rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
 +		ret = -EINVAL;
 +		goto rollback;
 +	}

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 02/10] ethdev: add mbuf RSS update as an offload
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 02/10] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-11-13 18:04                                 ` Ferruh Yigit
  0 siblings, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-13 18:04 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, John McNamara, Marko Kovacevic
  Cc: dev

On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
> @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>  		goto rollback;
>  	}
>  
> +	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
> +	if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
> +	    (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
> +		RTE_ETHDEV_LOG(ERR,
> +			"Ethdev port_id=%u config invalid Rx mq_mode without RSS but %s offload is requested",
> +			port_id,
> +			rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));

"\n" is missing in the log, can you please send a fix?


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 03/10] ethdev: add validation to offloads set by PMD
  2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 03/10] ethdev: add validation to offloads set by PMD pbhagavatula
@ 2019-11-13 18:10                                 ` Ferruh Yigit
  0 siblings, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-13 18:10 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas; +Cc: dev

On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
> +static int
> +validate_offloads(uint16_t port_id, uint64_t req_offloads,
> +		  uint64_t set_offloads, const char *offload_type,
> +		  const char *(*offload_name)(uint64_t))
> +{
> +	uint64_t offloads_diff = req_offloads ^ set_offloads;
> +	uint64_t offload;
> +	int ret = 0;
> +
> +	while (offloads_diff != 0) {
> +		/* Check if any offload is requested but not enabled. */
> +		offload = 1ULL << __builtin_ctzll(offloads_diff);
> +		if (offload & req_offloads) {
> +			RTE_ETHDEV_LOG(ERR,
> +				"Port %u failed to enable %s offload %s\n",
> +				port_id, offload_type, offload_name(offload));
> +			ret = -EINVAL;
> +		}
> +
> +		/* Chech if offload couldn't be disabled. */
> +		if (offload & set_offloads) {
> +			RTE_ETHDEV_LOG(INFO,
> +				"Port %u failed to disable %s offload %s\n",
> +				port_id, offload_type, offload_name(offload));

Since many PMDs now doesn't support to disable RSS_HASH config, keep getting
this log, and the message saying 'failed' confusing people.

My initial comment was to add the log in the PMDs and as "disabling not
supported ...", but since this is in the ethdev, we can we really say if
disabling not supported or failed? Can we figure out a less confusing message?

And second, to not keep getting this message, what do you think reducing the log
level to DEBUG?

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities
  2019-11-13 18:02                                 ` Ferruh Yigit
@ 2019-11-14 12:52                                   ` Ferruh Yigit
  2019-11-14 12:57                                   ` Jerin Jacob
  1 sibling, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-14 12:52 UTC (permalink / raw)
  To: pbhagavatula, arybchenko, jerinj, thomas, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev

On 11/13/2019 6:02 PM, Ferruh Yigit wrote:
> On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>> index 30c0379d4..8c1caac18 100644
>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>> @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
>>  	int ret;
>>  
>>  	PMD_INIT_FUNC_TRACE();
>> +
>> +	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
>> +
> 
> Hi Pavan, Andrew, Jerin,
> 
> This is causing trouble when device is re-configured with its existing data,
> because of the check in the ethdev [1].
> 
> This is for the case device configuration get, a few thing changed and
> re-configured case, this is what is done in bonding and it is failing now.
> 
> Do you have any suggestion for the solution?
> 
> We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
> still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
> but reconfigure is not.
> 
> Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?
> 

No update? I think we should fix this before rc3!

> 
> 
> [1]
> 
>  @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
> nb_rx_q, uint16_t nb_tx_q,
>   		goto rollback;
>   	}
> 
>  +	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
>  +	if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
>  +	    (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
>  +		RTE_ETHDEV_LOG(ERR,
>  +			"Ethdev port_id=%u config invalid Rx mq_mode without RSS  but %s offload is
> requested",
>  +			port_id,
>  +			rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
>  +		ret = -EINVAL;
>  +		goto rollback;
>  +	}
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities
  2019-11-13 18:02                                 ` Ferruh Yigit
  2019-11-14 12:52                                   ` Ferruh Yigit
@ 2019-11-14 12:57                                   ` Jerin Jacob
  2019-11-14 13:24                                     ` Andrew Rybchenko
  1 sibling, 1 reply; 246+ messages in thread
From: Jerin Jacob @ 2019-11-14 12:57 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Pavan Nikhilesh, Andrew Rybchenko, Jerin Jacob, Thomas Monjalon,
	Ajit Khaparde, Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal,
	Sachin Saxena, Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang,
	Xiao Wang, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang, dpdk-dev

On Wed, Nov 13, 2019 at 11:32 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index 30c0379d4..8c1caac18 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
> >       int ret;
> >
> >       PMD_INIT_FUNC_TRACE();
> > +
> > +     dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> > +
>
> Hi Pavan, Andrew, Jerin,
>
> This is causing trouble when device is re-configured with its existing data,
> because of the check in the ethdev [1].
>
> This is for the case device configuration get, a few thing changed and
> re-configured case, this is what is done in bonding and it is failing now.
>
> Do you have any suggestion for the solution?
>
> We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
> still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
> but reconfigure is not.
>
> Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?

IMO, We can relax the check as it is NOT at all critical for this flag.

>
>
>
> [1]
>
>  @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
> nb_rx_q, uint16_t nb_tx_q,
>                 goto rollback;
>         }
>
>  +      /* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
>  +      if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
>  +          (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
>  +              RTE_ETHDEV_LOG(ERR,
>  +                      "Ethdev port_id=%u config invalid Rx mq_mode without RSS  but %s offload is
> requested",
>  +                      port_id,
>  +                      rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
>  +              ret = -EINVAL;
>  +              goto rollback;
>  +      }

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities
  2019-11-14 12:57                                   ` Jerin Jacob
@ 2019-11-14 13:24                                     ` Andrew Rybchenko
  2019-11-14 13:59                                       ` Ferruh Yigit
  0 siblings, 1 reply; 246+ messages in thread
From: Andrew Rybchenko @ 2019-11-14 13:24 UTC (permalink / raw)
  To: Jerin Jacob, Ferruh Yigit
  Cc: Pavan Nikhilesh, Jerin Jacob, Thomas Monjalon, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang, dpdk-dev

On 11/14/19 3:57 PM, Jerin Jacob wrote:
> On Wed, Nov 13, 2019 at 11:32 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>> On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
>>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>>> index 30c0379d4..8c1caac18 100644
>>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>>> @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
>>>        int ret;
>>>
>>>        PMD_INIT_FUNC_TRACE();
>>> +
>>> +     dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
>>> +
>> Hi Pavan, Andrew, Jerin,
>>
>> This is causing trouble when device is re-configured with its existing data,
>> because of the check in the ethdev [1].
>>
>> This is for the case device configuration get, a few thing changed and
>> re-configured case, this is what is done in bonding and it is failing now.
>>
>> Do you have any suggestion for the solution?
>>
>> We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
>> still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
>> but reconfigure is not.
>>
>> Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?
> IMO, We can relax the check as it is NOT at all critical for this flag.

Other option is to set RSS_HASH above if (dev_conf->rxmode.mq_mode & 
ETH_MQ_RX_RSS_FLAG).
Should I care about it?

>> [1]
>>
>>   @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
>> nb_rx_q, uint16_t nb_tx_q,
>>                  goto rollback;
>>          }
>>
>>   +      /* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
>>   +      if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
>>   +          (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
>>   +              RTE_ETHDEV_LOG(ERR,
>>   +                      "Ethdev port_id=%u config invalid Rx mq_mode without RSS  but %s offload is
>> requested",
>>   +                      port_id,
>>   +                      rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
>>   +              ret = -EINVAL;
>>   +              goto rollback;
>>   +      }


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities
  2019-11-14 13:24                                     ` Andrew Rybchenko
@ 2019-11-14 13:59                                       ` Ferruh Yigit
  2019-11-14 14:14                                         ` Ferruh Yigit
  0 siblings, 1 reply; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-14 13:59 UTC (permalink / raw)
  To: Andrew Rybchenko, Jerin Jacob
  Cc: Pavan Nikhilesh, Jerin Jacob, Thomas Monjalon, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang, dpdk-dev

On 11/14/2019 1:24 PM, Andrew Rybchenko wrote:
> On 11/14/19 3:57 PM, Jerin Jacob wrote:
>> On Wed, Nov 13, 2019 at 11:32 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>> On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
>>>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>>>> index 30c0379d4..8c1caac18 100644
>>>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>>>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>>>> @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
>>>>        int ret;
>>>>
>>>>        PMD_INIT_FUNC_TRACE();
>>>> +
>>>> +     dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
>>>> +
>>> Hi Pavan, Andrew, Jerin,
>>>
>>> This is causing trouble when device is re-configured with its existing data,
>>> because of the check in the ethdev [1].
>>>
>>> This is for the case device configuration get, a few thing changed and
>>> re-configured case, this is what is done in bonding and it is failing now.
>>>
>>> Do you have any suggestion for the solution?
>>>
>>> We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
>>> still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
>>> but reconfigure is not.
>>>
>>> Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?
>> IMO, We can relax the check as it is NOT at all critical for this flag.
> 
> Other option is to set RSS_HASH above if (dev_conf->rxmode.mq_mode & 
> ETH_MQ_RX_RSS_FLAG).

+1 to this check in PMDs, even we can disable the RSS_HASH offload when RSS is
not enabled [2], but this won't solve the problem completely. User can do first
configure with RSS enabled and second with RSS disabled, it will be same issue.

[2]
in PMD, configure():
if (dev_conf->rxmode.mq_mode & TH_MQ_RX_RSS_FLAG)
 offload |= RSS_HASH
else
 offload &= ~RSS_HASH

> Should I care about it?
> 
>>> [1]
>>>
>>>   @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
>>> nb_rx_q, uint16_t nb_tx_q,
>>>                  goto rollback;
>>>          }
>>>
>>>   +      /* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
>>>   +      if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
>>>   +          (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
>>>   +              RTE_ETHDEV_LOG(ERR,
>>>   +                      "Ethdev port_id=%u config invalid Rx mq_mode without RSS  but %s offload is
>>> requested",
>>>   +                      port_id,
>>>   +                      rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
>>>   +              ret = -EINVAL;
>>>   +              goto rollback;
>>>   +      }
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v16 4/8] drivers/net: update Rx RSS hash offload capabilities
  2019-11-08  8:48                                 ` Andrew Rybchenko
@ 2019-11-14 14:01                                   ` Ferruh Yigit
  0 siblings, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-14 14:01 UTC (permalink / raw)
  To: Andrew Rybchenko, pbhagavatula, jerinj, thomas, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang
  Cc: dev

On 11/8/2019 8:48 AM, Andrew Rybchenko wrote:
> On 11/7/19 8:22 PM, Ferruh Yigit wrote:
>> On 11/6/2019 7:17 PM, pbhagavatula@marvell.com wrote:
>>> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
>>> index ed8cbd849..37df1c40a 100644
>>> --- a/drivers/net/i40e/i40e_ethdev.c
>>> +++ b/drivers/net/i40e/i40e_ethdev.c
>>> @@ -1812,6 +1812,8 @@ i40e_dev_configure(struct rte_eth_dev *dev)
>>>  	ad->tx_simple_allowed = true;
>>>  	ad->tx_vec_allowed = true;
>>>  
>>> +	dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
>>> +
>>>  	/* Only legacy filter API needs the following fdir config. So when the
>>>  	 * legacy filter API is deprecated, the following codes should also be
>>>  	 * removed.
>>
>> When I checked with "show port 0 rx_offload configuration" testpmd command, I
>> don't see that "RSS_HASH" is shown as enabled, do you know why it doesn't show up?
> 
> As I understand testpmd uses its own internal dev_conf copy,
> not dev->data->dev_conf.
> 

Yes, because device config is device internal application seems keeping its own
copy, and since the PMD updates the configuration on its own the application
config and PMD config diverges.

^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities
  2019-11-14 13:59                                       ` Ferruh Yigit
@ 2019-11-14 14:14                                         ` Ferruh Yigit
  0 siblings, 0 replies; 246+ messages in thread
From: Ferruh Yigit @ 2019-11-14 14:14 UTC (permalink / raw)
  To: Andrew Rybchenko, Jerin Jacob
  Cc: Pavan Nikhilesh, Jerin Jacob, Thomas Monjalon, Ajit Khaparde,
	Somnath Kotur, Rahul Lakkireddy, Hemant Agrawal, Sachin Saxena,
	Wenzhuo Lu, John Daley, Hyong Youb Kim, Qi Zhang, Xiao Wang,
	Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou, Beilei Xing,
	Jingjing Wu, Qiming Yang, Konstantin Ananyev, Shijith Thotton,
	Srisivasubramanian Srinivasan, Matan Azrad, Shahaf Shuler,
	Viacheslav Ovsiienko, Stephen Hemminger, K. Y. Srinivasan,
	Haiyang Zhang, Alejandro Lucero, Nithin Dabilpuram,
	Kiran Kumar K, Rasesh Mody, Shahed Shaikh, Maciej Czekaj,
	Yong Wang, dpdk-dev

On 11/14/2019 1:59 PM, Ferruh Yigit wrote:
> On 11/14/2019 1:24 PM, Andrew Rybchenko wrote:
>> On 11/14/19 3:57 PM, Jerin Jacob wrote:
>>> On Wed, Nov 13, 2019 at 11:32 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>>> On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
>>>>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>>>>> index 30c0379d4..8c1caac18 100644
>>>>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>>>>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>>>>> @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
>>>>>        int ret;
>>>>>
>>>>>        PMD_INIT_FUNC_TRACE();
>>>>> +
>>>>> +     dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
>>>>> +
>>>> Hi Pavan, Andrew, Jerin,
>>>>
>>>> This is causing trouble when device is re-configured with its existing data,
>>>> because of the check in the ethdev [1].
>>>>
>>>> This is for the case device configuration get, a few thing changed and
>>>> re-configured case, this is what is done in bonding and it is failing now.
>>>>
>>>> Do you have any suggestion for the solution?
>>>>
>>>> We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
>>>> still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
>>>> but reconfigure is not.
>>>>
>>>> Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?
>>> IMO, We can relax the check as it is NOT at all critical for this flag.
>>
>> Other option is to set RSS_HASH above if (dev_conf->rxmode.mq_mode & 
>> ETH_MQ_RX_RSS_FLAG).
> 
> +1 to this check in PMDs, even we can disable the RSS_HASH offload when RSS is
> not enabled [2], but this won't solve the problem completely. User can do first
> configure with RSS enabled and second with RSS disabled, it will be same issue.
> 
> [2]
> in PMD, configure():
> if (dev_conf->rxmode.mq_mode & TH_MQ_RX_RSS_FLAG)
>  offload |= RSS_HASH
> else
>  offload &= ~RSS_HASH

Hi Pavan, Andrew, Jerin,

All this bonding issue, tespmd rx_offload copy not being correct, the fail log
on each app start because PMD force enables this config.

I remember I have requested it to keep the device configuration correct, but it
is causing more troubles than expected.

Instead we can remove those PMD updates, so when application not requested
RSS_HAS, PMD will say OK and update the configuration according, but indeed it
will continue to update mbuf:rss:hash fields, since PMD is doing more than
requested this shouldn't be a problem in application side.
The behavior can be fixed when PMD implements the disabling RSS_HASH but this is
most probably won't happen for some PMDs because of performance reasons. So the
device configuration may remain wrong for those PMDs.

Overall, since that was the case in prev versions, I believe you are OK but can
you confirm again please?

> 
>> Should I care about it?
>>
>>>> [1]
>>>>
>>>>   @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
>>>> nb_rx_q, uint16_t nb_tx_q,
>>>>                  goto rollback;
>>>>          }
>>>>
>>>>   +      /* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
>>>>   +      if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
>>>>   +          (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
>>>>   +              RTE_ETHDEV_LOG(ERR,
>>>>   +                      "Ethdev port_id=%u config invalid Rx mq_mode without RSS  but %s offload is
>>>> requested",
>>>>   +                      port_id,
>>>>   +                      rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
>>>>   +              ret = -EINVAL;
>>>>   +              goto rollback;
>>>>   +      }
>>
> 


^ permalink raw reply	[flat|nested] 246+ messages in thread

* Re: [dpdk-dev] [PATCH v7 1/7] ethdev: add set ptype function
@ 2019-10-02 14:06 Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 246+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-10-02 14:06 UTC (permalink / raw)
  To: Andrew Rybchenko, Jerin Jacob Kollanukkaran, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit
  Cc: dev


>On 10/2/19 4:37 PM, Andrew Rybchenko wrote:
>> Hi,
>>
>> looks good, just few comments below.
>>
>> Many thanks for working on it,
>> Andrew.
>>

Thank you for your patience.

Pavan.

>> On 10/2/19 6:47 AM, pbhagavatula@marvell.com wrote:
>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>>
>>> Add `rte_eth_dev_set_supported_ptypes` function that will allow
>the
>>> application to inform the PMD the packet types it is interested in.
>>> Based on the ptypes set PMDs can optimize their Rx path.
>>>
>>> -If application doesn’t want any ptype information it can call
>>> `rte_eth_dev_set_supported_ptypes(ethdev_id,
>RTE_PTYPE_UNKNOWN, NULL,
>>> 0)`
>>> and PMD may skip packet type processing and set
>rte_mbuf::packet_type to
>>> RTE_PTYPE_UNKNOWN.
>>>
>>> -If application doesn’t call `rte_eth_dev_set_supported_ptypes`
>PMD can
>>> return `rte_mbuf::packet_type` with
>`rte_eth_dev_get_supported_ptypes`.
>>>
>>> -If application is interested only in L2/L3 layer, it can inform the PMD
>>> to update `rte_mbuf::packet_type` with L2/L3 ptype by calling
>>> `rte_eth_dev_set_supported_ptypes(ethdev_id,
>>>         RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.
>>>
>>> Suggested-by: Konstantin Ananyev
><konstantin.ananyev@intel.com>
>>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> [snip]
>>
>>> diff --git a/lib/librte_ethdev/rte_ethdev.c
>>> b/lib/librte_ethdev/rte_ethdev.c
>>> index 17d183e1f..b1588fe7a 100644
>>> --- a/lib/librte_ethdev/rte_ethdev.c
>>> +++ b/lib/librte_ethdev/rte_ethdev.c
>>> @@ -2602,6 +2602,56 @@
>rte_eth_dev_get_supported_ptypes(uint16_t
>>> port_id, uint32_t ptype_mask,
>>>       return j;
>>>   }
>>>   +int
>>> +rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t
>ptype_mask,
>>> +                 uint32_t *set_ptypes, unsigned int num)
>>> +{
>>> +    unsigned int i, j;
>>> +    struct rte_eth_dev *dev;
>>> +    const uint32_t *all_ptypes;
>>> +
>>> +    RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>>> +    dev = &rte_eth_devices[port_id];
>>> + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops-
>>dev_supported_ptypes_get, 0);
>>> + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops-
>>dev_supported_ptypes_set, 0);
>>
>> When 0 is returned above, we should set set_ptypes. So, below
>> check num vs set_types should be done before callbacks check and
>> I think it is OK to do
>>       set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>
>of course if num > 0
>
>> just after the check. It will allow to simplify code below and will
>> make it set correctly even if 0 returned because of no callbacks.

Ack, will roll v8.

>>
>>> +
>>> +    if (num > 0 && set_ptypes == NULL)
>>> +        return -EINVAL;
>>> +
>>> +    if (ptype_mask == 0) {
>>> +        if (num > 0)
>>> +            set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>>> +
>>> +        return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
>>> +                ptype_mask);
>>> +    }
>>> +
>>> +    all_ptypes = (*dev->dev_ops-
>>dev_supported_ptypes_get)(dev);
>>> +    if (all_ptypes == NULL) {
>>> +        if (num > 0)
>>> +            set_ptypes[0] = RTE_PTYPE_UNKNOWN;
>>> +
>>> +        return 0;
>>> +    }
>>> +
>>> +    for (i = 0, j = 0; set_ptypes != NULL &&
>>> +                (all_ptypes[i] != RTE_PTYPE_UNKNOWN); ++i) {
>>> +        if (ptype_mask & all_ptypes[i]) {
>>> +            if (j < num - 1) {
>>> +                set_ptypes[j] = all_ptypes[i];
>>> +                j++;
>>> +                continue;
>>> +            }
>>> +            break;
>>
>> I'd like to repeat my question about insufficient space to return
>> set_ptypes. Do we need to signal it somehow? If no, it should be
>> explained why in the comments here.

I actually documented it above set_supported_ptypes fn
"
+ *
+ * The function accepts an array `set_ptypes` allocated by the caller to
+ * store the packet types set by the driver, the last element of the array
+ * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype` array should be
+ * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be filled
+ * partially.
"

I will comment the code too. Just in case.

>>
>>> +        }
>>> +    }
>>> +
>>> +    if (set_ptypes != NULL)
>>> +        set_ptypes[j] = RTE_PTYPE_UNKNOWN;
>>> +
>>> +    return (*dev->dev_ops->dev_supported_ptypes_set)(dev,
>ptype_mask);
>>> +}
>>> +
>>>   void
>>>   rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr
>*mac_addr)
>>>   {
>>> diff --git a/lib/librte_ethdev/rte_ethdev.h
>>> b/lib/librte_ethdev/rte_ethdev.h
>>> index d9871782e..c577a9172 100644
>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>> @@ -2431,6 +2431,42 @@ int
>rte_eth_dev_fw_version_get(uint16_t port_id,
>>>    */
>>>   int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t
>>> ptype_mask,
>>>                        uint32_t *ptypes, int num);
>>> +/**
>>> + * @warning
>>> + * @b EXPERIMENTAL: this API may change without prior notice.
>>> + *
>>> + * Inform Ethernet device of the packet types classification in which
>>> + * the recipient is interested.
>>> + *
>>> + * Application can use this function to set only specific ptypes
>>> that it's
>>> + * interested. This information can be used by the PMD to optimize
>>> Rx path.
>>> + *
>>> + * The function accepts an array `set_ptypes` allocated by the
>>> caller to
>>> + * store the packet types set by the driver, the last element of the
>>> array
>>> + * is set to RTE_PTYPE_UNKNOWN. The size of the `set_ptype`
>array
>>> should be
>>> + * `rte_eth_dev_get_supported_ptypes() + 1` else it might only be
>>> filled
>>> + * partially.
>>> + *
>>> + * @param port_id
>>> + *   The port identifier of the Ethernet device.
>>> + * @param ptype_mask
>>> + *   The ptype family that application is interested in.
>>> + * @param set_ptypes
>>> + *   An array pointer to store set packet types, allocated by
>>> caller. The
>>> + *   function marks the end of array with RTE_PTYPE_UNKNOWN.
>>> + * @param num
>>> + *   Size of the array pointed by param ptypes.
>>> + *   Should be rte_eth_dev_get_supported_ptypes() + 1 to
>accommodate
>>> the
>>> + *   set ptypes.
>>> + * @return
>>> + *   - (0) if Success.
>>> + *   - (-ENODEV) if *port_id* invalid.
>>> + *   - (-EINVAL) if *ptype_mask* is invalid (or) set_ptypes is NULL
>and
>>> + *     num > 0.
>>> + */
>>> +__rte_experimental
>>> +int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t
>>> ptype_mask,
>>> +                     uint32_t *set_ptypes, unsigned int num);
>>>     /**
>>>    * Retrieve the MTU of an Ethernet device.
>>> diff --git a/lib/librte_ethdev/rte_ethdev_core.h
>>> b/lib/librte_ethdev/rte_ethdev_core.h
>>> index 2922d5b7c..93bc34480 100644
>>> --- a/lib/librte_ethdev/rte_ethdev_core.h
>>> +++ b/lib/librte_ethdev/rte_ethdev_core.h
>>> @@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct
>>> rte_eth_dev *dev,
>>>   typedef const uint32_t
>*(*eth_dev_supported_ptypes_get_t)(struct
>>> rte_eth_dev *dev);
>>>   /**< @internal Get supported ptypes of an Ethernet device. */
>>>   +typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct
>>> rte_eth_dev *dev,
>>> +                          uint32_t ptype_mask);
>>> +/**< @internal Inform device about packet types in which the
>>> recipient is interested. */
>>> +
>>
>> Please, take a look at promiscuous mode callback and let's put
>> more verbose description here which better document interface
>> to drivers. I think ptyep_mask description should refer to
>corresponding
>> defines to be used.

Ack. More description never hurts.

>>
>> [snip]
>>


^ permalink raw reply	[flat|nested] 246+ messages in thread

end of thread, other threads:[~2019-11-14 14:15 UTC | newest]

Thread overview: 246+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-21 20:47 [dpdk-dev] [PATCH v2 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 1/7] ethdev: add set ptype function pbhagavatula
2019-08-23  9:44   ` Andrew Rybchenko
2019-10-01 14:54   ` Jerin Jacob
2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-08-23  1:19   ` Stephen Hemminger
2019-08-27 13:44     ` Andrew Rybchenko
2019-08-23  9:49   ` Andrew Rybchenko
2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 3/7] ethdev: add flow action type " pbhagavatula
2019-08-23 10:00   ` Andrew Rybchenko
2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-01 14:43   ` Jerin Jacob
2019-10-01 15:40   ` Ajit Khaparde
2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
2019-08-23 10:03   ` Andrew Rybchenko
2019-10-01 14:48   ` Jerin Jacob
2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-08-21 20:47 ` [dpdk-dev] [PATCH v2 7/7] examples: disable Rx packet type parsing pbhagavatula
2019-08-23 10:10   ` Andrew Rybchenko
2019-09-29 21:19 ` [dpdk-dev] [PATCH v3 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 1/7] ethdev: add set ptype function pbhagavatula
2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 3/7] ethdev: add flow action type " pbhagavatula
2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-09-29 21:19   ` [dpdk-dev] [PATCH v3 7/7] examples: disable Rx packet type parsing pbhagavatula
2019-09-30 17:47     ` Aaron Conole
2019-10-01  5:02       ` Pavan Nikhilesh Bhagavatula
2019-10-01  6:34   ` [dpdk-dev] [PATCH v4 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 1/7] ethdev: add set ptype function pbhagavatula
2019-10-01  7:04       ` Andrew Rybchenko
2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 3/7] ethdev: add flow action type " pbhagavatula
2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-01  6:34     ` [dpdk-dev] [PATCH v4 7/7] examples: disable Rx packet type parsing pbhagavatula
2019-10-01  6:41     ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 1/7] ethdev: add set ptype function pbhagavatula
2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 3/7] ethdev: add flow action type " pbhagavatula
2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-01  7:10         ` Andrew Rybchenko
2019-10-01 11:50         ` Hemant Agrawal
2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
2019-10-01  7:11         ` Andrew Rybchenko
2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-01  6:41       ` [dpdk-dev] [PATCH v5 7/7] examples: disable Rx packet type parsing pbhagavatula
2019-10-01 18:52       ` [dpdk-dev] [PATCH v6 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 1/7] ethdev: add set ptype function pbhagavatula
2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 3/7] ethdev: add flow action type " pbhagavatula
2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-01 18:52         ` [dpdk-dev] [PATCH v6 7/7] examples: disable Rx packet type parsing pbhagavatula
2019-10-02  3:47         ` [dpdk-dev] [PATCH v5 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 1/7] ethdev: add set ptype function pbhagavatula
2019-10-02 13:37             ` Andrew Rybchenko
2019-10-02 13:41               ` Andrew Rybchenko
2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 3/7] ethdev: add flow action type " pbhagavatula
2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
2019-10-02  9:52             ` Jerin Jacob
2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-02  3:47           ` [dpdk-dev] [PATCH v7 7/7] examples: disable Rx packet type parsing pbhagavatula
2019-10-02 21:36           ` [dpdk-dev] [PATCH v8 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 1/7] ethdev: add set ptype function pbhagavatula
2019-10-03  7:40               ` Andrew Rybchenko
2019-10-03 17:15                 ` Pavan Nikhilesh Bhagavatula
2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 3/7] ethdev: add flow action type " pbhagavatula
2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-02 21:36             ` [dpdk-dev] [PATCH v8 7/7] examples: disable Rx packet type parsing pbhagavatula
2019-10-07  6:51             ` [dpdk-dev] [PATCH v9 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 1/7] ethdev: add set ptype function pbhagavatula
2019-10-08 14:48                 ` Andrew Rybchenko
2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 3/7] ethdev: add flow action type " pbhagavatula
2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-07  6:51               ` [dpdk-dev] [PATCH v9 7/7] examples: disable Rx packet type parsing pbhagavatula
2019-10-09 15:33               ` [dpdk-dev] [PATCH v10 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 1/7] ethdev: add set ptype function pbhagavatula
2019-10-10  8:46                   ` Andrew Rybchenko
2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 3/7] ethdev: add flow action type " pbhagavatula
2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-09 15:33                 ` [dpdk-dev] [PATCH v10 7/7] examples: disable Rx packet type parsing pbhagavatula
2019-10-10 10:51                 ` [dpdk-dev] [PATCH v11 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 1/7] ethdev: add set ptype function pbhagavatula
2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 3/7] ethdev: add flow action type " pbhagavatula
2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-10 10:51                   ` [dpdk-dev] [PATCH v11 7/7] examples: disable Rx packet type parsing pbhagavatula
2019-10-17 12:02                   ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 1/7] ethdev: add set ptype function pbhagavatula
2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 3/7] ethdev: add flow action type " pbhagavatula
2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 5/7] drivers/net: update Rx flow flag and mark capabilities pbhagavatula
2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 6/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-17 12:02                     ` [dpdk-dev] [PATCH v12 7/7] examples: disable Rx packet type parsing pbhagavatula
2019-10-17 17:43                     ` [dpdk-dev] [PATCH v12 0/7] ethdev: add new Rx offload flags Ferruh Yigit
2019-10-18  7:32                       ` Andrew Rybchenko
2019-10-18  9:42                         ` Ferruh Yigit
2019-10-18 10:31                           ` Andrew Rybchenko
2019-10-21 15:06                             ` Ferruh Yigit
2019-10-25 14:33                     ` [dpdk-dev] [PATCH v13 0/6] " pbhagavatula
2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 1/6] ethdev: add set ptype function pbhagavatula
2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 2/6] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 3/6] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-25 14:56                         ` Andrew Rybchenko
2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 4/6] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 5/6] examples/l2fwd: disable ptype parsing pbhagavatula
2019-10-25 14:33                       ` [dpdk-dev] [PATCH v13 6/6] app/testpmd: add command to set supported ptype mask pbhagavatula
2019-10-29  5:03                       ` [dpdk-dev] [PATCH v14 0/6] ethdev: add new Rx offload flags pbhagavatula
2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 1/7] ethdev: add set ptype function pbhagavatula
2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-29  7:13                           ` Andrew Rybchenko
2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 3/7] ethdev: log offloads that can't be disabled by PMD pbhagavatula
2019-10-29  7:05                           ` Andrew Rybchenko
2019-10-29  8:33                             ` Pavan Nikhilesh Bhagavatula
2019-10-29  8:42                               ` Andrew Rybchenko
2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-29  7:21                           ` Andrew Rybchenko
2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 5/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 6/7] examples/l2fwd: disable ptype parsing pbhagavatula
2019-10-29  5:03                         ` [dpdk-dev] [PATCH v14 7/7] app/testpmd: add command to set supported ptype mask pbhagavatula
2019-10-29 15:37                         ` [dpdk-dev] [PATCH v15 0/7] ethdev: add new Rx offload flags pbhagavatula
2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 1/7] ethdev: add set ptype function pbhagavatula
2019-10-31 13:39                             ` Thomas Monjalon
2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-31 13:43                             ` Thomas Monjalon
2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 3/7] ethdev: add validation to offloads set by PMD pbhagavatula
2019-10-29 16:53                             ` Andrew Rybchenko
2019-10-29 17:25                               ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2019-10-31 13:45                               ` [dpdk-dev] " Thomas Monjalon
2019-10-31 13:58                             ` Thomas Monjalon
2019-10-31 16:44                               ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2019-11-01 22:50                                 ` Thomas Monjalon
2019-10-31 15:13                             ` [dpdk-dev] " Matan Azrad
2019-10-31 15:18                               ` Pavan Nikhilesh Bhagavatula
2019-10-31 15:50                                 ` Matan Azrad
2019-10-31 16:33                                   ` Pavan Nikhilesh Bhagavatula
2019-11-01 11:04                                     ` Andrew Rybchenko
2019-11-03  6:57                                       ` Matan Azrad
2019-11-03 12:12                                         ` Andrew Rybchenko
2019-11-03 15:16                                           ` Matan Azrad
2019-11-05 12:48                                             ` Andrew Rybchenko
2019-11-05 14:05                                               ` Matan Azrad
2019-11-05 14:37                                                 ` Andrew Rybchenko
2019-11-06  6:58                                                   ` Matan Azrad
2019-11-06  8:12                                                     ` Andrew Rybchenko
2019-11-07  6:56                                                       ` Matan Azrad
2019-11-08 10:12                                                         ` Andrew Rybchenko
2019-11-08 10:29                                                           ` Matan Azrad
2019-11-08 11:24                                                             ` Andrew Rybchenko
2019-11-08 11:48                                                               ` Matan Azrad
2019-11-08 12:09                                                                 ` Andrew Rybchenko
2019-11-08 12:59                                                                   ` Thomas Monjalon
2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 4/7] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-10-31 14:03                             ` Thomas Monjalon
2019-10-31 16:51                               ` Pavan Nikhilesh Bhagavatula
2019-11-01 11:11                                 ` Andrew Rybchenko
2019-11-01 22:22                                   ` Thomas Monjalon
2019-11-01 17:49                             ` Liron Himi
2019-11-03 12:06                               ` Andrew Rybchenko
2019-11-03 14:06                                 ` [dpdk-dev] [EXT] " Liron Himi
2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 5/7] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-10-31 14:05                             ` Thomas Monjalon
2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 6/7] examples/l2fwd: disable ptype parsing pbhagavatula
2019-10-29 15:37                           ` [dpdk-dev] [PATCH v15 7/7] app/testpmd: add command to set supported ptype mask pbhagavatula
2019-10-31 10:33                             ` Iremonger, Bernard
2019-11-06 18:13                               ` Pavan Nikhilesh Bhagavatula
2019-11-06 19:17                           ` [dpdk-dev] [PATCH v16 0/8] ethdev: add new Rx offload flags pbhagavatula
2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 1/8] ethdev: add set ptype function pbhagavatula
2019-11-07 18:28                               ` Ferruh Yigit
2019-11-08  9:05                                 ` Andrew Rybchenko
2019-11-08  9:52                                   ` Ferruh Yigit
2019-11-08 10:24                                     ` Andrew Rybchenko
2019-11-08 11:05                                       ` Ferruh Yigit
2019-11-08 11:40                                         ` Andrew Rybchenko
2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 2/8] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-11-07 17:24                               ` Ferruh Yigit
2019-11-10 14:43                                 ` Pavan Nikhilesh Bhagavatula
2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 3/8] ethdev: add validation to offloads set by PMD pbhagavatula
2019-11-07 16:51                               ` Ferruh Yigit
2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 4/8] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-11-07 16:48                               ` Ferruh Yigit
2019-11-07 17:22                               ` Ferruh Yigit
2019-11-08  8:48                                 ` Andrew Rybchenko
2019-11-14 14:01                                   ` Ferruh Yigit
2019-11-06 19:17                             ` [dpdk-dev] [PATCH v16 5/8] examples/eventdev_pipeline: split port init sequence pbhagavatula
2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 6/8] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 7/8] examples/l2fwd: disable ptype parsing pbhagavatula
2019-11-07 17:59                               ` Ferruh Yigit
2019-11-07 18:30                               ` Ferruh Yigit
2019-11-06 19:18                             ` [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set supported ptype mask pbhagavatula
2019-11-07 11:57                               ` Iremonger, Bernard
2019-11-07 12:27                                 ` Iremonger, Bernard
2019-11-07 14:36                                   ` Pavan Nikhilesh Bhagavatula
2019-11-07 15:00                                     ` Iremonger, Bernard
2019-11-07 18:40                               ` Ferruh Yigit
2019-11-07 18:55                                 ` Jerin Jacob
2019-11-07 19:40                                   ` Ferruh Yigit
2019-11-08  4:13                                     ` Jerin Jacob
2019-11-08 13:54                                     ` Ananyev, Konstantin
2019-11-08 15:01                                       ` Jerin Jacob
2019-11-11  4:56                                         ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2019-11-11  5:02                                           ` Jerin Jacob
2019-11-11 10:44                                             ` Ferruh Yigit
2019-11-11 13:19                             ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags pbhagavatula
2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 01/10] ethdev: add set ptype function pbhagavatula
2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 02/10] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-11-13 18:04                                 ` Ferruh Yigit
2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 03/10] ethdev: add validation to offloads set by PMD pbhagavatula
2019-11-13 18:10                                 ` Ferruh Yigit
2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 04/10] drivers/net: update Rx RSS hash offload capabilities pbhagavatula
2019-11-11 15:05                                 ` Ferruh Yigit
2019-11-11 15:10                                   ` Pavan Nikhilesh Bhagavatula
2019-11-13 18:02                                 ` Ferruh Yigit
2019-11-14 12:52                                   ` Ferruh Yigit
2019-11-14 12:57                                   ` Jerin Jacob
2019-11-14 13:24                                     ` Andrew Rybchenko
2019-11-14 13:59                                       ` Ferruh Yigit
2019-11-14 14:14                                         ` Ferruh Yigit
2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 05/10] examples/eventdev_pipeline: split port init sequence pbhagavatula
2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 06/10] examples/eventdev_pipeline: add new Rx RSS hash offload pbhagavatula
2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 07/10] examples/l2fwd: disable ptype parsing pbhagavatula
2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 08/10] app/testpmd: add command to set supported ptype mask pbhagavatula
2019-11-11 14:51                                 ` Ferruh Yigit
2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 09/10] app/testpmd: disable packet type parsing by default pbhagavatula
2019-11-11 14:54                                 ` Ferruh Yigit
2019-11-11 13:19                               ` [dpdk-dev] [PATCH v17 10/10] app/testpmd: add RSS hash offload to port Rx offload cmd pbhagavatula
2019-11-11 15:45                               ` [dpdk-dev] [PATCH v17 00/10] ethdev: add new Rx offload flags Ferruh Yigit
2019-10-02 14:06 [dpdk-dev] [PATCH v7 1/7] ethdev: add set ptype function Pavan Nikhilesh Bhagavatula

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).