All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/39] convert examples to new ethdev offloads API
@ 2017-11-23 12:14 Shahaf Shuler
  2017-11-23 12:14 ` [PATCH 01/39] examples/l2fwd: convert " Shahaf Shuler
                   ` (10 more replies)
  0 siblings, 11 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:14 UTC (permalink / raw)
  To: dev

This series is to convert DPDK examples to the new offloads API [1].

[1] http://dpdk.org/ml/archives/dev/2017-October/077329.html

Shahaf Shuler (39):
  examples/l2fwd: convert to new ethdev offloads API
  examples/l2fwd-crypto: convert to new ethdev offloads API
  examples/l2fwd-jobstats: convert to new ethdev offloads API
  examples/l2fwd-keepalive: convert to new ethdev offloads API
  examples/l3fwd: move to ethdev offloads API
  examples/l3fwd-acl: convert to new ethdev offloads API
  examples/l3fwd-power: convert to new ethdev offloads API
  examples/l3fwd-vf: convert to new ethdev offloads API
  examples/bond: convert to new ethdev offloads API
  examples/exception_path: convert to new ethdev offloads API
  examples/kni: convert to new ethdev offloads API
  examples/ip_fragmentation: convert to new offloads API
  examples/ip_pipeline: convert to new ethdev offloads API
  examples/ip_reassembly: convert to new ethdev offloads API
  examples/ipsec-secgw: convert to new ethdev offloads API
  examples/ipv4_multicast: convert to new ethdev offloads API
  examples/link_status_interrupt: convert to new offloads API
  examples/load_balancer: convert to new ethdev offloads API
  examples/multi_process: convert to new ethdev offloads API
  examples/netmap_compat: convert to new ethdev offloads API
  examples/performance-thread: convert to new offloads API
  examples/qos_meter: convert to new ethdev offloads API
  examples/qos_sched: convert to new ethdev offloads API
  examples/quota_watermark: convert to new ethdev offloads API
  examples/tep_termination: convert to new ethdev offloads API
  examples/vhost: convert to new ethdev offloads API
  examples/vmdq: convert to new ethdev offloads API
  examples/vmdq_dcb: convert to new ethdev offloads API
  examples/vm_power_manager: convert to new offloads API
  examples/distributor: convert to new ethdev offloads API
  examples/ethtool: convert to new ethdev offloads API
  examples/eventdev_pipeline: convert to new offloads API
  examples/flow_classify: convert to new ethdev offloads API
  examples/flow_filtering: convert to new ethdev offloads API
  examples/packet_ordering: convert to new ethdev offloads API
  examples/ptpclient: convert to new ethdev offloads API
  examples/rxtx_callbacks: convert to new ethdev offloads API
  examples/server_node_efd: convert to new ethdev offloads API
  examples/skeleton: convert to new ethdev offloads API

 examples/bond/main.c                            | 68 +++++++++++++++++---
 examples/distributor/main.c                     |  8 ++-
 examples/ethtool/ethtool-app/main.c             |  7 +-
 examples/eventdev_pipeline_sw_pmd/main.c        | 10 ++-
 examples/exception_path/main.c                  | 38 ++++++++---
 examples/flow_classify/flow_classify.c          | 12 +++-
 examples/flow_filtering/main.c                  | 27 ++++----
 examples/ip_fragmentation/main.c                | 36 +++++++++--
 examples/ip_pipeline/config_parse.c             | 13 +---
 examples/ip_pipeline/init.c                     | 30 +++++++--
 examples/ip_reassembly/main.c                   | 36 +++++++++--
 examples/ipsec-secgw/ipsec-secgw.c              | 27 +++++++-
 examples/ipv4_multicast/main.c                  | 35 ++++++++--
 examples/kni/main.c                             | 67 ++++++++++++++++---
 examples/l2fwd-crypto/main.c                    | 38 ++++++++---
 examples/l2fwd-jobstats/main.c                  | 39 ++++++++---
 examples/l2fwd-keepalive/main.c                 | 39 ++++++++---
 examples/l2fwd/main.c                           | 38 ++++++++---
 examples/l3fwd-acl/main.c                       | 41 +++++++++---
 examples/l3fwd-power/main.c                     | 42 +++++++++---
 examples/l3fwd-vf/main.c                        | 38 ++++++++---
 examples/l3fwd/main.c                           | 41 +++++++++---
 examples/link_status_interrupt/main.c           | 38 ++++++++---
 examples/load_balancer/init.c                   | 37 +++++++++--
 examples/multi_process/l2fwd_fork/main.c        | 36 +++++++++--
 examples/multi_process/symmetric_mp/main.c      | 35 ++++++++--
 examples/netmap_compat/bridge/bridge.c          |  7 +-
 examples/netmap_compat/lib/compat_netmap.c      | 29 ++++++++-
 examples/packet_ordering/main.c                 | 13 +++-
 examples/performance-thread/l3fwd-thread/main.c | 42 +++++++++---
 examples/ptpclient/ptpclient.c                  |  7 +-
 examples/qos_meter/main.c                       | 64 ++++++++++++++++--
 examples/qos_sched/init.c                       | 31 +++++++--
 examples/quota_watermark/qw/init.c              | 38 ++++++++---
 examples/rxtx_callbacks/main.c                  | 12 +++-
 examples/server_node_efd/server/init.c          | 10 ++-
 examples/skeleton/basicfwd.c                    | 12 +++-
 examples/tep_termination/vxlan_setup.c          | 37 +++++++++--
 examples/vhost/main.c                           | 42 ++++++++----
 examples/vm_power_manager/main.c                | 12 +++-
 examples/vmdq/main.c                            | 11 ++--
 examples/vmdq_dcb/main.c                        | 10 +--
 42 files changed, 993 insertions(+), 260 deletions(-)

-- 
2.12.0

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

* [PATCH 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
@ 2017-11-23 12:14 ` Shahaf Shuler
  2017-11-24 15:00   ` Andrew Rybchenko
  2017-11-23 12:14 ` [PATCH 02/39] examples/l2fwd-crypto: " Shahaf Shuler
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:14 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd/main.c | 38 ++++++++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index e89e2e1bf..a1e378be6 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -110,14 +110,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
 static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -649,6 +646,9 @@ main(int argc, char **argv)
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+
 		/* skip ports that are not enabled */
 		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", portid);
@@ -658,6 +658,23 @@ main(int argc, char **argv)
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+			port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+			port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+		}
 		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
@@ -674,9 +691,11 @@ main(int argc, char **argv)
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     l2fwd_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
@@ -684,9 +703,12 @@ main(int argc, char **argv)
 
 		/* init one TX queue on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n",
 				ret, portid);
-- 
2.12.0

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

* [PATCH 02/39] examples/l2fwd-crypto: convert to new ethdev offloads API
  2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
  2017-11-23 12:14 ` [PATCH 01/39] examples/l2fwd: convert " Shahaf Shuler
@ 2017-11-23 12:14 ` Shahaf Shuler
  2017-11-23 12:14 ` [PATCH 03/39] examples/l2fwd-jobstats: " Shahaf Shuler
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:14 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd-crypto/main.c | 38 ++++++++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index d4e1682c8..e88638af4 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -235,16 +235,13 @@ struct lcore_queue_conf {
 
 struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.mq_mode = ETH_MQ_RX_NONE,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -2356,6 +2353,9 @@ initialize_ports(struct l2fwd_crypto_options *options)
 
 	for (last_portid = 0, portid = 0; portid < nb_ports; portid++) {
 		int retval;
+		struct rte_eth_dev_info dev_info;
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
 
 		/* Skip ports that are not enabled */
 		if ((options->portmask & (1 << portid)) == 0)
@@ -2364,6 +2364,23 @@ initialize_ports(struct l2fwd_crypto_options *options)
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+			port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+			port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+		}
 		retval = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 		if (retval < 0) {
 			printf("Cannot configure device: err=%d, port=%u\n",
@@ -2381,9 +2398,11 @@ initialize_ports(struct l2fwd_crypto_options *options)
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL, l2fwd_pktmbuf_pool);
+					     &rxq_conf, l2fwd_pktmbuf_pool);
 		if (retval < 0) {
 			printf("rte_eth_rx_queue_setup:err=%d, port=%u\n",
 					retval, portid);
@@ -2392,9 +2411,12 @@ initialize_ports(struct l2fwd_crypto_options *options)
 
 		/* init one TX queue on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = port_conf.txmode.offloads;
 		retval = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (retval < 0) {
 			printf("rte_eth_tx_queue_setup:err=%d, port=%u\n",
 				retval, portid);
-- 
2.12.0

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

* [PATCH 03/39] examples/l2fwd-jobstats: convert to new ethdev offloads API
  2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
  2017-11-23 12:14 ` [PATCH 01/39] examples/l2fwd: convert " Shahaf Shuler
  2017-11-23 12:14 ` [PATCH 02/39] examples/l2fwd-crypto: " Shahaf Shuler
@ 2017-11-23 12:14 ` Shahaf Shuler
  2017-11-23 12:14 ` [PATCH 04/39] examples/l2fwd-keepalive: " Shahaf Shuler
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:14 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd-jobstats/main.c | 39 +++++++++++++++++++++++++++++--------
 1 file changed, 31 insertions(+), 8 deletions(-)

diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 485370de6..f522cd905 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -116,14 +116,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
 struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -866,6 +863,10 @@ main(int argc, char **argv)
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_dev_info dev_info;
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+
 		/* skip ports that are not enabled */
 		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", portid);
@@ -875,6 +876,23 @@ main(int argc, char **argv)
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+			port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+			port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+		}
 		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
@@ -891,19 +909,24 @@ main(int argc, char **argv)
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     l2fwd_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
 				  ret, portid);
 
 		/* init one TX queue on each port */
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = port_conf.txmode.offloads;
 		fflush(stdout);
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 			"rte_eth_tx_queue_setup:err=%d, port=%u\n",
-- 
2.12.0

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

* [PATCH 04/39] examples/l2fwd-keepalive: convert to new ethdev offloads API
  2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
                   ` (2 preceding siblings ...)
  2017-11-23 12:14 ` [PATCH 03/39] examples/l2fwd-jobstats: " Shahaf Shuler
@ 2017-11-23 12:14 ` Shahaf Shuler
  2017-11-23 12:14 ` [PATCH 05/39] examples/l3fwd: move to " Shahaf Shuler
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:14 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd-keepalive/main.c | 39 ++++++++++++++++++++++++++++--------
 1 file changed, 31 insertions(+), 8 deletions(-)

diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 358ca5ec7..798abf792 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -107,14 +107,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
 struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -658,6 +655,10 @@ main(int argc, char **argv)
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_dev_info dev_info;
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+
 		/* skip ports that are not enabled */
 		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", portid);
@@ -667,6 +668,23 @@ main(int argc, char **argv)
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+			port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+			port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+		}
 		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
@@ -684,9 +702,11 @@ main(int argc, char **argv)
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     l2fwd_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
@@ -695,9 +715,12 @@ main(int argc, char **argv)
 
 		/* init one TX queue on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 				"rte_eth_tx_queue_setup:err=%d, port=%u\n",
-- 
2.12.0

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

* [PATCH 05/39] examples/l3fwd: move to ethdev offloads API
  2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
                   ` (3 preceding siblings ...)
  2017-11-23 12:14 ` [PATCH 04/39] examples/l2fwd-keepalive: " Shahaf Shuler
@ 2017-11-23 12:14 ` Shahaf Shuler
  2017-11-23 12:14 ` [PATCH 06/39] examples/l3fwd-acl: convert to new " Shahaf Shuler
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:14 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l3fwd/main.c | 41 +++++++++++++++++++++++++++++++----------
 1 file changed, 31 insertions(+), 10 deletions(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 6229568f2..cb1606c64 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -149,11 +149,9 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -612,7 +610,8 @@ parse_args(int argc, char **argv)
 			};
 
 			printf("%s\n", str8);
-			port_conf.rxmode.jumbo_frame = 1;
+			port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+			port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
 			/*
 			 * if no max-pkt-len set, use the default
@@ -908,6 +907,24 @@ main(int argc, char **argv)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue );
+
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+			port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+			port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+		}
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
 					(uint16_t)n_tx_queue, &port_conf);
 		if (ret < 0)
@@ -955,10 +972,9 @@ main(int argc, char **argv)
 			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
-			if (port_conf.rxmode.jumbo_frame)
-				txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socketid, txconf);
 			if (ret < 0)
@@ -984,6 +1000,8 @@ main(int argc, char **argv)
 		fflush(stdout);
 		/* init RX queues */
 		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+			struct rte_eth_rxconf rxq_conf;
+
 			portid = qconf->rx_queue_list[queue].port_id;
 			queueid = qconf->rx_queue_list[queue].queue_id;
 
@@ -996,9 +1014,12 @@ main(int argc, char **argv)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
 					socketid,
-					NULL,
+					&rxq_conf,
 					pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE,
-- 
2.12.0

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

* [PATCH 06/39] examples/l3fwd-acl: convert to new ethdev offloads API
  2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
                   ` (4 preceding siblings ...)
  2017-11-23 12:14 ` [PATCH 05/39] examples/l3fwd: move to " Shahaf Shuler
@ 2017-11-23 12:14 ` Shahaf Shuler
  2017-12-11 14:48   ` Ananyev, Konstantin
  2017-11-23 12:14 ` [PATCH 07/39] examples/l3fwd-power: " Shahaf Shuler
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:14 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l3fwd-acl/main.c | 41 ++++++++++++++++++++++++++++++++---------
 1 file changed, 32 insertions(+), 9 deletions(-)

diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index e50b1a1a8..977364f17 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -156,11 +156,9 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode	= ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -1727,7 +1725,10 @@ parse_args(int argc, char **argv)
 				};
 
 				printf("jumbo frame is enabled\n");
-				port_conf.rxmode.jumbo_frame = 1;
+				port_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_JUMBO_FRAME;
+				port_conf.txmode.offloads |=
+						DEV_TX_OFFLOAD_MULTI_SEGS;
 
 				/*
 				 * if no max-pkt-len set, then use the
@@ -1948,6 +1949,23 @@ main(int argc, char **argv)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+			port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+			port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+		}
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
 					(uint16_t)n_tx_queue, &port_conf);
 		if (ret < 0)
@@ -2004,8 +2022,8 @@ main(int argc, char **argv)
 
 			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
-			if (port_conf.rxmode.jumbo_frame)
-				txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socketid, txconf);
 			if (ret < 0)
@@ -2031,6 +2049,8 @@ main(int argc, char **argv)
 		fflush(stdout);
 		/* init RX queues */
 		for (queue = 0; queue < qconf->n_rx_queue; ++queue) {
+			struct rte_eth_rxconf rxq_conf;
+
 			portid = qconf->rx_queue_list[queue].port_id;
 			queueid = qconf->rx_queue_list[queue].queue_id;
 
@@ -2043,8 +2063,11 @@ main(int argc, char **argv)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-					socketid, NULL,
+					socketid, &rxq_conf,
 					pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE,
-- 
2.12.0

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

* [PATCH 07/39] examples/l3fwd-power: convert to new ethdev offloads API
  2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
                   ` (5 preceding siblings ...)
  2017-11-23 12:14 ` [PATCH 06/39] examples/l3fwd-acl: convert to new " Shahaf Shuler
@ 2017-11-23 12:14 ` Shahaf Shuler
  2017-12-11 14:00   ` Hunt, David
  2017-11-23 12:14 ` [PATCH 08/39] examples/l3fwd-vf: " Shahaf Shuler
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:14 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l3fwd-power/main.c | 42 ++++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 10 deletions(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 0a4ed145c..89c773d3e 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -215,11 +215,9 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode        = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -1317,7 +1315,10 @@ parse_args(int argc, char **argv)
 									0, 0};
 
 				printf("jumbo frame is enabled \n");
-				port_conf.rxmode.jumbo_frame = 1;
+				port_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_JUMBO_FRAME;
+				port_conf.txmode.offloads |=
+						DEV_TX_OFFLOAD_MULTI_SEGS;
 
 				/**
 				 * if no max-pkt-len set, use the default value
@@ -1718,6 +1719,23 @@ main(int argc, char **argv)
 		/* If number of Rx queue is 0, no need to enable Rx interrupt */
 		if (nb_rx_queue == 0)
 			port_conf.intr_conf.rxq = 0;
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+			port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+			port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+		}
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
 					(uint16_t)n_tx_queue, &port_conf);
 		/* Revert to original value */
@@ -1776,10 +1794,9 @@ main(int argc, char **argv)
 			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
-			if (port_conf.rxmode.jumbo_frame)
-				txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socketid, txconf);
 			if (ret < 0)
@@ -1819,6 +1836,8 @@ main(int argc, char **argv)
 		fflush(stdout);
 		/* init RX queues */
 		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+			struct rte_eth_rxconf rxq_conf;
+
 			portid = qconf->rx_queue_list[queue].port_id;
 			queueid = qconf->rx_queue_list[queue].queue_id;
 
@@ -1831,8 +1850,11 @@ main(int argc, char **argv)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-				socketid, NULL,
+				socketid, &rxq_conf,
 				pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE,
-- 
2.12.0

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

* [PATCH 08/39] examples/l3fwd-vf: convert to new ethdev offloads API
  2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
                   ` (6 preceding siblings ...)
  2017-11-23 12:14 ` [PATCH 07/39] examples/l3fwd-power: " Shahaf Shuler
@ 2017-11-23 12:14 ` Shahaf Shuler
  2017-11-23 12:14 ` [PATCH 09/39] examples/bond: " Shahaf Shuler
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:14 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l3fwd-vf/main.c | 38 +++++++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 9 deletions(-)

diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 6ef89fc8c..060c102a9 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -190,11 +190,9 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode	= ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -1006,6 +1004,24 @@ main(int argc, char **argv)
 
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)1 );
+
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+			port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+			port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+		}
 		ret = rte_eth_dev_configure(portid, nb_rx_queue, n_tx_queue, &port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%d\n",
@@ -1032,10 +1048,9 @@ main(int argc, char **argv)
 		printf("txq=%d,%d,%d ", portid, 0, socketid);
 		fflush(stdout);
 
-		rte_eth_dev_info_get(portid, &dev_info);
 		txconf = &dev_info.default_txconf;
-		if (port_conf.rxmode.jumbo_frame)
-			txconf->txq_flags = 0;
+		txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txconf->offloads = port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 						 socketid, txconf);
 		if (ret < 0)
@@ -1046,6 +1061,8 @@ main(int argc, char **argv)
 	}
 
 	for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
+		struct rte_eth_rxconf rxq_conf;
+
 		if (rte_lcore_is_enabled(lcore_id) == 0)
 			continue;
 		qconf = &lcore_conf[lcore_id];
@@ -1066,8 +1083,11 @@ main(int argc, char **argv)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-						socketid, NULL,
+						socketid, &rxq_conf,
 						pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d,"
-- 
2.12.0

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

* [PATCH 09/39] examples/bond: convert to new ethdev offloads API
  2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
                   ` (7 preceding siblings ...)
  2017-11-23 12:14 ` [PATCH 08/39] examples/l3fwd-vf: " Shahaf Shuler
@ 2017-11-23 12:14 ` Shahaf Shuler
  2017-12-11 11:08   ` Radu Nicolau
  2017-12-04 12:12 ` [PATCH 00/39] convert examples " Shahaf Shuler
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
  10 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:14 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/bond/main.c | 68 ++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 58 insertions(+), 10 deletions(-)

diff --git a/examples/bond/main.c b/examples/bond/main.c
index 8e3b1f340..306447e6b 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -151,11 +151,8 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode = ETH_MQ_RX_NONE,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -174,10 +171,30 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 	int retval;
 	uint16_t nb_rxd = RTE_RX_DESC_DEFAULT;
 	uint16_t nb_txd = RTE_TX_DESC_DEFAULT;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
 
 	if (portid >= rte_eth_dev_count())
 		rte_exit(EXIT_FAILURE, "Invalid port\n");
 
+	rte_eth_dev_info_get(portid, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       portid, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+		port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	     port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       portid, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+		port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+	}
 	retval = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 	if (retval != 0)
 		rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n",
@@ -189,16 +206,22 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 				"failed (res=%d)\n", portid, retval);
 
 	/* RX setup */
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = port_conf.rxmode.offloads;
 	retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
-					rte_eth_dev_socket_id(portid), NULL,
+					rte_eth_dev_socket_id(portid),
+					&rxq_conf,
 					mbuf_pool);
 	if (retval < 0)
 		rte_exit(retval, " port %u: RX queue 0 setup failed (res=%d)",
 				portid, retval);
 
 	/* TX setup */
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = port_conf.txmode.offloads;
 	retval = rte_eth_tx_queue_setup(portid, 0, nb_txd,
-				rte_eth_dev_socket_id(portid), NULL);
+				rte_eth_dev_socket_id(portid), &txq_conf);
 
 	if (retval < 0)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
@@ -225,6 +248,9 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 	uint8_t i;
 	uint16_t nb_rxd = RTE_RX_DESC_DEFAULT;
 	uint16_t nb_txd = RTE_TX_DESC_DEFAULT;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
 
 	retval = rte_eth_bond_create("bond0", BONDING_MODE_ALB,
 			0 /*SOCKET_ID_ANY*/);
@@ -234,6 +260,23 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 
 	BOND_PORT = retval;
 
+	rte_eth_dev_info_get(BOND_PORT, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       BOND_PORT, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+		port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       BOND_PORT, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+		port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+	}
 	retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf);
 	if (retval != 0)
 		rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n",
@@ -245,16 +288,21 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 				"failed (res=%d)\n", BOND_PORT, retval);
 
 	/* RX setup */
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = port_conf.rxmode.offloads;
 	retval = rte_eth_rx_queue_setup(BOND_PORT, 0, nb_rxd,
-					rte_eth_dev_socket_id(BOND_PORT), NULL,
-					mbuf_pool);
+					rte_eth_dev_socket_id(BOND_PORT),
+					&rxq_conf, mbuf_pool);
 	if (retval < 0)
 		rte_exit(retval, " port %u: RX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
 	/* TX setup */
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = port_conf.txmode.offloads;
 	retval = rte_eth_tx_queue_setup(BOND_PORT, 0, nb_txd,
-				rte_eth_dev_socket_id(BOND_PORT), NULL);
+				rte_eth_dev_socket_id(BOND_PORT), &txq_conf);
 
 	if (retval < 0)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
-- 
2.12.0

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

* Re: [PATCH 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-11-23 12:14 ` [PATCH 01/39] examples/l2fwd: convert " Shahaf Shuler
@ 2017-11-24 15:00   ` Andrew Rybchenko
  2017-11-26  7:41     ` Shahaf Shuler
  0 siblings, 1 reply; 134+ messages in thread
From: Andrew Rybchenko @ 2017-11-24 15:00 UTC (permalink / raw)
  To: Shahaf Shuler, dev

On 11/23/2017 03:14 PM, Shahaf Shuler wrote:
> Ethdev offloads API has changed since:
>
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")
>
> This commit support the new API.
>
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>   examples/l2fwd/main.c | 38 ++++++++++++++++++++++++++++++--------
>   1 file changed, 30 insertions(+), 8 deletions(-)
>
> diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
> index e89e2e1bf..a1e378be6 100644
> --- a/examples/l2fwd/main.c
> +++ b/examples/l2fwd/main.c
> @@ -110,14 +110,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
>   
>   static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
>   
> -static const struct rte_eth_conf port_conf = {
> +static struct rte_eth_conf port_conf = {
>   	.rxmode = {
>   		.split_hdr_size = 0,
> -		.header_split   = 0, /**< Header Split disabled */
> -		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
> -		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
> -		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
> -		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
> +		.ignore_offload_bitfield = 1,
> +		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,

It is not directly related to the patch.
May be I miss something, but it looks like there is no way to say that
"I always strip CRC and cannot preserve it".

>   	},
>   	.txmode = {
>   		.mq_mode = ETH_MQ_TX_NONE,
> @@ -649,6 +646,9 @@ main(int argc, char **argv)
>   
>   	/* Initialise each port */
>   	for (portid = 0; portid < nb_ports; portid++) {
> +		struct rte_eth_rxconf rxq_conf;
> +		struct rte_eth_txconf txq_conf;
> +
>   		/* skip ports that are not enabled */
>   		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
>   			printf("Skipping disabled port %u\n", portid);
> @@ -658,6 +658,23 @@ main(int argc, char **argv)
>   		/* init port */
>   		printf("Initializing port %u... ", portid);
>   		fflush(stdout);
> +		rte_eth_dev_info_get(portid, &dev_info);
> +		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
> +		    port_conf.rxmode.offloads) {
> +			printf("Some Rx offloads are not supported "
> +			       "by port %d: requested 0x%lx supported 0x%lx\n",
> +			       portid, port_conf.rxmode.offloads,
> +			       dev_info.rx_offload_capa);
> +			port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
> +		}
> +		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
> +		    port_conf.txmode.offloads) {
> +			printf("Some Tx offloads are not supported "
> +			       "by port %d: requested 0x%lx supported 0x%lx\n",
> +			       portid, port_conf.txmode.offloads,
> +			       dev_info.tx_offload_capa);
> +			port_conf.txmode.offloads &= dev_info.tx_offload_capa;
> +		}
>   		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
>   		if (ret < 0)
>   			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
> @@ -674,9 +691,11 @@ main(int argc, char **argv)
>   
>   		/* init one RX queue */
>   		fflush(stdout);
> +		rxq_conf = dev_info.default_rxconf;
> +		rxq_conf.offloads = port_conf.rxmode.offloads;
>   		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
>   					     rte_eth_dev_socket_id(portid),
> -					     NULL,
> +					     &rxq_conf,
>   					     l2fwd_pktmbuf_pool);
>   		if (ret < 0)
>   			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
> @@ -684,9 +703,12 @@ main(int argc, char **argv)
>   
>   		/* init one TX queue on each port */
>   		fflush(stdout);
> +		txq_conf = dev_info.default_txconf;
> +		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
> +		txq_conf.offloads = port_conf.txmode.offloads;

It looks like it is not 100% equivalent. As far as I can see dev_info 
get does
not convert txq_flags to offloads in default_txconf and in any case 
txq_conf.offloads
are overwritten here. So, if PMD provides default txq_flags, it is lost.
If it is intentionally, it should be highlighted and explained.

>   		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
>   				rte_eth_dev_socket_id(portid),
> -				NULL);
> +				&txq_conf);
>   		if (ret < 0)
>   			rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n",
>   				ret, portid);

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

* Re: [PATCH 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-11-24 15:00   ` Andrew Rybchenko
@ 2017-11-26  7:41     ` Shahaf Shuler
  2017-11-27  6:34       ` Andrew Rybchenko
  0 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-26  7:41 UTC (permalink / raw)
  To: Andrew Rybchenko, dev

>>+            .ignore_offload_bitfield = 1,

>>+            .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
>
>It is not directly related to the patch.
>May be I miss something, but it looks like there is no way to say that
>"I always strip CRC and cannot preserve it".

Yes this is right. Not exposing the CRC offload flag means the device don’t support CRC strip toggling, however it does not explicitly say if device always strip/not.
I guess device that has such limitation should specify it on the “Limitation” section of the PMD guide.


>>+            txq_conf = dev_info.default_txconf;

>>+            txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;

>>+            txq_conf.offloads = port_conf.txmode.offloads;
>
>It looks like it is not 100% equivalent. As far as I can see dev_info get does
>not convert txq_flags to offloads in default_txconf and in any case txq_conf.offloads
>are overwritten here. So, if PMD provides default txq_flags, it is lost.
>If it is intentionally, it should be highlighted and explained.

Yes it is.
With the new Tx offloads API the application can choose the Tx offloads it wants to use according to its needs.
For l2fwd case – it doesn’t use any of them. Any default txq flag the PMD set there is irrelevant.
What I tried to do is not to preserve the entire old behavior rather to evolve the examples/applications while keeping the same functionality (i.e. the offloads which the application use are set, the rest are not).

Moreover – it is a wrong approach, IMO, that the PMD set default offloads flags to the application. It has no knowledge to do so. I think this mechanism was initially created since the Tx offloads were all set by default, so it provided a mean to have good OOB configuration. Now when all offloads are set, I am not sure such API is needed anymore.
Will be happy to hear more opinion on that.


--Shahaf

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

* Re: [PATCH 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-11-26  7:41     ` Shahaf Shuler
@ 2017-11-27  6:34       ` Andrew Rybchenko
  2017-11-27  7:03         ` Shahaf Shuler
  0 siblings, 1 reply; 134+ messages in thread
From: Andrew Rybchenko @ 2017-11-27  6:34 UTC (permalink / raw)
  To: Shahaf Shuler, dev

On 11/26/2017 10:41 AM, Shahaf Shuler wrote:
> >>+            .ignore_offload_bitfield = 1,
> >>+            .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
>
> >
> >It is not directly related to the patch.
> >May be I miss something, but it looks like there is no way to say that
> >"I always strip CRC and cannot preserve it".
>
> Yes this is right. Not exposing the CRC offload flag means the device 
> don’t support CRC strip toggling, however it does not explicitly say 
> if device always strip/not.
>
> I guess device that has such limitation should specify it on the 
> “Limitation” section of the PMD guide.
>

If it is interpreted in such way it sounds like loss of functionality.
Don't think it is a good way to rely on documentation here. It should
be more reliable way. PMD still can check if offload is not enabled and
complain, but there is no way to say that it is strictly required.
As I understand similar things are covered with so-called fixed offloads
in Linux.

> >>+            txq_conf = dev_info.default_txconf;
> >>+            txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
> >>+            txq_conf.offloads = port_conf.txmode.offloads;
>
> >
> >It looks like it is not 100% equivalent. As far as I can see dev_info 
> get does
> >not convert txq_flags to offloads in default_txconf and in any case 
> txq_conf.offloads
> >are overwritten here. So, if PMD provides default txq_flags, it is lost.
> >If it is intentionally, it should be highlighted and explained.
>
> Yes it is.
>
> With the new Tx offloads API the application can choose the Tx 
> offloads it wants to use according to its needs.
>
> For l2fwd case – it doesn’t use any of them. Any default txq flag the 
> PMD set there is irrelevant.
>
> What I tried to do is not to preserve the entire old behavior rather 
> to evolve the examples/applications while keeping the same 
> functionality (i.e. the offloads which the application use are set, 
> the rest are not).
>

That's true for checksum and VLAN offloads, but false for fast-free.
As I understand l2fwd and many other examples meet fast-free
requirements and if PMD supports it, it should be used since it will
show better performance results.

> Moreover – it is a wrong approach, IMO, that the PMD set default 
> offloads flags to the application. It has no knowledge to do so. I 
> think this mechanism was initially created since the Tx offloads were 
> all set by default, so it provided a mean to have good OOB 
> configuration. Now when all offloads are set, I am not sure such API 
> is needed anymore.
>
> Will be happy to hear more opinion on that.
>

I agree that blindly using PMD default offloads is a wrong approach.

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

* Re: [PATCH 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-11-27  6:34       ` Andrew Rybchenko
@ 2017-11-27  7:03         ` Shahaf Shuler
  2017-11-27  7:33           ` Jerin Jacob
  2017-11-27  7:40           ` Andrew Rybchenko
  0 siblings, 2 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-27  7:03 UTC (permalink / raw)
  To: Andrew Rybchenko, dev

Monday, November 27, 2017 8:35 AM, Andrew Rybchenko:

Yes this is right. Not exposing the CRC offload flag means the device don’t support CRC strip toggling, however it does not explicitly say if device always strip/not.
I guess device that has such limitation should specify it on the “Limitation” section of the PMD guide.

If it is interpreted in such way it sounds like loss of functionality.
Don't think it is a good way to rely on documentation here. It should
be more reliable way. PMD still can check if offload is not enabled and
complain, but there is no way to say that it is strictly required.
As I understand similar things are covered with so-called fixed offloads
in Linux.

Can you elaborate which functionality is being lost here?
If your suggestion is for the PMD to force the CRC STRIP offload in case it is not supporting *not* to strip CRC then I am OK with that.

Yes it is.
With the new Tx offloads API the application can choose the Tx offloads it wants to use according to its needs.
For l2fwd case – it doesn’t use any of them. Any default txq flag the PMD set there is irrelevant.
What I tried to do is not to preserve the entire old behavior rather to evolve the examples/applications while keeping the same functionality (i.e. the offloads which the application use are set, the rest are not).

That's true for checksum and VLAN offloads, but false for fast-free.
As I understand l2fwd and many other examples meet fast-free
requirements and if PMD supports it, it should be used since it will
show better performance results.

I agree about the Fast free offload. However IMO such optimization can be introduced on other series which further more optimize the performance of such applications, what do you think?

--Shahaf

From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
Sent: Monday, November 27, 2017 8:35 AM
To: Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 01/39] examples/l2fwd: convert to new ethdev offloads API

On 11/26/2017 10:41 AM, Shahaf Shuler wrote:

>>+            .ignore_offload_bitfield = 1,

>>+            .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
>
>It is not directly related to the patch.
>May be I miss something, but it looks like there is no way to say that
>"I always strip CRC and cannot preserve it".

Yes this is right. Not exposing the CRC offload flag means the device don’t support CRC strip toggling, however it does not explicitly say if device always strip/not.
I guess device that has such limitation should specify it on the “Limitation” section of the PMD guide.

If it is interpreted in such way it sounds like loss of functionality.
Don't think it is a good way to rely on documentation here. It should
be more reliable way. PMD still can check if offload is not enabled and
complain, but there is no way to say that it is strictly required.
As I understand similar things are covered with so-called fixed offloads
in Linux.



>>+            txq_conf = dev_info.default_txconf;

>>+            txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;

>>+            txq_conf.offloads = port_conf.txmode.offloads;
>
>It looks like it is not 100% equivalent. As far as I can see dev_info get does
>not convert txq_flags to offloads in default_txconf and in any case txq_conf.offloads
>are overwritten here. So, if PMD provides default txq_flags, it is lost.
>If it is intentionally, it should be highlighted and explained.

Yes it is.
With the new Tx offloads API the application can choose the Tx offloads it wants to use according to its needs.
For l2fwd case – it doesn’t use any of them. Any default txq flag the PMD set there is irrelevant.
What I tried to do is not to preserve the entire old behavior rather to evolve the examples/applications while keeping the same functionality (i.e. the offloads which the application use are set, the rest are not).

That's true for checksum and VLAN offloads, but false for fast-free.
As I understand l2fwd and many other examples meet fast-free
requirements and if PMD supports it, it should be used since it will
show better performance results.


Moreover – it is a wrong approach, IMO, that the PMD set default offloads flags to the application. It has no knowledge to do so. I think this mechanism was initially created since the Tx offloads were all set by default, so it provided a mean to have good OOB configuration. Now when all offloads are set, I am not sure such API is needed anymore.
Will be happy to hear more opinion on that.

I agree that blindly using PMD default offloads is a wrong approach.

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

* Re: [PATCH 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-11-27  7:03         ` Shahaf Shuler
@ 2017-11-27  7:33           ` Jerin Jacob
  2017-11-27 19:41             ` Shahaf Shuler
  2017-11-27  7:40           ` Andrew Rybchenko
  1 sibling, 1 reply; 134+ messages in thread
From: Jerin Jacob @ 2017-11-27  7:33 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: Andrew Rybchenko, dev

-----Original Message-----
> Date: Mon, 27 Nov 2017 07:03:54 +0000
> From: Shahaf Shuler <shahafs@mellanox.com>
> To: Andrew Rybchenko <arybchenko@solarflare.com>, "dev@dpdk.org"
>  <dev@dpdk.org>
> Subject: Re: [dpdk-dev] [PATCH 01/39] examples/l2fwd: convert to new ethdev
>  offloads API
> 
> Monday, November 27, 2017 8:35 AM, Andrew Rybchenko:
> 
> Yes this is right. Not exposing the CRC offload flag means the device don’t support CRC strip toggling, however it does not explicitly say if device always strip/not.
> I guess device that has such limitation should specify it on the “Limitation” section of the PMD guide.
> 
> If it is interpreted in such way it sounds like loss of functionality.
> Don't think it is a good way to rely on documentation here. It should
> be more reliable way. PMD still can check if offload is not enabled and
> complain, but there is no way to say that it is strictly required.
> As I understand similar things are covered with so-called fixed offloads
> in Linux.
> 
> Can you elaborate which functionality is being lost here?
> If your suggestion is for the PMD to force the CRC STRIP offload in case it is not supporting *not* to strip CRC then I am OK with that.
> 
> Yes it is.
> With the new Tx offloads API the application can choose the Tx offloads it wants to use according to its needs.
> For l2fwd case – it doesn’t use any of them. Any default txq flag the PMD set there is irrelevant.
> What I tried to do is not to preserve the entire old behavior rather to evolve the examples/applications while keeping the same functionality (i.e. the offloads which the application use are set, the rest are not).
> 
> That's true for checksum and VLAN offloads, but false for fast-free.
> As I understand l2fwd and many other examples meet fast-free
> requirements and if PMD supports it, it should be used since it will
> show better performance results.
> 
> I agree about the Fast free offload. However IMO such optimization can be introduced on other series which further more optimize the performance of such applications, what do you think?

If Fast free offload is meeting the l2fwd or l3fwd example application requirements, Why not
to add it now?

> 
> --Shahaf
> 
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Monday, November 27, 2017 8:35 AM
> To: Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 01/39] examples/l2fwd: convert to new ethdev offloads API
> 
> On 11/26/2017 10:41 AM, Shahaf Shuler wrote:
> 
> >>+            .ignore_offload_bitfield = 1,
> 
> >>+            .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
> >
> >It is not directly related to the patch.
> >May be I miss something, but it looks like there is no way to say that
> >"I always strip CRC and cannot preserve it".
> 
> Yes this is right. Not exposing the CRC offload flag means the device don’t support CRC strip toggling, however it does not explicitly say if device always strip/not.
> I guess device that has such limitation should specify it on the “Limitation” section of the PMD guide.
> 
> If it is interpreted in such way it sounds like loss of functionality.
> Don't think it is a good way to rely on documentation here. It should
> be more reliable way. PMD still can check if offload is not enabled and
> complain, but there is no way to say that it is strictly required.
> As I understand similar things are covered with so-called fixed offloads
> in Linux.
> 
> 
> 
> >>+            txq_conf = dev_info.default_txconf;
> 
> >>+            txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
> 
> >>+            txq_conf.offloads = port_conf.txmode.offloads;
> >
> >It looks like it is not 100% equivalent. As far as I can see dev_info get does
> >not convert txq_flags to offloads in default_txconf and in any case txq_conf.offloads
> >are overwritten here. So, if PMD provides default txq_flags, it is lost.
> >If it is intentionally, it should be highlighted and explained.
> 
> Yes it is.
> With the new Tx offloads API the application can choose the Tx offloads it wants to use according to its needs.
> For l2fwd case – it doesn’t use any of them. Any default txq flag the PMD set there is irrelevant.
> What I tried to do is not to preserve the entire old behavior rather to evolve the examples/applications while keeping the same functionality (i.e. the offloads which the application use are set, the rest are not).
> 
> That's true for checksum and VLAN offloads, but false for fast-free.
> As I understand l2fwd and many other examples meet fast-free
> requirements and if PMD supports it, it should be used since it will
> show better performance results.
> 
> 
> Moreover – it is a wrong approach, IMO, that the PMD set default offloads flags to the application. It has no knowledge to do so. I think this mechanism was initially created since the Tx offloads were all set by default, so it provided a mean to have good OOB configuration. Now when all offloads are set, I am not sure such API is needed anymore.
> Will be happy to hear more opinion on that.
> 
> I agree that blindly using PMD default offloads is a wrong approach.

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

* Re: [PATCH 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-11-27  7:03         ` Shahaf Shuler
  2017-11-27  7:33           ` Jerin Jacob
@ 2017-11-27  7:40           ` Andrew Rybchenko
  1 sibling, 0 replies; 134+ messages in thread
From: Andrew Rybchenko @ 2017-11-27  7:40 UTC (permalink / raw)
  To: Shahaf Shuler, dev
  Cc: Ferruh Yigit, Thomas Monjalon, Bruce Richardson,
	Pablo de Lara Guarch, Stephen Hurd, Ajit Khaparde, Qi Zhang,
	Xiao Wang, Jingjing Wu, Beilei Xing, Wenzhuo Lu,
	Konstantin Ananyev, Adrien Mazarguil, Nelio Laranjeiro,
	Alejandro Lucero, Rasesh Mody, Harish Patil, Shahed Shaikh,
	Yuanhan Liu, Maxime Coquelin, Jerin Jacob

On 11/27/2017 10:03 AM, Shahaf Shuler wrote:
>
> Monday, November 27, 2017 8:35 AM, Andrew Rybchenko:
>
> Yes this is right. Not exposing the CRC offload flag means the device 
> don’t support CRC strip toggling, however it does not explicitly say 
> if device always strip/not.
>
> I guess device that has such limitation should specify it on the 
> “Limitation” section of the PMD guide.
>
> If it is interpreted in such way it sounds like loss of functionality.
> Don't think it is a good way to rely on documentation here. It should
> be more reliable way. PMD still can check if offload is not enabled and
> complain, but there is no way to say that it is strictly required.
> As I understand similar things are covered with so-called fixed offloads
> in Linux.
>
> Can you elaborate which functionality is being lost here?
>
> If your suggestion is for the PMD to force the CRC STRIP offload in 
> case it is not supporting **not** to strip CRC then I am OK with that.
>

[AR] I mean that if we say that no CRC strip offload set means either 
strip or not-strip it is bad. Application and transmit part may rely on 
Ethernet CRC presence. My suggestion is to provide a way to say that CRC 
striping (and any other offload) cannot be disabled.
>
> Yes it is.
>
> With the new Tx offloads API the application can choose the Tx 
> offloads it wants to use according to its needs.
>
> For l2fwd case – it doesn’t use any of them. Any default txq flag the 
> PMD set there is irrelevant.
>
> What I tried to do is not to preserve the entire old behavior rather 
> to evolve the examples/applications while keeping the same 
> functionality (i.e. the offloads which the application use are set, 
> the rest are not).
>
>
> That's true for checksum and VLAN offloads, but false for fast-free.
> As I understand l2fwd and many other examples meet fast-free
> requirements and if PMD supports it, it should be used since it will
> show better performance results.
>
> I agree about the Fast free offload. However IMO such optimization can 
> be introduced on other series which further more optimize the 
> performance of such applications, what do you think?
>

[AR] If so, it is definitely a loss of functionality here. Since before 
the patch PMD can provide default TxQ flags and usage of these flags 
will allow an application to see the best performance. (Yes, if it was 
bad if application blindly use these flags). May be it should be covered 
by separate patches, but hanging it in the air for a long time is bad. I 
definitely would like to hear more opinions here from example 
application and PMD maintainers.

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

* Re: [PATCH 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-11-27  7:33           ` Jerin Jacob
@ 2017-11-27 19:41             ` Shahaf Shuler
  0 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-11-27 19:41 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: Andrew Rybchenko, dev

Monday, November 27, 2017 9:34 AM, Jerin Jacob:
> >
> > Monday, November 27, 2017 8:35 AM, Andrew Rybchenko:
> >
> > I agree about the Fast free offload. However IMO such optimization can be
> introduced on other series which further more optimize the performance of
> such applications, what do you think?
> 
> If Fast free offload is meeting the l2fwd or l3fwd example application
> requirements, Why not to add it now?
> 

Andrew, Jerin,
Agreed. Fast free offload, when possible, will be part of v2. 

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

* Re: [PATCH 00/39] convert examples to new ethdev offloads API
  2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
                   ` (8 preceding siblings ...)
  2017-11-23 12:14 ` [PATCH 09/39] examples/bond: " Shahaf Shuler
@ 2017-12-04 12:12 ` Shahaf Shuler
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
  10 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-04 12:12 UTC (permalink / raw)
  To: Shahaf Shuler, dev

Thursday, November 23, 2017 2:14 PM, Shahaf Shuler:
> This series is to convert DPDK examples to the new offloads API [1].
> 
> [1]
> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdpd
> k.org%2Fml%2Farchives%2Fdev%2F2017-
> October%2F077329.html&data=02%7C01%7Cshahafs%40mellanox.com%7C3
> 7f29fda9a22465ed38c08d5326be81d%7Ca652971c7d2e4d9ba6a4d149256f461
> b%7C0%7C0%7C636470361404979357&sdata=mCjG9GSwSPVspr3t8n9iyjtAiivc
> gt2H279YtcNwAts%3D&reserved=0
> 

Any more comment on the series before the v2? 

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

* Re: [PATCH 09/39] examples/bond: convert to new ethdev offloads API
  2017-11-23 12:14 ` [PATCH 09/39] examples/bond: " Shahaf Shuler
@ 2017-12-11 11:08   ` Radu Nicolau
  0 siblings, 0 replies; 134+ messages in thread
From: Radu Nicolau @ 2017-12-11 11:08 UTC (permalink / raw)
  To: Shahaf Shuler, dev


On 11/23/2017 12:14 PM, Shahaf Shuler wrote:
> Ethdev offloads API has changed since:
>
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")
>
> This commit support the new API.
>
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>   examples/bond/main.c | 68 ++++++++++++++++++++++++++++++++++++++++-------
>   1 file changed, 58 insertions(+), 10 deletions(-)
>
> diff --git a/examples/bond/main.c b/examples/bond/main.c
> index 8e3b1f340..306447e6b 100644
> --- a/examples/bond/main.c
> +++ b/examples/bond/main.c
> @@ -151,11 +151,8 @@ static struct rte_eth_conf port_conf = {
>   		.mq_mode = ETH_MQ_RX_NONE,
>   		.max_rx_pkt_len = ETHER_MAX_LEN,
>   		.split_hdr_size = 0,
> -		.header_split   = 0, /**< Header Split disabled */
> -		.hw_ip_checksum = 0, /**< IP checksum offload enabled */
> -		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
> -		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
> -		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
> +		.ignore_offload_bitfield = 1,
> +		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
>   	},
>   	.rx_adv_conf = {
>   		.rss_conf = {
> @@ -174,10 +171,30 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
>   	int retval;
>   	uint16_t nb_rxd = RTE_RX_DESC_DEFAULT;
>   	uint16_t nb_txd = RTE_TX_DESC_DEFAULT;
> +	struct rte_eth_dev_info dev_info;
> +	struct rte_eth_rxconf rxq_conf;
> +	struct rte_eth_txconf txq_conf;
>   
>   	if (portid >= rte_eth_dev_count())
>   		rte_exit(EXIT_FAILURE, "Invalid port\n");
>   
> +	rte_eth_dev_info_get(portid, &dev_info);
> +	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
> +	    port_conf.rxmode.offloads) {
> +		printf("Some Rx offloads are not supported "
> +		       "by port %d: requested 0x%lx supported 0x%lx\n",
> +		       portid, port_conf.rxmode.offloads,
> +		       dev_info.rx_offload_capa);
> +		port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
> +	}
> +	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
> +	     port_conf.txmode.offloads) {
> +		printf("Some Tx offloads are not supported "
> +		       "by port %d: requested 0x%lx supported 0x%lx\n",
> +		       portid, port_conf.txmode.offloads,
> +		       dev_info.tx_offload_capa);
> +		port_conf.txmode.offloads &= dev_info.tx_offload_capa;
> +	}
>   	retval = rte_eth_dev_configure(portid, 1, 1, &port_conf);
>   	if (retval != 0)
>   		rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n",
> @@ -189,16 +206,22 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
>   				"failed (res=%d)\n", portid, retval);
>   
>   	/* RX setup */
> +	rxq_conf = dev_info.default_rxconf;
> +	rxq_conf.offloads = port_conf.rxmode.offloads;
>   	retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
> -					rte_eth_dev_socket_id(portid), NULL,
> +					rte_eth_dev_socket_id(portid),
> +					&rxq_conf,
>   					mbuf_pool);
>   	if (retval < 0)
>   		rte_exit(retval, " port %u: RX queue 0 setup failed (res=%d)",
>   				portid, retval);
>   
>   	/* TX setup */
> +	txq_conf = dev_info.default_txconf;
> +	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
> +	txq_conf.offloads = port_conf.txmode.offloads;
>   	retval = rte_eth_tx_queue_setup(portid, 0, nb_txd,
> -				rte_eth_dev_socket_id(portid), NULL);
> +				rte_eth_dev_socket_id(portid), &txq_conf);
>   
>   	if (retval < 0)
>   		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
> @@ -225,6 +248,9 @@ bond_port_init(struct rte_mempool *mbuf_pool)
>   	uint8_t i;
>   	uint16_t nb_rxd = RTE_RX_DESC_DEFAULT;
>   	uint16_t nb_txd = RTE_TX_DESC_DEFAULT;
> +	struct rte_eth_dev_info dev_info;
> +	struct rte_eth_rxconf rxq_conf;
> +	struct rte_eth_txconf txq_conf;
>   
>   	retval = rte_eth_bond_create("bond0", BONDING_MODE_ALB,
>   			0 /*SOCKET_ID_ANY*/);
> @@ -234,6 +260,23 @@ bond_port_init(struct rte_mempool *mbuf_pool)
>   
>   	BOND_PORT = retval;
>   
> +	rte_eth_dev_info_get(BOND_PORT, &dev_info);
> +	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
> +	    port_conf.rxmode.offloads) {
> +		printf("Some Rx offloads are not supported "
> +		       "by port %d: requested 0x%lx supported 0x%lx\n",
> +		       BOND_PORT, port_conf.rxmode.offloads,
> +		       dev_info.rx_offload_capa);
> +		port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
> +	}
> +	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
> +	    port_conf.txmode.offloads) {
> +		printf("Some Tx offloads are not supported "
> +		       "by port %d: requested 0x%lx supported 0x%lx\n",
> +		       BOND_PORT, port_conf.txmode.offloads,
> +		       dev_info.tx_offload_capa);
> +		port_conf.txmode.offloads &= dev_info.tx_offload_capa;
> +	}
>   	retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf);
>   	if (retval != 0)
>   		rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n",
> @@ -245,16 +288,21 @@ bond_port_init(struct rte_mempool *mbuf_pool)
>   				"failed (res=%d)\n", BOND_PORT, retval);
>   
>   	/* RX setup */
> +	rxq_conf = dev_info.default_rxconf;
> +	rxq_conf.offloads = port_conf.rxmode.offloads;
>   	retval = rte_eth_rx_queue_setup(BOND_PORT, 0, nb_rxd,
> -					rte_eth_dev_socket_id(BOND_PORT), NULL,
> -					mbuf_pool);
> +					rte_eth_dev_socket_id(BOND_PORT),
> +					&rxq_conf, mbuf_pool);
>   	if (retval < 0)
>   		rte_exit(retval, " port %u: RX queue 0 setup failed (res=%d)",
>   				BOND_PORT, retval);
>   
>   	/* TX setup */
> +	txq_conf = dev_info.default_txconf;
> +	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
> +	txq_conf.offloads = port_conf.txmode.offloads;
>   	retval = rte_eth_tx_queue_setup(BOND_PORT, 0, nb_txd,
> -				rte_eth_dev_socket_id(BOND_PORT), NULL);
> +				rte_eth_dev_socket_id(BOND_PORT), &txq_conf);
>   
>   	if (retval < 0)
>   		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
Reviewed-by:  Radu Nicolau <radu.nicolau@intel.com>

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

* Re: [PATCH 07/39] examples/l3fwd-power: convert to new ethdev offloads API
  2017-11-23 12:14 ` [PATCH 07/39] examples/l3fwd-power: " Shahaf Shuler
@ 2017-12-11 14:00   ` Hunt, David
  0 siblings, 0 replies; 134+ messages in thread
From: Hunt, David @ 2017-12-11 14:00 UTC (permalink / raw)
  To: Shahaf Shuler, dev

Hi Shahaf,


On 23/11/2017 12:14 PM, Shahaf Shuler wrote:
> Ethdev offloads API has changed since:
>
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")
>
> This commit support the new API.
>
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>   examples/l3fwd-power/main.c | 42 ++++++++++++++++++++++++++++++----------
>   1 file changed, 32 insertions(+), 10 deletions(-)
>

--snip--

Looks good to me.

Acked-by: David Hunt <david.hunt@intel.com>

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

* Re: [PATCH 06/39] examples/l3fwd-acl: convert to new ethdev offloads API
  2017-11-23 12:14 ` [PATCH 06/39] examples/l3fwd-acl: convert to new " Shahaf Shuler
@ 2017-12-11 14:48   ` Ananyev, Konstantin
  0 siblings, 0 replies; 134+ messages in thread
From: Ananyev, Konstantin @ 2017-12-11 14:48 UTC (permalink / raw)
  To: Shahaf Shuler, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Thursday, November 23, 2017 12:14 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 06/39] examples/l3fwd-acl: convert to new ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>  examples/l3fwd-acl/main.c | 41 ++++++++++++++++++++++++++++++++---------
>  1 file changed, 32 insertions(+), 9 deletions(-)
> 

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

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

* [PATCH v2 00/39] convert examples to new ethdev offloads API
  2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
                   ` (9 preceding siblings ...)
  2017-12-04 12:12 ` [PATCH 00/39] convert examples " Shahaf Shuler
@ 2017-12-12 12:26 ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 01/39] examples/l2fwd: convert " Shahaf Shuler
                     ` (39 more replies)
  10 siblings, 40 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

This series is to convert DPDK examples to the new offloads API [1].

on v2:
 - Add DEV_TX_OFFLOAD_MBUF_FAST_FREE offload of entitled examples.
 - Instead of masking the un-supported offloads print a warning and let
   the PMD to fail the configuration.

[1] http://dpdk.org/ml/archives/dev/2017-October/077329.html

Shahaf Shuler (39):
  examples/l2fwd: convert to new ethdev offloads API
  examples/l2fwd-crypto: convert to new ethdev offloads API
  examples/l2fwd-jobstats: convert to new ethdev offloads API
  examples/l2fwd-keepalive: convert to new ethdev offloads API
  examples/l3fwd: move to ethdev offloads API
  examples/l3fwd-acl: convert to new ethdev offloads API
  examples/l3fwd-power: convert to new ethdev offloads API
  examples/l3fwd-vf: convert to new ethdev offloads API
  examples/bond: convert to new ethdev offloads API
  examples/exception_path: convert to new ethdev offloads API
  examples/kni: convert to new ethdev offloads API
  examples/ip_fragmentation: convert to new offloads API
  examples/ip_pipeline: convert to new ethdev offloads API
  examples/ip_reassembly: convert to new ethdev offloads API
  examples/ipsec-secgw: convert to new ethdev offloads API
  examples/ipv4_multicast: convert to new ethdev offloads API
  examples/link_status_interrupt: convert to new offloads API
  examples/load_balancer: convert to new ethdev offloads API
  examples/multi_process: convert to new ethdev offloads API
  examples/netmap_compat: convert to new ethdev offloads API
  examples/performance-thread: convert to new offloads API
  examples/qos_meter: convert to new ethdev offloads API
  examples/qos_sched: convert to new ethdev offloads API
  examples/quota_watermark: convert to new ethdev offloads API
  examples/tep_termination: convert to new ethdev offloads API
  examples/vhost: convert to new ethdev offloads API
  examples/vmdq: convert to new ethdev offloads API
  examples/vmdq_dcb: convert to new ethdev offloads API
  examples/vm_power_manager: convert to new offloads API
  examples/distributor: convert to new ethdev offloads API
  examples/ethtool: convert to new ethdev offloads API
  examples/eventdev_pipeline: convert to new offloads API
  examples/flow_classify: convert to new ethdev offloads API
  examples/flow_filtering: convert to new ethdev offloads API
  examples/packet_ordering: convert to new ethdev offloads API
  examples/ptpclient: convert to new ethdev offloads API
  examples/rxtx_callbacks: convert to new ethdev offloads API
  examples/server_node_efd: convert to new ethdev offloads API
  examples/skeleton: convert to new ethdev offloads API

 examples/bond/main.c                            | 65 ++++++++++++++++---
 examples/distributor/main.c                     | 25 +++++++-
 examples/ethtool/ethtool-app/main.c             |  7 ++-
 examples/eventdev_pipeline_sw_pmd/main.c        | 29 ++++++++-
 examples/exception_path/main.c                  | 37 ++++++++---
 examples/flow_classify/flow_classify.c          | 31 ++++++++-
 examples/flow_filtering/main.c                  | 26 ++++----
 examples/ip_fragmentation/main.c                | 35 ++++++++---
 examples/ip_pipeline/config_parse.c             | 14 ++---
 examples/ip_pipeline/init.c                     | 26 ++++++--
 examples/ip_reassembly/main.c                   | 35 ++++++++---
 examples/ipsec-secgw/ipsec-secgw.c              | 26 +++++++-
 examples/ipv4_multicast/main.c                  | 33 +++++++---
 examples/kni/main.c                             | 66 +++++++++++++++++---
 examples/l2fwd-crypto/main.c                    | 37 ++++++++---
 examples/l2fwd-jobstats/main.c                  | 38 ++++++++---
 examples/l2fwd-keepalive/main.c                 | 38 ++++++++---
 examples/l2fwd/main.c                           | 37 ++++++++---
 examples/l3fwd-acl/main.c                       | 40 +++++++++---
 examples/l3fwd-power/main.c                     | 41 +++++++++---
 examples/l3fwd-vf/main.c                        | 37 ++++++++---
 examples/l3fwd/main.c                           | 40 +++++++++---
 examples/link_status_interrupt/main.c           | 37 ++++++++---
 examples/load_balancer/init.c                   | 36 ++++++++---
 examples/multi_process/l2fwd_fork/main.c        | 35 ++++++++---
 examples/multi_process/symmetric_mp/main.c      | 34 +++++++---
 examples/netmap_compat/bridge/bridge.c          |  8 +--
 examples/netmap_compat/lib/compat_netmap.c      | 27 +++++++-
 examples/packet_ordering/main.c                 | 32 +++++++++-
 examples/performance-thread/l3fwd-thread/main.c | 41 +++++++++---
 examples/ptpclient/ptpclient.c                  | 28 ++++++++-
 examples/qos_meter/main.c                       | 61 +++++++++++++++---
 examples/qos_sched/init.c                       | 30 ++++++---
 examples/quota_watermark/qw/init.c              | 37 ++++++++---
 examples/rxtx_callbacks/main.c                  | 31 ++++++++-
 examples/server_node_efd/server/init.c          | 33 ++++++++--
 examples/skeleton/basicfwd.c                    | 31 ++++++++-
 examples/tep_termination/vxlan_setup.c          | 36 ++++++++---
 examples/vhost/main.c                           | 41 ++++++++----
 examples/vm_power_manager/main.c                | 31 ++++++++-
 examples/vmdq/main.c                            | 29 +++++++--
 examples/vmdq_dcb/main.c                        | 27 ++++++--
 42 files changed, 1165 insertions(+), 263 deletions(-)

-- 
1.8.3.1

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

* [PATCH v2 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-19 12:16     ` De Lara Guarch, Pablo
  2017-12-12 12:26   ` [PATCH v2 02/39] examples/l2fwd-crypto: " Shahaf Shuler
                     ` (38 subsequent siblings)
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd/main.c | 37 +++++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index e89e2e1..e25b107 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -110,17 +110,15 @@ struct lcore_queue_conf {
 
 static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -649,6 +647,9 @@ enum {
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+
 		/* skip ports that are not enabled */
 		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", portid);
@@ -658,6 +659,21 @@ enum {
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
@@ -674,9 +690,11 @@ enum {
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     l2fwd_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
@@ -684,9 +702,12 @@ enum {
 
 		/* init one TX queue on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n",
 				ret, portid);
-- 
1.8.3.1

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

* [PATCH v2 02/39] examples/l2fwd-crypto: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 01/39] examples/l2fwd: convert " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-19 12:18     ` De Lara Guarch, Pablo
  2017-12-12 12:26   ` [PATCH v2 03/39] examples/l2fwd-jobstats: " Shahaf Shuler
                     ` (37 subsequent siblings)
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd-crypto/main.c | 37 +++++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index d4e1682..81d2957 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -235,19 +235,17 @@ struct lcore_queue_conf {
 
 struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.mq_mode = ETH_MQ_RX_NONE,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -2356,6 +2354,9 @@ struct l2fwd_crypto_statistics {
 
 	for (last_portid = 0, portid = 0; portid < nb_ports; portid++) {
 		int retval;
+		struct rte_eth_dev_info dev_info;
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
 
 		/* Skip ports that are not enabled */
 		if ((options->portmask & (1 << portid)) == 0)
@@ -2364,6 +2365,21 @@ struct l2fwd_crypto_statistics {
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		retval = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 		if (retval < 0) {
 			printf("Cannot configure device: err=%d, port=%u\n",
@@ -2381,9 +2397,11 @@ struct l2fwd_crypto_statistics {
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL, l2fwd_pktmbuf_pool);
+					     &rxq_conf, l2fwd_pktmbuf_pool);
 		if (retval < 0) {
 			printf("rte_eth_rx_queue_setup:err=%d, port=%u\n",
 					retval, portid);
@@ -2392,9 +2410,12 @@ struct l2fwd_crypto_statistics {
 
 		/* init one TX queue on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = port_conf.txmode.offloads;
 		retval = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (retval < 0) {
 			printf("rte_eth_tx_queue_setup:err=%d, port=%u\n",
 				retval, portid);
-- 
1.8.3.1

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

* [PATCH v2 03/39] examples/l2fwd-jobstats: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 01/39] examples/l2fwd: convert " Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 02/39] examples/l2fwd-crypto: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-19 12:33     ` De Lara Guarch, Pablo
  2017-12-12 12:26   ` [PATCH v2 04/39] examples/l2fwd-keepalive: " Shahaf Shuler
                     ` (36 subsequent siblings)
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd-jobstats/main.c | 38 +++++++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 485370d..eb035ef 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -116,17 +116,15 @@ struct lcore_queue_conf {
 
 struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -866,6 +864,10 @@ struct l2fwd_port_statistics {
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_dev_info dev_info;
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+
 		/* skip ports that are not enabled */
 		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", portid);
@@ -875,6 +877,21 @@ struct l2fwd_port_statistics {
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
@@ -891,19 +908,24 @@ struct l2fwd_port_statistics {
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     l2fwd_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
 				  ret, portid);
 
 		/* init one TX queue on each port */
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = port_conf.txmode.offloads;
 		fflush(stdout);
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 			"rte_eth_tx_queue_setup:err=%d, port=%u\n",
-- 
1.8.3.1

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

* [PATCH v2 04/39] examples/l2fwd-keepalive: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (2 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 03/39] examples/l2fwd-jobstats: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 05/39] examples/l3fwd: move to " Shahaf Shuler
                     ` (35 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd-keepalive/main.c | 38 ++++++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 358ca5e..a60d3e9 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -107,17 +107,15 @@ struct lcore_queue_conf {
 
 struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -658,6 +656,10 @@ static void handle_sigterm(__rte_unused int value)
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_dev_info dev_info;
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+
 		/* skip ports that are not enabled */
 		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", portid);
@@ -667,6 +669,21 @@ static void handle_sigterm(__rte_unused int value)
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
@@ -684,9 +701,11 @@ static void handle_sigterm(__rte_unused int value)
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     l2fwd_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
@@ -695,9 +714,12 @@ static void handle_sigterm(__rte_unused int value)
 
 		/* init one TX queue on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 				"rte_eth_tx_queue_setup:err=%d, port=%u\n",
-- 
1.8.3.1

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

* [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (3 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 04/39] examples/l2fwd-keepalive: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 17:12     ` Ananyev, Konstantin
  2017-12-18 16:00     ` Maciej Czekaj
  2017-12-12 12:26   ` [PATCH v2 06/39] examples/l3fwd-acl: convert to new " Shahaf Shuler
                     ` (34 subsequent siblings)
  39 siblings, 2 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l3fwd/main.c | 40 ++++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 6229568..3bdf4d5 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -149,11 +149,9 @@ struct lcore_params {
 		.mq_mode = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -163,6 +161,7 @@ struct lcore_params {
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -612,7 +611,8 @@ enum {
 			};
 
 			printf("%s\n", str8);
-			port_conf.rxmode.jumbo_frame = 1;
+			port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+			port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
 			/*
 			 * if no max-pkt-len set, use the default
@@ -908,6 +908,22 @@ enum {
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue );
+
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
 					(uint16_t)n_tx_queue, &port_conf);
 		if (ret < 0)
@@ -955,10 +971,9 @@ enum {
 			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
-			if (port_conf.rxmode.jumbo_frame)
-				txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socketid, txconf);
 			if (ret < 0)
@@ -984,6 +999,8 @@ enum {
 		fflush(stdout);
 		/* init RX queues */
 		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+			struct rte_eth_rxconf rxq_conf;
+
 			portid = qconf->rx_queue_list[queue].port_id;
 			queueid = qconf->rx_queue_list[queue].queue_id;
 
@@ -996,9 +1013,12 @@ enum {
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
 					socketid,
-					NULL,
+					&rxq_conf,
 					pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE,
-- 
1.8.3.1

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

* [PATCH v2 06/39] examples/l3fwd-acl: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (4 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 05/39] examples/l3fwd: move to " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 07/39] examples/l3fwd-power: " Shahaf Shuler
                     ` (33 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 examples/l3fwd-acl/main.c | 40 +++++++++++++++++++++++++++++++---------
 1 file changed, 31 insertions(+), 9 deletions(-)

diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index e50b1a1..e13b1d9 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -156,11 +156,9 @@ struct lcore_params {
 		.mq_mode	= ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -171,6 +169,7 @@ struct lcore_params {
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -1727,7 +1726,10 @@ struct lcore_conf {
 				};
 
 				printf("jumbo frame is enabled\n");
-				port_conf.rxmode.jumbo_frame = 1;
+				port_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_JUMBO_FRAME;
+				port_conf.txmode.offloads |=
+						DEV_TX_OFFLOAD_MULTI_SEGS;
 
 				/*
 				 * if no max-pkt-len set, then use the
@@ -1948,6 +1950,21 @@ struct lcore_conf {
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
 					(uint16_t)n_tx_queue, &port_conf);
 		if (ret < 0)
@@ -2004,8 +2021,8 @@ struct lcore_conf {
 
 			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
-			if (port_conf.rxmode.jumbo_frame)
-				txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socketid, txconf);
 			if (ret < 0)
@@ -2031,6 +2048,8 @@ struct lcore_conf {
 		fflush(stdout);
 		/* init RX queues */
 		for (queue = 0; queue < qconf->n_rx_queue; ++queue) {
+			struct rte_eth_rxconf rxq_conf;
+
 			portid = qconf->rx_queue_list[queue].port_id;
 			queueid = qconf->rx_queue_list[queue].queue_id;
 
@@ -2043,8 +2062,11 @@ struct lcore_conf {
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-					socketid, NULL,
+					socketid, &rxq_conf,
 					pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE,
-- 
1.8.3.1

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

* [PATCH v2 07/39] examples/l3fwd-power: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (5 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 06/39] examples/l3fwd-acl: convert to new " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 08/39] examples/l3fwd-vf: " Shahaf Shuler
                     ` (32 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: David Hunt <david.hunt@intel.com>
---
 examples/l3fwd-power/main.c | 41 ++++++++++++++++++++++++++++++----------
 1 file changed, 31 insertions(+), 10 deletions(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 0a4ed14..10c6f1b 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -215,11 +215,9 @@ struct lcore_params {
 		.mq_mode        = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -229,6 +227,7 @@ struct lcore_params {
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 	.intr_conf = {
 		.lsc = 1,
@@ -1317,7 +1316,10 @@ static int parse_max_pkt_len(const char *pktlen)
 									0, 0};
 
 				printf("jumbo frame is enabled \n");
-				port_conf.rxmode.jumbo_frame = 1;
+				port_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_JUMBO_FRAME;
+				port_conf.txmode.offloads |=
+						DEV_TX_OFFLOAD_MULTI_SEGS;
 
 				/**
 				 * if no max-pkt-len set, use the default value
@@ -1718,6 +1720,21 @@ static int check_ptype(uint16_t portid)
 		/* If number of Rx queue is 0, no need to enable Rx interrupt */
 		if (nb_rx_queue == 0)
 			port_conf.intr_conf.rxq = 0;
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
 					(uint16_t)n_tx_queue, &port_conf);
 		/* Revert to original value */
@@ -1776,10 +1793,9 @@ static int check_ptype(uint16_t portid)
 			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
-			if (port_conf.rxmode.jumbo_frame)
-				txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socketid, txconf);
 			if (ret < 0)
@@ -1819,6 +1835,8 @@ static int check_ptype(uint16_t portid)
 		fflush(stdout);
 		/* init RX queues */
 		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+			struct rte_eth_rxconf rxq_conf;
+
 			portid = qconf->rx_queue_list[queue].port_id;
 			queueid = qconf->rx_queue_list[queue].queue_id;
 
@@ -1831,8 +1849,11 @@ static int check_ptype(uint16_t portid)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-				socketid, NULL,
+				socketid, &rxq_conf,
 				pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE,
-- 
1.8.3.1

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

* [PATCH v2 08/39] examples/l3fwd-vf: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (6 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 07/39] examples/l3fwd-power: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 09/39] examples/bond: " Shahaf Shuler
                     ` (31 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l3fwd-vf/main.c | 37 ++++++++++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 9 deletions(-)

diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 6ef89fc..04aaa13 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -190,11 +190,9 @@ struct lcore_params {
 		.mq_mode	= ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -204,6 +202,7 @@ struct lcore_params {
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -1006,6 +1005,22 @@ struct lcore_conf {
 
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)1 );
+
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, nb_rx_queue, n_tx_queue, &port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%d\n",
@@ -1032,10 +1047,9 @@ struct lcore_conf {
 		printf("txq=%d,%d,%d ", portid, 0, socketid);
 		fflush(stdout);
 
-		rte_eth_dev_info_get(portid, &dev_info);
 		txconf = &dev_info.default_txconf;
-		if (port_conf.rxmode.jumbo_frame)
-			txconf->txq_flags = 0;
+		txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txconf->offloads = port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 						 socketid, txconf);
 		if (ret < 0)
@@ -1046,6 +1060,8 @@ struct lcore_conf {
 	}
 
 	for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
+		struct rte_eth_rxconf rxq_conf;
+
 		if (rte_lcore_is_enabled(lcore_id) == 0)
 			continue;
 		qconf = &lcore_conf[lcore_id];
@@ -1066,8 +1082,11 @@ struct lcore_conf {
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-						socketid, NULL,
+						socketid, &rxq_conf,
 						pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d,"
-- 
1.8.3.1

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

* [PATCH v2 09/39] examples/bond: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (7 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 08/39] examples/l3fwd-vf: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 10/39] examples/exception_path: " Shahaf Shuler
                     ` (30 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Reviewed-by: Radu Nicolau <radu.nicolau@intel.com>
---
 examples/bond/main.c | 65 +++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 55 insertions(+), 10 deletions(-)

diff --git a/examples/bond/main.c b/examples/bond/main.c
index 8e3b1f3..d0050b3 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -151,11 +151,8 @@
 		.mq_mode = ETH_MQ_RX_NONE,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -165,6 +162,7 @@
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -174,10 +172,28 @@
 	int retval;
 	uint16_t nb_rxd = RTE_RX_DESC_DEFAULT;
 	uint16_t nb_txd = RTE_TX_DESC_DEFAULT;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
 
 	if (portid >= rte_eth_dev_count())
 		rte_exit(EXIT_FAILURE, "Invalid port\n");
 
+	rte_eth_dev_info_get(portid, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       portid, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	     port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       portid, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	retval = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 	if (retval != 0)
 		rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n",
@@ -189,16 +205,22 @@
 				"failed (res=%d)\n", portid, retval);
 
 	/* RX setup */
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = port_conf.rxmode.offloads;
 	retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
-					rte_eth_dev_socket_id(portid), NULL,
+					rte_eth_dev_socket_id(portid),
+					&rxq_conf,
 					mbuf_pool);
 	if (retval < 0)
 		rte_exit(retval, " port %u: RX queue 0 setup failed (res=%d)",
 				portid, retval);
 
 	/* TX setup */
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = port_conf.txmode.offloads;
 	retval = rte_eth_tx_queue_setup(portid, 0, nb_txd,
-				rte_eth_dev_socket_id(portid), NULL);
+				rte_eth_dev_socket_id(portid), &txq_conf);
 
 	if (retval < 0)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
@@ -225,6 +247,9 @@
 	uint8_t i;
 	uint16_t nb_rxd = RTE_RX_DESC_DEFAULT;
 	uint16_t nb_txd = RTE_TX_DESC_DEFAULT;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
 
 	retval = rte_eth_bond_create("bond0", BONDING_MODE_ALB,
 			0 /*SOCKET_ID_ANY*/);
@@ -234,6 +259,21 @@
 
 	BOND_PORT = retval;
 
+	rte_eth_dev_info_get(BOND_PORT, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       BOND_PORT, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       BOND_PORT, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf);
 	if (retval != 0)
 		rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n",
@@ -245,16 +285,21 @@
 				"failed (res=%d)\n", BOND_PORT, retval);
 
 	/* RX setup */
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = port_conf.rxmode.offloads;
 	retval = rte_eth_rx_queue_setup(BOND_PORT, 0, nb_rxd,
-					rte_eth_dev_socket_id(BOND_PORT), NULL,
-					mbuf_pool);
+					rte_eth_dev_socket_id(BOND_PORT),
+					&rxq_conf, mbuf_pool);
 	if (retval < 0)
 		rte_exit(retval, " port %u: RX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
 	/* TX setup */
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = port_conf.txmode.offloads;
 	retval = rte_eth_tx_queue_setup(BOND_PORT, 0, nb_txd,
-				rte_eth_dev_socket_id(BOND_PORT), NULL);
+				rte_eth_dev_socket_id(BOND_PORT), &txq_conf);
 
 	if (retval < 0)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
-- 
1.8.3.1

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

* [PATCH v2 10/39] examples/exception_path: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (8 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 09/39] examples/bond: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 11/39] examples/kni: " Shahaf Shuler
                     ` (29 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/exception_path/main.c | 37 +++++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index f8f5bbd..dc0546a 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -107,16 +107,14 @@
  */
 
 /* Options for configuring ethernet port */
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
-		.header_split = 0,      /* Header Split disabled */
-		.hw_ip_checksum = 0,    /* IP checksum offload disabled */
-		.hw_vlan_filter = 0,    /* VLAN filtering disabled */
-		.jumbo_frame = 0,       /* Jumbo Frame Support disabled */
-		.hw_strip_crc = 1,      /* CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -447,10 +445,28 @@ static int tap_create(char *name)
 	int ret;
 	uint16_t nb_rxd = NB_RXD;
 	uint16_t nb_txd = NB_TXD;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
 
 	/* Initialise device and RX/TX queues */
 	PRINT_INFO("Initialising port %u ...", port);
 	fflush(stdout);
+	rte_eth_dev_info_get(port, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	ret = rte_eth_dev_configure(port, 1, 1, &port_conf);
 	if (ret < 0)
 		FATAL_ERROR("Could not configure port%u (%d)", port, ret);
@@ -460,17 +476,22 @@ static int tap_create(char *name)
 		FATAL_ERROR("Could not adjust number of descriptors for port%u (%d)",
 			    port, ret);
 
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = port_conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port, 0, nb_rxd,
 				rte_eth_dev_socket_id(port),
-				NULL,
+				&rxq_conf,
 				pktmbuf_pool);
 	if (ret < 0)
 		FATAL_ERROR("Could not setup up RX queue for port%u (%d)",
 				port, ret);
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = port_conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(port, 0, nb_txd,
 				rte_eth_dev_socket_id(port),
-				NULL);
+				&txq_conf);
 	if (ret < 0)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
-- 
1.8.3.1

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

* [PATCH v2 11/39] examples/kni: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (9 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 10/39] examples/exception_path: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 12/39] examples/ip_fragmentation: convert to new " Shahaf Shuler
                     ` (28 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/kni/main.c | 66 +++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 57 insertions(+), 9 deletions(-)

diff --git a/examples/kni/main.c b/examples/kni/main.c
index 3f17385..6a35579 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -124,14 +124,12 @@ struct kni_port_params {
 /* Options for configuring ethernet port */
 static struct rte_eth_conf port_conf = {
 	.rxmode = {
-		.header_split = 0,      /* Header Split disabled */
-		.hw_ip_checksum = 0,    /* IP checksum offload disabled */
-		.hw_vlan_filter = 0,    /* VLAN filtering disabled */
-		.jumbo_frame = 0,       /* Jumbo Frame Support disabled */
-		.hw_strip_crc = 1,      /* CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -607,10 +605,28 @@ struct kni_interface_stats {
 	int ret;
 	uint16_t nb_rxd = NB_RXD;
 	uint16_t nb_txd = NB_TXD;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
 
 	/* Initialise device and RX/TX queues */
 	RTE_LOG(INFO, APP, "Initialising port %u ...\n", (unsigned)port);
 	fflush(stdout);
+	rte_eth_dev_info_get(port, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	     port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	ret = rte_eth_dev_configure(port, 1, 1, &port_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not configure port%u (%d)\n",
@@ -621,14 +637,19 @@ struct kni_interface_stats {
 		rte_exit(EXIT_FAILURE, "Could not adjust number of descriptors "
 				"for port%u (%d)\n", (unsigned)port, ret);
 
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = port_conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port, 0, nb_rxd,
-		rte_eth_dev_socket_id(port), NULL, pktmbuf_pool);
+		rte_eth_dev_socket_id(port), &rxq_conf, pktmbuf_pool);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not setup up RX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = port_conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(port, 0, nb_txd,
-		rte_eth_dev_socket_id(port), NULL);
+		rte_eth_dev_socket_id(port), &txq_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
@@ -702,7 +723,10 @@ struct kni_interface_stats {
 kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
 {
 	int ret;
+	uint16_t nb_rxd = NB_RXD;
 	struct rte_eth_conf conf;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
 
 	if (port_id >= rte_eth_dev_count()) {
 		RTE_LOG(ERR, APP, "Invalid port id %d\n", port_id);
@@ -717,19 +741,43 @@ struct kni_interface_stats {
 	memcpy(&conf, &port_conf, sizeof(conf));
 	/* Set new MTU */
 	if (new_mtu > ETHER_MAX_LEN)
-		conf.rxmode.jumbo_frame = 1;
+		conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
 	else
-		conf.rxmode.jumbo_frame = 0;
+		conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
 
 	/* mtu + length of header + length of FCS = max pkt length */
 	conf.rxmode.max_rx_pkt_len = new_mtu + KNI_ENET_HEADER_SIZE +
 							KNI_ENET_FCS_SIZE;
+	rte_eth_dev_info_get(port_id, &dev_info);
+	if ((dev_info.rx_offload_capa & conf.rxmode.offloads) !=
+	     conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port_id, conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
 	ret = rte_eth_dev_configure(port_id, 1, 1, &conf);
 	if (ret < 0) {
 		RTE_LOG(ERR, APP, "Fail to reconfigure port %d\n", port_id);
 		return ret;
 	}
 
+	ret = rte_eth_dev_adjust_nb_rx_tx_desc(port_id, &nb_rxd, NULL);
+	if (ret < 0)
+		rte_exit(EXIT_FAILURE, "Could not adjust number of descriptors "
+				"for port%u (%d)\n", (unsigned int)port_id,
+				ret);
+
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = conf.rxmode.offloads;
+	ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd,
+		rte_eth_dev_socket_id(port_id), &rxq_conf, pktmbuf_pool);
+	if (ret < 0) {
+		RTE_LOG(ERR, APP, "Fail to setup Rx queue of port %d\n",
+				port_id);
+		return ret;
+	}
+
 	/* Restart specific port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
-- 
1.8.3.1

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

* [PATCH v2 12/39] examples/ip_fragmentation: convert to new offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (10 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 11/39] examples/kni: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 13/39] examples/ip_pipeline: convert to new ethdev " Shahaf Shuler
                     ` (27 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 examples/ip_fragmentation/main.c | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 5aefe09..1bb0563 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -169,14 +169,16 @@ struct lcore_queue_conf {
 	.rxmode = {
 		.max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 1, /**< Jumbo Frame Support enabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+			     DEV_RX_OFFLOAD_JUMBO_FRAME |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_MULTI_SEGS |
+			     DEV_TX_OFFLOAD_MBUF_FAST_FREE),
 	},
 };
 
@@ -905,6 +907,8 @@ struct rte_lpm6_config lpm6_config = {
 
 	/* initialize all ports */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+
 		/* skip ports that are not enabled */
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %d\n", portid);
@@ -949,6 +953,20 @@ struct rte_lpm6_config lpm6_config = {
 		n_tx_queue = nb_lcores;
 		if (n_tx_queue > MAX_TX_QUEUE_PER_PORT)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue,
 					    &port_conf);
 		if (ret < 0) {
@@ -967,8 +985,10 @@ struct rte_lpm6_config lpm6_config = {
 		}
 
 		/* init one RX queue */
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
-					     socket, NULL,
+					     socket, &rxq_conf,
 					     socket_direct_pool[socket]);
 		if (ret < 0) {
 			printf("\n");
@@ -992,7 +1012,8 @@ struct rte_lpm6_config lpm6_config = {
 			fflush(stdout);
 
 			txconf = &dev_info.default_txconf;
-			txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socket, txconf);
 			if (ret < 0) {
-- 
1.8.3.1

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

* [PATCH v2 13/39] examples/ip_pipeline: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (11 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 12/39] examples/ip_fragmentation: convert to new " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 14/39] examples/ip_reassembly: " Shahaf Shuler
                     ` (26 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ip_pipeline/config_parse.c | 14 ++++----------
 examples/ip_pipeline/init.c         | 26 ++++++++++++++++++++++----
 2 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/examples/ip_pipeline/config_parse.c b/examples/ip_pipeline/config_parse.c
index 3211c6a..a16d1a5 100644
--- a/examples/ip_pipeline/config_parse.c
+++ b/examples/ip_pipeline/config_parse.c
@@ -97,14 +97,8 @@
 		.rxmode = {
 			.mq_mode = ETH_MQ_RX_NONE,
 
-			.header_split   = 0, /* Header split */
-			.hw_ip_checksum = 0, /* IP checksum offload */
-			.hw_vlan_filter = 0, /* VLAN filtering */
-			.hw_vlan_strip  = 0, /* VLAN strip */
-			.hw_vlan_extend = 0, /* Extended VLAN */
-			.jumbo_frame    = 0, /* Jumbo frame support */
-			.hw_strip_crc   = 1, /* CRC strip by HW */
-			.enable_scatter = 0, /* Scattered packets RX handler */
+			.ignore_offload_bitfield = 1,
+			.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 
 			.max_rx_pkt_len = 9000, /* Jumbo frame max packet len */
 			.split_hdr_size = 0, /* Header split buffer size */
@@ -118,6 +112,7 @@
 		},
 		.txmode = {
 			.mq_mode = ETH_MQ_TX_NONE,
+			.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 		},
 		.lpbk_mode = 0,
 	},
@@ -158,8 +153,7 @@
 		},
 		.tx_rs_thresh = 0,
 		.tx_free_thresh = 0,
-		.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS |
-			ETH_TXQ_FLAGS_NOOFFLOADS,
+		.txq_flags = ETH_TXQ_FLAGS_IGNORE,
 		.tx_deferred_start = 0,
 	}
 };
diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
index e56e404..85eeb2d 100644
--- a/examples/ip_pipeline/init.c
+++ b/examples/ip_pipeline/init.c
@@ -876,10 +876,10 @@
 	uint32_t i;
 
 	if (is_any_swq_frag_or_ras(app)) {
-		for (i = 0; i < app->n_pktq_hwq_out; i++) {
-			struct app_pktq_hwq_out_params *p_txq = &app->hwq_out_params[i];
-
-			p_txq->conf.txq_flags &= ~ETH_TXQ_FLAGS_NOMULTSEGS;
+		for (i = 0; i < app->n_links; i++) {
+			struct app_link_params *p_link = &app->link_params[i];
+				p_link->conf.txmode.offloads |=
+						DEV_TX_OFFLOAD_MULTI_SEGS;
 		}
 	}
 }
@@ -962,6 +962,7 @@
 
 	for (i = 0; i < app->n_links; i++) {
 		struct app_link_params *p_link = &app->link_params[i];
+		struct rte_eth_dev_info dev_info;
 		uint32_t link_id, n_hwq_in, n_hwq_out, j;
 		int status;
 
@@ -978,6 +979,21 @@
 			n_hwq_out);
 
 		/* LINK */
+		rte_eth_dev_info_get(p_link->pmd_id, &dev_info);
+		if ((dev_info.rx_offload_capa & p_link->conf.rxmode.offloads) !=
+		    p_link->conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       p_link->pmd_id, p_link->conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & p_link->conf.txmode.offloads) !=
+		    p_link->conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       p_link->pmd_id, p_link->conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		status = rte_eth_dev_configure(
 			p_link->pmd_id,
 			n_hwq_in,
@@ -1019,6 +1035,7 @@
 					p_rxq->name,
 					status);
 
+			p_rxq->conf.offloads = p_link->conf.rxmode.offloads;
 			status = rte_eth_rx_queue_setup(
 				p_link->pmd_id,
 				rxq_queue_id,
@@ -1060,6 +1077,7 @@
 					p_txq->name,
 					status);
 
+			p_txq->conf.offloads = p_link->conf.txmode.offloads;
 			status = rte_eth_tx_queue_setup(
 				p_link->pmd_id,
 				txq_queue_id,
-- 
1.8.3.1

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

* [PATCH v2 14/39] examples/ip_reassembly: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (12 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 13/39] examples/ip_pipeline: convert to new ethdev " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 15/39] examples/ipsec-secgw: " Shahaf Shuler
                     ` (25 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ip_reassembly/main.c | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 756f90e..5c0f55a 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -193,11 +193,10 @@ struct lcore_queue_conf {
 		.mq_mode        = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 1, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+			     DEV_RX_OFFLOAD_JUMBO_FRAME |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.rx_adv_conf = {
 			.rss_conf = {
@@ -207,6 +206,9 @@ struct lcore_queue_conf {
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_MULTI_SEGS |
+			     DEV_TX_OFFLOAD_MBUF_FAST_FREE),
 	},
 };
 
@@ -1052,6 +1054,8 @@ struct rte_lpm6_config lpm6_config = {
 
 	/* initialize all ports */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+
 		/* skip ports that are not enabled */
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			printf("\nSkipping disabled port %d\n", portid);
@@ -1104,6 +1108,20 @@ struct rte_lpm6_config lpm6_config = {
 		n_tx_queue = nb_lcores;
 		if (n_tx_queue > MAX_TX_QUEUE_PER_PORT)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue,
 					    &port_conf);
 		if (ret < 0) {
@@ -1114,8 +1132,10 @@ struct rte_lpm6_config lpm6_config = {
 		}
 
 		/* init one RX queue */
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
-					     socket, NULL,
+					     socket, &rxq_conf,
 					     rxq->pool);
 		if (ret < 0) {
 			printf("\n");
@@ -1140,7 +1160,8 @@ struct rte_lpm6_config lpm6_config = {
 			fflush(stdout);
 
 			txconf = &dev_info.default_txconf;
-			txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = port_conf.txmode.offloads;
 
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 					socket, txconf);
-- 
1.8.3.1

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

* [PATCH v2 15/39] examples/ipsec-secgw: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (13 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 14/39] examples/ip_reassembly: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-19 12:38     ` De Lara Guarch, Pablo
  2017-12-12 12:26   ` [PATCH v2 16/39] examples/ipv4_multicast: " Shahaf Shuler
                     ` (24 subsequent siblings)
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index c98454a..1e8af8d 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -217,6 +217,9 @@ struct lcore_conf {
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_MULTI_SEGS |
+			     DEV_TX_OFFLOAD_MBUF_FAST_FREE),
 	},
 };
 
@@ -1394,6 +1397,20 @@ struct ipsec_traffic {
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_SECURITY)
 		port_conf.txmode.offloads |= DEV_TX_OFFLOAD_SECURITY;
 
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       portid, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	     port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       portid, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	ret = rte_eth_dev_configure(portid, nb_rx_queue, nb_tx_queue,
 			&port_conf);
 	if (ret < 0)
@@ -1420,7 +1437,8 @@ struct ipsec_traffic {
 		printf("Setup txq=%u,%d,%d\n", lcore_id, tx_queueid, socket_id);
 
 		txconf = &dev_info.default_txconf;
-		txconf->txq_flags = 0;
+		txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txconf->offloads = port_conf.txmode.offloads;
 
 		ret = rte_eth_tx_queue_setup(portid, tx_queueid, nb_txd,
 				socket_id, txconf);
@@ -1434,6 +1452,8 @@ struct ipsec_traffic {
 
 		/* init RX queues */
 		for (queue = 0; queue < qconf->nb_rx_queue; ++queue) {
+			struct rte_eth_rxconf rxq_conf;
+
 			if (portid != qconf->rx_queue_list[queue].port_id)
 				continue;
 
@@ -1442,8 +1462,10 @@ struct ipsec_traffic {
 			printf("Setup rxq=%d,%d,%d\n", portid, rx_queueid,
 					socket_id);
 
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, rx_queueid,
-					nb_rxd,	socket_id, NULL,
+					nb_rxd,	socket_id, &rxq_conf,
 					socket_ctx[socket_id].mbuf_pool);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE,
-- 
1.8.3.1

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

* [PATCH v2 16/39] examples/ipv4_multicast: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (14 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 15/39] examples/ipsec-secgw: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 17/39] examples/link_status_interrupt: convert to new " Shahaf Shuler
                     ` (23 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ipv4_multicast/main.c | 33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 1c58516..ddefd71 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -138,14 +138,13 @@ struct lcore_queue_conf {
 	.rxmode = {
 		.max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 1, /**< Jumbo Frame Support enabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_JUMBO_FRAME |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MULTI_SEGS,
 	},
 };
 
@@ -714,6 +713,8 @@ struct mcast_group_params {
 
 	/* initialize all ports */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+
 		/* skip ports that are not enabled */
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %d\n", portid);
@@ -748,6 +749,21 @@ struct mcast_group_params {
 		n_tx_queue = nb_lcores;
 		if (n_tx_queue > MAX_TX_QUEUE_PER_PORT)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
+
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue,
 					    &port_conf);
 		if (ret < 0)
@@ -769,9 +785,11 @@ struct mcast_group_params {
 		queueid = 0;
 		printf("rxq=%hu ", queueid);
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     packet_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, port=%d\n",
@@ -787,7 +805,8 @@ struct mcast_group_params {
 			fflush(stdout);
 
 			txconf = &dev_info.default_txconf;
-			txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     rte_lcore_to_socket_id(lcore_id), txconf);
 			if (ret < 0)
-- 
1.8.3.1

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

* [PATCH v2 17/39] examples/link_status_interrupt: convert to new offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (15 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 16/39] examples/ipv4_multicast: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 18/39] examples/load_balancer: convert to new ethdev " Shahaf Shuler
                     ` (22 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/link_status_interrupt/main.c | 37 +++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index bc47dcc..e7716a3 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -105,17 +105,15 @@ struct lcore_queue_conf {
 
 struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 	.intr_conf = {
 		.lsc = 1, /**< lsc interrupt feature enabled */
@@ -633,6 +631,9 @@ struct lsi_port_statistics {
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+
 		/* skip ports that are not enabled */
 		if ((lsi_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", (unsigned) portid);
@@ -641,6 +642,21 @@ struct lsi_port_statistics {
 		/* init port */
 		printf("Initializing port %u... ", (unsigned) portid);
 		fflush(stdout);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
@@ -666,9 +682,11 @@ struct lsi_port_statistics {
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     lsi_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, port=%u\n",
@@ -676,9 +694,12 @@ struct lsi_port_statistics {
 
 		/* init one TX queue logical core on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d,port=%u\n",
 				  ret, (unsigned) portid);
-- 
1.8.3.1

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

* [PATCH v2 18/39] examples/load_balancer: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (16 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 17/39] examples/link_status_interrupt: convert to new " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 19/39] examples/multi_process: " Shahaf Shuler
                     ` (21 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/load_balancer/init.c | 36 +++++++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 7 deletions(-)

diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3dab7f2..e348fc1 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -74,11 +74,9 @@
 	.rxmode = {
 		.mq_mode	= ETH_MQ_RX_RSS,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -88,6 +86,7 @@
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -430,6 +429,9 @@
 		struct rte_mempool *pool;
 		uint16_t nic_rx_ring_size;
 		uint16_t nic_tx_ring_size;
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+		struct rte_eth_dev_info dev_info;
 
 		n_rx_queues = app_get_nic_rx_queues_per_port(port);
 		n_tx_queues = app.nic_tx_port_mask[port];
@@ -440,6 +442,21 @@
 
 		/* Init port */
 		printf("Initializing NIC port %u ...\n", port);
+		rte_eth_dev_info_get(port, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       port, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       port, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(
 			port,
 			(uint8_t) n_rx_queues,
@@ -461,6 +478,8 @@
 		app.nic_rx_ring_size = nic_rx_ring_size;
 		app.nic_tx_ring_size = nic_tx_ring_size;
 
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		/* Init RX queues */
 		for (queue = 0; queue < APP_MAX_RX_QUEUES_PER_NIC_PORT; queue ++) {
 			if (app.nic_rx_queue_mask[port][queue] == 0) {
@@ -478,7 +497,7 @@
 				queue,
 				(uint16_t) app.nic_rx_ring_size,
 				socket,
-				NULL,
+				&rxq_conf,
 				pool);
 			if (ret < 0) {
 				rte_panic("Cannot init RX queue %u for port %u (%d)\n",
@@ -486,6 +505,9 @@
 			}
 		}
 
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = port_conf.txmode.offloads;
 		/* Init TX queues */
 		if (app.nic_tx_port_mask[port] == 1) {
 			app_get_lcore_for_nic_tx(port, &lcore);
@@ -497,7 +519,7 @@
 				0,
 				(uint16_t) app.nic_tx_ring_size,
 				socket,
-				NULL);
+				&txq_conf);
 			if (ret < 0) {
 				rte_panic("Cannot init TX queue 0 for port %d (%d)\n",
 					port,
-- 
1.8.3.1

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

* [PATCH v2 19/39] examples/multi_process: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (17 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 18/39] examples/load_balancer: convert to new ethdev " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 20/39] examples/netmap_compat: " Shahaf Shuler
                     ` (20 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/multi_process/l2fwd_fork/main.c   | 35 ++++++++++++++++++++-----
 examples/multi_process/symmetric_mp/main.c | 34 +++++++++++++++++++-----
 2 files changed, 55 insertions(+), 14 deletions(-)

diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c
index deace27..3451b51 100644
--- a/examples/multi_process/l2fwd_fork/main.c
+++ b/examples/multi_process/l2fwd_fork/main.c
@@ -156,14 +156,12 @@ struct cpu_aff_arg{
 static const struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -1064,6 +1062,9 @@ struct l2fwd_port_statistics {
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+
 		/* skip ports that are not enabled */
 		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", (unsigned) portid);
@@ -1073,6 +1074,21 @@ struct l2fwd_port_statistics {
 		/* init port */
 		printf("Initializing port %u... ", (unsigned) portid);
 		fflush(stdout);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		     port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       port, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		     port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       port, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
@@ -1089,9 +1105,11 @@ struct l2fwd_port_statistics {
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     l2fwd_pktmbuf_pool[portid]);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
@@ -1099,9 +1117,12 @@ struct l2fwd_port_statistics {
 
 		/* init one TX queue on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.tx_offloads = port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n",
 				ret, (unsigned) portid);
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 6fb285c..d3b9c62 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -207,11 +207,9 @@ struct port_stats{
 			.rxmode = {
 				.mq_mode	= ETH_MQ_RX_RSS,
 				.split_hdr_size = 0,
-				.header_split   = 0, /**< Header Split disabled */
-				.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-				.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-				.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-				.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+				.ignore_offload_bitfield = 1,
+				.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+					     DEV_RX_OFFLOAD_CRC_STRIP),
 			},
 			.rx_adv_conf = {
 				.rss_conf = {
@@ -221,10 +219,13 @@ struct port_stats{
 			},
 			.txmode = {
 				.mq_mode = ETH_MQ_TX_NONE,
+				.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 			}
 	};
 	const uint16_t rx_rings = num_queues, tx_rings = num_queues;
 	struct rte_eth_dev_info info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
 	int retval;
 	uint16_t q;
 	uint16_t nb_rxd = RX_RING_SIZE;
@@ -242,6 +243,20 @@ struct port_stats{
 	rte_eth_dev_info_get(port, &info);
 	info.default_rxconf.rx_drop_en = 1;
 
+	if ((info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	     port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       info.rx_offload_capa);
+	}
+	if ((info.tx_offload_capa & port_conf.txmode.offloads) !=
+			port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       info.tx_offload_capa);
+	}
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval < 0)
 		return retval;
@@ -250,19 +265,24 @@ struct port_stats{
 	if (retval < 0)
 		return retval;
 
+	rxq_conf = info.default_rxconf;
+	rxq_conf.offloads = port_conf.rxmode.offloads;
 	for (q = 0; q < rx_rings; q ++) {
 		retval = rte_eth_rx_queue_setup(port, q, nb_rxd,
 				rte_eth_dev_socket_id(port),
-				&info.default_rxconf,
+				&rxq_conf,
 				mbuf_pool);
 		if (retval < 0)
 			return retval;
 	}
 
+	txq_conf = info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < tx_rings; q ++) {
 		retval = rte_eth_tx_queue_setup(port, q, nb_txd,
 				rte_eth_dev_socket_id(port),
-				NULL);
+				&txq_conf);
 		if (retval < 0)
 			return retval;
 	}
-- 
1.8.3.1

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

* [PATCH v2 20/39] examples/netmap_compat: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (18 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 19/39] examples/multi_process: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 21/39] examples/performance-thread: convert to new " Shahaf Shuler
                     ` (19 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/netmap_compat/bridge/bridge.c     |  8 +++-----
 examples/netmap_compat/lib/compat_netmap.c | 27 +++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/examples/netmap_compat/bridge/bridge.c b/examples/netmap_compat/bridge/bridge.c
index 2f2b6ba..ec969e1 100644
--- a/examples/netmap_compat/bridge/bridge.c
+++ b/examples/netmap_compat/bridge/bridge.c
@@ -55,14 +55,12 @@
 struct rte_eth_conf eth_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0,
-		.hw_ip_checksum = 0,
-		.hw_vlan_filter = 0,
-		.jumbo_frame    = 0,
-		.hw_strip_crc   = 1,
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c
index 12b3fcb..f145019 100644
--- a/examples/netmap_compat/lib/compat_netmap.c
+++ b/examples/netmap_compat/lib/compat_netmap.c
@@ -690,6 +690,9 @@ struct netmap_state {
 	int32_t ret;
 	uint16_t i;
 	uint16_t rx_slots, tx_slots;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
+	struct rte_eth_dev_info dev_info;
 
 	if (conf == NULL ||
 			portid >= RTE_DIM(ports) ||
@@ -710,6 +713,21 @@ struct netmap_state {
 		return -EINVAL;
 	}
 
+	rte_eth_dev_info_get(portid, &dev_info);
+	if ((dev_info.rx_offload_capa & conf->eth_conf->rxmode.offloads) !=
+	    conf->eth_conf->rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       portid, conf->eth_conf->rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & conf->eth_conf->txmode.offloads) !=
+	    conf->eth_conf->txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       portid, conf->eth_conf->txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	ret = rte_eth_dev_configure(portid, conf->nr_rx_rings,
 		conf->nr_tx_rings, conf->eth_conf);
 
@@ -727,9 +745,14 @@ struct netmap_state {
 		return ret;
 	}
 
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = conf->eth_conf->rxmode.offloads;
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = conf->eth_conf->txmode.offloads;
 	for (i = 0; i < conf->nr_tx_rings; i++) {
 		ret = rte_eth_tx_queue_setup(portid, i, tx_slots,
-			conf->socket_id, NULL);
+			conf->socket_id, &txq_conf);
 
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
@@ -739,7 +762,7 @@ struct netmap_state {
 		}
 
 		ret = rte_eth_rx_queue_setup(portid, i, rx_slots,
-			conf->socket_id, NULL, conf->pool);
+			conf->socket_id, &rxq_conf, conf->pool);
 
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
-- 
1.8.3.1

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

* [PATCH v2 21/39] examples/performance-thread: convert to new offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (19 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 20/39] examples/netmap_compat: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 22/39] examples/qos_meter: convert to new ethdev " Shahaf Shuler
                     ` (18 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/performance-thread/l3fwd-thread/main.c | 41 +++++++++++++++-----
 1 file changed, 31 insertions(+), 10 deletions(-)

diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index fa65234..2d61f03 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -335,11 +335,9 @@ struct tx_thread_params {
 		.mq_mode = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -349,6 +347,7 @@ struct tx_thread_params {
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -2999,7 +2998,10 @@ static int parse_max_pkt_len(const char *pktlen)
 						0};
 
 				printf("jumbo frame is enabled - disabling simple TX path\n");
-				port_conf.rxmode.jumbo_frame = 1;
+				port_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_JUMBO_FRAME;
+				port_conf.txmode.offloads |=
+						DEV_TX_OFFLOAD_MULTI_SEGS;
 
 				/* if no max-pkt-len set, use the default value ETHER_MAX_LEN */
 				if (0 == getopt_long(argc, argvopt, "", &lenopts,
@@ -3567,6 +3569,21 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1,
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+		    port_conf.rxmode.offloads) {
+			printf("Some Rx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.rxmode.offloads,
+			       dev_info.rx_offload_capa);
+		}
+		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+		    port_conf.txmode.offloads) {
+			printf("Some Tx offloads are not supported "
+			       "by port %d: requested 0x%lx supported 0x%lx\n",
+			       portid, port_conf.txmode.offloads,
+			       dev_info.tx_offload_capa);
+		}
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
 					(uint16_t)n_tx_queue, &port_conf);
 		if (ret < 0)
@@ -3612,10 +3629,9 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1,
 			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
-			if (port_conf.rxmode.jumbo_frame)
-				txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socketid, txconf);
 			if (ret < 0)
@@ -3644,6 +3660,8 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1,
 
 		/* init RX queues */
 		for (queue = 0; queue < rx_thread[i].n_rx_queue; ++queue) {
+			struct rte_eth_rxconf rxq_conf;
+
 			portid = rx_thread[i].rx_queue_list[queue].port_id;
 			queueid = rx_thread[i].rx_queue_list[queue].queue_id;
 
@@ -3655,9 +3673,12 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1,
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
 					socketid,
-					NULL,
+					&rxq_conf,
 					pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, "
-- 
1.8.3.1

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

* [PATCH v2 22/39] examples/qos_meter: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (20 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 21/39] examples/performance-thread: convert to new " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 23/39] examples/qos_sched: " Shahaf Shuler
                     ` (17 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/qos_meter/main.c | 61 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 54 insertions(+), 7 deletions(-)

diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index 67b4a75..5b0e3ae 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -85,11 +85,9 @@
 		.mq_mode	= ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0,
-		.hw_ip_checksum = 1,
-		.hw_vlan_filter = 0,
-		.jumbo_frame    = 0,
-		.hw_strip_crc   = 1,
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -99,6 +97,7 @@
 	},
 	.txmode = {
 		.mq_mode = ETH_DCB_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -310,6 +309,10 @@ static __attribute__((noreturn)) int
 	uint32_t lcore_id;
 	uint16_t nb_rxd = NIC_RX_QUEUE_DESC;
 	uint16_t nb_txd = NIC_TX_QUEUE_DESC;
+	struct rte_eth_conf conf;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
+	struct rte_eth_dev_info dev_info;
 	int ret;
 
 	/* EAL init */
@@ -335,6 +338,22 @@ static __attribute__((noreturn)) int
 		rte_exit(EXIT_FAILURE, "Buffer pool creation error\n");
 
 	/* NIC init */
+	rte_eth_dev_info_get(port_rx, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port_rx, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port_rx, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
+	conf = port_conf;
 	ret = rte_eth_dev_configure(port_rx, 1, 1, &port_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_rx, ret);
@@ -344,18 +363,41 @@ static __attribute__((noreturn)) int
 		rte_exit(EXIT_FAILURE, "Port %d adjust number of descriptors error (%d)\n",
 				port_rx, ret);
 
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port_rx, NIC_RX_QUEUE, nb_rxd,
 				rte_eth_dev_socket_id(port_rx),
-				NULL, pool);
+				&rxq_conf, pool);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d RX queue setup error (%d)\n", port_rx, ret);
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(port_rx, NIC_TX_QUEUE, nb_txd,
 				rte_eth_dev_socket_id(port_rx),
-				NULL);
+				&txq_conf);
 	if (ret < 0)
 	rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_rx, ret);
 
+	rte_eth_dev_info_get(port_tx, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port_tx, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port_tx, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
+	conf = port_conf;
+	conf.rxmode.offloads &= dev_info.rx_offload_capa;
+	conf.txmode.offloads &= dev_info.tx_offload_capa;
 	ret = rte_eth_dev_configure(port_tx, 1, 1, &port_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_tx, ret);
@@ -367,12 +409,17 @@ static __attribute__((noreturn)) int
 		rte_exit(EXIT_FAILURE, "Port %d adjust number of descriptors error (%d)\n",
 				port_tx, ret);
 
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port_tx, NIC_RX_QUEUE, nb_rxd,
 				rte_eth_dev_socket_id(port_tx),
 				NULL, pool);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d RX queue setup error (%d)\n", port_tx, ret);
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(port_tx, NIC_TX_QUEUE, nb_txd,
 				rte_eth_dev_socket_id(port_tx),
 				NULL);
-- 
1.8.3.1

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

* [PATCH v2 23/39] examples/qos_sched: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (21 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 22/39] examples/qos_meter: convert to new ethdev " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 24/39] examples/quota_watermark: " Shahaf Shuler
                     ` (16 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/qos_sched/init.c | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 038f042..696e15d 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -84,18 +84,16 @@ struct ring_thresh tx_thresh = {
 int mp_size = NB_MBUF;
 struct flow_conf qos_conf[MAX_DATA_STREAMS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_DCB_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 };
 
@@ -104,6 +102,7 @@ struct ring_thresh tx_thresh = {
 {
 	int ret;
 	struct rte_eth_link link;
+	struct rte_eth_dev_info dev_info;
 	struct rte_eth_rxconf rx_conf;
 	struct rte_eth_txconf tx_conf;
 	uint16_t rx_size;
@@ -125,12 +124,27 @@ struct ring_thresh tx_thresh = {
 	tx_conf.tx_thresh.wthresh = tx_thresh.wthresh;
 	tx_conf.tx_free_thresh = 0;
 	tx_conf.tx_rs_thresh = 0;
-	tx_conf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS;
 	tx_conf.tx_deferred_start = 0;
+	tx_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 
 	/* init port */
 	RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", portid);
 	fflush(stdout);
+	rte_eth_dev_info_get(portid, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       portid, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       portid, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE,
@@ -149,6 +163,7 @@ struct ring_thresh tx_thresh = {
 
 	/* init one RX queue */
 	fflush(stdout);
+	rx_conf.offloads = port_conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(portid, 0, (uint16_t)ring_conf.rx_size,
 		rte_eth_dev_socket_id(portid), &rx_conf, mp);
 	if (ret < 0)
@@ -158,6 +173,7 @@ struct ring_thresh tx_thresh = {
 
 	/* init one TX queue */
 	fflush(stdout);
+	tx_conf.offloads = port_conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(portid, 0,
 		(uint16_t)ring_conf.tx_size, rte_eth_dev_socket_id(portid), &tx_conf);
 	if (ret < 0)
-- 
1.8.3.1

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

* [PATCH v2 24/39] examples/quota_watermark: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (22 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 23/39] examples/qos_sched: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 25/39] examples/tep_termination: " Shahaf Shuler
                     ` (15 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/quota_watermark/qw/init.c | 37 ++++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 37b0362..74cb054 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -50,17 +50,15 @@
 #include "../include/conf.h"
 
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 		.rxmode = {
 			.split_hdr_size = 0,
-			.header_split   = 0, /**< Header Split disabled */
-			.hw_ip_checksum = 0, /**< IP csum offload disabled */
-			.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-			.jumbo_frame    = 0, /**< Jumbo Frame disabled */
-			.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+			.ignore_offload_bitfield = 1,
+			.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 		},
 		.txmode = {
 			.mq_mode = ETH_DCB_NONE,
+			.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 		},
 };
 
@@ -78,9 +76,27 @@ void configure_eth_port(uint16_t port_id)
 	int ret;
 	uint16_t nb_rxd = RX_DESC_PER_QUEUE;
 	uint16_t nb_txd = TX_DESC_PER_QUEUE;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
+	struct rte_eth_dev_info dev_info;
 
 	rte_eth_dev_stop(port_id);
 
+	rte_eth_dev_info_get(port_id, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port_id, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port_id, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	ret = rte_eth_dev_configure(port_id, 1, 1, &port_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Cannot configure port %u (error %d)\n",
@@ -93,9 +109,11 @@ void configure_eth_port(uint16_t port_id)
 				(unsigned int) port_id, ret);
 
 	/* Initialize the port's RX queue */
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = port_conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd,
 			rte_eth_dev_socket_id(port_id),
-			NULL,
+			&rxq_conf,
 			mbuf_pool);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE,
@@ -103,9 +121,12 @@ void configure_eth_port(uint16_t port_id)
 				(unsigned int) port_id, ret);
 
 	/* Initialize the port's TX queue */
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = port_conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(port_id, 0, nb_txd,
 			rte_eth_dev_socket_id(port_id),
-			NULL);
+			&txq_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE,
 				"Failed to setup TX queue on port %u (error %d)\n",
-- 
1.8.3.1

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

* [PATCH v2 25/39] examples/tep_termination: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (23 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 24/39] examples/quota_watermark: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 26/39] examples/vhost: " Shahaf Shuler
                     ` (14 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/tep_termination/vxlan_setup.c | 36 +++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 7 deletions(-)

diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 1ad4ca3..4edde1b 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -95,17 +95,23 @@
 			RTE_TUNNEL_FILTER_OMAC_TENID_IMAC,};
 
 /* Options for configuring ethernet port */
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_UDP_CKSUM |
+			     DEV_TX_OFFLOAD_TCP_CKSUM |
+			     DEV_TX_OFFLOAD_SCTP_CKSUM |
+			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_TCP_TSO |
+			     DEV_TX_OFFLOAD_MULTI_SEGS |
+			     DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
+			     DEV_TX_OFFLOAD_MBUF_FAST_FREE),
 	},
 };
 
@@ -154,7 +160,7 @@
 
 	rxconf = &dev_info.default_rxconf;
 	txconf = &dev_info.default_txconf;
-	txconf->txq_flags = 0;
+	txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
 
 	if (port >= rte_eth_dev_count())
 		return -1;
@@ -162,6 +168,20 @@
 	rx_rings = nb_devices;
 
 	/* Configure ethernet device. */
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+			port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
 		return retval;
@@ -172,6 +192,7 @@
 		return retval;
 
 	/* Setup the queues. */
+	rxconf->offloads = port_conf.rxmode.offloads;
 	for (q = 0; q < rx_rings; q++) {
 		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
 						rte_eth_dev_socket_id(port),
@@ -180,6 +201,7 @@
 		if (retval < 0)
 			return retval;
 	}
+	txconf->offloads = port_conf.txmode.offloads;
 	for (q = 0; q < tx_rings; q++) {
 		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
 						rte_eth_dev_socket_id(port),
-- 
1.8.3.1

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

* [PATCH v2 26/39] examples/vhost: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (24 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 25/39] examples/tep_termination: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 27/39] examples/vmdq: " Shahaf Shuler
                     ` (13 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/vhost/main.c | 41 ++++++++++++++++++++++++++++++-----------
 1 file changed, 30 insertions(+), 11 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 89a61f0..5e0c680 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -145,21 +145,24 @@
 	.rxmode = {
 		.mq_mode        = ETH_MQ_RX_VMDQ_ONLY,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
+		.ignore_offload_bitfield = 1,
 		/*
-		 * It is necessary for 1G NIC such as I350,
+		 * VLAN strip is necessary for 1G NIC such as I350,
 		 * this fixes bug of ipv4 forwarding in guest can't
 		 * forward pakets from one virtio dev to another virtio dev.
 		 */
-		.hw_vlan_strip  = 1, /**< VLAN strip enabled. */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_VLAN_STRIP),
 	},
 
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_TCP_CKSUM |
+			     DEV_TX_OFFLOAD_VLAN_INSERT |
+			     DEV_TX_OFFLOAD_MULTI_SEGS |
+			     DEV_TX_OFFLOAD_TCP_TSO |
+			     DEV_TX_OFFLOAD_MBUF_FAST_FREE),
 	},
 	.rx_adv_conf = {
 		/*
@@ -176,6 +179,7 @@
 	},
 };
 
+
 static unsigned lcore_ids[RTE_MAX_LCORE];
 static uint16_t ports[RTE_MAX_ETHPORTS];
 static unsigned num_ports = 0; /**< The number of ports specified in command line */
@@ -288,9 +292,7 @@ struct mbuf_table {
 	rxconf = &dev_info.default_rxconf;
 	txconf = &dev_info.default_txconf;
 	rxconf->rx_drop_en = 1;
-
-	/* Enable vlan offload */
-	txconf->txq_flags &= ~ETH_TXQ_FLAGS_NOVLANOFFL;
+	txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
 
 	/*configure the number of supported virtio devices based on VMDQ limits */
 	num_devices = dev_info.max_vmdq_pools;
@@ -332,6 +334,20 @@ struct mbuf_table {
 
 	rx_rings = (uint16_t)dev_info.max_rx_queues;
 	/* Configure ethernet device. */
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+			port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0) {
 		RTE_LOG(ERR, VHOST_PORT, "Failed to configure port %u: %s.\n",
@@ -353,6 +369,7 @@ struct mbuf_table {
 	}
 
 	/* Setup the queues. */
+	rxconf->offloads = port_conf.rxmode.offloads;
 	for (q = 0; q < rx_rings; q ++) {
 		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
 						rte_eth_dev_socket_id(port),
@@ -365,6 +382,7 @@ struct mbuf_table {
 			return retval;
 		}
 	}
+	txconf->offloads = port_conf.txmode.offloads;
 	for (q = 0; q < tx_rings; q ++) {
 		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
 						rte_eth_dev_socket_id(port),
@@ -624,7 +642,8 @@ struct mbuf_table {
 				} else {
 					mergeable = !!ret;
 					if (ret) {
-						vmdq_conf_default.rxmode.jumbo_frame = 1;
+						vmdq_conf_default.rxmode.offloads |=
+							DEV_RX_OFFLOAD_JUMBO_FRAME;
 						vmdq_conf_default.rxmode.max_rx_pkt_len
 							= JUMBO_FRAME_MAX_SIZE;
 					}
-- 
1.8.3.1

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

* [PATCH v2 27/39] examples/vmdq: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (25 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 26/39] examples/vhost: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 28/39] examples/vmdq_dcb: " Shahaf Shuler
                     ` (12 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/vmdq/main.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 84e9937..069960c 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -94,14 +94,12 @@
 	.rxmode = {
 		.mq_mode        = ETH_MQ_RX_VMDQ_ONLY,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
+		.ignore_offload_bitfield = 1,
 	},
 
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 	.rx_adv_conf = {
 		/*
@@ -188,6 +186,7 @@
 {
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_rxconf *rxconf;
+	struct rte_eth_txconf *txconf;
 	struct rte_eth_conf port_conf;
 	uint16_t rxRings, txRings;
 	uint16_t rxRingSize = RTE_TEST_RX_DESC_DEFAULT;
@@ -245,6 +244,22 @@
 	 */
 	rxRings = (uint16_t)dev_info.max_rx_queues;
 	txRings = (uint16_t)dev_info.max_tx_queues;
+
+	rte_eth_dev_info_get(port, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	retval = rte_eth_dev_configure(port, rxRings, txRings, &port_conf);
 	if (retval != 0)
 		return retval;
@@ -260,9 +275,11 @@
 		return -1;
 	}
 
-	rte_eth_dev_info_get(port, &dev_info);
 	rxconf = &dev_info.default_rxconf;
 	rxconf->rx_drop_en = 1;
+	txconf = &dev_info.default_txconf;
+	txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf->offloads = port_conf.txmode.offloads;
 	for (q = 0; q < rxRings; q++) {
 		retval = rte_eth_rx_queue_setup(port, q, rxRingSize,
 					rte_eth_dev_socket_id(port),
@@ -277,7 +294,7 @@
 	for (q = 0; q < txRings; q++) {
 		retval = rte_eth_tx_queue_setup(port, q, txRingSize,
 					rte_eth_dev_socket_id(port),
-					NULL);
+					txconf);
 		if (retval < 0) {
 			printf("initialise tx queue %d failed\n", q);
 			return retval;
-- 
1.8.3.1

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

* [PATCH v2 28/39] examples/vmdq_dcb: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (26 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 27/39] examples/vmdq: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:26   ` [PATCH v2 29/39] examples/vm_power_manager: convert to new " Shahaf Shuler
                     ` (11 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/vmdq_dcb/main.c | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 9dad2b8..50a6bf5 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -100,13 +100,11 @@
 	.rxmode = {
 		.mq_mode        = ETH_MQ_RX_VMDQ_DCB,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
+		.ignore_offload_bitfield = 1,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_VMDQ_DCB,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 	/*
 	 * should be overridden separately in code with
@@ -228,6 +226,7 @@
 	uint16_t q;
 	uint16_t queues_per_pool;
 	uint32_t max_nb_pools;
+	struct rte_eth_txconf txq_conf;
 
 	/*
 	 * The max pool number from dev_info will be used to validate the pool
@@ -284,6 +283,21 @@
 	if (retval < 0)
 		return retval;
 
+	rte_eth_dev_info_get(port, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+			port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	/*
 	 * Though in this example, all queues including pf queues are setup.
 	 * This is because VMDQ queues doesn't always start from zero, and the
@@ -316,10 +330,13 @@
 		}
 	}
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < num_queues; q++) {
 		retval = rte_eth_tx_queue_setup(port, q, txRingSize,
 					rte_eth_dev_socket_id(port),
-					NULL);
+					&txq_conf);
 		if (retval < 0) {
 			printf("initialize tx queue %d failed\n", q);
 			return retval;
-- 
1.8.3.1

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

* [PATCH v2 29/39] examples/vm_power_manager: convert to new offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (27 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 28/39] examples/vmdq_dcb: " Shahaf Shuler
@ 2017-12-12 12:26   ` Shahaf Shuler
  2017-12-12 12:35   ` [PATCH v2 30/39] examples/distributor: convert to new ethdev " Shahaf Shuler
                     ` (10 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:26 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: David Hunt <david.hunt@intel.com>
---
 examples/vm_power_manager/main.c | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 399fbdd..3248f75 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -74,7 +74,13 @@
 
 /****************/
 static const struct rte_eth_conf port_conf_default = {
-	.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
+	.rxmode = {
+		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
+	},
+	.txmode = {
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
+	},
 };
 
 static inline int
@@ -84,10 +90,28 @@
 	const uint16_t rx_rings = 1, tx_rings = 1;
 	int retval;
 	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txq_conf;
 
 	if (port >= rte_eth_dev_count())
 		return -1;
 
+	rte_eth_dev_info_get(port, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
+
 	/* Configure the Ethernet device. */
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
@@ -101,10 +125,13 @@
 			return retval;
 	}
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_cont.offloads = port_conf.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), NULL);
+				rte_eth_dev_socket_id(port), &txq_conf);
 		if (retval < 0)
 			return retval;
 	}
-- 
1.8.3.1

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

* [PATCH v2 30/39] examples/distributor: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (28 preceding siblings ...)
  2017-12-12 12:26   ` [PATCH v2 29/39] examples/vm_power_manager: convert to new " Shahaf Shuler
@ 2017-12-12 12:35   ` Shahaf Shuler
  2017-12-12 12:35   ` [PATCH v2 31/39] examples/ethtool: " Shahaf Shuler
                     ` (9 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:35 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/distributor/main.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 61e6e6b..c2ef5cc 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -108,9 +108,11 @@
 	.rxmode = {
 		.mq_mode = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -140,10 +142,28 @@ struct output_buffer {
 	uint16_t q;
 	uint16_t nb_rxd = RX_RING_SIZE;
 	uint16_t nb_txd = TX_RING_SIZE;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
 
 	if (port >= rte_eth_dev_count())
 		return -1;
 
+	rte_eth_dev_info_get(port, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
+
 	retval = rte_eth_dev_configure(port, rxRings, txRings, &port_conf);
 	if (retval != 0)
 		return retval;
@@ -160,10 +180,13 @@ struct output_buffer {
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < txRings; q++) {
 		retval = rte_eth_tx_queue_setup(port, q, nb_txd,
 						rte_eth_dev_socket_id(port),
-						NULL);
+						&txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
1.8.3.1

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

* [PATCH v2 31/39] examples/ethtool: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (29 preceding siblings ...)
  2017-12-12 12:35   ` [PATCH v2 30/39] examples/distributor: convert to new ethdev " Shahaf Shuler
@ 2017-12-12 12:35   ` Shahaf Shuler
  2017-12-12 12:35   ` [PATCH v2 32/39] examples/eventdev_pipeline: convert to new " Shahaf Shuler
                     ` (8 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:35 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ethtool/ethtool-app/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index bbab2f6..8a1a5f3 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -124,9 +124,11 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
 	char str_name[16];
 	uint16_t nb_rxd = PORT_RX_QUEUE_SIZE;
 	uint16_t nb_txd = PORT_TX_QUEUE_SIZE;
+	struct rte_eth_txconf txconf;
 
 	memset(&cfg_port, 0, sizeof(cfg_port));
 	cfg_port.txmode.mq_mode = ETH_MQ_TX_NONE;
+	cfg_port.rxmode.ignore_offload_bitfield = 1;
 
 	for (idx_port = 0; idx_port < cnt_ports; idx_port++) {
 		struct app_port *ptr_port = &app_cfg->ports[idx_port];
@@ -160,6 +162,7 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
 						     &nb_txd) < 0)
 			rte_exit(EXIT_FAILURE,
 				 "rte_eth_dev_adjust_nb_rx_tx_desc failed");
+
 		if (rte_eth_rx_queue_setup(
 			    idx_port, 0, nb_rxd,
 			    rte_eth_dev_socket_id(idx_port), NULL,
@@ -167,9 +170,11 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
 			rte_exit(EXIT_FAILURE,
 				 "rte_eth_rx_queue_setup failed"
 				);
+		txconf = dev_info.default_txconf;
+		txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 		if (rte_eth_tx_queue_setup(
 			    idx_port, 0, nb_txd,
-			    rte_eth_dev_socket_id(idx_port), NULL) < 0)
+			    rte_eth_dev_socket_id(idx_port), &txconf) < 0)
 			rte_exit(EXIT_FAILURE,
 				 "rte_eth_tx_queue_setup failed"
 				);
-- 
1.8.3.1

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

* [PATCH v2 32/39] examples/eventdev_pipeline: convert to new offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (30 preceding siblings ...)
  2017-12-12 12:35   ` [PATCH v2 31/39] examples/ethtool: " Shahaf Shuler
@ 2017-12-12 12:35   ` Shahaf Shuler
  2017-12-15 15:20     ` Van Haaren, Harry
  2017-12-12 12:35   ` [PATCH v2 33/39] examples/flow_classify: convert to new ethdev " Shahaf Shuler
                     ` (7 subsequent siblings)
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:35 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/eventdev_pipeline_sw_pmd/main.c | 29 +++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c
index 5f431d8..b7d1795 100644
--- a/examples/eventdev_pipeline_sw_pmd/main.c
+++ b/examples/eventdev_pipeline_sw_pmd/main.c
@@ -563,7 +563,11 @@ static int xdigit2val(unsigned char c)
 	static const struct rte_eth_conf port_conf_default = {
 		.rxmode = {
 			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = ETHER_MAX_LEN
+			.max_rx_pkt_len = ETHER_MAX_LEN,
+			.ignore_offload_bitfield = 1,
+		},
+		.txmode = {
+			.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
 		},
 		.rx_adv_conf = {
 			.rss_conf = {
@@ -578,10 +582,28 @@ static int xdigit2val(unsigned char c)
 	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 (port >= rte_eth_dev_count())
 		return -1;
 
+	rte_eth_dev_info_get(port, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
+
 	/* Configure the Ethernet device. */
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
@@ -595,10 +617,13 @@ static int xdigit2val(unsigned char c)
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	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), NULL);
+				rte_eth_dev_socket_id(port), &txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
1.8.3.1

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

* [PATCH v2 33/39] examples/flow_classify: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (31 preceding siblings ...)
  2017-12-12 12:35   ` [PATCH v2 32/39] examples/eventdev_pipeline: convert to new " Shahaf Shuler
@ 2017-12-12 12:35   ` Shahaf Shuler
  2017-12-12 12:35   ` [PATCH v2 34/39] examples/flow_filtering: " Shahaf Shuler
                     ` (6 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:35 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/flow_classify/flow_classify.c | 31 +++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 766f1dd..0a94348 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -89,7 +89,13 @@ enum {
 const char cb_port_delim[] = ":";
 
 static const struct rte_eth_conf port_conf_default = {
-	.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
+	.rxmode = {
+		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
+	},
+	.txmode = {
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
+	},
 };
 
 struct flow_classifier {
@@ -216,10 +222,28 @@ enum {
 	const uint16_t rx_rings = 1, tx_rings = 1;
 	int retval;
 	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
 
 	if (port >= rte_eth_dev_count())
 		return -1;
 
+	rte_eth_dev_info_get(port, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
+
 	/* Configure the Ethernet device. */
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
@@ -233,10 +257,13 @@ enum {
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.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), NULL);
+				rte_eth_dev_socket_id(port), &txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
1.8.3.1

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

* [PATCH v2 34/39] examples/flow_filtering: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (32 preceding siblings ...)
  2017-12-12 12:35   ` [PATCH v2 33/39] examples/flow_classify: convert to new ethdev " Shahaf Shuler
@ 2017-12-12 12:35   ` Shahaf Shuler
  2017-12-12 12:35   ` [PATCH v2 35/39] examples/packet_ordering: " Shahaf Shuler
                     ` (5 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:35 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/flow_filtering/main.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index 7d739b4..48648f0 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -138,20 +138,22 @@
 	struct rte_eth_conf port_conf = {
 		.rxmode = {
 			.split_hdr_size = 0,
-			/**< Header Split disabled */
-			.header_split   = 0,
-			/**< IP checksum offload disabled */
-			.hw_ip_checksum = 0,
-			/**< VLAN filtering disabled */
-			.hw_vlan_filter = 0,
-			/**< Jumbo Frame Support disabled */
-			.jumbo_frame    = 0,
-			/**< CRC stripped by hardware */
-			.hw_strip_crc   = 1,
+			.ignore_offload_bitfield = 1,
+			.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 		},
 	};
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_dev_info dev_info;
 
 	printf(":: initializing port: %d\n", port_id);
+	rte_eth_dev_info_get(port_id, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	     port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port_id, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
 	ret = rte_eth_dev_configure(port_id,
 				nr_queues, nr_queues, &port_conf);
 	if (ret < 0) {
@@ -160,11 +162,13 @@
 			ret, port_id);
 	}
 
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = port_conf.rxmode.offloads;
 	/* only set Rx queues: something we care only so far */
 	for (i = 0; i < nr_queues; i++) {
 		ret = rte_eth_rx_queue_setup(port_id, i, 512,
 				     rte_eth_dev_socket_id(port_id),
-				     NULL,
+				     &rxq_conf,
 				     mbuf_pool);
 		if (ret < 0) {
 			rte_exit(EXIT_FAILURE,
-- 
1.8.3.1

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

* [PATCH v2 35/39] examples/packet_ordering: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (33 preceding siblings ...)
  2017-12-12 12:35   ` [PATCH v2 34/39] examples/flow_filtering: " Shahaf Shuler
@ 2017-12-12 12:35   ` Shahaf Shuler
  2017-12-12 12:35   ` [PATCH v2 36/39] examples/ptpclient: " Shahaf Shuler
                     ` (4 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:35 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/packet_ordering/main.c | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 3add7be..4a58e4d 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -64,7 +64,14 @@
 
 static struct rte_mempool *mbuf_pool;
 
-static struct rte_eth_conf port_conf_default;
+static struct rte_eth_conf port_conf_default = {
+	.rxmode = {
+		.ignore_offload_bitfield = 1,
+	},
+	.txmode = {
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
+	},
+};
 
 struct worker_thread_args {
 	struct rte_ring *ring_in;
@@ -293,10 +300,28 @@ struct send_thread_args {
 	uint16_t q;
 	uint16_t nb_rxd = RX_DESC_PER_QUEUE;
 	uint16_t nb_txd = TX_DESC_PER_QUEUE;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+	struct rte_eth_conf port_conf = port_conf_default;
 
 	if (port_id > nb_ports)
 		return -1;
 
+	rte_eth_dev_info_get(port_id, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+			port_id, port_conf.rxmode.offloads,
+			dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port_id, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
 	ret = rte_eth_dev_configure(port_id, rxRings, txRings, &port_conf_default);
 	if (ret != 0)
 		return ret;
@@ -313,9 +338,12 @@ struct send_thread_args {
 			return ret;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < txRings; q++) {
 		ret = rte_eth_tx_queue_setup(port_id, q, nb_txd,
-				rte_eth_dev_socket_id(port_id), NULL);
+				rte_eth_dev_socket_id(port_id), &txconf);
 		if (ret < 0)
 			return ret;
 	}
-- 
1.8.3.1

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

* [PATCH v2 36/39] examples/ptpclient: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (34 preceding siblings ...)
  2017-12-12 12:35   ` [PATCH v2 35/39] examples/packet_ordering: " Shahaf Shuler
@ 2017-12-12 12:35   ` Shahaf Shuler
  2017-12-12 12:35   ` [PATCH v2 37/39] examples/rxtx_callbacks: " Shahaf Shuler
                     ` (3 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:35 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ptpclient/ptpclient.c | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index c53dad6..a4c709e 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -77,7 +77,13 @@
 static uint8_t ptp_enabled_ports[RTE_MAX_ETHPORTS];
 
 static const struct rte_eth_conf port_conf_default = {
-	.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
+	.rxmode = {
+		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
+	},
+	.txmode = {
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
+	},
 };
 
 static const struct ether_addr ether_multicast = {
@@ -216,6 +222,22 @@ static inline uint64_t timespec64_to_ns(const struct timespec *ts)
 	if (port >= rte_eth_dev_count())
 		return -1;
 
+	rte_eth_dev_info_get(port, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+			port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+			port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
+
 	/* Configure the Ethernet device. */
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
@@ -239,9 +261,9 @@ static inline uint64_t timespec64_to_ns(const struct timespec *ts)
 		/* Setup txq_flags */
 		struct rte_eth_txconf *txconf;
 
-		rte_eth_dev_info_get(q, &dev_info);
 		txconf = &dev_info.default_txconf;
-		txconf->txq_flags = 0;
+		txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txconf->offloads = port_conf.txmode.offloads;
 
 		retval = rte_eth_tx_queue_setup(port, q, nb_txd,
 				rte_eth_dev_socket_id(port), txconf);
-- 
1.8.3.1

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

* [PATCH v2 37/39] examples/rxtx_callbacks: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (35 preceding siblings ...)
  2017-12-12 12:35   ` [PATCH v2 36/39] examples/ptpclient: " Shahaf Shuler
@ 2017-12-12 12:35   ` Shahaf Shuler
  2017-12-12 12:35   ` [PATCH v2 38/39] examples/server_node_efd: " Shahaf Shuler
                     ` (2 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:35 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/rxtx_callbacks/main.c | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index ca135d2..0f563f2 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -47,7 +47,13 @@
 #define BURST_SIZE 32
 
 static const struct rte_eth_conf port_conf_default = {
-	.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN, },
+	.rxmode = {
+		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
+	},
+	.txmode = {
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
+	},
 };
 
 static unsigned nb_ports;
@@ -105,10 +111,28 @@
 	uint16_t nb_txd = TX_RING_SIZE;
 	int retval;
 	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
 
 	if (port >= rte_eth_dev_count())
 		return -1;
 
+	rte_eth_dev_info_get(port, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
+
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
 		return retval;
@@ -124,9 +148,12 @@
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < tx_rings; q++) {
 		retval = rte_eth_tx_queue_setup(port, q, nb_txd,
-				rte_eth_dev_socket_id(port), NULL);
+				rte_eth_dev_socket_id(port), &txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
1.8.3.1

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

* [PATCH v2 38/39] examples/server_node_efd: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (36 preceding siblings ...)
  2017-12-12 12:35   ` [PATCH v2 37/39] examples/rxtx_callbacks: " Shahaf Shuler
@ 2017-12-12 12:35   ` Shahaf Shuler
  2017-12-12 12:35   ` [PATCH v2 39/39] examples/skeleton: " Shahaf Shuler
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:35 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/server_node_efd/server/init.c | 33 +++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index 0bcab8c..19d0ff4 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -123,14 +123,20 @@
 init_port(uint16_t port_num)
 {
 	/* for port configuration all features are off by default */
-	const struct rte_eth_conf port_conf = {
+	struct rte_eth_conf port_conf = {
 		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS
-		}
+			.mq_mode = ETH_MQ_RX_RSS,
+			.ignore_offload_bitfield = 1,
+		},
+		.txmode = {
+			.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
+		},
 	};
 	const uint16_t rx_rings = 1, tx_rings = num_nodes;
 	uint16_t rx_ring_size = RTE_MP_RX_DESC_DEFAULT;
 	uint16_t tx_ring_size = RTE_MP_TX_DESC_DEFAULT;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
 
 	uint16_t q;
 	int retval;
@@ -138,6 +144,22 @@
 	printf("Port %u init ... ", port_num);
 	fflush(stdout);
 
+	rte_eth_dev_info_get(port_num, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port_num, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port_num, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
+
 	/*
 	 * Standard DPDK port initialisation - config port, then set up
 	 * rx and tx rings.
@@ -159,10 +181,13 @@
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < tx_rings; q++) {
 		retval = rte_eth_tx_queue_setup(port_num, q, tx_ring_size,
 				rte_eth_dev_socket_id(port_num),
-				NULL);
+				&txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
1.8.3.1

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

* [PATCH v2 39/39] examples/skeleton: convert to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (37 preceding siblings ...)
  2017-12-12 12:35   ` [PATCH v2 38/39] examples/server_node_efd: " Shahaf Shuler
@ 2017-12-12 12:35   ` Shahaf Shuler
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-12 12:35 UTC (permalink / raw)
  To: dev, konstantin.ananyev, radu.nicolau, arybchenko

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/skeleton/basicfwd.c | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index e623754..02ce7ba 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -47,7 +47,13 @@
 #define BURST_SIZE 32
 
 static const struct rte_eth_conf port_conf_default = {
-	.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
+	.rxmode = {
+		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
+	},
+	.txmode = {
+		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
+	},
 };
 
 /* basicfwd.c: Basic DPDK skeleton forwarding example. */
@@ -65,10 +71,28 @@
 	uint16_t nb_txd = TX_RING_SIZE;
 	int retval;
 	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
 
 	if (port >= rte_eth_dev_count())
 		return -1;
 
+	rte_eth_dev_info_get(port, &dev_info);
+	if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
+	    port_conf.rxmode.offloads) {
+		printf("Some Rx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.rxmode.offloads,
+		       dev_info.rx_offload_capa);
+	}
+	if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
+	    port_conf.txmode.offloads) {
+		printf("Some Tx offloads are not supported "
+		       "by port %d: requested 0x%lx supported 0x%lx\n",
+		       port, port_conf.txmode.offloads,
+		       dev_info.tx_offload_capa);
+	}
+
 	/* Configure the Ethernet device. */
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
@@ -86,10 +110,13 @@
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.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, nb_txd,
-				rte_eth_dev_socket_id(port), NULL);
+				rte_eth_dev_socket_id(port), &txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
1.8.3.1

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

* Re: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
  2017-12-12 12:26   ` [PATCH v2 05/39] examples/l3fwd: move to " Shahaf Shuler
@ 2017-12-12 17:12     ` Ananyev, Konstantin
  2017-12-13  7:21       ` Shahaf Shuler
  2017-12-18 16:00     ` Maciej Czekaj
  1 sibling, 1 reply; 134+ messages in thread
From: Ananyev, Konstantin @ 2017-12-12 17:12 UTC (permalink / raw)
  To: Shahaf Shuler, dev, Nicolau, Radu, arybchenko



> -----Original Message-----
> From: Shahaf Shuler [mailto:shahafs@mellanox.com]
> Sent: Tuesday, December 12, 2017 12:26 PM
> To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>; Nicolau, Radu <radu.nicolau@intel.com>;
> arybchenko@solarflare.com
> Subject: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>  examples/l3fwd/main.c | 40 ++++++++++++++++++++++++++++++----------
>  1 file changed, 30 insertions(+), 10 deletions(-)
> 
> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> index 6229568..3bdf4d5 100644
> --- a/examples/l3fwd/main.c
> +++ b/examples/l3fwd/main.c
> @@ -149,11 +149,9 @@ struct lcore_params {
>  		.mq_mode = ETH_MQ_RX_RSS,
>  		.max_rx_pkt_len = ETHER_MAX_LEN,
>  		.split_hdr_size = 0,
> -		.header_split   = 0, /**< Header Split disabled */
> -		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
> -		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
> -		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
> -		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
> +		.ignore_offload_bitfield = 1,
> +		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
> +			     DEV_RX_OFFLOAD_CHECKSUM),
>  	},
>  	.rx_adv_conf = {
>  		.rss_conf = {
> @@ -163,6 +161,7 @@ struct lcore_params {
>  	},
>  	.txmode = {
>  		.mq_mode = ETH_MQ_TX_NONE,
> +		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,

Hmm, does it mean a new warning for all PMDs (majority) which don't support DEV_TX_OFFLOAD_MBUF_FAST_FREE?
Konstantin

>  	},
>  };
> 
> @@ -612,7 +611,8 @@ enum {
>  			};
> 
>  			printf("%s\n", str8);
> -			port_conf.rxmode.jumbo_frame = 1;
> +			port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
> +			port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS;
> 
>  			/*
>  			 * if no max-pkt-len set, use the default
> @@ -908,6 +908,22 @@ enum {
>  			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
>  		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
>  			nb_rx_queue, (unsigned)n_tx_queue );
> +
> +		rte_eth_dev_info_get(portid, &dev_info);
> +		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
> +		    port_conf.rxmode.offloads) {
> +			printf("Some Rx offloads are not supported "
> +			       "by port %d: requested 0x%lx supported 0x%lx\n",
> +			       portid, port_conf.rxmode.offloads,
> +			       dev_info.rx_offload_capa);
> +		}
> +		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
> +		    port_conf.txmode.offloads) {
> +			printf("Some Tx offloads are not supported "
> +			       "by port %d: requested 0x%lx supported 0x%lx\n",
> +			       portid, port_conf.txmode.offloads,
> +			       dev_info.tx_offload_capa);
> +		}
>  		ret = rte_eth_dev_configure(portid, nb_rx_queue,
>  					(uint16_t)n_tx_queue, &port_conf);
>  		if (ret < 0)
> @@ -955,10 +971,9 @@ enum {
>  			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
>  			fflush(stdout);
> 
> -			rte_eth_dev_info_get(portid, &dev_info);
>  			txconf = &dev_info.default_txconf;
> -			if (port_conf.rxmode.jumbo_frame)
> -				txconf->txq_flags = 0;
> +			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
> +			txconf->offloads = port_conf.txmode.offloads;
>  			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
>  						     socketid, txconf);
>  			if (ret < 0)
> @@ -984,6 +999,8 @@ enum {
>  		fflush(stdout);
>  		/* init RX queues */
>  		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
> +			struct rte_eth_rxconf rxq_conf;
> +
>  			portid = qconf->rx_queue_list[queue].port_id;
>  			queueid = qconf->rx_queue_list[queue].queue_id;
> 
> @@ -996,9 +1013,12 @@ enum {
>  			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
>  			fflush(stdout);
> 
> +			rte_eth_dev_info_get(portid, &dev_info);
> +			rxq_conf = dev_info.default_rxconf;
> +			rxq_conf.offloads = port_conf.rxmode.offloads;
>  			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
>  					socketid,
> -					NULL,
> +					&rxq_conf,
>  					pktmbuf_pool[socketid]);
>  			if (ret < 0)
>  				rte_exit(EXIT_FAILURE,
> --
> 1.8.3.1

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

* Re: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
  2017-12-12 17:12     ` Ananyev, Konstantin
@ 2017-12-13  7:21       ` Shahaf Shuler
  2017-12-13  7:55         ` Jerin Jacob
  0 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-13  7:21 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev, Nicolau, Radu, arybchenko

Tuesday, December 12, 2017 7:12 PM, Ananyev, Konstantin:
> > -----Original Message-----
> > From: Shahaf Shuler [mailto:shahafs@mellanox.com]
> > Sent: Tuesday, December 12, 2017 12:26 PM
> > To: dev@dpdk.org; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>;
> > Nicolau, Radu <radu.nicolau@intel.com>; arybchenko@solarflare.com
> > Subject: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
> >
> > Ethdev offloads API has changed since:
> >
> > commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> > cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> >
> > This commit support the new API.
> >
> > Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> > ---
> >  examples/l3fwd/main.c | 40 ++++++++++++++++++++++++++++++--------
> --
> >  1 file changed, 30 insertions(+), 10 deletions(-)
> >
> > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index
> > 6229568..3bdf4d5 100644
> > --- a/examples/l3fwd/main.c
> > +++ b/examples/l3fwd/main.c
> > @@ -149,11 +149,9 @@ struct lcore_params {
> >  		.mq_mode = ETH_MQ_RX_RSS,
> >  		.max_rx_pkt_len = ETHER_MAX_LEN,
> >  		.split_hdr_size = 0,
> > -		.header_split   = 0, /**< Header Split disabled */
> > -		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
> > -		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
> > -		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
> > -		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
> > +		.ignore_offload_bitfield = 1,
> > +		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
> > +			     DEV_RX_OFFLOAD_CHECKSUM),
> >  	},
> >  	.rx_adv_conf = {
> >  		.rss_conf = {
> > @@ -163,6 +161,7 @@ struct lcore_params {
> >  	},
> >  	.txmode = {
> >  		.mq_mode = ETH_MQ_TX_NONE,
> > +		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
> 
> Hmm, does it mean a new warning for all PMDs (majority) which don't
> support DEV_TX_OFFLOAD_MBUF_FAST_FREE?

Good point.
Unlike other offloads which are must for the application proper run, this one it only for optimizing the performance and should be set only if PMD supports. 
Am continuing to aggregate reasons why the DEV_TX_OFFLOAD_MBUF_FAST_FREE should not be defined as an offload. Anyway we passed that... 

I will fix on v3.

> Konstantin
> 
> >  	},
> >  };
> >
> > @@ -612,7 +611,8 @@ enum {
> >  			};
> >
> >  			printf("%s\n", str8);
> > -			port_conf.rxmode.jumbo_frame = 1;
> > +			port_conf.rxmode.offloads |=
> DEV_RX_OFFLOAD_JUMBO_FRAME;
> > +			port_conf.txmode.offloads |=
> DEV_TX_OFFLOAD_MULTI_SEGS;
> >
> >  			/*
> >  			 * if no max-pkt-len set, use the default @@ -908,6
> +908,22 @@
> > enum {
> >  			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
> >  		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
> >  			nb_rx_queue, (unsigned)n_tx_queue );
> > +
> > +		rte_eth_dev_info_get(portid, &dev_info);
> > +		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads)
> !=
> > +		    port_conf.rxmode.offloads) {
> > +			printf("Some Rx offloads are not supported "
> > +			       "by port %d: requested 0x%lx supported
> 0x%lx\n",
> > +			       portid, port_conf.rxmode.offloads,
> > +			       dev_info.rx_offload_capa);
> > +		}
> > +		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads)
> !=
> > +		    port_conf.txmode.offloads) {
> > +			printf("Some Tx offloads are not supported "
> > +			       "by port %d: requested 0x%lx supported
> 0x%lx\n",
> > +			       portid, port_conf.txmode.offloads,
> > +			       dev_info.tx_offload_capa);
> > +		}
> >  		ret = rte_eth_dev_configure(portid, nb_rx_queue,
> >  					(uint16_t)n_tx_queue, &port_conf);
> >  		if (ret < 0)
> > @@ -955,10 +971,9 @@ enum {
> >  			printf("txq=%u,%d,%d ", lcore_id, queueid,
> socketid);
> >  			fflush(stdout);
> >
> > -			rte_eth_dev_info_get(portid, &dev_info);
> >  			txconf = &dev_info.default_txconf;
> > -			if (port_conf.rxmode.jumbo_frame)
> > -				txconf->txq_flags = 0;
> > +			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
> > +			txconf->offloads = port_conf.txmode.offloads;
> >  			ret = rte_eth_tx_queue_setup(portid, queueid,
> nb_txd,
> >  						     socketid, txconf);
> >  			if (ret < 0)
> > @@ -984,6 +999,8 @@ enum {
> >  		fflush(stdout);
> >  		/* init RX queues */
> >  		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
> > +			struct rte_eth_rxconf rxq_conf;
> > +
> >  			portid = qconf->rx_queue_list[queue].port_id;
> >  			queueid = qconf->rx_queue_list[queue].queue_id;
> >
> > @@ -996,9 +1013,12 @@ enum {
> >  			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
> >  			fflush(stdout);
> >
> > +			rte_eth_dev_info_get(portid, &dev_info);
> > +			rxq_conf = dev_info.default_rxconf;
> > +			rxq_conf.offloads = port_conf.rxmode.offloads;
> >  			ret = rte_eth_rx_queue_setup(portid, queueid,
> nb_rxd,
> >  					socketid,
> > -					NULL,
> > +					&rxq_conf,
> >  					pktmbuf_pool[socketid]);
> >  			if (ret < 0)
> >  				rte_exit(EXIT_FAILURE,
> > --
> > 1.8.3.1

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

* Re: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
  2017-12-13  7:21       ` Shahaf Shuler
@ 2017-12-13  7:55         ` Jerin Jacob
  2017-12-13 12:10           ` Ananyev, Konstantin
  0 siblings, 1 reply; 134+ messages in thread
From: Jerin Jacob @ 2017-12-13  7:55 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: Ananyev, Konstantin, dev, Nicolau, Radu, arybchenko

-----Original Message-----
> Date: Wed, 13 Dec 2017 07:21:01 +0000
> From: Shahaf Shuler <shahafs@mellanox.com>
> To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>, "dev@dpdk.org"
>  <dev@dpdk.org>, "Nicolau, Radu" <radu.nicolau@intel.com>,
>  "arybchenko@solarflare.com" <arybchenko@solarflare.com>
> Subject: Re: [dpdk-dev] [PATCH v2 05/39] examples/l3fwd: move to ethdev
>  offloads API
> 
> Tuesday, December 12, 2017 7:12 PM, Ananyev, Konstantin:
> > > -----Original Message-----
> > > From: Shahaf Shuler [mailto:shahafs@mellanox.com]
> > > Sent: Tuesday, December 12, 2017 12:26 PM
> > > To: dev@dpdk.org; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>;
> > > Nicolau, Radu <radu.nicolau@intel.com>; arybchenko@solarflare.com
> > > Subject: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
> > >
> > > Ethdev offloads API has changed since:
> > >
> > > commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> > > cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> > >
> > > This commit support the new API.
> > >
> > > Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> > > ---
> > >  examples/l3fwd/main.c | 40 ++++++++++++++++++++++++++++++--------
> > --
> > >  1 file changed, 30 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index
> > > 6229568..3bdf4d5 100644
> > > --- a/examples/l3fwd/main.c
> > > +++ b/examples/l3fwd/main.c
> > > @@ -149,11 +149,9 @@ struct lcore_params {
> > >  		.mq_mode = ETH_MQ_RX_RSS,
> > >  		.max_rx_pkt_len = ETHER_MAX_LEN,
> > >  		.split_hdr_size = 0,
> > > -		.header_split   = 0, /**< Header Split disabled */
> > > -		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
> > > -		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
> > > -		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
> > > -		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
> > > +		.ignore_offload_bitfield = 1,
> > > +		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
> > > +			     DEV_RX_OFFLOAD_CHECKSUM),
> > >  	},
> > >  	.rx_adv_conf = {
> > >  		.rss_conf = {
> > > @@ -163,6 +161,7 @@ struct lcore_params {
> > >  	},
> > >  	.txmode = {
> > >  		.mq_mode = ETH_MQ_TX_NONE,
> > > +		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
> > 
> > Hmm, does it mean a new warning for all PMDs (majority) which don't
> > support DEV_TX_OFFLOAD_MBUF_FAST_FREE?
> 
> Good point.
> Unlike other offloads which are must for the application proper run, this one it only for optimizing the performance and should be set only if PMD supports. 
> Am continuing to aggregate reasons why the DEV_TX_OFFLOAD_MBUF_FAST_FREE should not be defined as an offload. Anyway we passed that... 
> 
> I will fix on v3.

Removing is not an option as the PMDs rely on that flag to will have the
impact.
# I see DEV_TX_OFFLOAD_MBUF_FAST_FREE as hint driver to depict the application requirements
# All the drivers by default can support DEV_TX_OFFLOAD_MBUF_FAST_FREE(They are using the hint or
not is a different question)

So, How about setting DEV_TX_OFFLOAD_MBUF_FAST_FREE in all PMD driver as
dummy one? I think, currently, it can be moved to old API to new API
transition function till the drivers change to new offload flag scheme.

We are planning to change nicvf driver to new offload scheme for this
release so with this change, we have the performance impact on l3fwd
application.

I think, the other option could be to change usage/meaning of
DEV_TX_OFFLOAD_MBUF_FAST_FREE flag where when the application needs
multi-pool and reference count scheme then "it sets" the offload flags.
If so, we don't need to set by default on the these applications.

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

* Re: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
  2017-12-13  7:55         ` Jerin Jacob
@ 2017-12-13 12:10           ` Ananyev, Konstantin
  2017-12-13 17:32             ` Jerin Jacob
  0 siblings, 1 reply; 134+ messages in thread
From: Ananyev, Konstantin @ 2017-12-13 12:10 UTC (permalink / raw)
  To: Jerin Jacob, Shahaf Shuler; +Cc: dev, Nicolau, Radu, arybchenko

Hi Jerin,

> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Wednesday, December 13, 2017 7:55 AM
> To: Shahaf Shuler <shahafs@mellanox.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; dev@dpdk.org; Nicolau, Radu <radu.nicolau@intel.com>;
> arybchenko@solarflare.com
> Subject: Re: [dpdk-dev] [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
> 
> -----Original Message-----
> > Date: Wed, 13 Dec 2017 07:21:01 +0000
> > From: Shahaf Shuler <shahafs@mellanox.com>
> > To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>, "dev@dpdk.org"
> >  <dev@dpdk.org>, "Nicolau, Radu" <radu.nicolau@intel.com>,
> >  "arybchenko@solarflare.com" <arybchenko@solarflare.com>
> > Subject: Re: [dpdk-dev] [PATCH v2 05/39] examples/l3fwd: move to ethdev
> >  offloads API
> >
> > Tuesday, December 12, 2017 7:12 PM, Ananyev, Konstantin:
> > > > -----Original Message-----
> > > > From: Shahaf Shuler [mailto:shahafs@mellanox.com]
> > > > Sent: Tuesday, December 12, 2017 12:26 PM
> > > > To: dev@dpdk.org; Ananyev, Konstantin
> > > <konstantin.ananyev@intel.com>;
> > > > Nicolau, Radu <radu.nicolau@intel.com>; arybchenko@solarflare.com
> > > > Subject: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
> > > >
> > > > Ethdev offloads API has changed since:
> > > >
> > > > commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> > > > cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> > > >
> > > > This commit support the new API.
> > > >
> > > > Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> > > > ---
> > > >  examples/l3fwd/main.c | 40 ++++++++++++++++++++++++++++++--------
> > > --
> > > >  1 file changed, 30 insertions(+), 10 deletions(-)
> > > >
> > > > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index
> > > > 6229568..3bdf4d5 100644
> > > > --- a/examples/l3fwd/main.c
> > > > +++ b/examples/l3fwd/main.c
> > > > @@ -149,11 +149,9 @@ struct lcore_params {
> > > >  		.mq_mode = ETH_MQ_RX_RSS,
> > > >  		.max_rx_pkt_len = ETHER_MAX_LEN,
> > > >  		.split_hdr_size = 0,
> > > > -		.header_split   = 0, /**< Header Split disabled */
> > > > -		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
> > > > -		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
> > > > -		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
> > > > -		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
> > > > +		.ignore_offload_bitfield = 1,
> > > > +		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
> > > > +			     DEV_RX_OFFLOAD_CHECKSUM),
> > > >  	},
> > > >  	.rx_adv_conf = {
> > > >  		.rss_conf = {
> > > > @@ -163,6 +161,7 @@ struct lcore_params {
> > > >  	},
> > > >  	.txmode = {
> > > >  		.mq_mode = ETH_MQ_TX_NONE,
> > > > +		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
> > >
> > > Hmm, does it mean a new warning for all PMDs (majority) which don't
> > > support DEV_TX_OFFLOAD_MBUF_FAST_FREE?
> >
> > Good point.
> > Unlike other offloads which are must for the application proper run, this one it only for optimizing the performance and should be set only
> if PMD supports.
> > Am continuing to aggregate reasons why the DEV_TX_OFFLOAD_MBUF_FAST_FREE should not be defined as an offload. Anyway we
> passed that...
> >
> > I will fix on v3.
> 
> Removing is not an option as the PMDs rely on that flag to will have the
> impact.
> # I see DEV_TX_OFFLOAD_MBUF_FAST_FREE as hint driver to depict the application requirements
> # All the drivers by default can support DEV_TX_OFFLOAD_MBUF_FAST_FREE(They are using the hint or
> not is a different question)
> 
> So, How about setting DEV_TX_OFFLOAD_MBUF_FAST_FREE in all PMD driver as
> dummy one? I think, currently, it can be moved to old API to new API
> transition function till the drivers change to new offload flag scheme.

I don't think anyone plans to remove it right now.
If you believe your PMD does need it, that's ok by me.
Though I still think it is a very limited usage for it, and I don't think
we have to make that flag supported by all PMDs.
Konstantin

> 
> We are planning to change nicvf driver to new offload scheme for this
> release so with this change, we have the performance impact on l3fwd
> application.
> 
> I think, the other option could be to change usage/meaning of
> DEV_TX_OFFLOAD_MBUF_FAST_FREE flag where when the application needs
> multi-pool and reference count scheme then "it sets" the offload flags.
> If so, we don't need to set by default on the these applications.

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

* Re: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
  2017-12-13 12:10           ` Ananyev, Konstantin
@ 2017-12-13 17:32             ` Jerin Jacob
  2017-12-21 14:26               ` Shahaf Shuler
  0 siblings, 1 reply; 134+ messages in thread
From: Jerin Jacob @ 2017-12-13 17:32 UTC (permalink / raw)
  To: Ananyev, Konstantin; +Cc: Shahaf Shuler, dev, Nicolau, Radu, arybchenko

-----Original Message-----
> Date: Wed, 13 Dec 2017 12:10:26 +0000
> From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Shahaf Shuler
>  <shahafs@mellanox.com>
> CC: "dev@dpdk.org" <dev@dpdk.org>, "Nicolau, Radu"
>  <radu.nicolau@intel.com>, "arybchenko@solarflare.com"
>  <arybchenko@solarflare.com>
> Subject: RE: [dpdk-dev] [PATCH v2 05/39] examples/l3fwd: move to ethdev
>  offloads API
> 
> Hi Jerin,

Hi Konstantin,

> 
> > -----Original Message-----
> > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > Sent: Wednesday, December 13, 2017 7:55 AM
> > To: Shahaf Shuler <shahafs@mellanox.com>
> > Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; dev@dpdk.org; Nicolau, Radu <radu.nicolau@intel.com>;
> > arybchenko@solarflare.com
> > Subject: Re: [dpdk-dev] [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
> > 
> > -----Original Message-----
> > > Date: Wed, 13 Dec 2017 07:21:01 +0000
> > > From: Shahaf Shuler <shahafs@mellanox.com>
> > > To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>, "dev@dpdk.org"
> > >  <dev@dpdk.org>, "Nicolau, Radu" <radu.nicolau@intel.com>,
> > >  "arybchenko@solarflare.com" <arybchenko@solarflare.com>
> > > Subject: Re: [dpdk-dev] [PATCH v2 05/39] examples/l3fwd: move to ethdev
> > >  offloads API
> > >
> > > Tuesday, December 12, 2017 7:12 PM, Ananyev, Konstantin:
> > > > > -----Original Message-----
> > > > > From: Shahaf Shuler [mailto:shahafs@mellanox.com]
> > > > > Sent: Tuesday, December 12, 2017 12:26 PM
> > > > > To: dev@dpdk.org; Ananyev, Konstantin
> > > > <konstantin.ananyev@intel.com>;
> > > > > Nicolau, Radu <radu.nicolau@intel.com>; arybchenko@solarflare.com
> > > > > Subject: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
> > > > >
> > > > > Ethdev offloads API has changed since:
> > > > >
> > > > > commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> > > > > cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> > > > >
> > > > > This commit support the new API.
> > > > >
> > > > > Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> > > > > ---
> > > > >  examples/l3fwd/main.c | 40 ++++++++++++++++++++++++++++++--------
> > > > --
> > > > >  1 file changed, 30 insertions(+), 10 deletions(-)
> > > > >
> > > > > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index
> > > > > 6229568..3bdf4d5 100644
> > > > > --- a/examples/l3fwd/main.c
> > > > > +++ b/examples/l3fwd/main.c
> > > > > @@ -149,11 +149,9 @@ struct lcore_params {
> > > > >  		.mq_mode = ETH_MQ_RX_RSS,
> > > > >  		.max_rx_pkt_len = ETHER_MAX_LEN,
> > > > >  		.split_hdr_size = 0,
> > > > > -		.header_split   = 0, /**< Header Split disabled */
> > > > > -		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
> > > > > -		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
> > > > > -		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
> > > > > -		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
> > > > > +		.ignore_offload_bitfield = 1,
> > > > > +		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
> > > > > +			     DEV_RX_OFFLOAD_CHECKSUM),
> > > > >  	},
> > > > >  	.rx_adv_conf = {
> > > > >  		.rss_conf = {
> > > > > @@ -163,6 +161,7 @@ struct lcore_params {
> > > > >  	},
> > > > >  	.txmode = {
> > > > >  		.mq_mode = ETH_MQ_TX_NONE,
> > > > > +		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
> > > >
> > > > Hmm, does it mean a new warning for all PMDs (majority) which don't
> > > > support DEV_TX_OFFLOAD_MBUF_FAST_FREE?
> > >
> > > Good point.
> > > Unlike other offloads which are must for the application proper run, this one it only for optimizing the performance and should be set only
> > if PMD supports.
> > > Am continuing to aggregate reasons why the DEV_TX_OFFLOAD_MBUF_FAST_FREE should not be defined as an offload. Anyway we
> > passed that...
> > >
> > > I will fix on v3.
> > 
> > Removing is not an option as the PMDs rely on that flag to will have the
> > impact.
> > # I see DEV_TX_OFFLOAD_MBUF_FAST_FREE as hint driver to depict the application requirements
> > # All the drivers by default can support DEV_TX_OFFLOAD_MBUF_FAST_FREE(They are using the hint or
> > not is a different question)
> > 
> > So, How about setting DEV_TX_OFFLOAD_MBUF_FAST_FREE in all PMD driver as
> > dummy one? I think, currently, it can be moved to old API to new API
> > transition function till the drivers change to new offload flag scheme.
> 
> I don't think anyone plans to remove it right now.
> If you believe your PMD does need it, that's ok by me.

OK.

> Though I still think it is a very limited usage for it, and I don't think
> we have to make that flag supported by all PMDs.

OK. I just suggested because adding the flag in PMD is harmless and we can 
avoid an extra check(setting the DEV_TX_OFFLOAD_MBUF_FAST_FREE only
when PMD supports it) in application to hide warning as you pointed out.
No strong opinion on the specifics, I am just cared only reaching the flag to 
driver.



> Konstantin
> 
> > 
> > We are planning to change nicvf driver to new offload scheme for this
> > release so with this change, we have the performance impact on l3fwd
> > application.
> > 
> > I think, the other option could be to change usage/meaning of
> > DEV_TX_OFFLOAD_MBUF_FAST_FREE flag where when the application needs
> > multi-pool and reference count scheme then "it sets" the offload flags.
> > If so, we don't need to set by default on the these applications.

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

* Re: [PATCH v2 32/39] examples/eventdev_pipeline: convert to new offloads API
  2017-12-12 12:35   ` [PATCH v2 32/39] examples/eventdev_pipeline: convert to new " Shahaf Shuler
@ 2017-12-15 15:20     ` Van Haaren, Harry
  0 siblings, 0 replies; 134+ messages in thread
From: Van Haaren, Harry @ 2017-12-15 15:20 UTC (permalink / raw)
  To: Shahaf Shuler, dev, Ananyev, Konstantin, Nicolau, Radu, arybchenko

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 12, 2017 12:35 PM
> To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> Nicolau, Radu <radu.nicolau@intel.com>; arybchenko@solarflare.com
> Subject: [dpdk-dev] [PATCH v2 32/39] examples/eventdev_pipeline: convert to
> new offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>


I'm not familiar with the new offloads API, but with quick look seems fine;

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
  2017-12-12 12:26   ` [PATCH v2 05/39] examples/l3fwd: move to " Shahaf Shuler
  2017-12-12 17:12     ` Ananyev, Konstantin
@ 2017-12-18 16:00     ` Maciej Czekaj
  2017-12-21 14:08       ` Shahaf Shuler
  1 sibling, 1 reply; 134+ messages in thread
From: Maciej Czekaj @ 2017-12-18 16:00 UTC (permalink / raw)
  To: Shahaf Shuler, dev, konstantin.ananyev, radu.nicolau, arybchenko



-- Oryginal message --
> Ethdev offloads API has changed since:
>
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")
>
> This commit support the new API.
>
> Signed-off-by: Shahaf Shuler<shahafs@mellanox.com>
> ---
>   examples/l3fwd/main.c | 40 ++++++++++++++++++++++++++++++----------
>   1 file changed, 30 insertions(+), 10 deletions(-)
>
> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> index 6229568..3bdf4d5 100644
> --- a/examples/l3fwd/main.c
> +++ b/examples/l3fwd/main.c
> @@ -149,11 +149,9 @@ struct lcore_params {
>   		.mq_mode = ETH_MQ_RX_RSS,
>   		.max_rx_pkt_len = ETHER_MAX_LEN,
>   		.split_hdr_size = 0,
> -		.header_split   = 0, /**< Header Split disabled */
> -		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
> -		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
> -		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
> -		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
> +		.ignore_offload_bitfield = 1,
> +		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
> +			     DEV_RX_OFFLOAD_CHECKSUM),
>   	},
>   	.rx_adv_conf = {
>   		.rss_conf = {
> @@ -163,6 +161,7 @@ struct lcore_params {
>   	},
>   	.txmode = {
>   		.mq_mode = ETH_MQ_TX_NONE,
> +		.offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
>   	},
>   };
>   
> @@ -612,7 +611,8 @@ enum {
>   			};
>   
>   			printf("%s\n", str8);
> -			port_conf.rxmode.jumbo_frame = 1;
> +			port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
> +			port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS;
>   
>   			/*
>   			 * if no max-pkt-len set, use the default
> @@ -908,6 +908,22 @@ enum {
>   			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
>   		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
>   			nb_rx_queue, (unsigned)n_tx_queue );
> +
> +		rte_eth_dev_info_get(portid, &dev_info);
> +		if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=
> +		    port_conf.rxmode.offloads) {
> +			printf("Some Rx offloads are not supported "
> +			       "by port %d: requested 0x%lx supported 0x%lx\n",
> +			       portid, port_conf.rxmode.offloads,
> +			       dev_info.rx_offload_capa);
> +		}
> +		if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=
> +		    port_conf.txmode.offloads) {
> +			printf("Some Tx offloads are not supported "
> +			       "by port %d: requested 0x%lx supported 0x%lx\n",
> +			       portid, port_conf.txmode.offloads,
> +			       dev_info.tx_offload_capa);
> +		}

Looking at diff between v1 and v2, following lines are missing:

-                       port_conf.rxmode.offloads &= 
dev_info.rx_offload_capa;
-                       port_conf.txmode.offloads &= 
dev_info.tx_offload_capa;

I can see this change is consistent across all examples. Is it 
intentional to enforce the capabilities this way?
If so, why enforcing DEV_RX_OFFLOAD_CHECKSUM if the feature is not used 
by l3fwd code?
I.e. there is no reference to RX-side ol_flags so application can run 
without it.

In v1 the flag was optional which made sense for this particular case.


>   		ret = rte_eth_dev_configure(portid, nb_rx_queue,
>   					(uint16_t)n_tx_queue, &port_conf);
>   		if (ret < 0)
> @@ -955,10 +971,9 @@ enum {
>   			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
>   			fflush(stdout);
>   
> -			rte_eth_dev_info_get(portid, &dev_info);
>   			txconf = &dev_info.default_txconf;
> -			if (port_conf.rxmode.jumbo_frame)
> -				txconf->txq_flags = 0;
> +			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
> +			txconf->offloads = port_conf.txmode.offloads;
>   			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
>   						     socketid, txconf);
>   			if (ret < 0)
> @@ -984,6 +999,8 @@ enum {
>   		fflush(stdout);
>   		/* init RX queues */
>   		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
> +			struct rte_eth_rxconf rxq_conf;
> +
>   			portid = qconf->rx_queue_list[queue].port_id;
>   			queueid = qconf->rx_queue_list[queue].queue_id;
>   
> @@ -996,9 +1013,12 @@ enum {
>   			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
>   			fflush(stdout);
>   
> +			rte_eth_dev_info_get(portid, &dev_info);
> +			rxq_conf = dev_info.default_rxconf;
> +			rxq_conf.offloads = port_conf.rxmode.offloads;
>   			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
>   					socketid,
> -					NULL,
> +					&rxq_conf,
>   					pktmbuf_pool[socketid]);
>   			if (ret < 0)
>   				rte_exit(EXIT_FAILURE,

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

* Re: [PATCH v2 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-12-12 12:26   ` [PATCH v2 01/39] examples/l2fwd: convert " Shahaf Shuler
@ 2017-12-19 12:16     ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 134+ messages in thread
From: De Lara Guarch, Pablo @ 2017-12-19 12:16 UTC (permalink / raw)
  To: Shahaf Shuler, dev, Ananyev, Konstantin, Nicolau, Radu, arybchenko



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 12, 2017 12:26 PM
> To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> Nicolau, Radu <radu.nicolau@intel.com>; arybchenko@solarflare.com
> Subject: [dpdk-dev] [PATCH v2 01/39] examples/l2fwd: convert to new
> ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

When sending the pending v3 of this patchset, you can add my ack in this patch.

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

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

* Re: [PATCH v2 02/39] examples/l2fwd-crypto: convert to new ethdev offloads API
  2017-12-12 12:26   ` [PATCH v2 02/39] examples/l2fwd-crypto: " Shahaf Shuler
@ 2017-12-19 12:18     ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 134+ messages in thread
From: De Lara Guarch, Pablo @ 2017-12-19 12:18 UTC (permalink / raw)
  To: Shahaf Shuler, dev, Ananyev, Konstantin, Nicolau, Radu, arybchenko



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 12, 2017 12:26 PM
> To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> Nicolau, Radu <radu.nicolau@intel.com>; arybchenko@solarflare.com
> Subject: [dpdk-dev] [PATCH v2 02/39] examples/l2fwd-crypto: convert to
> new ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

When sending the pending v3 of this patchset, you can add my ack in this patch.

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

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

* Re: [PATCH v2 03/39] examples/l2fwd-jobstats: convert to new ethdev offloads API
  2017-12-12 12:26   ` [PATCH v2 03/39] examples/l2fwd-jobstats: " Shahaf Shuler
@ 2017-12-19 12:33     ` De Lara Guarch, Pablo
  2017-12-21 13:47       ` Shahaf Shuler
  0 siblings, 1 reply; 134+ messages in thread
From: De Lara Guarch, Pablo @ 2017-12-19 12:33 UTC (permalink / raw)
  To: Shahaf Shuler, dev, Ananyev, Konstantin, Nicolau, Radu, arybchenko



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 12, 2017 12:26 PM
> To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> Nicolau, Radu <radu.nicolau@intel.com>; arybchenko@solarflare.com
> Subject: [dpdk-dev] [PATCH v2 03/39] examples/l2fwd-jobstats: convert to
> new ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

Hi Shahaf,

There is a compilation error when building for 32-bit targets:

examples/l2fwd-jobstats/main.c:883:11: error: format '%lx' expects argument
of type 'long unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}'
[-Werror=format=]
    printf("Some Rx offloads are not supported "
           ^
examples/l2fwd-jobstats/main.c:883:11: error: format '%lx' expects argument
of type 'long unsigned int', but argument 4 has type 'uint64_t {aka long long unsigned int}'
[-Werror=format=]
examples/l2fwd-jobstats/main.c:890:11: error: format '%lx' expects argument
of type 'long unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}'
[-Werror=format=]
    printf("Some Tx offloads are not supported "
           ^
examples/l2fwd-jobstats/main.c:890:11: error: format '%lx' expects argument
of type 'long unsigned int', but argument 4 has type 'uint64_t {aka long long unsigned int}'
[-Werror=format=]

This happens on all the apps (I acked the first two apps, since I missed this issue when I was reviewing them).

Thanks,
Pablo

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

* Re: [PATCH v2 15/39] examples/ipsec-secgw: convert to new ethdev offloads API
  2017-12-12 12:26   ` [PATCH v2 15/39] examples/ipsec-secgw: " Shahaf Shuler
@ 2017-12-19 12:38     ` De Lara Guarch, Pablo
  2017-12-21 13:45       ` Shahaf Shuler
  0 siblings, 1 reply; 134+ messages in thread
From: De Lara Guarch, Pablo @ 2017-12-19 12:38 UTC (permalink / raw)
  To: Shahaf Shuler, dev, Ananyev, Konstantin, Nicolau, Radu, arybchenko



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 12, 2017 12:27 PM
> To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> Nicolau, Radu <radu.nicolau@intel.com>; arybchenko@solarflare.com
> Subject: [dpdk-dev] [PATCH v2 15/39] examples/ipsec-secgw: convert to
> new ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>  examples/ipsec-secgw/ipsec-secgw.c | 26 ++++++++++++++++++++++++--
>  1 file changed, 24 insertions(+), 2 deletions(-)
> 
> diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-
> secgw/ipsec-secgw.c
> index c98454a..1e8af8d 100644
> --- a/examples/ipsec-secgw/ipsec-secgw.c
> +++ b/examples/ipsec-secgw/ipsec-secgw.c
> @@ -217,6 +217,9 @@ struct lcore_conf {
>  	},
>  	.txmode = {
>  		.mq_mode = ETH_MQ_TX_NONE,
> +		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
> +			     DEV_TX_OFFLOAD_MULTI_SEGS |
> +			     DEV_TX_OFFLOAD_MBUF_FAST_FREE),

Hi Shahaf,

Isn't this removing some checksums that were previously done?
Txq_flags was set to 0, which means that SCTP, UDP... checksums
are disabled now?

Regards,
Pablo

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

* Re: [PATCH v2 15/39] examples/ipsec-secgw: convert to new ethdev offloads API
  2017-12-19 12:38     ` De Lara Guarch, Pablo
@ 2017-12-21 13:45       ` Shahaf Shuler
  2018-01-08 16:27         ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-21 13:45 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev, Ananyev, Konstantin, Nicolau, Radu,
	arybchenko

Hi Pablo and maintainers of ipsec-secgw,

Tuesday, December 19, 2017 2:39 PM, De Lara Guarch, Pablo
> > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-
> > secgw/ipsec-secgw.c index c98454a..1e8af8d 100644
> > --- a/examples/ipsec-secgw/ipsec-secgw.c
> > +++ b/examples/ipsec-secgw/ipsec-secgw.c
> > @@ -217,6 +217,9 @@ struct lcore_conf {
> >  	},
> >  	.txmode = {
> >  		.mq_mode = ETH_MQ_TX_NONE,
> > +		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
> > +			     DEV_TX_OFFLOAD_MULTI_SEGS |
> > +			     DEV_TX_OFFLOAD_MBUF_FAST_FREE),
> 
> Hi Shahaf,
> 
> Isn't this removing some checksums that were previously done?
> Txq_flags was set to 0, which means that SCTP, UDP... checksums are
> disabled now?

You are right that before txqflags were 0, but it doesn't seem the application uses any Tx checksum offload beside IPv4, as seen on snipped code[1].
If I was mistaken and it does uses L4 checksums then I will need to update this commit. 

Maintainers of this examples - can you confirm?

[1]
static inline void                                                           
prepare_tx_pkt(struct rte_mbuf *pkt, uint16_t port)                          
{                                                                            
        struct ip *ip;                                                       
        struct ether_hdr *ethhdr;                                            
                                                                             
        ip = rte_pktmbuf_mtod(pkt, struct ip *);                             
                                                                             
        ethhdr = (struct ether_hdr *)rte_pktmbuf_prepend(pkt, ETHER_HDR_LEN);
                                                                             
        if (ip->ip_v == IPVERSION) {                                         
                pkt->ol_flags |= PKT_TX_IP_CKSUM | PKT_TX_IPV4;              
                pkt->l3_len = sizeof(struct ip);                             
                pkt->l2_len = ETHER_HDR_LEN;                                 
                                                                             
                ethhdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);      
        } else {                                                             
                pkt->ol_flags |= PKT_TX_IPV6;                                
                pkt->l3_len = sizeof(struct ip6_hdr);                        
                pkt->l2_len = ETHER_HDR_LEN;                                 
                                                                             
                ethhdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);      
        }                                                                    
                                                                             
        memcpy(&ethhdr->s_addr, &ethaddr_tbl[port].src,                      
                        sizeof(struct ether_addr));                          
        memcpy(&ethhdr->d_addr, &ethaddr_tbl[port].dst,                      
                        sizeof(struct ether_addr));                          
}                                                                            

> 
> Regards,
> Pablo
> 

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

* Re: [PATCH v2 03/39] examples/l2fwd-jobstats: convert to new ethdev offloads API
  2017-12-19 12:33     ` De Lara Guarch, Pablo
@ 2017-12-21 13:47       ` Shahaf Shuler
  0 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-21 13:47 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev, Ananyev, Konstantin, Nicolau, Radu,
	arybchenko

Tuesday, December 19, 2017 2:33 PM, De Lara Guarch, Pablo:
> 
> There is a compilation error when building for 32-bit targets:
> 
> examples/l2fwd-jobstats/main.c:883:11: error: format '%lx' expects
> argument of type 'long unsigned int', but argument 3 has type 'uint64_t {aka
> long long unsigned int}'
> [-Werror=format=]
>     printf("Some Rx offloads are not supported "
>            ^
> examples/l2fwd-jobstats/main.c:883:11: error: format '%lx' expects
> argument of type 'long unsigned int', but argument 4 has type 'uint64_t {aka
> long long unsigned int}'
> [-Werror=format=]
> examples/l2fwd-jobstats/main.c:890:11: error: format '%lx' expects
> argument of type 'long unsigned int', but argument 3 has type 'uint64_t {aka
> long long unsigned int}'
> [-Werror=format=]
>     printf("Some Tx offloads are not supported "
>            ^
> examples/l2fwd-jobstats/main.c:890:11: error: format '%lx' expects
> argument of type 'long unsigned int', but argument 4 has type 'uint64_t {aka
> long long unsigned int}'
> [-Werror=format=]
> 
> This happens on all the apps (I acked the first two apps, since I missed this
> issue when I was reviewing them).

Thanks, will take care. 
In fact am thinking of removing those prints, they don't seems necessary. The PMD can print error/warn log in case of bad offloads configuration. 

> 
> Thanks,
> Pablo

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

* Re: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
  2017-12-18 16:00     ` Maciej Czekaj
@ 2017-12-21 14:08       ` Shahaf Shuler
  0 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-21 14:08 UTC (permalink / raw)
  To: Maciej Czekaj, dev, konstantin.ananyev, radu.nicolau, arybchenko,
	tomasz.kantecki

>Looking at diff between v1 and v2, following lines are missing:
>
>-                       port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
>-                       port_conf.txmode.offloads &= dev_info.tx_offload_capa;
>
>I can see this change is consistent across all examples. Is it intentional to enforce the capabilities this way?

Yes it was intentional.

The reason is that application is relying on its offloads to be set. So any offloads set by the application must reach the PMD, otherwise application won’t work correctly.
For example – if application needs Rx checksum, and it is silently masked (by v1 of this series) then it will wrongly assume all checksums are bad.
This is true almost to every offloads. One is exceptional - DEV_TX_OFFLOAD_MBUF_FAST_FREE. Application *can* work without it, as it is only a performance optimization for the mbuf free.

>If so, why enforcing DEV_RX_OFFLOAD_CHECKSUM if the feature is not used by l3fwd code?
>I.e. there is no reference to RX-side ol_flags so application can run without it.

You are right.
When I worked on this code I used the DEV_RX_OFFLOAD_CHECKSUM offloads because also the original example enabled it (hw_ip_checksum = 1)

Adding Thomas the maintainer to confirm.
If it doesn’t use , then we can safely remove this offload.

>
>In v1 the flag was optional which made sense for this particular case.


--Shahaf

From: Maciej Czekaj [mailto:mjc@semihalf.com]
Sent: Monday, December 18, 2017 6:00 PM
To: Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org; konstantin.ananyev@intel.com; radu.nicolau@intel.com; arybchenko@solarflare.com
Subject: Re: [dpdk-dev] [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API



-- Oryginal message --

Ethdev offloads API has changed since:



commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")

commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")



This commit support the new API.



Signed-off-by: Shahaf Shuler <shahafs@mellanox.com><mailto:shahafs@mellanox.com>

---

 examples/l3fwd/main.c | 40 ++++++++++++++++++++++++++++++----------

 1 file changed, 30 insertions(+), 10 deletions(-)



diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c

index 6229568..3bdf4d5 100644

--- a/examples/l3fwd/main.c

+++ b/examples/l3fwd/main.c

@@ -149,11 +149,9 @@ struct lcore_params {

                .mq_mode = ETH_MQ_RX_RSS,

                .max_rx_pkt_len = ETHER_MAX_LEN,

                .split_hdr_size = 0,

-               .header_split   = 0, /**< Header Split disabled */

-               .hw_ip_checksum = 1, /**< IP checksum offload enabled */

-               .hw_vlan_filter = 0, /**< VLAN filtering disabled */

-               .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */

-               .hw_strip_crc   = 1, /**< CRC stripped by hardware */

+               .ignore_offload_bitfield = 1,

+               .offloads = (DEV_RX_OFFLOAD_CRC_STRIP |

+                            DEV_RX_OFFLOAD_CHECKSUM),

        },

        .rx_adv_conf = {

                .rss_conf = {

@@ -163,6 +161,7 @@ struct lcore_params {

        },

        .txmode = {

                .mq_mode = ETH_MQ_TX_NONE,

+               .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,

        },

 };



@@ -612,7 +611,8 @@ enum {

                        };



                        printf("%s\n", str8);

-                       port_conf.rxmode.jumbo_frame = 1;

+                       port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;

+                       port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS;



                        /*

                         * if no max-pkt-len set, use the default

@@ -908,6 +908,22 @@ enum {

                        n_tx_queue = MAX_TX_QUEUE_PER_PORT;

                printf("Creating queues: nb_rxq=%d nb_txq=%u... ",

                        nb_rx_queue, (unsigned)n_tx_queue );

+

+               rte_eth_dev_info_get(portid, &dev_info);

+               if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) !=

+                   port_conf.rxmode.offloads) {

+                       printf("Some Rx offloads are not supported "

+                              "by port %d: requested 0x%lx supported 0x%lx\n",

+                              portid, port_conf.rxmode.offloads,

+                              dev_info.rx_offload_capa);

+               }

+               if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) !=

+                   port_conf.txmode.offloads) {

+                       printf("Some Tx offloads are not supported "

+                              "by port %d: requested 0x%lx supported 0x%lx\n",

+                              portid, port_conf.txmode.offloads,

+                              dev_info.tx_offload_capa);

+               }

Looking at diff between v1 and v2, following lines are missing:

-                       port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
-                       port_conf.txmode.offloads &= dev_info.tx_offload_capa;

I can see this change is consistent across all examples. Is it intentional to enforce the capabilities this way?
If so, why enforcing DEV_RX_OFFLOAD_CHECKSUM if the feature is not used by l3fwd code?
I.e. there is no reference to RX-side ol_flags so application can run without it.

In v1 the flag was optional which made sense for this particular case.




                ret = rte_eth_dev_configure(portid, nb_rx_queue,

                                       (uint16_t)n_tx_queue, &port_conf);

                if (ret < 0)

@@ -955,10 +971,9 @@ enum {

                        printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);

                        fflush(stdout);



-                       rte_eth_dev_info_get(portid, &dev_info);

                        txconf = &dev_info.default_txconf;

-                       if (port_conf.rxmode.jumbo_frame)

-                              txconf->txq_flags = 0;

+                       txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;

+                       txconf->offloads = port_conf.txmode.offloads;

                        ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,

                                                    socketid, txconf);

                        if (ret < 0)

@@ -984,6 +999,8 @@ enum {

                fflush(stdout);

                /* init RX queues */

                for(queue = 0; queue < qconf->n_rx_queue; ++queue) {

+                       struct rte_eth_rxconf rxq_conf;

+

                        portid = qconf->rx_queue_list[queue].port_id;

                        queueid = qconf->rx_queue_list[queue].queue_id;



@@ -996,9 +1013,12 @@ enum {

                        printf("rxq=%d,%d,%d ", portid, queueid, socketid);

                        fflush(stdout);



+                       rte_eth_dev_info_get(portid, &dev_info);

+                       rxq_conf = dev_info.default_rxconf;

+                       rxq_conf.offloads = port_conf.rxmode.offloads;

                        ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,

                                       socketid,

-                                      NULL,

+                                      &rxq_conf,

                                       pktmbuf_pool[socketid]);

                        if (ret < 0)

                               rte_exit(EXIT_FAILURE,


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

* Re: [PATCH v2 05/39] examples/l3fwd: move to ethdev offloads API
  2017-12-13 17:32             ` Jerin Jacob
@ 2017-12-21 14:26               ` Shahaf Shuler
  0 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-21 14:26 UTC (permalink / raw)
  To: Jerin Jacob, Ananyev, Konstantin; +Cc: dev, Nicolau, Radu, arybchenko

Wednesday, December 13, 2017 7:32 PM, Jerin Jacob:
> 
> OK. I just suggested because adding the flag in PMD is harmless and we can
> avoid an extra check(setting the DEV_TX_OFFLOAD_MBUF_FAST_FREE only
> when PMD supports it) in application to hide warning as you pointed out.
> No strong opinion on the specifics, I am just cared only reaching the flag to
> driver.

Following some other comments from different examples I believe the way to go is the following: 
1. application will set the offloads it *must have* in order to properly function. PMD will fail the configuration if not supported. Such kind of offloads are basically all the offloads besides 
DEV_TX_OFFLOAD_MBUF_FAST_FREE as it is an optimization. 
2. application will set optional features only if supported (such as DEV_TX_OFFLOAD_MBUF_FAST_FREE)
3. I will remove the redundant print for offloads set but not supported. This can be done in the PMD level based on its implemented (as I understood some PMDs don't set some offloads but do expect to have them enabled. This though should be fixed IMO). 
> 
> 

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

* [PATCH v3 00/39] convert examples to new ethdev offloads API
  2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
                     ` (38 preceding siblings ...)
  2017-12-12 12:35   ` [PATCH v2 39/39] examples/skeleton: " Shahaf Shuler
@ 2017-12-26  9:22   ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 01/39] examples/l2fwd: convert " Shahaf Shuler
                       ` (39 more replies)
  39 siblings, 40 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:22 UTC (permalink / raw)
  To: dev

This series is to convert DPDK examples to the new offloads API [1].

on v3:
 - Set DEV_TX_OFFLOAD_MBUF_FAST_FREE only if device supports.
 - Remove error prints from application.
 - Fix configuration of mutiple ports without override the global port config.

on v2:
 - Add DEV_TX_OFFLOAD_MBUF_FAST_FREE offload of entitled examples.
 - Instead of masking the un-supported offloads print a warning and let
   the PMD to fail the configuration.

[1] http://dpdk.org/ml/archives/dev/2017-October/077329.html

Shahaf Shuler (39):
  examples/l2fwd: convert to new ethdev offloads API
  examples/l2fwd-crypto: convert to new ethdev offloads API
  examples/l2fwd-jobstats: convert to new ethdev offloads API
  examples/l2fwd-keepalive: convert to new ethdev offloads API
  examples/l3fwd: convert to ethdev offloads API
  examples/l3fwd-acl: convert to new ethdev offloads API
  examples/l3fwd-power: convert to new ethdev offloads API
  examples/l3fwd-vf: convert to new ethdev offloads API
  examples/bond: convert to new ethdev offloads API
  examples/exception_path: convert to new ethdev offloads API
  examples/kni: convert to new ethdev offloads API
  examples/ip_fragmentation: convert to new offloads API
  examples/ip_pipeline: convert to new ethdev offloads API
  examples/ip_reassembly: convert to new ethdev offloads API
  examples/ipsec-secgw: convert to new ethdev offloads API
  examples/ipv4_multicast: convert to new ethdev offloads API
  examples/link_status_interrupt: convert to new offloads API
  examples/load_balancer: convert to new ethdev offloads API
  examples/multi_process: convert to new ethdev offloads API
  examples/netmap_compat: convert to new ethdev offloads API
  examples/performance-thread: convert to new offloads API
  examples/qos_meter: convert to new ethdev offloads API
  examples/qos_sched: convert to new ethdev offloads API
  examples/quota_watermark: convert to new ethdev offloads API
  examples/tep_termination: convert to new ethdev offloads API
  examples/vhost: convert to new ethdev offloads API
  examples/vmdq: convert to new ethdev offloads API
  examples/vmdq_dcb: convert to new ethdev offloads API
  examples/vm_power_manager: convert to new offloads API
  examples/distributor: convert to new ethdev offloads API
  examples/ethtool: convert to new ethdev offloads API
  examples/eventdev_pipeline: convert to new offloads API
  examples/flow_classify: convert to new ethdev offloads API
  examples/flow_filtering: convert to new ethdev offloads API
  examples/packet_ordering: convert to new ethdev offloads API
  examples/ptpclient: convert to new ethdev offloads API
  examples/rxtx_callbacks: convert to new ethdev offloads API
  examples/server_node_efd: convert to new ethdev offloads API
  examples/skeleton: convert to new ethdev offloads API

 examples/bond/main.c                            | 48 ++++++++++++++-----
 examples/distributor/main.c                     | 13 ++++-
 examples/ethtool/ethtool-app/main.c             |  7 ++-
 examples/eventdev_pipeline_sw_pmd/main.c        | 15 +++++-
 examples/exception_path/main.c                  | 28 +++++++----
 examples/flow_classify/flow_classify.c          | 17 ++++++-
 examples/flow_filtering/main.c                  | 19 ++++----
 examples/ip_fragmentation/main.c                | 31 ++++++++----
 examples/ip_pipeline/config_parse.c             | 13 ++---
 examples/ip_pipeline/init.c                     | 15 ++++--
 examples/ip_reassembly/main.c                   | 31 ++++++++----
 examples/ipsec-secgw/ipsec-secgw.c              | 26 ++++++----
 examples/ipv4_multicast/main.c                  | 27 +++++++----
 examples/kni/main.c                             | 50 ++++++++++++++++----
 examples/l2fwd-crypto/main.c                    | 28 +++++++----
 examples/l2fwd-jobstats/main.c                  | 29 ++++++++----
 examples/l2fwd-keepalive/main.c                 | 29 ++++++++----
 examples/l2fwd/main.c                           | 28 +++++++----
 examples/l3fwd-acl/main.c                       | 36 ++++++++++----
 examples/l3fwd-power/main.c                     | 42 ++++++++++------
 examples/l3fwd-vf/main.c                        | 35 ++++++++++----
 examples/l3fwd/main.c                           | 36 +++++++++-----
 examples/link_status_interrupt/main.c           | 28 +++++++----
 examples/load_balancer/init.c                   | 27 +++++++----
 examples/multi_process/l2fwd_fork/main.c        | 26 ++++++----
 examples/multi_process/symmetric_mp/main.c      | 22 ++++++---
 examples/netmap_compat/bridge/bridge.c          |  7 +--
 examples/netmap_compat/lib/compat_netmap.c      | 16 ++++++-
 examples/packet_ordering/main.c                 | 18 ++++++-
 examples/performance-thread/l3fwd-thread/main.c | 37 ++++++++++-----
 examples/ptpclient/ptpclient.c                  | 14 ++++--
 examples/qos_meter/main.c                       | 38 +++++++++++----
 examples/qos_sched/init.c                       | 21 ++++----
 examples/quota_watermark/qw/init.c              | 28 +++++++----
 examples/rxtx_callbacks/main.c                  | 17 ++++++-
 examples/server_node_efd/server/init.c          | 19 ++++++--
 examples/skeleton/basicfwd.c                    | 17 ++++++-
 examples/tep_termination/vxlan_setup.c          | 29 ++++++++----
 examples/vhost/main.c                           | 29 +++++++-----
 examples/vm_power_manager/main.c                | 17 ++++++-
 examples/vmdq/main.c                            | 17 ++++---
 examples/vmdq_dcb/main.c                        | 15 ++++--
 42 files changed, 741 insertions(+), 304 deletions(-)

-- 
2.12.0

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

* [PATCH v3 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2018-01-10 12:12       ` De Lara Guarch, Pablo
  2018-01-12 13:30       ` Ferruh Yigit
  2017-12-26  9:23     ` [PATCH v3 02/39] examples/l2fwd-crypto: " Shahaf Shuler
                       ` (38 subsequent siblings)
  39 siblings, 2 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd/main.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index e89e2e1bf..4436ea587 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -110,14 +110,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
 static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -649,6 +646,10 @@ main(int argc, char **argv)
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", portid);
@@ -658,7 +659,11 @@ main(int argc, char **argv)
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+		ret = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
 				  ret, portid);
@@ -674,9 +679,11 @@ main(int argc, char **argv)
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = local_port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     l2fwd_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
@@ -684,9 +691,12 @@ main(int argc, char **argv)
 
 		/* init one TX queue on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = local_port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n",
 				ret, portid);
-- 
2.12.0

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

* [PATCH v3 02/39] examples/l2fwd-crypto: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 01/39] examples/l2fwd: convert " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2018-01-10 12:12       ` De Lara Guarch, Pablo
  2017-12-26  9:23     ` [PATCH v3 03/39] examples/l2fwd-jobstats: " Shahaf Shuler
                       ` (37 subsequent siblings)
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd-crypto/main.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index d4e1682c8..06c805b87 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -235,16 +235,13 @@ struct lcore_queue_conf {
 
 struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.mq_mode = ETH_MQ_RX_NONE,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -2356,6 +2353,10 @@ initialize_ports(struct l2fwd_crypto_options *options)
 
 	for (last_portid = 0, portid = 0; portid < nb_ports; portid++) {
 		int retval;
+		struct rte_eth_dev_info dev_info;
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+		struct rte_eth_conf local_port_conf = port_conf;
 
 		/* Skip ports that are not enabled */
 		if ((options->portmask & (1 << portid)) == 0)
@@ -2364,7 +2365,11 @@ initialize_ports(struct l2fwd_crypto_options *options)
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		retval = rte_eth_dev_configure(portid, 1, 1, &port_conf);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+		retval = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
 		if (retval < 0) {
 			printf("Cannot configure device: err=%d, port=%u\n",
 				  retval, portid);
@@ -2381,9 +2386,11 @@ initialize_ports(struct l2fwd_crypto_options *options)
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = local_port_conf.rxmode.offloads;
 		retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL, l2fwd_pktmbuf_pool);
+					     &rxq_conf, l2fwd_pktmbuf_pool);
 		if (retval < 0) {
 			printf("rte_eth_rx_queue_setup:err=%d, port=%u\n",
 					retval, portid);
@@ -2392,9 +2399,12 @@ initialize_ports(struct l2fwd_crypto_options *options)
 
 		/* init one TX queue on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = local_port_conf.txmode.offloads;
 		retval = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (retval < 0) {
 			printf("rte_eth_tx_queue_setup:err=%d, port=%u\n",
 				retval, portid);
-- 
2.12.0

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

* [PATCH v3 03/39] examples/l2fwd-jobstats: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 01/39] examples/l2fwd: convert " Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 02/39] examples/l2fwd-crypto: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2018-01-10 12:13       ` De Lara Guarch, Pablo
  2017-12-26  9:23     ` [PATCH v3 04/39] examples/l2fwd-keepalive: " Shahaf Shuler
                       ` (36 subsequent siblings)
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd-jobstats/main.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 485370de6..a5ba86be7 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -116,14 +116,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
 struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -866,6 +863,11 @@ main(int argc, char **argv)
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_dev_info dev_info;
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", portid);
@@ -875,7 +877,11 @@ main(int argc, char **argv)
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+		ret = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
 				  ret, portid);
@@ -891,19 +897,24 @@ main(int argc, char **argv)
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = local_port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     l2fwd_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
 				  ret, portid);
 
 		/* init one TX queue on each port */
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = local_port_conf.txmode.offloads;
 		fflush(stdout);
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 			"rte_eth_tx_queue_setup:err=%d, port=%u\n",
-- 
2.12.0

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

* [PATCH v3 04/39] examples/l2fwd-keepalive: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (2 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 03/39] examples/l2fwd-jobstats: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 05/39] examples/l3fwd: convert to " Shahaf Shuler
                       ` (35 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l2fwd-keepalive/main.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 358ca5ec7..6decbd994 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -107,14 +107,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
 struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -658,6 +655,11 @@ main(int argc, char **argv)
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_dev_info dev_info;
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", portid);
@@ -667,7 +669,11 @@ main(int argc, char **argv)
 		/* init port */
 		printf("Initializing port %u... ", portid);
 		fflush(stdout);
-		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+		ret = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 				"Cannot configure device: err=%d, port=%u\n",
@@ -684,9 +690,11 @@ main(int argc, char **argv)
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = local_port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     l2fwd_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
@@ -695,9 +703,12 @@ main(int argc, char **argv)
 
 		/* init one TX queue on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = local_port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 				"rte_eth_tx_queue_setup:err=%d, port=%u\n",
-- 
2.12.0

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

* [PATCH v3 05/39] examples/l3fwd: convert to ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (3 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 04/39] examples/l2fwd-keepalive: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 06/39] examples/l3fwd-acl: convert to new " Shahaf Shuler
                       ` (34 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l3fwd/main.c | 36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 6229568f2..b55979eda 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -149,11 +149,9 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -612,7 +610,8 @@ parse_args(int argc, char **argv)
 			};
 
 			printf("%s\n", str8);
-			port_conf.rxmode.jumbo_frame = 1;
+			port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+			port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS;
 
 			/*
 			 * if no max-pkt-len set, use the default
@@ -892,6 +891,8 @@ main(int argc, char **argv)
 
 	/* initialize all ports */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			printf("\nSkipping disabled port %d\n", portid);
@@ -908,8 +909,13 @@ main(int argc, char **argv)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue );
+
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
-					(uint16_t)n_tx_queue, &port_conf);
+					(uint16_t)n_tx_queue, &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 				"Cannot configure device: err=%d, port=%d\n",
@@ -955,10 +961,9 @@ main(int argc, char **argv)
 			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
-			if (port_conf.rxmode.jumbo_frame)
-				txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = local_port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socketid, txconf);
 			if (ret < 0)
@@ -984,8 +989,14 @@ main(int argc, char **argv)
 		fflush(stdout);
 		/* init RX queues */
 		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+			struct rte_eth_dev *dev;
+			struct rte_eth_conf *conf;
+			struct rte_eth_rxconf rxq_conf;
+
 			portid = qconf->rx_queue_list[queue].port_id;
 			queueid = qconf->rx_queue_list[queue].queue_id;
+			dev = &rte_eth_devices[portid];
+			conf = &dev->data->dev_conf;
 
 			if (numa_on)
 				socketid =
@@ -996,9 +1007,12 @@ main(int argc, char **argv)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = conf->rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
 					socketid,
-					NULL,
+					&rxq_conf,
 					pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE,
-- 
2.12.0

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

* [PATCH v3 06/39] examples/l3fwd-acl: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (4 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 05/39] examples/l3fwd: convert to " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 07/39] examples/l3fwd-power: " Shahaf Shuler
                       ` (33 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 examples/l3fwd-acl/main.c | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index e50b1a1a8..f253a63ee 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -156,11 +156,9 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode	= ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -1727,7 +1725,10 @@ parse_args(int argc, char **argv)
 				};
 
 				printf("jumbo frame is enabled\n");
-				port_conf.rxmode.jumbo_frame = 1;
+				port_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_JUMBO_FRAME;
+				port_conf.txmode.offloads |=
+						DEV_TX_OFFLOAD_MULTI_SEGS;
 
 				/*
 				 * if no max-pkt-len set, then use the
@@ -1932,6 +1933,8 @@ main(int argc, char **argv)
 
 	/* initialize all ports */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			printf("\nSkipping disabled port %d\n", portid);
@@ -1948,8 +1951,12 @@ main(int argc, char **argv)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
-					(uint16_t)n_tx_queue, &port_conf);
+					(uint16_t)n_tx_queue, &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
 				"Cannot configure device: err=%d, port=%d\n",
@@ -2004,8 +2011,8 @@ main(int argc, char **argv)
 
 			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
-			if (port_conf.rxmode.jumbo_frame)
-				txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = local_port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socketid, txconf);
 			if (ret < 0)
@@ -2031,8 +2038,14 @@ main(int argc, char **argv)
 		fflush(stdout);
 		/* init RX queues */
 		for (queue = 0; queue < qconf->n_rx_queue; ++queue) {
+			struct rte_eth_dev *dev;
+			struct rte_eth_conf *conf;
+			struct rte_eth_rxconf rxq_conf;
+
 			portid = qconf->rx_queue_list[queue].port_id;
 			queueid = qconf->rx_queue_list[queue].queue_id;
+			dev = &rte_eth_devices[portid];
+			conf = &dev->data->dev_conf;
 
 			if (numa_on)
 				socketid = (uint8_t)
@@ -2043,8 +2056,11 @@ main(int argc, char **argv)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = conf->rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-					socketid, NULL,
+					socketid, &rxq_conf,
 					pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE,
-- 
2.12.0

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

* [PATCH v3 07/39] examples/l3fwd-power: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (5 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 06/39] examples/l3fwd-acl: convert to new " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 08/39] examples/l3fwd-vf: " Shahaf Shuler
                       ` (32 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: David Hunt <david.hunt@intel.com>
---
 examples/l3fwd-power/main.c | 42 ++++++++++++++++++++++++++--------------
 1 file changed, 27 insertions(+), 15 deletions(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 0a4ed145c..bd10bdacf 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -215,11 +215,9 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode        = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -1317,7 +1315,10 @@ parse_args(int argc, char **argv)
 									0, 0};
 
 				printf("jumbo frame is enabled \n");
-				port_conf.rxmode.jumbo_frame = 1;
+				port_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_JUMBO_FRAME;
+				port_conf.txmode.offloads |=
+						DEV_TX_OFFLOAD_MULTI_SEGS;
 
 				/**
 				 * if no max-pkt-len set, use the default value
@@ -1654,7 +1655,6 @@ main(int argc, char **argv)
 	uint32_t dev_rxq_num, dev_txq_num;
 	uint8_t nb_rx_queue, queue, socketid;
 	uint16_t portid;
-	uint16_t org_rxq_intr = port_conf.intr_conf.rxq;
 
 	/* catch SIGINT and restore cpufreq governor to ondemand */
 	signal(SIGINT, signal_exit_now);
@@ -1690,6 +1690,8 @@ main(int argc, char **argv)
 
 	/* initialize all ports */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			printf("\nSkipping disabled port %d\n", portid);
@@ -1717,11 +1719,13 @@ main(int argc, char **argv)
 			nb_rx_queue, (unsigned)n_tx_queue );
 		/* If number of Rx queue is 0, no need to enable Rx interrupt */
 		if (nb_rx_queue == 0)
-			port_conf.intr_conf.rxq = 0;
+			local_port_conf.intr_conf.rxq = 0;
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
-					(uint16_t)n_tx_queue, &port_conf);
-		/* Revert to original value */
-		port_conf.intr_conf.rxq = org_rxq_intr;
+					(uint16_t)n_tx_queue, &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: "
 					"err=%d, port=%d\n", ret, portid);
@@ -1776,10 +1780,9 @@ main(int argc, char **argv)
 			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
-			if (port_conf.rxmode.jumbo_frame)
-				txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = local_port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socketid, txconf);
 			if (ret < 0)
@@ -1819,8 +1822,14 @@ main(int argc, char **argv)
 		fflush(stdout);
 		/* init RX queues */
 		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+			struct rte_eth_rxconf rxq_conf;
+			struct rte_eth_dev *dev;
+			struct rte_eth_conf *conf;
+
 			portid = qconf->rx_queue_list[queue].port_id;
 			queueid = qconf->rx_queue_list[queue].queue_id;
+			dev = &rte_eth_devices[portid];
+			conf = &dev->data->dev_conf;
 
 			if (numa_on)
 				socketid = \
@@ -1831,8 +1840,11 @@ main(int argc, char **argv)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = conf->rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-				socketid, NULL,
+				socketid, &rxq_conf,
 				pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE,
-- 
2.12.0

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

* [PATCH v3 08/39] examples/l3fwd-vf: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (6 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 07/39] examples/l3fwd-power: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 09/39] examples/bond: " Shahaf Shuler
                       ` (31 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/l3fwd-vf/main.c | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 6ef89fc8c..a986c3b11 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -190,11 +190,9 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode	= ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_CHECKSUM),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -990,6 +988,8 @@ main(int argc, char **argv)
 
 	/* initialize all ports */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			printf("\nSkipping disabled port %d\n", portid);
@@ -1006,7 +1006,13 @@ main(int argc, char **argv)
 
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)1 );
-		ret = rte_eth_dev_configure(portid, nb_rx_queue, n_tx_queue, &port_conf);
+
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+		ret = rte_eth_dev_configure(portid, nb_rx_queue,
+					    n_tx_queue, &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%d\n",
 				ret, portid);
@@ -1032,10 +1038,9 @@ main(int argc, char **argv)
 		printf("txq=%d,%d,%d ", portid, 0, socketid);
 		fflush(stdout);
 
-		rte_eth_dev_info_get(portid, &dev_info);
 		txconf = &dev_info.default_txconf;
-		if (port_conf.rxmode.jumbo_frame)
-			txconf->txq_flags = 0;
+		txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txconf->offloads = local_port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 						 socketid, txconf);
 		if (ret < 0)
@@ -1046,6 +1051,8 @@ main(int argc, char **argv)
 	}
 
 	for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
+		struct rte_eth_rxconf rxq_conf;
+
 		if (rte_lcore_is_enabled(lcore_id) == 0)
 			continue;
 		qconf = &lcore_conf[lcore_id];
@@ -1055,8 +1062,13 @@ main(int argc, char **argv)
 		fflush(stdout);
 		/* init RX queues */
 		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+			struct rte_eth_dev *dev;
+			struct rte_eth_conf *conf;
+
 			portid = qconf->rx_queue_list[queue].port_id;
 			queueid = qconf->rx_queue_list[queue].queue_id;
+			dev = &rte_eth_devices[portid];
+			conf = &dev->data->dev_conf;
 
 			if (numa_on)
 				socketid = (uint8_t)rte_lcore_to_socket_id(lcore_id);
@@ -1066,8 +1078,11 @@ main(int argc, char **argv)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = conf->rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
-						socketid, NULL,
+						socketid, &rxq_conf,
 						pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d,"
-- 
2.12.0

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

* [PATCH v3 09/39] examples/bond: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (7 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 08/39] examples/l3fwd-vf: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 10/39] examples/exception_path: " Shahaf Shuler
                       ` (30 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Reviewed-by: Radu Nicolau <radu.nicolau@intel.com>
---
 examples/bond/main.c | 48 +++++++++++++++++++++++++++++++++++------------
 1 file changed, 36 insertions(+), 12 deletions(-)

diff --git a/examples/bond/main.c b/examples/bond/main.c
index 8e3b1f340..68dd53856 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -151,11 +151,8 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode = ETH_MQ_RX_NONE,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -174,11 +171,19 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 	int retval;
 	uint16_t nb_rxd = RTE_RX_DESC_DEFAULT;
 	uint16_t nb_txd = RTE_TX_DESC_DEFAULT;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
+	struct rte_eth_conf local_port_conf = port_conf;
 
 	if (portid >= rte_eth_dev_count())
 		rte_exit(EXIT_FAILURE, "Invalid port\n");
 
-	retval = rte_eth_dev_configure(portid, 1, 1, &port_conf);
+	rte_eth_dev_info_get(portid, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		local_port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	retval = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
 	if (retval != 0)
 		rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n",
 				portid, retval);
@@ -189,16 +194,22 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 				"failed (res=%d)\n", portid, retval);
 
 	/* RX setup */
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = local_port_conf.rxmode.offloads;
 	retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
-					rte_eth_dev_socket_id(portid), NULL,
+					rte_eth_dev_socket_id(portid),
+					&rxq_conf,
 					mbuf_pool);
 	if (retval < 0)
 		rte_exit(retval, " port %u: RX queue 0 setup failed (res=%d)",
 				portid, retval);
 
 	/* TX setup */
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = local_port_conf.txmode.offloads;
 	retval = rte_eth_tx_queue_setup(portid, 0, nb_txd,
-				rte_eth_dev_socket_id(portid), NULL);
+				rte_eth_dev_socket_id(portid), &txq_conf);
 
 	if (retval < 0)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
@@ -225,6 +236,10 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 	uint8_t i;
 	uint16_t nb_rxd = RTE_RX_DESC_DEFAULT;
 	uint16_t nb_txd = RTE_TX_DESC_DEFAULT;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
+	struct rte_eth_conf local_port_conf = port_conf;
 
 	retval = rte_eth_bond_create("bond0", BONDING_MODE_ALB,
 			0 /*SOCKET_ID_ANY*/);
@@ -234,7 +249,11 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 
 	BOND_PORT = retval;
 
-	retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf);
+	rte_eth_dev_info_get(BOND_PORT, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		local_port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &local_port_conf);
 	if (retval != 0)
 		rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n",
 				BOND_PORT, retval);
@@ -245,16 +264,21 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 				"failed (res=%d)\n", BOND_PORT, retval);
 
 	/* RX setup */
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = local_port_conf.rxmode.offloads;
 	retval = rte_eth_rx_queue_setup(BOND_PORT, 0, nb_rxd,
-					rte_eth_dev_socket_id(BOND_PORT), NULL,
-					mbuf_pool);
+					rte_eth_dev_socket_id(BOND_PORT),
+					&rxq_conf, mbuf_pool);
 	if (retval < 0)
 		rte_exit(retval, " port %u: RX queue 0 setup failed (res=%d)",
 				BOND_PORT, retval);
 
 	/* TX setup */
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = local_port_conf.txmode.offloads;
 	retval = rte_eth_tx_queue_setup(BOND_PORT, 0, nb_txd,
-				rte_eth_dev_socket_id(BOND_PORT), NULL);
+				rte_eth_dev_socket_id(BOND_PORT), &txq_conf);
 
 	if (retval < 0)
 		rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
-- 
2.12.0

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

* [PATCH v3 10/39] examples/exception_path: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (8 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 09/39] examples/bond: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 11/39] examples/kni: " Shahaf Shuler
                       ` (29 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/exception_path/main.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index f8f5bbdf0..59ee2d574 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -107,13 +107,10 @@
  */
 
 /* Options for configuring ethernet port */
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
-		.header_split = 0,      /* Header Split disabled */
-		.hw_ip_checksum = 0,    /* IP checksum offload disabled */
-		.hw_vlan_filter = 0,    /* VLAN filtering disabled */
-		.jumbo_frame = 0,       /* Jumbo Frame Support disabled */
-		.hw_strip_crc = 1,      /* CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -447,11 +444,19 @@ init_port(uint16_t port)
 	int ret;
 	uint16_t nb_rxd = NB_RXD;
 	uint16_t nb_txd = NB_TXD;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
+	struct rte_eth_conf local_port_conf = port_conf;
 
 	/* Initialise device and RX/TX queues */
 	PRINT_INFO("Initialising port %u ...", port);
 	fflush(stdout);
-	ret = rte_eth_dev_configure(port, 1, 1, &port_conf);
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		local_port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	ret = rte_eth_dev_configure(port, 1, 1, &local_port_conf);
 	if (ret < 0)
 		FATAL_ERROR("Could not configure port%u (%d)", port, ret);
 
@@ -460,17 +465,22 @@ init_port(uint16_t port)
 		FATAL_ERROR("Could not adjust number of descriptors for port%u (%d)",
 			    port, ret);
 
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = local_port_conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port, 0, nb_rxd,
 				rte_eth_dev_socket_id(port),
-				NULL,
+				&rxq_conf,
 				pktmbuf_pool);
 	if (ret < 0)
 		FATAL_ERROR("Could not setup up RX queue for port%u (%d)",
 				port, ret);
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = local_port_conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(port, 0, nb_txd,
 				rte_eth_dev_socket_id(port),
-				NULL);
+				&txq_conf);
 	if (ret < 0)
 		FATAL_ERROR("Could not setup up TX queue for port%u (%d)",
 				port, ret);
-- 
2.12.0

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

* [PATCH v3 11/39] examples/kni: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (9 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 10/39] examples/exception_path: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 12/39] examples/ip_fragmentation: convert to new " Shahaf Shuler
                       ` (28 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/kni/main.c | 50 ++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 40 insertions(+), 10 deletions(-)

diff --git a/examples/kni/main.c b/examples/kni/main.c
index 3f1738544..8ed838930 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -124,11 +124,8 @@ static struct kni_port_params *kni_port_params_array[RTE_MAX_ETHPORTS];
 /* Options for configuring ethernet port */
 static struct rte_eth_conf port_conf = {
 	.rxmode = {
-		.header_split = 0,      /* Header Split disabled */
-		.hw_ip_checksum = 0,    /* IP checksum offload disabled */
-		.hw_vlan_filter = 0,    /* VLAN filtering disabled */
-		.jumbo_frame = 0,       /* Jumbo Frame Support disabled */
-		.hw_strip_crc = 1,      /* CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -607,11 +604,19 @@ init_port(uint16_t port)
 	int ret;
 	uint16_t nb_rxd = NB_RXD;
 	uint16_t nb_txd = NB_TXD;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
+	struct rte_eth_conf local_port_conf = port_conf;
 
 	/* Initialise device and RX/TX queues */
 	RTE_LOG(INFO, APP, "Initialising port %u ...\n", (unsigned)port);
 	fflush(stdout);
-	ret = rte_eth_dev_configure(port, 1, 1, &port_conf);
+	rte_eth_dev_info_get(port, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		local_port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	ret = rte_eth_dev_configure(port, 1, 1, &local_port_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not configure port%u (%d)\n",
 		            (unsigned)port, ret);
@@ -621,14 +626,19 @@ init_port(uint16_t port)
 		rte_exit(EXIT_FAILURE, "Could not adjust number of descriptors "
 				"for port%u (%d)\n", (unsigned)port, ret);
 
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = local_port_conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port, 0, nb_rxd,
-		rte_eth_dev_socket_id(port), NULL, pktmbuf_pool);
+		rte_eth_dev_socket_id(port), &rxq_conf, pktmbuf_pool);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not setup up RX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = local_port_conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(port, 0, nb_txd,
-		rte_eth_dev_socket_id(port), NULL);
+		rte_eth_dev_socket_id(port), &txq_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not setup up TX queue for "
 				"port%u (%d)\n", (unsigned)port, ret);
@@ -702,7 +712,10 @@ static int
 kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
 {
 	int ret;
+	uint16_t nb_rxd = NB_RXD;
 	struct rte_eth_conf conf;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_rxconf rxq_conf;
 
 	if (port_id >= rte_eth_dev_count()) {
 		RTE_LOG(ERR, APP, "Invalid port id %d\n", port_id);
@@ -717,9 +730,9 @@ kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
 	memcpy(&conf, &port_conf, sizeof(conf));
 	/* Set new MTU */
 	if (new_mtu > ETHER_MAX_LEN)
-		conf.rxmode.jumbo_frame = 1;
+		conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
 	else
-		conf.rxmode.jumbo_frame = 0;
+		conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
 
 	/* mtu + length of header + length of FCS = max pkt length */
 	conf.rxmode.max_rx_pkt_len = new_mtu + KNI_ENET_HEADER_SIZE +
@@ -730,6 +743,23 @@ kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
 		return ret;
 	}
 
+	ret = rte_eth_dev_adjust_nb_rx_tx_desc(port_id, &nb_rxd, NULL);
+	if (ret < 0)
+		rte_exit(EXIT_FAILURE, "Could not adjust number of descriptors "
+				"for port%u (%d)\n", (unsigned int)port_id,
+				ret);
+
+	rte_eth_dev_info_get(port_id, &dev_info);
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = conf.rxmode.offloads;
+	ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd,
+		rte_eth_dev_socket_id(port_id), &rxq_conf, pktmbuf_pool);
+	if (ret < 0) {
+		RTE_LOG(ERR, APP, "Fail to setup Rx queue of port %d\n",
+				port_id);
+		return ret;
+	}
+
 	/* Restart specific port */
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
-- 
2.12.0

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

* [PATCH v3 12/39] examples/ip_fragmentation: convert to new offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (10 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 11/39] examples/kni: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 13/39] examples/ip_pipeline: convert to new ethdev " Shahaf Shuler
                       ` (27 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 examples/ip_fragmentation/main.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 5aefe0987..55fb7d942 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -169,14 +169,15 @@ static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 1, /**< Jumbo Frame Support enabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+			     DEV_RX_OFFLOAD_JUMBO_FRAME |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_MULTI_SEGS),
 	},
 };
 
@@ -905,6 +906,9 @@ main(int argc, char **argv)
 
 	/* initialize all ports */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_conf local_port_conf = port_conf;
+		struct rte_eth_rxconf rxq_conf;
+
 		/* skip ports that are not enabled */
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %d\n", portid);
@@ -915,8 +919,9 @@ main(int argc, char **argv)
 
 		/* limit the frame size to the maximum supported by NIC */
 		rte_eth_dev_info_get(portid, &dev_info);
-		port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
-		    dev_info.max_rx_pktlen, port_conf.rxmode.max_rx_pkt_len);
+		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
+		    dev_info.max_rx_pktlen,
+		    local_port_conf.rxmode.max_rx_pkt_len);
 
 		/* get the lcore_id for this port */
 		while (rte_lcore_is_enabled(rx_lcore_id) == 0 ||
@@ -949,8 +954,11 @@ main(int argc, char **argv)
 		n_tx_queue = nb_lcores;
 		if (n_tx_queue > MAX_TX_QUEUE_PER_PORT)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 		ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue,
-					    &port_conf);
+					    &local_port_conf);
 		if (ret < 0) {
 			printf("\n");
 			rte_exit(EXIT_FAILURE, "Cannot configure device: "
@@ -967,8 +975,10 @@ main(int argc, char **argv)
 		}
 
 		/* init one RX queue */
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = local_port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
-					     socket, NULL,
+					     socket, &rxq_conf,
 					     socket_direct_pool[socket]);
 		if (ret < 0) {
 			printf("\n");
@@ -992,7 +1002,8 @@ main(int argc, char **argv)
 			fflush(stdout);
 
 			txconf = &dev_info.default_txconf;
-			txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = local_port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socket, txconf);
 			if (ret < 0) {
-- 
2.12.0

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

* [PATCH v3 13/39] examples/ip_pipeline: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (11 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 12/39] examples/ip_fragmentation: convert to new " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 14/39] examples/ip_reassembly: " Shahaf Shuler
                       ` (26 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ip_pipeline/config_parse.c | 13 +++----------
 examples/ip_pipeline/init.c         | 15 +++++++++++----
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/examples/ip_pipeline/config_parse.c b/examples/ip_pipeline/config_parse.c
index 3211c6ab7..835541229 100644
--- a/examples/ip_pipeline/config_parse.c
+++ b/examples/ip_pipeline/config_parse.c
@@ -97,14 +97,8 @@ static const struct app_link_params link_params_default = {
 		.rxmode = {
 			.mq_mode = ETH_MQ_RX_NONE,
 
-			.header_split   = 0, /* Header split */
-			.hw_ip_checksum = 0, /* IP checksum offload */
-			.hw_vlan_filter = 0, /* VLAN filtering */
-			.hw_vlan_strip  = 0, /* VLAN strip */
-			.hw_vlan_extend = 0, /* Extended VLAN */
-			.jumbo_frame    = 0, /* Jumbo frame support */
-			.hw_strip_crc   = 1, /* CRC strip by HW */
-			.enable_scatter = 0, /* Scattered packets RX handler */
+			.ignore_offload_bitfield = 1,
+			.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 
 			.max_rx_pkt_len = 9000, /* Jumbo frame max packet len */
 			.split_hdr_size = 0, /* Header split buffer size */
@@ -158,8 +152,7 @@ static const struct app_pktq_hwq_out_params default_hwq_out_params = {
 		},
 		.tx_rs_thresh = 0,
 		.tx_free_thresh = 0,
-		.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS |
-			ETH_TXQ_FLAGS_NOOFFLOADS,
+		.txq_flags = ETH_TXQ_FLAGS_IGNORE,
 		.tx_deferred_start = 0,
 	}
 };
diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
index e56e40482..84017ddf9 100644
--- a/examples/ip_pipeline/init.c
+++ b/examples/ip_pipeline/init.c
@@ -876,10 +876,10 @@ app_init_link_frag_ras(struct app_params *app)
 	uint32_t i;
 
 	if (is_any_swq_frag_or_ras(app)) {
-		for (i = 0; i < app->n_pktq_hwq_out; i++) {
-			struct app_pktq_hwq_out_params *p_txq = &app->hwq_out_params[i];
-
-			p_txq->conf.txq_flags &= ~ETH_TXQ_FLAGS_NOMULTSEGS;
+		for (i = 0; i < app->n_links; i++) {
+			struct app_link_params *p_link = &app->link_params[i];
+				p_link->conf.txmode.offloads |=
+						DEV_TX_OFFLOAD_MULTI_SEGS;
 		}
 	}
 }
@@ -962,6 +962,7 @@ app_init_link(struct app_params *app)
 
 	for (i = 0; i < app->n_links; i++) {
 		struct app_link_params *p_link = &app->link_params[i];
+		struct rte_eth_dev_info dev_info;
 		uint32_t link_id, n_hwq_in, n_hwq_out, j;
 		int status;
 
@@ -978,6 +979,10 @@ app_init_link(struct app_params *app)
 			n_hwq_out);
 
 		/* LINK */
+		rte_eth_dev_info_get(p_link->pmd_id, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			p_link->conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 		status = rte_eth_dev_configure(
 			p_link->pmd_id,
 			n_hwq_in,
@@ -1019,6 +1024,7 @@ app_init_link(struct app_params *app)
 					p_rxq->name,
 					status);
 
+			p_rxq->conf.offloads = p_link->conf.rxmode.offloads;
 			status = rte_eth_rx_queue_setup(
 				p_link->pmd_id,
 				rxq_queue_id,
@@ -1060,6 +1066,7 @@ app_init_link(struct app_params *app)
 					p_txq->name,
 					status);
 
+			p_txq->conf.offloads = p_link->conf.txmode.offloads;
 			status = rte_eth_tx_queue_setup(
 				p_link->pmd_id,
 				txq_queue_id,
-- 
2.12.0

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

* [PATCH v3 14/39] examples/ip_reassembly: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (12 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 13/39] examples/ip_pipeline: convert to new ethdev " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 15/39] examples/ipsec-secgw: " Shahaf Shuler
                       ` (25 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ip_reassembly/main.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 756f90efb..521ec60a7 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -193,11 +193,10 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode        = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 1, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+			     DEV_RX_OFFLOAD_JUMBO_FRAME |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.rx_adv_conf = {
 			.rss_conf = {
@@ -207,6 +206,8 @@ static struct rte_eth_conf port_conf = {
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_MULTI_SEGS),
 	},
 };
 
@@ -1052,6 +1053,9 @@ main(int argc, char **argv)
 
 	/* initialize all ports */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			printf("\nSkipping disabled port %d\n", portid);
@@ -1062,8 +1066,9 @@ main(int argc, char **argv)
 
 		/* limit the frame size to the maximum supported by NIC */
 		rte_eth_dev_info_get(portid, &dev_info);
-		port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
-		    dev_info.max_rx_pktlen, port_conf.rxmode.max_rx_pkt_len);
+		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
+		    dev_info.max_rx_pktlen,
+		    local_port_conf.rxmode.max_rx_pkt_len);
 
 		/* get the lcore_id for this port */
 		while (rte_lcore_is_enabled(rx_lcore_id) == 0 ||
@@ -1104,8 +1109,11 @@ main(int argc, char **argv)
 		n_tx_queue = nb_lcores;
 		if (n_tx_queue > MAX_TX_QUEUE_PER_PORT)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 		ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue,
-					    &port_conf);
+					    &local_port_conf);
 		if (ret < 0) {
 			printf("\n");
 			rte_exit(EXIT_FAILURE, "Cannot configure device: "
@@ -1114,8 +1122,10 @@ main(int argc, char **argv)
 		}
 
 		/* init one RX queue */
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = local_port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
-					     socket, NULL,
+					     socket, &rxq_conf,
 					     rxq->pool);
 		if (ret < 0) {
 			printf("\n");
@@ -1140,7 +1150,8 @@ main(int argc, char **argv)
 			fflush(stdout);
 
 			txconf = &dev_info.default_txconf;
-			txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = local_port_conf.txmode.offloads;
 
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 					socket, txconf);
-- 
2.12.0

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

* [PATCH v3 15/39] examples/ipsec-secgw: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (13 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 14/39] examples/ip_reassembly: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2018-01-16 11:10       ` Nicolau, Radu
  2017-12-26  9:23     ` [PATCH v3 16/39] examples/ipv4_multicast: " Shahaf Shuler
                       ` (24 subsequent siblings)
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index c98454a90..ff101e98d 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -217,6 +217,8 @@ static struct rte_eth_conf port_conf = {
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_MULTI_SEGS),
 	},
 };
 
@@ -1358,6 +1360,7 @@ port_init(uint16_t portid)
 	int32_t ret, socket_id;
 	struct lcore_conf *qconf;
 	struct ether_addr ethaddr;
+	struct rte_eth_conf local_port_conf = port_conf;
 
 	rte_eth_dev_info_get(portid, &dev_info);
 
@@ -1385,17 +1388,19 @@ port_init(uint16_t portid)
 			nb_rx_queue, nb_tx_queue);
 
 	if (frame_size) {
-		port_conf.rxmode.max_rx_pkt_len = frame_size;
-		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+		local_port_conf.rxmode.max_rx_pkt_len = frame_size;
+		local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
 	}
 
 	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SECURITY)
-		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_SECURITY;
+		local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_SECURITY;
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_SECURITY)
-		port_conf.txmode.offloads |= DEV_TX_OFFLOAD_SECURITY;
-
+		local_port_conf.txmode.offloads |= DEV_TX_OFFLOAD_SECURITY;
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		local_port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 	ret = rte_eth_dev_configure(portid, nb_rx_queue, nb_tx_queue,
-			&port_conf);
+			&local_port_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Cannot configure device: "
 				"err=%d, port=%d\n", ret, portid);
@@ -1420,7 +1425,8 @@ port_init(uint16_t portid)
 		printf("Setup txq=%u,%d,%d\n", lcore_id, tx_queueid, socket_id);
 
 		txconf = &dev_info.default_txconf;
-		txconf->txq_flags = 0;
+		txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txconf->offloads = local_port_conf.txmode.offloads;
 
 		ret = rte_eth_tx_queue_setup(portid, tx_queueid, nb_txd,
 				socket_id, txconf);
@@ -1434,6 +1440,8 @@ port_init(uint16_t portid)
 
 		/* init RX queues */
 		for (queue = 0; queue < qconf->nb_rx_queue; ++queue) {
+			struct rte_eth_rxconf rxq_conf;
+
 			if (portid != qconf->rx_queue_list[queue].port_id)
 				continue;
 
@@ -1442,8 +1450,10 @@ port_init(uint16_t portid)
 			printf("Setup rxq=%d,%d,%d\n", portid, rx_queueid,
 					socket_id);
 
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = local_port_conf.rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, rx_queueid,
-					nb_rxd,	socket_id, NULL,
+					nb_rxd,	socket_id, &rxq_conf,
 					socket_ctx[socket_id].mbuf_pool);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE,
-- 
2.12.0

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

* [PATCH v3 16/39] examples/ipv4_multicast: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (14 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 15/39] examples/ipsec-secgw: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 17/39] examples/link_status_interrupt: convert to new " Shahaf Shuler
                       ` (23 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ipv4_multicast/main.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 1c5851654..8e59e534d 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -138,14 +138,13 @@ static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 1, /**< Jumbo Frame Support enabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_JUMBO_FRAME |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = DEV_TX_OFFLOAD_MULTI_SEGS,
 	},
 };
 
@@ -714,6 +713,9 @@ main(int argc, char **argv)
 
 	/* initialize all ports */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %d\n", portid);
@@ -724,8 +726,9 @@ main(int argc, char **argv)
 
 		/* limit the frame size to the maximum supported by NIC */
 		rte_eth_dev_info_get(portid, &dev_info);
-		port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
-		    dev_info.max_rx_pktlen, port_conf.rxmode.max_rx_pkt_len);
+		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
+		    dev_info.max_rx_pktlen,
+		    local_port_conf.rxmode.max_rx_pkt_len);
 
 		/* get the lcore_id for this port */
 		while (rte_lcore_is_enabled(rx_lcore_id) == 0 ||
@@ -748,8 +751,9 @@ main(int argc, char **argv)
 		n_tx_queue = nb_lcores;
 		if (n_tx_queue > MAX_TX_QUEUE_PER_PORT)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
+
 		ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue,
-					    &port_conf);
+					    &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%d\n",
 				  ret, portid);
@@ -769,9 +773,11 @@ main(int argc, char **argv)
 		queueid = 0;
 		printf("rxq=%hu ", queueid);
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = local_port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     packet_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, port=%d\n",
@@ -787,7 +793,8 @@ main(int argc, char **argv)
 			fflush(stdout);
 
 			txconf = &dev_info.default_txconf;
-			txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = local_port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     rte_lcore_to_socket_id(lcore_id), txconf);
 			if (ret < 0)
-- 
2.12.0

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

* [PATCH v3 17/39] examples/link_status_interrupt: convert to new offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (15 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 16/39] examples/ipv4_multicast: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 18/39] examples/load_balancer: convert to new ethdev " Shahaf Shuler
                       ` (22 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/link_status_interrupt/main.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index bc47dcce3..b62a0621e 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -105,14 +105,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
 struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -633,6 +630,10 @@ main(int argc, char **argv)
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((lsi_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", (unsigned) portid);
@@ -641,7 +642,11 @@ main(int argc, char **argv)
 		/* init port */
 		printf("Initializing port %u... ", (unsigned) portid);
 		fflush(stdout);
-		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+		ret = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
 				  ret, (unsigned) portid);
@@ -666,9 +671,11 @@ main(int argc, char **argv)
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = local_port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     lsi_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, port=%u\n",
@@ -676,9 +683,12 @@ main(int argc, char **argv)
 
 		/* init one TX queue logical core on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = local_port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d,port=%u\n",
 				  ret, (unsigned) portid);
-- 
2.12.0

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

* [PATCH v3 18/39] examples/load_balancer: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (16 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 17/39] examples/link_status_interrupt: convert to new " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 19/39] examples/multi_process: " Shahaf Shuler
                       ` (21 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/load_balancer/init.c | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3dab7f258..5b2ca1c22 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -74,11 +74,9 @@ static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.mq_mode	= ETH_MQ_RX_RSS,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -430,6 +428,10 @@ app_init_nics(void)
 		struct rte_mempool *pool;
 		uint16_t nic_rx_ring_size;
 		uint16_t nic_tx_ring_size;
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+		struct rte_eth_dev_info dev_info;
+		struct rte_eth_conf local_port_conf = port_conf;
 
 		n_rx_queues = app_get_nic_rx_queues_per_port(port);
 		n_tx_queues = app.nic_tx_port_mask[port];
@@ -440,11 +442,15 @@ app_init_nics(void)
 
 		/* Init port */
 		printf("Initializing NIC port %u ...\n", port);
+		rte_eth_dev_info_get(port, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 		ret = rte_eth_dev_configure(
 			port,
 			(uint8_t) n_rx_queues,
 			(uint8_t) n_tx_queues,
-			&port_conf);
+			&local_port_conf);
 		if (ret < 0) {
 			rte_panic("Cannot init NIC port %u (%d)\n", port, ret);
 		}
@@ -461,6 +467,8 @@ app_init_nics(void)
 		app.nic_rx_ring_size = nic_rx_ring_size;
 		app.nic_tx_ring_size = nic_tx_ring_size;
 
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = local_port_conf.rxmode.offloads;
 		/* Init RX queues */
 		for (queue = 0; queue < APP_MAX_RX_QUEUES_PER_NIC_PORT; queue ++) {
 			if (app.nic_rx_queue_mask[port][queue] == 0) {
@@ -478,7 +486,7 @@ app_init_nics(void)
 				queue,
 				(uint16_t) app.nic_rx_ring_size,
 				socket,
-				NULL,
+				&rxq_conf,
 				pool);
 			if (ret < 0) {
 				rte_panic("Cannot init RX queue %u for port %u (%d)\n",
@@ -486,6 +494,9 @@ app_init_nics(void)
 			}
 		}
 
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.offloads = local_port_conf.txmode.offloads;
 		/* Init TX queues */
 		if (app.nic_tx_port_mask[port] == 1) {
 			app_get_lcore_for_nic_tx(port, &lcore);
@@ -497,7 +508,7 @@ app_init_nics(void)
 				0,
 				(uint16_t) app.nic_tx_ring_size,
 				socket,
-				NULL);
+				&txq_conf);
 			if (ret < 0) {
 				rte_panic("Cannot init TX queue 0 for port %d (%d)\n",
 					port,
-- 
2.12.0

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

* [PATCH v3 19/39] examples/multi_process: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (17 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 18/39] examples/load_balancer: convert to new ethdev " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 20/39] examples/netmap_compat: " Shahaf Shuler
                       ` (20 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/multi_process/l2fwd_fork/main.c   | 26 +++++++++++++++++--------
 examples/multi_process/symmetric_mp/main.c | 22 ++++++++++++++-------
 2 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c
index deace2739..673c22e63 100644
--- a/examples/multi_process/l2fwd_fork/main.c
+++ b/examples/multi_process/l2fwd_fork/main.c
@@ -156,11 +156,8 @@ struct cpu_aff_arg{
 static const struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -1064,6 +1061,10 @@ main(int argc, char **argv)
 
 	/* Initialise each port */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_rxconf rxq_conf;
+		struct rte_eth_txconf txq_conf;
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", (unsigned) portid);
@@ -1073,7 +1074,11 @@ main(int argc, char **argv)
 		/* init port */
 		printf("Initializing port %u... ", (unsigned) portid);
 		fflush(stdout);
-		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+		ret = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
 				  ret, (unsigned) portid);
@@ -1089,9 +1094,11 @@ main(int argc, char **argv)
 
 		/* init one RX queue */
 		fflush(stdout);
+		rxq_conf = dev_info.default_rxconf;
+		rxq_conf.offloads = local_port_conf.rxmode.offloads;
 		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
 					     rte_eth_dev_socket_id(portid),
-					     NULL,
+					     &rxq_conf,
 					     l2fwd_pktmbuf_pool[portid]);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
@@ -1099,9 +1106,12 @@ main(int argc, char **argv)
 
 		/* init one TX queue on each port */
 		fflush(stdout);
+		txq_conf = dev_info.default_txconf;
+		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txq_conf.tx_offloads = local_port_conf.txmode.offloads;
 		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
 				rte_eth_dev_socket_id(portid),
-				NULL);
+				&txq_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n",
 				ret, (unsigned) portid);
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 6fb285c74..87dc280b8 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -207,11 +207,9 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
 			.rxmode = {
 				.mq_mode	= ETH_MQ_RX_RSS,
 				.split_hdr_size = 0,
-				.header_split   = 0, /**< Header Split disabled */
-				.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-				.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-				.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-				.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+				.ignore_offload_bitfield = 1,
+				.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+					     DEV_RX_OFFLOAD_CRC_STRIP),
 			},
 			.rx_adv_conf = {
 				.rss_conf = {
@@ -225,6 +223,8 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
 	};
 	const uint16_t rx_rings = num_queues, tx_rings = num_queues;
 	struct rte_eth_dev_info info;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
 	int retval;
 	uint16_t q;
 	uint16_t nb_rxd = RX_RING_SIZE;
@@ -242,6 +242,9 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
 	rte_eth_dev_info_get(port, &info);
 	info.default_rxconf.rx_drop_en = 1;
 
+	if (info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval < 0)
 		return retval;
@@ -250,19 +253,24 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
 	if (retval < 0)
 		return retval;
 
+	rxq_conf = info.default_rxconf;
+	rxq_conf.offloads = port_conf.rxmode.offloads;
 	for (q = 0; q < rx_rings; q ++) {
 		retval = rte_eth_rx_queue_setup(port, q, nb_rxd,
 				rte_eth_dev_socket_id(port),
-				&info.default_rxconf,
+				&rxq_conf,
 				mbuf_pool);
 		if (retval < 0)
 			return retval;
 	}
 
+	txq_conf = info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < tx_rings; q ++) {
 		retval = rte_eth_tx_queue_setup(port, q, nb_txd,
 				rte_eth_dev_socket_id(port),
-				NULL);
+				&txq_conf);
 		if (retval < 0)
 			return retval;
 	}
-- 
2.12.0

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

* [PATCH v3 20/39] examples/netmap_compat: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (18 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 19/39] examples/multi_process: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 21/39] examples/performance-thread: convert to new " Shahaf Shuler
                       ` (19 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/netmap_compat/bridge/bridge.c     |  7 ++-----
 examples/netmap_compat/lib/compat_netmap.c | 16 ++++++++++++++--
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/examples/netmap_compat/bridge/bridge.c b/examples/netmap_compat/bridge/bridge.c
index 2f2b6baaa..33c38d3cc 100644
--- a/examples/netmap_compat/bridge/bridge.c
+++ b/examples/netmap_compat/bridge/bridge.c
@@ -55,11 +55,8 @@
 struct rte_eth_conf eth_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0,
-		.hw_ip_checksum = 0,
-		.hw_vlan_filter = 0,
-		.jumbo_frame    = 0,
-		.hw_strip_crc   = 1,
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c
index 12b3fcbe0..ee65697fe 100644
--- a/examples/netmap_compat/lib/compat_netmap.c
+++ b/examples/netmap_compat/lib/compat_netmap.c
@@ -690,6 +690,9 @@ rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf)
 	int32_t ret;
 	uint16_t i;
 	uint16_t rx_slots, tx_slots;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
+	struct rte_eth_dev_info dev_info;
 
 	if (conf == NULL ||
 			portid >= RTE_DIM(ports) ||
@@ -710,6 +713,10 @@ rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf)
 		return -EINVAL;
 	}
 
+	rte_eth_dev_info_get(portid, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		conf->eth_conf->txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 	ret = rte_eth_dev_configure(portid, conf->nr_rx_rings,
 		conf->nr_tx_rings, conf->eth_conf);
 
@@ -727,9 +734,14 @@ rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf)
 		return ret;
 	}
 
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = conf->eth_conf->rxmode.offloads;
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = conf->eth_conf->txmode.offloads;
 	for (i = 0; i < conf->nr_tx_rings; i++) {
 		ret = rte_eth_tx_queue_setup(portid, i, tx_slots,
-			conf->socket_id, NULL);
+			conf->socket_id, &txq_conf);
 
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
@@ -739,7 +751,7 @@ rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf)
 		}
 
 		ret = rte_eth_rx_queue_setup(portid, i, rx_slots,
-			conf->socket_id, NULL, conf->pool);
+			conf->socket_id, &rxq_conf, conf->pool);
 
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
-- 
2.12.0

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

* [PATCH v3 21/39] examples/performance-thread: convert to new offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (19 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 20/39] examples/netmap_compat: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 22/39] examples/qos_meter: convert to new ethdev " Shahaf Shuler
                       ` (18 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/performance-thread/l3fwd-thread/main.c | 37 ++++++++++++++------
 1 file changed, 26 insertions(+), 11 deletions(-)

diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index fa65234f3..ada4c785a 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -335,11 +335,9 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 1, /**< IP checksum offload enabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -2999,7 +2997,10 @@ parse_args(int argc, char **argv)
 						0};
 
 				printf("jumbo frame is enabled - disabling simple TX path\n");
-				port_conf.rxmode.jumbo_frame = 1;
+				port_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_JUMBO_FRAME;
+				port_conf.txmode.offloads |=
+						DEV_TX_OFFLOAD_MULTI_SEGS;
 
 				/* if no max-pkt-len set, use the default value ETHER_MAX_LEN */
 				if (0 == getopt_long(argc, argvopt, "", &lenopts,
@@ -3551,6 +3552,8 @@ main(int argc, char **argv)
 
 	/* initialize all ports */
 	for (portid = 0; portid < nb_ports; portid++) {
+		struct rte_eth_conf local_port_conf = port_conf;
+
 		/* skip ports that are not enabled */
 		if ((enabled_port_mask & (1 << portid)) == 0) {
 			printf("\nSkipping disabled port %d\n", portid);
@@ -3567,8 +3570,12 @@ main(int argc, char **argv)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue);
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
-					(uint16_t)n_tx_queue, &port_conf);
+					(uint16_t)n_tx_queue, &local_port_conf);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%d\n",
 				ret, portid);
@@ -3612,10 +3619,9 @@ main(int argc, char **argv)
 			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
-			if (port_conf.rxmode.jumbo_frame)
-				txconf->txq_flags = 0;
+			txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+			txconf->offloads = local_port_conf.txmode.offloads;
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 						     socketid, txconf);
 			if (ret < 0)
@@ -3644,8 +3650,14 @@ main(int argc, char **argv)
 
 		/* init RX queues */
 		for (queue = 0; queue < rx_thread[i].n_rx_queue; ++queue) {
+			struct rte_eth_dev *dev;
+			struct rte_eth_conf *conf;
+			struct rte_eth_rxconf rxq_conf;
+
 			portid = rx_thread[i].rx_queue_list[queue].port_id;
 			queueid = rx_thread[i].rx_queue_list[queue].queue_id;
+			dev = &rte_eth_devices[portid];
+			conf = &dev->data->dev_conf;
 
 			if (numa_on)
 				socketid = (uint8_t)rte_lcore_to_socket_id(lcore_id);
@@ -3655,9 +3667,12 @@ main(int argc, char **argv)
 			printf("rxq=%d,%d,%d ", portid, queueid, socketid);
 			fflush(stdout);
 
+			rte_eth_dev_info_get(portid, &dev_info);
+			rxq_conf = dev_info.default_rxconf;
+			rxq_conf.offloads = conf->rxmode.offloads;
 			ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
 					socketid,
-					NULL,
+					&rxq_conf,
 					pktmbuf_pool[socketid]);
 			if (ret < 0)
 				rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, "
-- 
2.12.0

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

* [PATCH v3 22/39] examples/qos_meter: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (20 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 21/39] examples/performance-thread: convert to new " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 23/39] examples/qos_sched: " Shahaf Shuler
                       ` (17 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/qos_meter/main.c | 38 +++++++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 9 deletions(-)

diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index 67b4a75b9..4e7c5baed 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -85,11 +85,9 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode	= ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0,
-		.hw_ip_checksum = 1,
-		.hw_vlan_filter = 0,
-		.jumbo_frame    = 0,
-		.hw_strip_crc   = 1,
+		.ignore_offload_bitfield = 1,
+		.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
+			     DEV_RX_OFFLOAD_CRC_STRIP),
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -310,6 +308,10 @@ main(int argc, char **argv)
 	uint32_t lcore_id;
 	uint16_t nb_rxd = NIC_RX_QUEUE_DESC;
 	uint16_t nb_txd = NIC_TX_QUEUE_DESC;
+	struct rte_eth_conf conf;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
+	struct rte_eth_dev_info dev_info;
 	int ret;
 
 	/* EAL init */
@@ -335,7 +337,11 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Buffer pool creation error\n");
 
 	/* NIC init */
-	ret = rte_eth_dev_configure(port_rx, 1, 1, &port_conf);
+	conf = port_conf;
+	rte_eth_dev_info_get(port_rx, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	ret = rte_eth_dev_configure(port_rx, 1, 1, &conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_rx, ret);
 
@@ -344,19 +350,28 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Port %d adjust number of descriptors error (%d)\n",
 				port_rx, ret);
 
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port_rx, NIC_RX_QUEUE, nb_rxd,
 				rte_eth_dev_socket_id(port_rx),
-				NULL, pool);
+				&rxq_conf, pool);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d RX queue setup error (%d)\n", port_rx, ret);
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(port_rx, NIC_TX_QUEUE, nb_txd,
 				rte_eth_dev_socket_id(port_rx),
-				NULL);
+				&txq_conf);
 	if (ret < 0)
 	rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_rx, ret);
 
-	ret = rte_eth_dev_configure(port_tx, 1, 1, &port_conf);
+	conf = port_conf;
+	rte_eth_dev_info_get(port_tx, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	ret = rte_eth_dev_configure(port_tx, 1, 1, &conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_tx, ret);
 
@@ -367,12 +382,17 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Port %d adjust number of descriptors error (%d)\n",
 				port_tx, ret);
 
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port_tx, NIC_RX_QUEUE, nb_rxd,
 				rte_eth_dev_socket_id(port_tx),
 				NULL, pool);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d RX queue setup error (%d)\n", port_tx, ret);
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(port_tx, NIC_TX_QUEUE, nb_txd,
 				rte_eth_dev_socket_id(port_tx),
 				NULL);
-- 
2.12.0

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

* [PATCH v3 23/39] examples/qos_sched: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (21 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 22/39] examples/qos_meter: convert to new ethdev " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 24/39] examples/quota_watermark: " Shahaf Shuler
                       ` (16 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/qos_sched/init.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 038f0427d..b5a9af784 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -84,15 +84,12 @@ const char *cfg_profile = NULL;
 int mp_size = NB_MBUF;
 struct flow_conf qos_conf[MAX_DATA_STREAMS];
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.max_rx_pkt_len = ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_DCB_NONE,
@@ -104,10 +101,12 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 {
 	int ret;
 	struct rte_eth_link link;
+	struct rte_eth_dev_info dev_info;
 	struct rte_eth_rxconf rx_conf;
 	struct rte_eth_txconf tx_conf;
 	uint16_t rx_size;
 	uint16_t tx_size;
+	struct rte_eth_conf local_port_conf = port_conf;
 
 	/* check if port already initialized (multistream configuration) */
 	if (app_inited_port_mask & (1u << portid))
@@ -125,13 +124,17 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 	tx_conf.tx_thresh.wthresh = tx_thresh.wthresh;
 	tx_conf.tx_free_thresh = 0;
 	tx_conf.tx_rs_thresh = 0;
-	tx_conf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS;
 	tx_conf.tx_deferred_start = 0;
+	tx_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 
 	/* init port */
 	RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", portid);
 	fflush(stdout);
-	ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
+	rte_eth_dev_info_get(portid, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		local_port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	ret = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE,
 			 "Cannot configure device: err=%d, port=%u\n",
@@ -149,6 +152,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 
 	/* init one RX queue */
 	fflush(stdout);
+	rx_conf.offloads = local_port_conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(portid, 0, (uint16_t)ring_conf.rx_size,
 		rte_eth_dev_socket_id(portid), &rx_conf, mp);
 	if (ret < 0)
@@ -158,6 +162,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 
 	/* init one TX queue */
 	fflush(stdout);
+	tx_conf.offloads = local_port_conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(portid, 0,
 		(uint16_t)ring_conf.tx_size, rte_eth_dev_socket_id(portid), &tx_conf);
 	if (ret < 0)
-- 
2.12.0

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

* [PATCH v3 24/39] examples/quota_watermark: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (22 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 23/39] examples/qos_sched: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 25/39] examples/tep_termination: " Shahaf Shuler
                       ` (15 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/quota_watermark/qw/init.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 37b03626d..0f8a596af 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -50,14 +50,11 @@
 #include "../include/conf.h"
 
 
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 		.rxmode = {
 			.split_hdr_size = 0,
-			.header_split   = 0, /**< Header Split disabled */
-			.hw_ip_checksum = 0, /**< IP csum offload disabled */
-			.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-			.jumbo_frame    = 0, /**< Jumbo Frame disabled */
-			.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+			.ignore_offload_bitfield = 1,
+			.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 		},
 		.txmode = {
 			.mq_mode = ETH_DCB_NONE,
@@ -78,10 +75,18 @@ void configure_eth_port(uint16_t port_id)
 	int ret;
 	uint16_t nb_rxd = RX_DESC_PER_QUEUE;
 	uint16_t nb_txd = TX_DESC_PER_QUEUE;
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_txconf txq_conf;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_conf local_port_conf = port_conf;
 
 	rte_eth_dev_stop(port_id);
 
-	ret = rte_eth_dev_configure(port_id, 1, 1, &port_conf);
+	rte_eth_dev_info_get(port_id, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		local_port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	ret = rte_eth_dev_configure(port_id, 1, 1, &local_port_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Cannot configure port %u (error %d)\n",
 				(unsigned int) port_id, ret);
@@ -93,9 +98,11 @@ void configure_eth_port(uint16_t port_id)
 				(unsigned int) port_id, ret);
 
 	/* Initialize the port's RX queue */
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = local_port_conf.rxmode.offloads;
 	ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd,
 			rte_eth_dev_socket_id(port_id),
-			NULL,
+			&rxq_conf,
 			mbuf_pool);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE,
@@ -103,9 +110,12 @@ void configure_eth_port(uint16_t port_id)
 				(unsigned int) port_id, ret);
 
 	/* Initialize the port's TX queue */
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = local_port_conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(port_id, 0, nb_txd,
 			rte_eth_dev_socket_id(port_id),
-			NULL);
+			&txq_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE,
 				"Failed to setup TX queue on port %u (error %d)\n",
-- 
2.12.0

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

* [PATCH v3 25/39] examples/tep_termination: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (23 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 24/39] examples/quota_watermark: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 26/39] examples/vhost: " Shahaf Shuler
                       ` (14 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/tep_termination/vxlan_setup.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 1ad4ca3cd..b53f8fc8d 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -95,17 +95,22 @@ uint8_t tep_filter_type[] = {RTE_TUNNEL_FILTER_IMAC_TENID,
 			RTE_TUNNEL_FILTER_OMAC_TENID_IMAC,};
 
 /* Options for configuring ethernet port */
-static const struct rte_eth_conf port_conf = {
+static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.ignore_offload_bitfield = 1,
+		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_UDP_CKSUM |
+			     DEV_TX_OFFLOAD_TCP_CKSUM |
+			     DEV_TX_OFFLOAD_SCTP_CKSUM |
+			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_TCP_TSO |
+			     DEV_TX_OFFLOAD_MULTI_SEGS |
+			     DEV_TX_OFFLOAD_VXLAN_TNL_TSO),
 	},
 };
 
@@ -141,6 +146,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	struct rte_eth_rxconf *rxconf;
 	struct rte_eth_txconf *txconf;
 	struct vxlan_conf *pconf = &vxdev;
+	struct rte_eth_conf local_port_conf = port_conf;
 
 	pconf->dst_port = udp_port;
 
@@ -154,15 +160,18 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 
 	rxconf = &dev_info.default_rxconf;
 	txconf = &dev_info.default_txconf;
-	txconf->txq_flags = 0;
+	txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
 
 	if (port >= rte_eth_dev_count())
 		return -1;
 
 	rx_rings = nb_devices;
-
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		local_port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 	/* Configure ethernet device. */
-	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+	retval = rte_eth_dev_configure(port, rx_rings, tx_rings,
+				       &local_port_conf);
 	if (retval != 0)
 		return retval;
 
@@ -172,6 +181,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		return retval;
 
 	/* Setup the queues. */
+	rxconf->offloads = local_port_conf.rxmode.offloads;
 	for (q = 0; q < rx_rings; q++) {
 		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
 						rte_eth_dev_socket_id(port),
@@ -180,6 +190,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		if (retval < 0)
 			return retval;
 	}
+	txconf->offloads = local_port_conf.txmode.offloads;
 	for (q = 0; q < tx_rings; q++) {
 		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
 						rte_eth_dev_socket_id(port),
-- 
2.12.0

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

* [PATCH v3 26/39] examples/vhost: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (24 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 25/39] examples/tep_termination: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 27/39] examples/vmdq: " Shahaf Shuler
                       ` (13 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/vhost/main.c | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 89a61f0e5..eddcea64b 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -145,21 +145,23 @@ static struct rte_eth_conf vmdq_conf_default = {
 	.rxmode = {
 		.mq_mode        = ETH_MQ_RX_VMDQ_ONLY,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
+		.ignore_offload_bitfield = 1,
 		/*
-		 * It is necessary for 1G NIC such as I350,
+		 * VLAN strip is necessary for 1G NIC such as I350,
 		 * this fixes bug of ipv4 forwarding in guest can't
 		 * forward pakets from one virtio dev to another virtio dev.
 		 */
-		.hw_vlan_strip  = 1, /**< VLAN strip enabled. */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
+		.offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
+			     DEV_RX_OFFLOAD_VLAN_STRIP),
 	},
 
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
+		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
+			     DEV_TX_OFFLOAD_TCP_CKSUM |
+			     DEV_TX_OFFLOAD_VLAN_INSERT |
+			     DEV_TX_OFFLOAD_MULTI_SEGS |
+			     DEV_TX_OFFLOAD_TCP_TSO),
 	},
 	.rx_adv_conf = {
 		/*
@@ -176,6 +178,7 @@ static struct rte_eth_conf vmdq_conf_default = {
 	},
 };
 
+
 static unsigned lcore_ids[RTE_MAX_LCORE];
 static uint16_t ports[RTE_MAX_ETHPORTS];
 static unsigned num_ports = 0; /**< The number of ports specified in command line */
@@ -288,9 +291,7 @@ port_init(uint16_t port)
 	rxconf = &dev_info.default_rxconf;
 	txconf = &dev_info.default_txconf;
 	rxconf->rx_drop_en = 1;
-
-	/* Enable vlan offload */
-	txconf->txq_flags &= ~ETH_TXQ_FLAGS_NOVLANOFFL;
+	txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
 
 	/*configure the number of supported virtio devices based on VMDQ limits */
 	num_devices = dev_info.max_vmdq_pools;
@@ -331,6 +332,9 @@ port_init(uint16_t port)
 	if (port >= rte_eth_dev_count()) return -1;
 
 	rx_rings = (uint16_t)dev_info.max_rx_queues;
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 	/* Configure ethernet device. */
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0) {
@@ -353,6 +357,7 @@ port_init(uint16_t port)
 	}
 
 	/* Setup the queues. */
+	rxconf->offloads = port_conf.rxmode.offloads;
 	for (q = 0; q < rx_rings; q ++) {
 		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
 						rte_eth_dev_socket_id(port),
@@ -365,6 +370,7 @@ port_init(uint16_t port)
 			return retval;
 		}
 	}
+	txconf->offloads = port_conf.txmode.offloads;
 	for (q = 0; q < tx_rings; q ++) {
 		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
 						rte_eth_dev_socket_id(port),
@@ -624,7 +630,8 @@ us_vhost_parse_args(int argc, char **argv)
 				} else {
 					mergeable = !!ret;
 					if (ret) {
-						vmdq_conf_default.rxmode.jumbo_frame = 1;
+						vmdq_conf_default.rxmode.offloads |=
+							DEV_RX_OFFLOAD_JUMBO_FRAME;
 						vmdq_conf_default.rxmode.max_rx_pkt_len
 							= JUMBO_FRAME_MAX_SIZE;
 					}
-- 
2.12.0

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

* [PATCH v3 27/39] examples/vmdq: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (25 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 26/39] examples/vhost: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 28/39] examples/vmdq_dcb: " Shahaf Shuler
                       ` (12 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/vmdq/main.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 84e9937d4..178f2fc8d 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -94,10 +94,7 @@ static const struct rte_eth_conf vmdq_conf_default = {
 	.rxmode = {
 		.mq_mode        = ETH_MQ_RX_VMDQ_ONLY,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
+		.ignore_offload_bitfield = 1,
 	},
 
 	.txmode = {
@@ -188,6 +185,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 {
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_rxconf *rxconf;
+	struct rte_eth_txconf *txconf;
 	struct rte_eth_conf port_conf;
 	uint16_t rxRings, txRings;
 	uint16_t rxRingSize = RTE_TEST_RX_DESC_DEFAULT;
@@ -245,6 +243,11 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	 */
 	rxRings = (uint16_t)dev_info.max_rx_queues;
 	txRings = (uint16_t)dev_info.max_tx_queues;
+
+	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;
 	retval = rte_eth_dev_configure(port, rxRings, txRings, &port_conf);
 	if (retval != 0)
 		return retval;
@@ -260,9 +263,11 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		return -1;
 	}
 
-	rte_eth_dev_info_get(port, &dev_info);
 	rxconf = &dev_info.default_rxconf;
 	rxconf->rx_drop_en = 1;
+	txconf = &dev_info.default_txconf;
+	txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf->offloads = port_conf.txmode.offloads;
 	for (q = 0; q < rxRings; q++) {
 		retval = rte_eth_rx_queue_setup(port, q, rxRingSize,
 					rte_eth_dev_socket_id(port),
@@ -277,7 +282,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	for (q = 0; q < txRings; q++) {
 		retval = rte_eth_tx_queue_setup(port, q, txRingSize,
 					rte_eth_dev_socket_id(port),
-					NULL);
+					txconf);
 		if (retval < 0) {
 			printf("initialise tx queue %d failed\n", q);
 			return retval;
-- 
2.12.0

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

* [PATCH v3 28/39] examples/vmdq_dcb: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (26 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 27/39] examples/vmdq: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 29/39] examples/vm_power_manager: convert to new " Shahaf Shuler
                       ` (11 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/vmdq_dcb/main.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 9dad2b8ec..752a6bdc2 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -100,10 +100,7 @@ static const struct rte_eth_conf vmdq_dcb_conf_default = {
 	.rxmode = {
 		.mq_mode        = ETH_MQ_RX_VMDQ_DCB,
 		.split_hdr_size = 0,
-		.header_split   = 0, /**< Header Split disabled */
-		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
-		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
-		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
+		.ignore_offload_bitfield = 1,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_VMDQ_DCB,
@@ -228,6 +225,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	uint16_t q;
 	uint16_t queues_per_pool;
 	uint32_t max_nb_pools;
+	struct rte_eth_txconf txq_conf;
 
 	/*
 	 * The max pool number from dev_info will be used to validate the pool
@@ -284,6 +282,10 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	if (retval < 0)
 		return retval;
 
+	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;
 	/*
 	 * Though in this example, all queues including pf queues are setup.
 	 * This is because VMDQ queues doesn't always start from zero, and the
@@ -316,10 +318,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_conf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < num_queues; q++) {
 		retval = rte_eth_tx_queue_setup(port, q, txRingSize,
 					rte_eth_dev_socket_id(port),
-					NULL);
+					&txq_conf);
 		if (retval < 0) {
 			printf("initialize tx queue %d failed\n", q);
 			return retval;
-- 
2.12.0

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

* [PATCH v3 29/39] examples/vm_power_manager: convert to new offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (27 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 28/39] examples/vmdq_dcb: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 30/39] examples/distributor: convert to new ethdev " Shahaf Shuler
                       ` (10 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: David Hunt <david.hunt@intel.com>
---
 examples/vm_power_manager/main.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 399fbdd43..a0dcb97f5 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -74,7 +74,10 @@ static volatile bool force_quit;
 
 /****************/
 static const struct rte_eth_conf port_conf_default = {
-	.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
+	.rxmode = {
+		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
+	},
 };
 
 static inline int
@@ -84,10 +87,17 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	const uint16_t rx_rings = 1, tx_rings = 1;
 	int retval;
 	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txq_conf;
 
 	if (port >= rte_eth_dev_count())
 		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;
+
 	/* Configure the Ethernet device. */
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
@@ -101,10 +111,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txq_cont.offloads = port_conf.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), NULL);
+				rte_eth_dev_socket_id(port), &txq_conf);
 		if (retval < 0)
 			return retval;
 	}
-- 
2.12.0

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

* [PATCH v3 30/39] examples/distributor: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (28 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 29/39] examples/vm_power_manager: convert to new " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 31/39] examples/ethtool: " Shahaf Shuler
                       ` (9 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/distributor/main.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 61e6e6b9e..398ed1132 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -108,6 +108,7 @@ static const struct rte_eth_conf port_conf_default = {
 	.rxmode = {
 		.mq_mode = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,
@@ -140,10 +141,17 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	uint16_t q;
 	uint16_t nb_rxd = RX_RING_SIZE;
 	uint16_t nb_txd = TX_RING_SIZE;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
 
 	if (port >= rte_eth_dev_count())
 		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;
+
 	retval = rte_eth_dev_configure(port, rxRings, txRings, &port_conf);
 	if (retval != 0)
 		return retval;
@@ -160,10 +168,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < txRings; q++) {
 		retval = rte_eth_tx_queue_setup(port, q, nb_txd,
 						rte_eth_dev_socket_id(port),
-						NULL);
+						&txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
2.12.0

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

* [PATCH v3 31/39] examples/ethtool: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (29 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 30/39] examples/distributor: convert to new ethdev " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 32/39] examples/eventdev_pipeline: convert to new " Shahaf Shuler
                       ` (8 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ethtool/ethtool-app/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index bbab2f6e6..8a1a5f34e 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -124,9 +124,11 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
 	char str_name[16];
 	uint16_t nb_rxd = PORT_RX_QUEUE_SIZE;
 	uint16_t nb_txd = PORT_TX_QUEUE_SIZE;
+	struct rte_eth_txconf txconf;
 
 	memset(&cfg_port, 0, sizeof(cfg_port));
 	cfg_port.txmode.mq_mode = ETH_MQ_TX_NONE;
+	cfg_port.rxmode.ignore_offload_bitfield = 1;
 
 	for (idx_port = 0; idx_port < cnt_ports; idx_port++) {
 		struct app_port *ptr_port = &app_cfg->ports[idx_port];
@@ -160,6 +162,7 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
 						     &nb_txd) < 0)
 			rte_exit(EXIT_FAILURE,
 				 "rte_eth_dev_adjust_nb_rx_tx_desc failed");
+
 		if (rte_eth_rx_queue_setup(
 			    idx_port, 0, nb_rxd,
 			    rte_eth_dev_socket_id(idx_port), NULL,
@@ -167,9 +170,11 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
 			rte_exit(EXIT_FAILURE,
 				 "rte_eth_rx_queue_setup failed"
 				);
+		txconf = dev_info.default_txconf;
+		txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 		if (rte_eth_tx_queue_setup(
 			    idx_port, 0, nb_txd,
-			    rte_eth_dev_socket_id(idx_port), NULL) < 0)
+			    rte_eth_dev_socket_id(idx_port), &txconf) < 0)
 			rte_exit(EXIT_FAILURE,
 				 "rte_eth_tx_queue_setup failed"
 				);
-- 
2.12.0

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

* [PATCH v3 32/39] examples/eventdev_pipeline: convert to new offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (30 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 31/39] examples/ethtool: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 33/39] examples/flow_classify: convert to new ethdev " Shahaf Shuler
                       ` (7 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 examples/eventdev_pipeline_sw_pmd/main.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c
index 5f431d87d..eb3adb826 100644
--- a/examples/eventdev_pipeline_sw_pmd/main.c
+++ b/examples/eventdev_pipeline_sw_pmd/main.c
@@ -563,7 +563,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	static const struct rte_eth_conf port_conf_default = {
 		.rxmode = {
 			.mq_mode = ETH_MQ_RX_RSS,
-			.max_rx_pkt_len = ETHER_MAX_LEN
+			.max_rx_pkt_len = ETHER_MAX_LEN,
+			.ignore_offload_bitfield = 1,
 		},
 		.rx_adv_conf = {
 			.rss_conf = {
@@ -578,10 +579,17 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	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 (port >= rte_eth_dev_count())
 		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;
+
 	/* Configure the Ethernet device. */
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
@@ -595,10 +603,13 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	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), NULL);
+				rte_eth_dev_socket_id(port), &txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
2.12.0

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

* [PATCH v3 33/39] examples/flow_classify: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (31 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 32/39] examples/eventdev_pipeline: convert to new " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2018-01-03 15:09       ` Iremonger, Bernard
  2017-12-26  9:23     ` [PATCH v3 34/39] examples/flow_filtering: " Shahaf Shuler
                       ` (6 subsequent siblings)
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/flow_classify/flow_classify.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 766f1dd0e..2391a80a1 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -89,7 +89,10 @@ static struct{
 const char cb_port_delim[] = ":";
 
 static const struct rte_eth_conf port_conf_default = {
-	.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
+	.rxmode = {
+		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
+	},
 };
 
 struct flow_classifier {
@@ -216,10 +219,17 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	const uint16_t rx_rings = 1, tx_rings = 1;
 	int retval;
 	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
 
 	if (port >= rte_eth_dev_count())
 		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;
+
 	/* Configure the Ethernet device. */
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
@@ -233,10 +243,13 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.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), NULL);
+				rte_eth_dev_socket_id(port), &txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
2.12.0

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

* [PATCH v3 34/39] examples/flow_filtering: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (32 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 33/39] examples/flow_classify: convert to new ethdev " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26 13:57       ` Ori Kam
  2017-12-26  9:23     ` [PATCH v3 35/39] examples/packet_ordering: " Shahaf Shuler
                       ` (5 subsequent siblings)
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/flow_filtering/main.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index 7d739b4ae..f534f0639 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -138,18 +138,12 @@ init_port(void)
 	struct rte_eth_conf port_conf = {
 		.rxmode = {
 			.split_hdr_size = 0,
-			/**< Header Split disabled */
-			.header_split   = 0,
-			/**< IP checksum offload disabled */
-			.hw_ip_checksum = 0,
-			/**< VLAN filtering disabled */
-			.hw_vlan_filter = 0,
-			/**< Jumbo Frame Support disabled */
-			.jumbo_frame    = 0,
-			/**< CRC stripped by hardware */
-			.hw_strip_crc   = 1,
+			.ignore_offload_bitfield = 1,
+			.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
 		},
 	};
+	struct rte_eth_rxconf rxq_conf;
+	struct rte_eth_dev_info dev_info;
 
 	printf(":: initializing port: %d\n", port_id);
 	ret = rte_eth_dev_configure(port_id,
@@ -160,11 +154,14 @@ init_port(void)
 			ret, port_id);
 	}
 
+	rte_eth_dev_info_get(port_id, &dev_info);
+	rxq_conf = dev_info.default_rxconf;
+	rxq_conf.offloads = port_conf.rxmode.offloads;
 	/* only set Rx queues: something we care only so far */
 	for (i = 0; i < nr_queues; i++) {
 		ret = rte_eth_rx_queue_setup(port_id, i, 512,
 				     rte_eth_dev_socket_id(port_id),
-				     NULL,
+				     &rxq_conf,
 				     mbuf_pool);
 		if (ret < 0) {
 			rte_exit(EXIT_FAILURE,
-- 
2.12.0

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

* [PATCH v3 35/39] examples/packet_ordering: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (33 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 34/39] examples/flow_filtering: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 36/39] examples/ptpclient: " Shahaf Shuler
                       ` (4 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/packet_ordering/main.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 3add7be47..4e52c29e6 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -64,7 +64,11 @@ volatile uint8_t quit_signal;
 
 static struct rte_mempool *mbuf_pool;
 
-static struct rte_eth_conf port_conf_default;
+static struct rte_eth_conf port_conf_default = {
+	.rxmode = {
+		.ignore_offload_bitfield = 1,
+	},
+};
 
 struct worker_thread_args {
 	struct rte_ring *ring_in;
@@ -293,10 +297,17 @@ configure_eth_port(uint16_t port_id)
 	uint16_t q;
 	uint16_t nb_rxd = RX_DESC_PER_QUEUE;
 	uint16_t nb_txd = TX_DESC_PER_QUEUE;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
+	struct rte_eth_conf port_conf = port_conf_default;
 
 	if (port_id > nb_ports)
 		return -1;
 
+	rte_eth_dev_info_get(port_id, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 	ret = rte_eth_dev_configure(port_id, rxRings, txRings, &port_conf_default);
 	if (ret != 0)
 		return ret;
@@ -313,9 +324,12 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < txRings; q++) {
 		ret = rte_eth_tx_queue_setup(port_id, q, nb_txd,
-				rte_eth_dev_socket_id(port_id), NULL);
+				rte_eth_dev_socket_id(port_id), &txconf);
 		if (ret < 0)
 			return ret;
 	}
-- 
2.12.0

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

* [PATCH v3 36/39] examples/ptpclient: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (34 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 35/39] examples/packet_ordering: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2018-01-10 12:14       ` De Lara Guarch, Pablo
  2017-12-26  9:23     ` [PATCH v3 37/39] examples/rxtx_callbacks: " Shahaf Shuler
                       ` (3 subsequent siblings)
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/ptpclient/ptpclient.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index c53dad68b..f6d4877bd 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -77,7 +77,10 @@ uint8_t ptp_enabled_port_nb;
 static uint8_t ptp_enabled_ports[RTE_MAX_ETHPORTS];
 
 static const struct rte_eth_conf port_conf_default = {
-	.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
+	.rxmode = {
+		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
+	},
 };
 
 static const struct ether_addr ether_multicast = {
@@ -216,6 +219,11 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	if (port >= rte_eth_dev_count())
 		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;
+
 	/* Configure the Ethernet device. */
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
@@ -239,9 +247,9 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		/* Setup txq_flags */
 		struct rte_eth_txconf *txconf;
 
-		rte_eth_dev_info_get(q, &dev_info);
 		txconf = &dev_info.default_txconf;
-		txconf->txq_flags = 0;
+		txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
+		txconf->offloads = port_conf.txmode.offloads;
 
 		retval = rte_eth_tx_queue_setup(port, q, nb_txd,
 				rte_eth_dev_socket_id(port), txconf);
-- 
2.12.0

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

* [PATCH v3 37/39] examples/rxtx_callbacks: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (35 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 36/39] examples/ptpclient: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2017-12-26  9:23     ` [PATCH v3 38/39] examples/server_node_efd: " Shahaf Shuler
                       ` (2 subsequent siblings)
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/rxtx_callbacks/main.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index ca135d219..57c1b9853 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -47,7 +47,10 @@
 #define BURST_SIZE 32
 
 static const struct rte_eth_conf port_conf_default = {
-	.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN, },
+	.rxmode = {
+		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
+	},
 };
 
 static unsigned nb_ports;
@@ -105,10 +108,17 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	uint16_t nb_txd = TX_RING_SIZE;
 	int retval;
 	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
 
 	if (port >= rte_eth_dev_count())
 		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;
+
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
 		return retval;
@@ -124,9 +134,12 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < tx_rings; q++) {
 		retval = rte_eth_tx_queue_setup(port, q, nb_txd,
-				rte_eth_dev_socket_id(port), NULL);
+				rte_eth_dev_socket_id(port), &txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
2.12.0

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

* [PATCH v3 38/39] examples/server_node_efd: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (36 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 37/39] examples/rxtx_callbacks: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2018-01-10 12:15       ` De Lara Guarch, Pablo
  2017-12-26  9:23     ` [PATCH v3 39/39] examples/skeleton: " Shahaf Shuler
  2018-01-16 16:25     ` [PATCH v3 00/39] convert examples " Ferruh Yigit
  39 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 examples/server_node_efd/server/init.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index 0bcab8cc1..9f2d46ec0 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -123,14 +123,17 @@ static int
 init_port(uint16_t port_num)
 {
 	/* for port configuration all features are off by default */
-	const struct rte_eth_conf port_conf = {
+	struct rte_eth_conf port_conf = {
 		.rxmode = {
-			.mq_mode = ETH_MQ_RX_RSS
-		}
+			.mq_mode = ETH_MQ_RX_RSS,
+			.ignore_offload_bitfield = 1,
+		},
 	};
 	const uint16_t rx_rings = 1, tx_rings = num_nodes;
 	uint16_t rx_ring_size = RTE_MP_RX_DESC_DEFAULT;
 	uint16_t tx_ring_size = RTE_MP_TX_DESC_DEFAULT;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
 
 	uint16_t q;
 	int retval;
@@ -138,6 +141,11 @@ init_port(uint16_t port_num)
 	printf("Port %u init ... ", port_num);
 	fflush(stdout);
 
+	rte_eth_dev_info_get(port_num, &dev_info);
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+		port_conf.txmode.offloads |=
+			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
 	/*
 	 * Standard DPDK port initialisation - config port, then set up
 	 * rx and tx rings.
@@ -159,10 +167,13 @@ init_port(uint16_t port_num)
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.txmode.offloads;
 	for (q = 0; q < tx_rings; q++) {
 		retval = rte_eth_tx_queue_setup(port_num, q, tx_ring_size,
 				rte_eth_dev_socket_id(port_num),
-				NULL);
+				&txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
2.12.0

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

* [PATCH v3 39/39] examples/skeleton: convert to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (37 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 38/39] examples/server_node_efd: " Shahaf Shuler
@ 2017-12-26  9:23     ` Shahaf Shuler
  2018-01-16 16:25     ` [PATCH v3 00/39] convert examples " Ferruh Yigit
  39 siblings, 0 replies; 134+ messages in thread
From: Shahaf Shuler @ 2017-12-26  9:23 UTC (permalink / raw)
  To: dev

Ethdev offloads API has changed since:

commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")

This commit support the new API.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/skeleton/basicfwd.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index e623754cf..b46c4325b 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -47,7 +47,10 @@
 #define BURST_SIZE 32
 
 static const struct rte_eth_conf port_conf_default = {
-	.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
+	.rxmode = {
+		.max_rx_pkt_len = ETHER_MAX_LEN,
+		.ignore_offload_bitfield = 1,
+	},
 };
 
 /* basicfwd.c: Basic DPDK skeleton forwarding example. */
@@ -65,10 +68,17 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	uint16_t nb_txd = TX_RING_SIZE;
 	int retval;
 	uint16_t q;
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_txconf txconf;
 
 	if (port >= rte_eth_dev_count())
 		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;
+
 	/* Configure the Ethernet device. */
 	retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
 	if (retval != 0)
@@ -86,10 +96,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
+	txconf.offloads = port_conf.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, nb_txd,
-				rte_eth_dev_socket_id(port), NULL);
+				rte_eth_dev_socket_id(port), &txconf);
 		if (retval < 0)
 			return retval;
 	}
-- 
2.12.0

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

* Re: [PATCH v3 34/39] examples/flow_filtering: convert to new ethdev offloads API
  2017-12-26  9:23     ` [PATCH v3 34/39] examples/flow_filtering: " Shahaf Shuler
@ 2017-12-26 13:57       ` Ori Kam
  0 siblings, 0 replies; 134+ messages in thread
From: Ori Kam @ 2017-12-26 13:57 UTC (permalink / raw)
  To: Shahaf Shuler, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 26, 2017 11:24 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 34/39] examples/flow_filtering: convert to
> new ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>  examples/flow_filtering/main.c | 19 ++++++++-----------
>  1 file changed, 8 insertions(+), 11 deletions(-)
> 
> diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
> index 7d739b4ae..f534f0639 100644
> --- a/examples/flow_filtering/main.c
> +++ b/examples/flow_filtering/main.c
> @@ -138,18 +138,12 @@ init_port(void)
>  	struct rte_eth_conf port_conf = {
>  		.rxmode = {
>  			.split_hdr_size = 0,
> -			/**< Header Split disabled */
> -			.header_split   = 0,
> -			/**< IP checksum offload disabled */
> -			.hw_ip_checksum = 0,
> -			/**< VLAN filtering disabled */
> -			.hw_vlan_filter = 0,
> -			/**< Jumbo Frame Support disabled */
> -			.jumbo_frame    = 0,
> -			/**< CRC stripped by hardware */
> -			.hw_strip_crc   = 1,
> +			.ignore_offload_bitfield = 1,
> +			.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
>  		},
>  	};
> +	struct rte_eth_rxconf rxq_conf;
> +	struct rte_eth_dev_info dev_info;
> 
>  	printf(":: initializing port: %d\n", port_id);
>  	ret = rte_eth_dev_configure(port_id,
> @@ -160,11 +154,14 @@ init_port(void)
>  			ret, port_id);
>  	}
> 
> +	rte_eth_dev_info_get(port_id, &dev_info);
> +	rxq_conf = dev_info.default_rxconf;
> +	rxq_conf.offloads = port_conf.rxmode.offloads;
>  	/* only set Rx queues: something we care only so far */
>  	for (i = 0; i < nr_queues; i++) {
>  		ret = rte_eth_rx_queue_setup(port_id, i, 512,
>  				     rte_eth_dev_socket_id(port_id),
> -				     NULL,
> +				     &rxq_conf,
>  				     mbuf_pool);
>  		if (ret < 0) {
>  			rte_exit(EXIT_FAILURE,
> --
> 2.12.0

Acked-by: Ori Kam <orika@mellanox.com>

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

* Re: [PATCH v3 33/39] examples/flow_classify: convert to new ethdev offloads API
  2017-12-26  9:23     ` [PATCH v3 33/39] examples/flow_classify: convert to new ethdev " Shahaf Shuler
@ 2018-01-03 15:09       ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2018-01-03 15:09 UTC (permalink / raw)
  To: Shahaf Shuler, dev

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 26, 2017 9:24 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 33/39] examples/flow_classify: convert to new
> ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

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

* Re: [PATCH v2 15/39] examples/ipsec-secgw: convert to new ethdev offloads API
  2017-12-21 13:45       ` Shahaf Shuler
@ 2018-01-08 16:27         ` De Lara Guarch, Pablo
  2018-01-09  7:07           ` Akhil Goyal
  0 siblings, 1 reply; 134+ messages in thread
From: De Lara Guarch, Pablo @ 2018-01-08 16:27 UTC (permalink / raw)
  To: Shahaf Shuler, dev, Ananyev, Konstantin, Nicolau, Radu, arybchenko
  Cc: Akhil Goyal



> -----Original Message-----
> From: Shahaf Shuler [mailto:shahafs@mellanox.com]
> Sent: Thursday, December 21, 2017 1:45 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> Nicolau, Radu <radu.nicolau@intel.com>; arybchenko@solarflare.com
> Subject: RE: [dpdk-dev] [PATCH v2 15/39] examples/ipsec-secgw: convert to
> new ethdev offloads API
> 
> Hi Pablo and maintainers of ipsec-secgw,
> 
> Tuesday, December 19, 2017 2:39 PM, De Lara Guarch, Pablo
> > > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-
> > > secgw/ipsec-secgw.c index c98454a..1e8af8d 100644
> > > --- a/examples/ipsec-secgw/ipsec-secgw.c
> > > +++ b/examples/ipsec-secgw/ipsec-secgw.c
> > > @@ -217,6 +217,9 @@ struct lcore_conf {
> > >  	},
> > >  	.txmode = {
> > >  		.mq_mode = ETH_MQ_TX_NONE,
> > > +		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
> > > +			     DEV_TX_OFFLOAD_MULTI_SEGS |
> > > +			     DEV_TX_OFFLOAD_MBUF_FAST_FREE),
> >
> > Hi Shahaf,
> >
> > Isn't this removing some checksums that were previously done?
> > Txq_flags was set to 0, which means that SCTP, UDP... checksums are
> > disabled now?
> 
> You are right that before txqflags were 0, but it doesn't seem the
> application uses any Tx checksum offload beside IPv4, as seen on snipped
> code[1].
> If I was mistaken and it does uses L4 checksums then I will need to update
> this commit.
> 
> Maintainers of this examples - can you confirm?
> 
Akhil, Radu, could you confirm that this change is OK for the IPSec app?
There is a v3 already of this patch: http://dpdk.org/dev/patchwork/patch/32711/

Thanks,
Pablo

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

* Re: [PATCH v2 15/39] examples/ipsec-secgw: convert to new ethdev offloads API
  2018-01-08 16:27         ` De Lara Guarch, Pablo
@ 2018-01-09  7:07           ` Akhil Goyal
  0 siblings, 0 replies; 134+ messages in thread
From: Akhil Goyal @ 2018-01-09  7:07 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, Shahaf Shuler, dev, Ananyev, Konstantin,
	Nicolau, Radu, arybchenko

Hi Pablo,

On 1/8/2018 9:57 PM, De Lara Guarch, Pablo wrote:
> 
> 
>> -----Original Message-----
>> From: Shahaf Shuler [mailto:shahafs@mellanox.com]
>> Sent: Thursday, December 21, 2017 1:45 PM
>> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
>> dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
>> Nicolau, Radu <radu.nicolau@intel.com>; arybchenko@solarflare.com
>> Subject: RE: [dpdk-dev] [PATCH v2 15/39] examples/ipsec-secgw: convert to
>> new ethdev offloads API
>>
>> Hi Pablo and maintainers of ipsec-secgw,
>>
>> Tuesday, December 19, 2017 2:39 PM, De Lara Guarch, Pablo
>>>> diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-
>>>> secgw/ipsec-secgw.c index c98454a..1e8af8d 100644
>>>> --- a/examples/ipsec-secgw/ipsec-secgw.c
>>>> +++ b/examples/ipsec-secgw/ipsec-secgw.c
>>>> @@ -217,6 +217,9 @@ struct lcore_conf {
>>>>   	},
>>>>   	.txmode = {
>>>>   		.mq_mode = ETH_MQ_TX_NONE,
>>>> +		.offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
>>>> +			     DEV_TX_OFFLOAD_MULTI_SEGS |
>>>> +			     DEV_TX_OFFLOAD_MBUF_FAST_FREE),
>>>
>>> Hi Shahaf,
>>>
>>> Isn't this removing some checksums that were previously done?
>>> Txq_flags was set to 0, which means that SCTP, UDP... checksums are
>>> disabled now?
>>
>> You are right that before txqflags were 0, but it doesn't seem the
>> application uses any Tx checksum offload beside IPv4, as seen on snipped
>> code[1].
>> If I was mistaken and it does uses L4 checksums then I will need to update
>> this commit.
>>
>> Maintainers of this examples - can you confirm?
>>
> Akhil, Radu, could you confirm that this change is OK for the IPSec app?
> There is a v3 already of this patch: http://dpdk.org/dev/patchwork/patch/32711/
> 
> Thanks,
> Pablo
> 
I believe Radu is a better person to review this one. It is related to 
ethernet offloads.

-Akhil

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

* Re: [PATCH v3 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-12-26  9:23     ` [PATCH v3 01/39] examples/l2fwd: convert " Shahaf Shuler
@ 2018-01-10 12:12       ` De Lara Guarch, Pablo
  2018-01-12 13:30       ` Ferruh Yigit
  1 sibling, 0 replies; 134+ messages in thread
From: De Lara Guarch, Pablo @ 2018-01-10 12:12 UTC (permalink / raw)
  To: Shahaf Shuler, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 26, 2017 9:23 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 01/39] examples/l2fwd: convert to new
> ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

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

* Re: [PATCH v3 02/39] examples/l2fwd-crypto: convert to new ethdev offloads API
  2017-12-26  9:23     ` [PATCH v3 02/39] examples/l2fwd-crypto: " Shahaf Shuler
@ 2018-01-10 12:12       ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 134+ messages in thread
From: De Lara Guarch, Pablo @ 2018-01-10 12:12 UTC (permalink / raw)
  To: Shahaf Shuler, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 26, 2017 9:23 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 02/39] examples/l2fwd-crypto: convert to
> new ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

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

* Re: [PATCH v3 03/39] examples/l2fwd-jobstats: convert to new ethdev offloads API
  2017-12-26  9:23     ` [PATCH v3 03/39] examples/l2fwd-jobstats: " Shahaf Shuler
@ 2018-01-10 12:13       ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 134+ messages in thread
From: De Lara Guarch, Pablo @ 2018-01-10 12:13 UTC (permalink / raw)
  To: Shahaf Shuler, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 26, 2017 9:23 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 03/39] examples/l2fwd-jobstats: convert to
> new ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

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

* Re: [PATCH v3 36/39] examples/ptpclient: convert to new ethdev offloads API
  2017-12-26  9:23     ` [PATCH v3 36/39] examples/ptpclient: " Shahaf Shuler
@ 2018-01-10 12:14       ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 134+ messages in thread
From: De Lara Guarch, Pablo @ 2018-01-10 12:14 UTC (permalink / raw)
  To: Shahaf Shuler, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 26, 2017 9:24 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 36/39] examples/ptpclient: convert to new
> ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

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

* Re: [PATCH v3 38/39] examples/server_node_efd: convert to new ethdev offloads API
  2017-12-26  9:23     ` [PATCH v3 38/39] examples/server_node_efd: " Shahaf Shuler
@ 2018-01-10 12:15       ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 134+ messages in thread
From: De Lara Guarch, Pablo @ 2018-01-10 12:15 UTC (permalink / raw)
  To: Shahaf Shuler, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 26, 2017 9:24 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 38/39] examples/server_node_efd: convert
> to new ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

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

* Re: [PATCH v3 01/39] examples/l2fwd: convert to new ethdev offloads API
  2017-12-26  9:23     ` [PATCH v3 01/39] examples/l2fwd: convert " Shahaf Shuler
  2018-01-10 12:12       ` De Lara Guarch, Pablo
@ 2018-01-12 13:30       ` Ferruh Yigit
  2018-01-14 10:37         ` Shahaf Shuler
  1 sibling, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2018-01-12 13:30 UTC (permalink / raw)
  To: Shahaf Shuler, dev

On 12/26/2017 9:23 AM, Shahaf Shuler wrote:
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.

This patch does three things:
1- Convert bit-field Rx Offload information to new bitwise "offloads" variable.
2- Use new queue specific offload configuration for Rx/Tx
3- Enable new mbuf fast free Tx offload


1 and 2 can be classified as "convert to new ethdev offloads", but I am not sure
about 3.

Wouldn't be better to enable new offloadings in a separate patch, other than
convert one? And I don't know if we want to enable that specific offload for all
samples.

> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>  examples/l2fwd/main.c | 28 +++++++++++++++++++---------
>  1 file changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
> index e89e2e1bf..4436ea587 100644
> --- a/examples/l2fwd/main.c
> +++ b/examples/l2fwd/main.c
> @@ -110,14 +110,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
>  
>  static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
>  
> -static const struct rte_eth_conf port_conf = {
> +static struct rte_eth_conf port_conf = {
>  	.rxmode = {
>  		.split_hdr_size = 0,
> -		.header_split   = 0, /**< Header Split disabled */
> -		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
> -		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
> -		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
> -		.hw_strip_crc   = 1, /**< CRC stripped by hardware */
> +		.ignore_offload_bitfield = 1,
> +		.offloads = DEV_RX_OFFLOAD_CRC_STRIP,
>  	},
>  	.txmode = {
>  		.mq_mode = ETH_MQ_TX_NONE,
> @@ -649,6 +646,10 @@ main(int argc, char **argv)
>  
>  	/* Initialise each port */
>  	for (portid = 0; portid < nb_ports; portid++) {
> +		struct rte_eth_rxconf rxq_conf;
> +		struct rte_eth_txconf txq_conf;
> +		struct rte_eth_conf local_port_conf = port_conf;
> +
>  		/* skip ports that are not enabled */
>  		if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
>  			printf("Skipping disabled port %u\n", portid);
> @@ -658,7 +659,11 @@ main(int argc, char **argv)
>  		/* init port */
>  		printf("Initializing port %u... ", portid);
>  		fflush(stdout);
> -		ret = rte_eth_dev_configure(portid, 1, 1, &port_conf);
> +		rte_eth_dev_info_get(portid, &dev_info);
> +		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
> +			local_port_conf.txmode.offloads |=
> +				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
> +		ret = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
>  		if (ret < 0)
>  			rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
>  				  ret, portid);
> @@ -674,9 +679,11 @@ main(int argc, char **argv)
>  
>  		/* init one RX queue */
>  		fflush(stdout);
> +		rxq_conf = dev_info.default_rxconf;
> +		rxq_conf.offloads = local_port_conf.rxmode.offloads;
>  		ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
>  					     rte_eth_dev_socket_id(portid),
> -					     NULL,
> +					     &rxq_conf,
>  					     l2fwd_pktmbuf_pool);
>  		if (ret < 0)
>  			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
> @@ -684,9 +691,12 @@ main(int argc, char **argv)
>  
>  		/* init one TX queue on each port */
>  		fflush(stdout);
> +		txq_conf = dev_info.default_txconf;
> +		txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
> +		txq_conf.offloads = local_port_conf.txmode.offloads;
>  		ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
>  				rte_eth_dev_socket_id(portid),
> -				NULL);
> +				&txq_conf);
>  		if (ret < 0)
>  			rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n",
>  				ret, portid);
> 

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

* Re: [PATCH v3 01/39] examples/l2fwd: convert to new ethdev offloads API
  2018-01-12 13:30       ` Ferruh Yigit
@ 2018-01-14 10:37         ` Shahaf Shuler
  2018-01-15 10:20           ` Ferruh Yigit
  0 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2018-01-14 10:37 UTC (permalink / raw)
  To: Ferruh Yigit, dev

Friday, January 12, 2018 3:31 PM, Ferruh Yigit:
> On 12/26/2017 9:23 AM, Shahaf Shuler wrote:
> > Ethdev offloads API has changed since:
> >
> > commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> > cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> >
> > This commit support the new API.
> 
> This patch does three things:
> 1- Convert bit-field Rx Offload information to new bitwise "offloads" variable.
> 2- Use new queue specific offload configuration for Rx/Tx
> 3- Enable new mbuf fast free Tx offload
> 
> 
> 1 and 2 can be classified as "convert to new ethdev offloads", but I am not
> sure about 3.

I think all of the 3 should be in a single patch.
The reason is that the convert patch should maintain the same offloads configuration needed for the application.
Before the convert patch the examples were using the default configuration set by the PMD. In there the txq flags were set to ignore ref count and to declare all mbufs are from the same pool. 
The fast free Tx offload was added in order to keep this old offloads configuration.

> 
> Wouldn't be better to enable new offloadings in a separate patch, other than
> convert one? And I don't know if we want to enable that specific offload for
> all samples.

As you can see, not all the examples has the FAST_FREE offloads, only the entitled ones (i.e. single mempool and no ref count).
For example, ipv4_multicast doesn't set this offload flag.

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

* Re: [PATCH v3 01/39] examples/l2fwd: convert to new ethdev offloads API
  2018-01-14 10:37         ` Shahaf Shuler
@ 2018-01-15 10:20           ` Ferruh Yigit
  2018-01-15 11:02             ` Shahaf Shuler
  0 siblings, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2018-01-15 10:20 UTC (permalink / raw)
  To: Shahaf Shuler, dev

On 1/14/2018 10:37 AM, Shahaf Shuler wrote:
> Friday, January 12, 2018 3:31 PM, Ferruh Yigit:
>> On 12/26/2017 9:23 AM, Shahaf Shuler wrote:
>>> Ethdev offloads API has changed since:
>>>
>>> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
>>> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
>>>
>>> This commit support the new API.
>>
>> This patch does three things:
>> 1- Convert bit-field Rx Offload information to new bitwise "offloads" variable.
>> 2- Use new queue specific offload configuration for Rx/Tx
>> 3- Enable new mbuf fast free Tx offload
>>
>>
>> 1 and 2 can be classified as "convert to new ethdev offloads", but I am not
>> sure about 3.
> 
> I think all of the 3 should be in a single patch.
> The reason is that the convert patch should maintain the same offloads configuration needed for the application.

Perhaps I am missing some details about "mbuf fast free" offload, can you please
give more details about it, what does having or not having it mean?
Currently no PMD seems implemented it.

> Before the convert patch the examples were using the default configuration set by the PMD. In there the txq flags were set to ignore ref count and to declare all mbufs are from the same pool. 
> The fast free Tx offload was added in order to keep this old offloads configuration.
> 
>>
>> Wouldn't be better to enable new offloadings in a separate patch, other than
>> convert one? And I don't know if we want to enable that specific offload for
>> all samples.
> 
> As you can see, not all the examples has the FAST_FREE offloads, only the entitled ones (i.e. single mempool and no ref count).
> For example, ipv4_multicast doesn't set this offload flag.
> 

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

* Re: [PATCH v3 01/39] examples/l2fwd: convert to new ethdev offloads API
  2018-01-15 10:20           ` Ferruh Yigit
@ 2018-01-15 11:02             ` Shahaf Shuler
  2018-01-15 11:34               ` Ferruh Yigit
  0 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2018-01-15 11:02 UTC (permalink / raw)
  To: Ferruh Yigit, dev

Monday, January 15, 2018 12:21 PM, Ferruh Yigit:
> > I think all of the 3 should be in a single patch.
> > The reason is that the convert patch should maintain the same offloads
> configuration needed for the application.
> 
> Perhaps I am missing some details about "mbuf fast free" offload, can you
> please give more details about it, what does having or not having it mean?
> Currently no PMD seems implemented it.

Sure,

FAST_FREE offload is the logical AND between the old txqflags of:
ETH_TXQ_FLAGS_NOREFCOUNT
ETH_TXQ_FLAGS_NOMULTMEM

The offload is just a performance optimization. As specified in the documentation [1] it enables the PMDs to further optimize the data path given the guarantees from the application. 
Not having it means possible performance degradation for some PMD which rely on it.

There is no PMD which implement it yet since not all PMDs moved to the new offloads API. However this flag is tested and translated into txqflags as part of rte_eth_convert_txq_offloads function.
Relevant PMDs for this offload will be: sfc, thunderx and i40e.


[1]
/**< Device supports optimization for fast release of mbufs.                 
  *   When set application must guarantee that per-queue all mbufs comes from 
  *   the same mempool and has refcnt = 1.                                    
  */                                                                           

> 
> > Before the convert patch the examples were using the default
> configuration set by the PMD. In there the txq flags were set to ignore ref
> count and to declare all mbufs are from the same pool.
> > The fast free Tx offload was added in order to keep this old offloads
> configuration.
> >
> >>
> >> Wouldn't be better to enable new offloadings in a separate patch,
> >> other than convert one? And I don't know if we want to enable that
> >> specific offload for all samples.
> >
> > As you can see, not all the examples has the FAST_FREE offloads, only the
> entitled ones (i.e. single mempool and no ref count).
> > For example, ipv4_multicast doesn't set this offload flag.
> >


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

* Re: [PATCH v3 01/39] examples/l2fwd: convert to new ethdev offloads API
  2018-01-15 11:02             ` Shahaf Shuler
@ 2018-01-15 11:34               ` Ferruh Yigit
  2018-01-15 11:41                 ` Shahaf Shuler
  0 siblings, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2018-01-15 11:34 UTC (permalink / raw)
  To: Shahaf Shuler, dev

On 1/15/2018 11:02 AM, Shahaf Shuler wrote:
> Monday, January 15, 2018 12:21 PM, Ferruh Yigit:
>>> I think all of the 3 should be in a single patch.
>>> The reason is that the convert patch should maintain the same offloads
>> configuration needed for the application.
>>
>> Perhaps I am missing some details about "mbuf fast free" offload, can you
>> please give more details about it, what does having or not having it mean?
>> Currently no PMD seems implemented it.
> 
> Sure,
> 
> FAST_FREE offload is the logical AND between the old txqflags of:
> ETH_TXQ_FLAGS_NOREFCOUNT
> ETH_TXQ_FLAGS_NOMULTMEM
> 
> The offload is just a performance optimization. As specified in the documentation [1] it enables the PMDs to further optimize the data path given the guarantees from the application. 
> Not having it means possible performance degradation for some PMD which rely on it.
> 
> There is no PMD which implement it yet since not all PMDs moved to the new offloads API. However this flag is tested and translated into txqflags as part of rte_eth_convert_txq_offloads function.
> Relevant PMDs for this offload will be: sfc, thunderx and i40e.

Thank you for clarification, I am OK to have it.

But since currently no PMD provide "DEV_TX_OFFLOAD_MBUF_FAST_FREE" capability,
and default txq_flags is overwritten, some PMDs lost this optimization until
they implement new capability, right?

> 
> 
> [1]
> /**< Device supports optimization for fast release of mbufs.                 
>   *   When set application must guarantee that per-queue all mbufs comes from 
>   *   the same mempool and has refcnt = 1.                                    
>   */                                                                           
> 
>>
>>> Before the convert patch the examples were using the default
>> configuration set by the PMD. In there the txq flags were set to ignore ref
>> count and to declare all mbufs are from the same pool.
>>> The fast free Tx offload was added in order to keep this old offloads
>> configuration.
>>>
>>>>
>>>> Wouldn't be better to enable new offloadings in a separate patch,
>>>> other than convert one? And I don't know if we want to enable that
>>>> specific offload for all samples.
>>>
>>> As you can see, not all the examples has the FAST_FREE offloads, only the
>> entitled ones (i.e. single mempool and no ref count).
>>> For example, ipv4_multicast doesn't set this offload flag.
>>>
> 

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

* Re: [PATCH v3 01/39] examples/l2fwd: convert to new ethdev offloads API
  2018-01-15 11:34               ` Ferruh Yigit
@ 2018-01-15 11:41                 ` Shahaf Shuler
  2018-01-15 11:56                   ` Ferruh Yigit
  0 siblings, 1 reply; 134+ messages in thread
From: Shahaf Shuler @ 2018-01-15 11:41 UTC (permalink / raw)
  To: Ferruh Yigit, dev

Monday, January 15, 2018 1:34 PM, Ferruh Yigit:
> >> Currently no PMD seems implemented it.
> >
> > Sure,
> >
> > FAST_FREE offload is the logical AND between the old txqflags of:
> > ETH_TXQ_FLAGS_NOREFCOUNT
> > ETH_TXQ_FLAGS_NOMULTMEM
> >
> > The offload is just a performance optimization. As specified in the
> documentation [1] it enables the PMDs to further optimize the data path
> given the guarantees from the application.
> > Not having it means possible performance degradation for some PMD
> which rely on it.
> >
> > There is no PMD which implement it yet since not all PMDs moved to the
> new offloads API. However this flag is tested and translated into txqflags as
> part of rte_eth_convert_txq_offloads function.
> > Relevant PMDs for this offload will be: sfc, thunderx and i40e.
> 
> Thank you for clarification, I am OK to have it.
> 
> But since currently no PMD provide "DEV_TX_OFFLOAD_MBUF_FAST_FREE"
> capability, and default txq_flags is overwritten, some PMDs lost this
> optimization until they implement new capability, right?

Yes this is correct, a good motivation to convert :). 
From the examples and testpmd part everything is ready. Just need for the PMD to report back the capability to have this offload. 


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

* Re: [PATCH v3 01/39] examples/l2fwd: convert to new ethdev offloads API
  2018-01-15 11:41                 ` Shahaf Shuler
@ 2018-01-15 11:56                   ` Ferruh Yigit
  0 siblings, 0 replies; 134+ messages in thread
From: Ferruh Yigit @ 2018-01-15 11:56 UTC (permalink / raw)
  To: Shahaf Shuler, dev

On 1/15/2018 11:41 AM, Shahaf Shuler wrote:
> Monday, January 15, 2018 1:34 PM, Ferruh Yigit:
>>>> Currently no PMD seems implemented it.
>>>
>>> Sure,
>>>
>>> FAST_FREE offload is the logical AND between the old txqflags of:
>>> ETH_TXQ_FLAGS_NOREFCOUNT
>>> ETH_TXQ_FLAGS_NOMULTMEM
>>>
>>> The offload is just a performance optimization. As specified in the
>> documentation [1] it enables the PMDs to further optimize the data path
>> given the guarantees from the application.
>>> Not having it means possible performance degradation for some PMD
>> which rely on it.
>>>
>>> There is no PMD which implement it yet since not all PMDs moved to the
>> new offloads API. However this flag is tested and translated into txqflags as
>> part of rte_eth_convert_txq_offloads function.
>>> Relevant PMDs for this offload will be: sfc, thunderx and i40e.
>>
>> Thank you for clarification, I am OK to have it.
>>
>> But since currently no PMD provide "DEV_TX_OFFLOAD_MBUF_FAST_FREE"
>> capability, and default txq_flags is overwritten, some PMDs lost this
>> optimization until they implement new capability, right?
> 
> Yes this is correct, a good motivation to convert :). 

My concern is being close to the integration deadline and if this patch cause
performance drop for some PMDs.
But I guess we can get the related PMD fixes almost until release if an issue
observed, so this gives time to PMD maintainers.

For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

> From the examples and testpmd part everything is ready. Just need for the PMD to report back the capability to have this offload. 
> 

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

* Re: [PATCH v3 15/39] examples/ipsec-secgw: convert to new ethdev offloads API
  2017-12-26  9:23     ` [PATCH v3 15/39] examples/ipsec-secgw: " Shahaf Shuler
@ 2018-01-16 11:10       ` Nicolau, Radu
  0 siblings, 0 replies; 134+ messages in thread
From: Nicolau, Radu @ 2018-01-16 11:10 UTC (permalink / raw)
  To: Shahaf Shuler, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 26, 2017 9:23 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 15/39] examples/ipsec-secgw: convert to
> new ethdev offloads API
> 
> Ethdev offloads API has changed since:
> 
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit
> cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> This commit support the new API.
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
> 

Acked-by: Radu Nicolau <radu.nicolau@intel.com>

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

* Re: [PATCH v3 00/39] convert examples to new ethdev offloads API
  2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
                       ` (38 preceding siblings ...)
  2017-12-26  9:23     ` [PATCH v3 39/39] examples/skeleton: " Shahaf Shuler
@ 2018-01-16 16:25     ` Ferruh Yigit
  39 siblings, 0 replies; 134+ messages in thread
From: Ferruh Yigit @ 2018-01-16 16:25 UTC (permalink / raw)
  To: Shahaf Shuler, dev

On 12/26/2017 9:22 AM, Shahaf Shuler wrote:
> This series is to convert DPDK examples to the new offloads API [1].
> 
> on v3:
>  - Set DEV_TX_OFFLOAD_MBUF_FAST_FREE only if device supports.
>  - Remove error prints from application.
>  - Fix configuration of mutiple ports without override the global port config.
> 
> on v2:
>  - Add DEV_TX_OFFLOAD_MBUF_FAST_FREE offload of entitled examples.
>  - Instead of masking the un-supported offloads print a warning and let
>    the PMD to fail the configuration.
> 
> [1] http://dpdk.org/ml/archives/dev/2017-October/077329.html
> 
> Shahaf Shuler (39):
>   examples/l2fwd: convert to new ethdev offloads API
>   examples/l2fwd-crypto: convert to new ethdev offloads API
>   examples/l2fwd-jobstats: convert to new ethdev offloads API
>   examples/l2fwd-keepalive: convert to new ethdev offloads API
>   examples/l3fwd: convert to ethdev offloads API
>   examples/l3fwd-acl: convert to new ethdev offloads API
>   examples/l3fwd-power: convert to new ethdev offloads API
>   examples/l3fwd-vf: convert to new ethdev offloads API
>   examples/bond: convert to new ethdev offloads API
>   examples/exception_path: convert to new ethdev offloads API
>   examples/kni: convert to new ethdev offloads API
>   examples/ip_fragmentation: convert to new offloads API
>   examples/ip_pipeline: convert to new ethdev offloads API
>   examples/ip_reassembly: convert to new ethdev offloads API
>   examples/ipsec-secgw: convert to new ethdev offloads API
>   examples/ipv4_multicast: convert to new ethdev offloads API
>   examples/link_status_interrupt: convert to new offloads API
>   examples/load_balancer: convert to new ethdev offloads API
>   examples/multi_process: convert to new ethdev offloads API
>   examples/netmap_compat: convert to new ethdev offloads API
>   examples/performance-thread: convert to new offloads API
>   examples/qos_meter: convert to new ethdev offloads API
>   examples/qos_sched: convert to new ethdev offloads API
>   examples/quota_watermark: convert to new ethdev offloads API
>   examples/tep_termination: convert to new ethdev offloads API
>   examples/vhost: convert to new ethdev offloads API
>   examples/vmdq: convert to new ethdev offloads API
>   examples/vmdq_dcb: convert to new ethdev offloads API
>   examples/vm_power_manager: convert to new offloads API
>   examples/distributor: convert to new ethdev offloads API
>   examples/ethtool: convert to new ethdev offloads API
>   examples/eventdev_pipeline: convert to new offloads API
>   examples/flow_classify: convert to new ethdev offloads API
>   examples/flow_filtering: convert to new ethdev offloads API
>   examples/packet_ordering: convert to new ethdev offloads API
>   examples/ptpclient: convert to new ethdev offloads API
>   examples/rxtx_callbacks: convert to new ethdev offloads API
>   examples/server_node_efd: convert to new ethdev offloads API
>   examples/skeleton: convert to new ethdev offloads API

Series applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2018-01-16 16:25 UTC | newest]

Thread overview: 134+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-23 12:14 [PATCH 00/39] convert examples to new ethdev offloads API Shahaf Shuler
2017-11-23 12:14 ` [PATCH 01/39] examples/l2fwd: convert " Shahaf Shuler
2017-11-24 15:00   ` Andrew Rybchenko
2017-11-26  7:41     ` Shahaf Shuler
2017-11-27  6:34       ` Andrew Rybchenko
2017-11-27  7:03         ` Shahaf Shuler
2017-11-27  7:33           ` Jerin Jacob
2017-11-27 19:41             ` Shahaf Shuler
2017-11-27  7:40           ` Andrew Rybchenko
2017-11-23 12:14 ` [PATCH 02/39] examples/l2fwd-crypto: " Shahaf Shuler
2017-11-23 12:14 ` [PATCH 03/39] examples/l2fwd-jobstats: " Shahaf Shuler
2017-11-23 12:14 ` [PATCH 04/39] examples/l2fwd-keepalive: " Shahaf Shuler
2017-11-23 12:14 ` [PATCH 05/39] examples/l3fwd: move to " Shahaf Shuler
2017-11-23 12:14 ` [PATCH 06/39] examples/l3fwd-acl: convert to new " Shahaf Shuler
2017-12-11 14:48   ` Ananyev, Konstantin
2017-11-23 12:14 ` [PATCH 07/39] examples/l3fwd-power: " Shahaf Shuler
2017-12-11 14:00   ` Hunt, David
2017-11-23 12:14 ` [PATCH 08/39] examples/l3fwd-vf: " Shahaf Shuler
2017-11-23 12:14 ` [PATCH 09/39] examples/bond: " Shahaf Shuler
2017-12-11 11:08   ` Radu Nicolau
2017-12-04 12:12 ` [PATCH 00/39] convert examples " Shahaf Shuler
2017-12-12 12:26 ` [PATCH v2 " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 01/39] examples/l2fwd: convert " Shahaf Shuler
2017-12-19 12:16     ` De Lara Guarch, Pablo
2017-12-12 12:26   ` [PATCH v2 02/39] examples/l2fwd-crypto: " Shahaf Shuler
2017-12-19 12:18     ` De Lara Guarch, Pablo
2017-12-12 12:26   ` [PATCH v2 03/39] examples/l2fwd-jobstats: " Shahaf Shuler
2017-12-19 12:33     ` De Lara Guarch, Pablo
2017-12-21 13:47       ` Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 04/39] examples/l2fwd-keepalive: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 05/39] examples/l3fwd: move to " Shahaf Shuler
2017-12-12 17:12     ` Ananyev, Konstantin
2017-12-13  7:21       ` Shahaf Shuler
2017-12-13  7:55         ` Jerin Jacob
2017-12-13 12:10           ` Ananyev, Konstantin
2017-12-13 17:32             ` Jerin Jacob
2017-12-21 14:26               ` Shahaf Shuler
2017-12-18 16:00     ` Maciej Czekaj
2017-12-21 14:08       ` Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 06/39] examples/l3fwd-acl: convert to new " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 07/39] examples/l3fwd-power: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 08/39] examples/l3fwd-vf: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 09/39] examples/bond: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 10/39] examples/exception_path: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 11/39] examples/kni: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 12/39] examples/ip_fragmentation: convert to new " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 13/39] examples/ip_pipeline: convert to new ethdev " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 14/39] examples/ip_reassembly: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 15/39] examples/ipsec-secgw: " Shahaf Shuler
2017-12-19 12:38     ` De Lara Guarch, Pablo
2017-12-21 13:45       ` Shahaf Shuler
2018-01-08 16:27         ` De Lara Guarch, Pablo
2018-01-09  7:07           ` Akhil Goyal
2017-12-12 12:26   ` [PATCH v2 16/39] examples/ipv4_multicast: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 17/39] examples/link_status_interrupt: convert to new " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 18/39] examples/load_balancer: convert to new ethdev " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 19/39] examples/multi_process: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 20/39] examples/netmap_compat: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 21/39] examples/performance-thread: convert to new " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 22/39] examples/qos_meter: convert to new ethdev " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 23/39] examples/qos_sched: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 24/39] examples/quota_watermark: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 25/39] examples/tep_termination: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 26/39] examples/vhost: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 27/39] examples/vmdq: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 28/39] examples/vmdq_dcb: " Shahaf Shuler
2017-12-12 12:26   ` [PATCH v2 29/39] examples/vm_power_manager: convert to new " Shahaf Shuler
2017-12-12 12:35   ` [PATCH v2 30/39] examples/distributor: convert to new ethdev " Shahaf Shuler
2017-12-12 12:35   ` [PATCH v2 31/39] examples/ethtool: " Shahaf Shuler
2017-12-12 12:35   ` [PATCH v2 32/39] examples/eventdev_pipeline: convert to new " Shahaf Shuler
2017-12-15 15:20     ` Van Haaren, Harry
2017-12-12 12:35   ` [PATCH v2 33/39] examples/flow_classify: convert to new ethdev " Shahaf Shuler
2017-12-12 12:35   ` [PATCH v2 34/39] examples/flow_filtering: " Shahaf Shuler
2017-12-12 12:35   ` [PATCH v2 35/39] examples/packet_ordering: " Shahaf Shuler
2017-12-12 12:35   ` [PATCH v2 36/39] examples/ptpclient: " Shahaf Shuler
2017-12-12 12:35   ` [PATCH v2 37/39] examples/rxtx_callbacks: " Shahaf Shuler
2017-12-12 12:35   ` [PATCH v2 38/39] examples/server_node_efd: " Shahaf Shuler
2017-12-12 12:35   ` [PATCH v2 39/39] examples/skeleton: " Shahaf Shuler
2017-12-26  9:22   ` [PATCH v3 00/39] convert examples " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 01/39] examples/l2fwd: convert " Shahaf Shuler
2018-01-10 12:12       ` De Lara Guarch, Pablo
2018-01-12 13:30       ` Ferruh Yigit
2018-01-14 10:37         ` Shahaf Shuler
2018-01-15 10:20           ` Ferruh Yigit
2018-01-15 11:02             ` Shahaf Shuler
2018-01-15 11:34               ` Ferruh Yigit
2018-01-15 11:41                 ` Shahaf Shuler
2018-01-15 11:56                   ` Ferruh Yigit
2017-12-26  9:23     ` [PATCH v3 02/39] examples/l2fwd-crypto: " Shahaf Shuler
2018-01-10 12:12       ` De Lara Guarch, Pablo
2017-12-26  9:23     ` [PATCH v3 03/39] examples/l2fwd-jobstats: " Shahaf Shuler
2018-01-10 12:13       ` De Lara Guarch, Pablo
2017-12-26  9:23     ` [PATCH v3 04/39] examples/l2fwd-keepalive: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 05/39] examples/l3fwd: convert to " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 06/39] examples/l3fwd-acl: convert to new " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 07/39] examples/l3fwd-power: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 08/39] examples/l3fwd-vf: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 09/39] examples/bond: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 10/39] examples/exception_path: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 11/39] examples/kni: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 12/39] examples/ip_fragmentation: convert to new " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 13/39] examples/ip_pipeline: convert to new ethdev " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 14/39] examples/ip_reassembly: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 15/39] examples/ipsec-secgw: " Shahaf Shuler
2018-01-16 11:10       ` Nicolau, Radu
2017-12-26  9:23     ` [PATCH v3 16/39] examples/ipv4_multicast: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 17/39] examples/link_status_interrupt: convert to new " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 18/39] examples/load_balancer: convert to new ethdev " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 19/39] examples/multi_process: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 20/39] examples/netmap_compat: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 21/39] examples/performance-thread: convert to new " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 22/39] examples/qos_meter: convert to new ethdev " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 23/39] examples/qos_sched: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 24/39] examples/quota_watermark: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 25/39] examples/tep_termination: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 26/39] examples/vhost: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 27/39] examples/vmdq: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 28/39] examples/vmdq_dcb: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 29/39] examples/vm_power_manager: convert to new " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 30/39] examples/distributor: convert to new ethdev " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 31/39] examples/ethtool: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 32/39] examples/eventdev_pipeline: convert to new " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 33/39] examples/flow_classify: convert to new ethdev " Shahaf Shuler
2018-01-03 15:09       ` Iremonger, Bernard
2017-12-26  9:23     ` [PATCH v3 34/39] examples/flow_filtering: " Shahaf Shuler
2017-12-26 13:57       ` Ori Kam
2017-12-26  9:23     ` [PATCH v3 35/39] examples/packet_ordering: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 36/39] examples/ptpclient: " Shahaf Shuler
2018-01-10 12:14       ` De Lara Guarch, Pablo
2017-12-26  9:23     ` [PATCH v3 37/39] examples/rxtx_callbacks: " Shahaf Shuler
2017-12-26  9:23     ` [PATCH v3 38/39] examples/server_node_efd: " Shahaf Shuler
2018-01-10 12:15       ` De Lara Guarch, Pablo
2017-12-26  9:23     ` [PATCH v3 39/39] examples/skeleton: " Shahaf Shuler
2018-01-16 16:25     ` [PATCH v3 00/39] convert examples " Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.