DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API
@ 2017-11-23 12:19 Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 11/39] examples/kni: " Shahaf Shuler
                   ` (28 more replies)
  0 siblings, 29 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 38 +++++++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index f8f5bbdf0..e5f69a4f6 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,10 +444,30 @@ 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;
 
 	/* 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);
+		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);
+		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 +477,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 = 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);
-- 
2.12.0

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

* [dpdk-dev] [PATCH 11/39] examples/kni: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 12/39] examples/ip_fragmentation: convert to new " Shahaf Shuler
                   ` (27 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 67 +++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 58 insertions(+), 9 deletions(-)

diff --git a/examples/kni/main.c b/examples/kni/main.c
index 3f1738544..ae5a8c61c 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,10 +604,30 @@ 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;
 
 	/* 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);
+		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);
+		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 +638,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 = 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 +724,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,19 +742,43 @@ 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 +
 							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);
+		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)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) {
-- 
2.12.0

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

* [dpdk-dev] [PATCH 12/39] examples/ip_fragmentation: convert to new offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 11/39] examples/kni: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-12-11 14:56   ` Ananyev, Konstantin
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 13/39] examples/ip_pipeline: convert to new ethdev " Shahaf Shuler
                   ` (26 subsequent siblings)
  28 siblings, 1 reply; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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_fragmentation/main.c | 36 ++++++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 7 deletions(-)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 5aefe0987..ab728989f 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,8 @@ main(int argc, char **argv)
 
 	/* 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 +952,22 @@ 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.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, (uint16_t)n_tx_queue,
 					    &port_conf);
 		if (ret < 0) {
@@ -967,8 +986,10 @@ main(int argc, char **argv)
 		}
 
 		/* 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 +1013,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 = 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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 13/39] examples/ip_pipeline: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 11/39] examples/kni: " Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 12/39] examples/ip_fragmentation: convert to new " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 14/39] examples/ip_reassembly: " Shahaf Shuler
                   ` (25 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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         | 30 ++++++++++++++++++++++++++----
 2 files changed, 29 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..79a2fbb63 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,25 @@ 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.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);
+			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);
+			p_link->conf.txmode.offloads &=
+						dev_info.tx_offload_capa;
+		}
 		status = rte_eth_dev_configure(
 			p_link->pmd_id,
 			n_hwq_in,
@@ -1019,6 +1039,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 +1081,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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 14/39] examples/ip_reassembly: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (2 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 13/39] examples/ip_pipeline: convert to new ethdev " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-12-11 15:03   ` Ananyev, Konstantin
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 15/39] examples/ipsec-secgw: " Shahaf Shuler
                   ` (24 subsequent siblings)
  28 siblings, 1 reply; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 36 +++++++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 7 deletions(-)

diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 756f90efb..d899e4c37 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,8 @@ main(int argc, char **argv)
 
 	/* 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 +1107,22 @@ 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.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, (uint16_t)n_tx_queue,
 					    &port_conf);
 		if (ret < 0) {
@@ -1114,8 +1133,10 @@ main(int argc, char **argv)
 		}
 
 		/* 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 +1161,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 = port_conf.txmode.offloads;
 
 			ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
 					socket, txconf);
-- 
2.12.0

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

* [dpdk-dev] [PATCH 15/39] examples/ipsec-secgw: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (3 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 14/39] examples/ip_reassembly: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-12-11 11:47   ` Radu Nicolau
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 16/39] examples/ipv4_multicast: " Shahaf Shuler
                   ` (23 subsequent siblings)
  28 siblings, 1 reply; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index c98454a90..6e538a1ab 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),
 	},
 };
 
@@ -1394,6 +1396,22 @@ port_init(uint16_t portid)
 	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);
+		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, nb_tx_queue,
 			&port_conf);
 	if (ret < 0)
@@ -1420,7 +1438,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 = port_conf.txmode.offloads;
 
 		ret = rte_eth_tx_queue_setup(portid, tx_queueid, nb_txd,
 				socket_id, txconf);
@@ -1434,6 +1453,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 +1463,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 = 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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 16/39] examples/ipv4_multicast: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (4 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 15/39] examples/ipsec-secgw: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 17/39] examples/link_status_interrupt: convert to new " Shahaf Shuler
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 1c5851654..1b8ad3e4e 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,8 @@ main(int argc, char **argv)
 
 	/* 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,23 @@ 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.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, (uint16_t)n_tx_queue,
 					    &port_conf);
 		if (ret < 0)
@@ -769,9 +787,11 @@ main(int argc, char **argv)
 		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 +807,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 = 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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 17/39] examples/link_status_interrupt: convert to new offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (5 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 16/39] examples/ipv4_multicast: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 18/39] examples/load_balancer: convert to new ethdev " Shahaf Shuler
                   ` (21 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 38 +++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index bc47dcce3..223c41b3f 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,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 ((lsi_enabled_port_mask & (1 << portid)) == 0) {
 			printf("Skipping disabled port %u\n", (unsigned) portid);
@@ -641,6 +641,23 @@ main(int argc, char **argv)
 		/* 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);
+			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",
@@ -666,9 +683,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,
 					     lsi_pktmbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, port=%u\n",
@@ -676,9 +695,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 = 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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 18/39] examples/load_balancer: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (6 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 17/39] examples/link_status_interrupt: convert to new " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 19/39] examples/multi_process: " Shahaf Shuler
                   ` (20 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 3dab7f258..532a8b765 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,9 @@ 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;
 
 		n_rx_queues = app_get_nic_rx_queues_per_port(port);
 		n_tx_queues = app.nic_tx_port_mask[port];
@@ -440,6 +441,23 @@ app_init_nics(void)
 
 		/* 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);
+			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);
+			port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+		}
 		ret = rte_eth_dev_configure(
 			port,
 			(uint8_t) n_rx_queues,
@@ -461,6 +479,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 = 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 +498,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 +506,9 @@ app_init_nics(void)
 			}
 		}
 
+		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 +520,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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 19/39] examples/multi_process: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (7 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 18/39] examples/load_balancer: convert to new ethdev " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 20/39] examples/netmap_compat: " Shahaf Shuler
                   ` (19 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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   | 36 ++++++++++++++++++++-----
 examples/multi_process/symmetric_mp/main.c | 35 +++++++++++++++++++-----
 2 files changed, 57 insertions(+), 14 deletions(-)

diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c
index deace2739..06c566d65 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,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", (unsigned) portid);
@@ -1073,6 +1073,23 @@ main(int argc, char **argv)
 		/* 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);
+			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);
+			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 +1106,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[portid]);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n",
@@ -1099,9 +1118,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 = 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..e722173a5 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,22 @@ 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.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);
+		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);
+		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 +266,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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 20/39] examples/netmap_compat: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (8 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 19/39] examples/multi_process: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 21/39] examples/performance-thread: convert to new " Shahaf Shuler
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 29 +++++++++++++++++++++++--
 2 files changed, 29 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..80a4d90eb 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,23 @@ 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.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);
+		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);
+		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 +747,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 +764,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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 21/39] examples/performance-thread: convert to new offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (9 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 20/39] examples/netmap_compat: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 22/39] examples/qos_meter: convert to new ethdev " Shahaf Shuler
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 42 +++++++++++++++-----
 1 file changed, 32 insertions(+), 10 deletions(-)

diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index fa65234f3..49ea80102 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,
@@ -3567,6 +3568,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)
@@ -3612,10 +3630,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)
@@ -3644,6 +3661,8 @@ main(int argc, char **argv)
 
 		/* 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 +3674,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, "rte_eth_rx_queue_setup: err=%d, "
-- 
2.12.0

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

* [dpdk-dev] [PATCH 22/39] examples/qos_meter: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (10 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 21/39] examples/performance-thread: convert to new " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 23/39] examples/qos_sched: " Shahaf Shuler
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 64 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 57 insertions(+), 7 deletions(-)

diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index 67b4a75b9..1fac4cf1e 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,6 +337,26 @@ main(int argc, char **argv)
 		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);
+		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);
+		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_rx, 1, 1, &port_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_rx, ret);
@@ -344,18 +366,41 @@ 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);
 
+	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 +412,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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 23/39] examples/qos_sched: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (11 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 22/39] examples/qos_meter: convert to new ethdev " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 24/39] examples/quota_watermark: " Shahaf Shuler
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 31 ++++++++++++++++++++++++-------
 1 file changed, 24 insertions(+), 7 deletions(-)

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 038f0427d..803ce54d7 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,6 +101,7 @@ 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;
@@ -125,12 +123,29 @@ 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);
+	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,
@@ -149,6 +164,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 
 	/* 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 +174,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 
 	/* 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)
-- 
2.12.0

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

* [dpdk-dev] [PATCH 24/39] examples/quota_watermark: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (12 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 23/39] examples/qos_sched: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 25/39] examples/tep_termination: " Shahaf Shuler
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 38 ++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 37b03626d..c26ef3aad 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,9 +75,29 @@ 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);
+		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);
+		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 +110,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 +122,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",
-- 
2.12.0

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

* [dpdk-dev] [PATCH 25/39] examples/tep_termination: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (13 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 24/39] examples/quota_watermark: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 26/39] examples/vhost: " Shahaf Shuler
                   ` (13 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 37 +++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 1ad4ca3cd..0a955dc06 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),
 	},
 };
 
@@ -154,7 +159,7 @@ 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;
@@ -162,6 +167,22 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 	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);
+		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);
+		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 +193,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		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 +202,7 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		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),
-- 
2.12.0

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

* [dpdk-dev] [PATCH 26/39] examples/vhost: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (14 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 25/39] examples/tep_termination: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 27/39] examples/vmdq: " Shahaf Shuler
                   ` (12 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 42 +++++++++++++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 11 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 89a61f0e5..aeb6f5e5d 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;
@@ -332,6 +333,22 @@ port_init(uint16_t port)
 
 	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);
+		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);
+		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 +370,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 +383,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 +643,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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 27/39] examples/vmdq: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (15 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 26/39] examples/vhost: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 28/39] examples/vmdq_dcb: " Shahaf Shuler
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 84e9937d4..aaf156aad 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;
@@ -260,9 +258,10 @@ 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;
 	for (q = 0; q < rxRings; q++) {
 		retval = rte_eth_rx_queue_setup(port, q, rxRingSize,
 					rte_eth_dev_socket_id(port),
@@ -277,7 +276,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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 28/39] examples/vmdq_dcb: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (16 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 27/39] examples/vmdq: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 29/39] examples/vm_power_manager: convert to new " Shahaf Shuler
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 9dad2b8ec..aff04cb0d 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
@@ -316,10 +314,12 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		}
 	}
 
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 	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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 29/39] examples/vm_power_manager: convert to new offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (17 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 28/39] examples/vmdq_dcb: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-12-11 12:06   ` Hunt, David
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 30/39] examples/distributor: convert to new ethdev " Shahaf Shuler
                   ` (9 subsequent siblings)
  28 siblings, 1 reply; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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/vm_power_manager/main.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 399fbdd43..53d587d83 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,6 +87,8 @@ 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;
@@ -101,10 +106,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_info_get(port, &dev_info);
+	txq_conf = dev_info.default_txconf;
+	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 	/* 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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 30/39] examples/distributor: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (18 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 29/39] examples/vm_power_manager: convert to new " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-12-11 16:20   ` Bruce Richardson
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 31/39] examples/ethtool: " Shahaf Shuler
                   ` (8 subsequent siblings)
  28 siblings, 1 reply; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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/distributor/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 61e6e6b9e..9a004476d 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,6 +141,8 @@ 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;
@@ -160,10 +163,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_info_get(port, &dev_info);
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 	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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 31/39] examples/ethtool: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (19 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 30/39] examples/distributor: convert to new ethdev " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 32/39] examples/eventdev_pipeline: convert to new " Shahaf Shuler
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 32/39] examples/eventdev_pipeline: convert to new offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (20 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 31/39] examples/ethtool: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 33/39] examples/flow_classify: convert to new ethdev " Shahaf Shuler
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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/eventdev_pipeline_sw_pmd/main.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c
index 5f431d87d..e2c746902 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,6 +579,8 @@ 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;
@@ -595,10 +598,13 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_info_get(port, &dev_info);
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 	/* 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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 33/39] examples/flow_classify: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (21 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 32/39] examples/eventdev_pipeline: convert to new " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 34/39] examples/flow_filtering: " Shahaf Shuler
                   ` (5 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 766f1dd0e..3abb004cf 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,6 +219,8 @@ 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;
@@ -233,10 +238,13 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_info_get(port, &dev_info);
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 	/* 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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 34/39] examples/flow_filtering: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (22 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 33/39] examples/flow_classify: convert to new ethdev " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 35/39] examples/packet_ordering: " Shahaf Shuler
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index 7d739b4ae..3fca813b4 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -138,20 +138,23 @@ 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);
+	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);
+		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 +163,13 @@ init_port(void)
 			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,
-- 
2.12.0

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

* [dpdk-dev] [PATCH 35/39] examples/packet_ordering: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (23 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 34/39] examples/flow_filtering: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 36/39] examples/ptpclient: " Shahaf Shuler
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 3add7be47..dd4cce895 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,6 +297,8 @@ 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;
 
 	if (port_id > nb_ports)
 		return -1;
@@ -313,9 +319,12 @@ configure_eth_port(uint16_t port_id)
 			return ret;
 	}
 
+	rte_eth_dev_info_get(port_id, &dev_info);
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 	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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 36/39] examples/ptpclient: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (24 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 35/39] examples/packet_ordering: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 37/39] examples/rxtx_callbacks: " Shahaf Shuler
                   ` (2 subsequent siblings)
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index c53dad68b..13ffecb27 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 = {
@@ -241,7 +244,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 
 		rte_eth_dev_info_get(q, &dev_info);
 		txconf = &dev_info.default_txconf;
-		txconf->txq_flags = 0;
+		txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE;
 
 		retval = rte_eth_tx_queue_setup(port, q, nb_txd,
 				rte_eth_dev_socket_id(port), txconf);
-- 
2.12.0

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

* [dpdk-dev] [PATCH 37/39] examples/rxtx_callbacks: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (25 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 36/39] examples/ptpclient: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-12-11 16:22   ` Bruce Richardson
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 38/39] examples/server_node_efd: " Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 39/39] examples/skeleton: " Shahaf Shuler
  28 siblings, 1 reply; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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/rxtx_callbacks/main.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index ca135d219..ca4518dcf 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,6 +108,8 @@ 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;
@@ -124,9 +129,12 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_info_get(port, &dev_info);
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 	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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 38/39] examples/server_node_efd: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (26 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 37/39] examples/rxtx_callbacks: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 39/39] examples/skeleton: " Shahaf Shuler
  28 siblings, 0 replies; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index 0bcab8cc1..9bce96fa2 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -125,12 +125,15 @@ init_port(uint16_t port_num)
 	/* for port configuration all features are off by default */
 	const 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;
@@ -159,10 +162,13 @@ init_port(uint16_t port_num)
 			return retval;
 	}
 
+	rte_eth_dev_info_get(port_num, &dev_info);
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 	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	[flat|nested] 41+ messages in thread

* [dpdk-dev] [PATCH 39/39] examples/skeleton: convert to new ethdev offloads API
  2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
                   ` (27 preceding siblings ...)
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 38/39] examples/server_node_efd: " Shahaf Shuler
@ 2017-11-23 12:19 ` Shahaf Shuler
  2017-12-11 16:23   ` Bruce Richardson
  28 siblings, 1 reply; 41+ messages in thread
From: Shahaf Shuler @ 2017-11-23 12:19 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/skeleton/basicfwd.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index e623754cf..32263a639 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,6 +68,8 @@ 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;
@@ -86,10 +91,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			return retval;
 	}
 
+	rte_eth_dev_info_get(port, &dev_info);
+	txconf = dev_info.default_txconf;
+	txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
 	/* 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	[flat|nested] 41+ messages in thread

* Re: [dpdk-dev] [PATCH 15/39] examples/ipsec-secgw: convert to new ethdev offloads API
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 15/39] examples/ipsec-secgw: " Shahaf Shuler
@ 2017-12-11 11:47   ` Radu Nicolau
  2017-12-11 12:33     ` Shahaf Shuler
  0 siblings, 1 reply; 41+ messages in thread
From: Radu Nicolau @ 2017-12-11 11:47 UTC (permalink / raw)
  To: Shahaf Shuler, dev

Hi,

Comment inline


On 11/23/2017 12:19 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/ipsec-secgw/ipsec-secgw.c | 27 +++++++++++++++++++++++++--
>   1 file changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
> index c98454a90..6e538a1ab 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),
>   	},
>   };
>   
> @@ -1394,6 +1396,22 @@ port_init(uint16_t portid)
>   	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);
> +		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;
> +	}
I don't think that clearing the offload flags that are not advertised in 
the capabilities is a good approach, although it may be the right one. 
 From what I can see there are more PMDs that don't fully populate the 
offload capabilities, but actually check for them in the configure/start 
function. One of them is ixgbe, which needs CRC strip enabled when IPSec 
is enabled, and will fail to start otherwise. So although it supports 
CRC strip it does not set the flag in the capabilities, but checks it in 
the start function.
I would propose to just print a warning if a requested offload is not 
set in the capabilities, but let the pmd start fail if it is not really 
supported.

>   	ret = rte_eth_dev_configure(portid, nb_rx_queue, nb_tx_queue,
>   			&port_conf);
>   	if (ret < 0)
> @@ -1420,7 +1438,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 = port_conf.txmode.offloads;
>   
>   		ret = rte_eth_tx_queue_setup(portid, tx_queueid, nb_txd,
>   				socket_id, txconf);
> @@ -1434,6 +1453,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 +1463,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 = 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,

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

* Re: [dpdk-dev] [PATCH 29/39] examples/vm_power_manager: convert to new offloads API
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 29/39] examples/vm_power_manager: convert to new " Shahaf Shuler
@ 2017-12-11 12:06   ` Hunt, David
  0 siblings, 0 replies; 41+ messages in thread
From: Hunt, David @ 2017-12-11 12:06 UTC (permalink / raw)
  To: Shahaf Shuler, dev



On 23/11/2017 12:19 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/vm_power_manager/main.c | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
> index 399fbdd43..53d587d83 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,6 +87,8 @@ 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;
> @@ -101,10 +106,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
>   			return retval;
>   	}
>   
> +	rte_eth_dev_info_get(port, &dev_info);
> +	txq_conf = dev_info.default_txconf;
> +	txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE;
>   	/* 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;
>   	}

Looks good to me.

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

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

* Re: [dpdk-dev] [PATCH 15/39] examples/ipsec-secgw: convert to new ethdev offloads API
  2017-12-11 11:47   ` Radu Nicolau
@ 2017-12-11 12:33     ` Shahaf Shuler
  2017-12-11 12:51       ` Radu Nicolau
  0 siblings, 1 reply; 41+ messages in thread
From: Shahaf Shuler @ 2017-12-11 12:33 UTC (permalink / raw)
  To: Radu Nicolau, dev

Hi Radu,

Monday, December 11, 2017 1:48 PM, Radu Nicolau :
> Hi,
> 
> Comment inline
> 
> 
> On 11/23/2017 12:19 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/ipsec-secgw/ipsec-secgw.c | 27
> +++++++++++++++++++++++++--
> >   1 file changed, 25 insertions(+), 2 deletions(-)
> >
> > diff --git a/examples/ipsec-secgw/ipsec-secgw.c
> > b/examples/ipsec-secgw/ipsec-secgw.c
> > index c98454a90..6e538a1ab 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),
> >   	},
> >   };
> >
> > @@ -1394,6 +1396,22 @@ port_init(uint16_t portid)
> >   	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);
> > +		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;
> > +	}
> I don't think that clearing the offload flags that are not advertised in the
> capabilities is a good approach, although it may be the right one.
>  From what I can see there are more PMDs that don't fully populate the
> offload capabilities, but actually check for them in the configure/start
> function. One of them is ixgbe, which needs CRC strip enabled when IPSec is
> enabled, and will fail to start otherwise. So although it supports CRC strip it
> does not set the flag in the capabilities, but checks it in the start function.

Why ixgbe don't expose the CRC cap then? It seems wrong behavior to expect the application to set it without any cap reported. 

> I would propose to just print a warning if a requested offload is not set in the
> capabilities, but let the pmd start fail if it is not really supported.


I think I agree, however not from the reason you mentioned.
It is bad to mask the un-supported offloads because the application relies on them to be set successfully. The application will not run successfully if the IPV4 checksum is not actually set (for example).

On v2 I will print just the warn. 

> 
> >   	ret = rte_eth_dev_configure(portid, nb_rx_queue, nb_tx_queue,
> >   			&port_conf);
> >   	if (ret < 0)
> > @@ -1420,7 +1438,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 = port_conf.txmode.offloads;
> >
> >   		ret = rte_eth_tx_queue_setup(portid, tx_queueid, nb_txd,
> >   				socket_id, txconf);
> > @@ -1434,6 +1453,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 +1463,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 = 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,


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

* Re: [dpdk-dev] [PATCH 15/39] examples/ipsec-secgw: convert to new ethdev offloads API
  2017-12-11 12:33     ` Shahaf Shuler
@ 2017-12-11 12:51       ` Radu Nicolau
  0 siblings, 0 replies; 41+ messages in thread
From: Radu Nicolau @ 2017-12-11 12:51 UTC (permalink / raw)
  To: Shahaf Shuler, dev



On 12/11/2017 12:33 PM, Shahaf Shuler wrote:
> Hi Radu,
>
> Monday, December 11, 2017 1:48 PM, Radu Nicolau :
>> Hi,
>>
>> Comment inline
>>
>>
>> On 11/23/2017 12:19 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/ipsec-secgw/ipsec-secgw.c | 27
>> +++++++++++++++++++++++++--
>>>    1 file changed, 25 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/examples/ipsec-secgw/ipsec-secgw.c
>>> b/examples/ipsec-secgw/ipsec-secgw.c
>>> index c98454a90..6e538a1ab 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),
>>>    	},
>>>    };
>>>
>>> @@ -1394,6 +1396,22 @@ port_init(uint16_t portid)
>>>    	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);
>>> +		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;
>>> +	}
>> I don't think that clearing the offload flags that are not advertised in the
>> capabilities is a good approach, although it may be the right one.
>>   From what I can see there are more PMDs that don't fully populate the
>> offload capabilities, but actually check for them in the configure/start
>> function. One of them is ixgbe, which needs CRC strip enabled when IPSec is
>> enabled, and will fail to start otherwise. So although it supports CRC strip it
>> does not set the flag in the capabilities, but checks it in the start function.
> Why ixgbe don't expose the CRC cap then? It seems wrong behavior to expect the application to set it without any cap reported.
It is bad behavior but from what I can see most, if not all, PMDs don't 
expose CRC strip (or jumbo frames) while still supporting it.
>
>> I would propose to just print a warning if a requested offload is not set in the
>> capabilities, but let the pmd start fail if it is not really supported.
>
> I think I agree, however not from the reason you mentioned.
> It is bad to mask the un-supported offloads because the application relies on them to be set successfully. The application will not run successfully if the IPV4 checksum is not actually set (for example).
>
> On v2 I will print just the warn.
>
>>>    	ret = rte_eth_dev_configure(portid, nb_rx_queue, nb_tx_queue,
>>>    			&port_conf);
>>>    	if (ret < 0)
>>> @@ -1420,7 +1438,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 = port_conf.txmode.offloads;
>>>
>>>    		ret = rte_eth_tx_queue_setup(portid, tx_queueid, nb_txd,
>>>    				socket_id, txconf);
>>> @@ -1434,6 +1453,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 +1463,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 = 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,

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

* Re: [dpdk-dev] [PATCH 12/39] examples/ip_fragmentation: convert to new offloads API
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 12/39] examples/ip_fragmentation: convert to new " Shahaf Shuler
@ 2017-12-11 14:56   ` Ananyev, Konstantin
  0 siblings, 0 replies; 41+ messages in thread
From: Ananyev, Konstantin @ 2017-12-11 14:56 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:19 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 12/39] examples/ip_fragmentation: 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>
> ---

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

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

* Re: [dpdk-dev] [PATCH 14/39] examples/ip_reassembly: convert to new ethdev offloads API
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 14/39] examples/ip_reassembly: " Shahaf Shuler
@ 2017-12-11 15:03   ` Ananyev, Konstantin
  2017-12-12  6:30     ` Shahaf Shuler
  0 siblings, 1 reply; 41+ messages in thread
From: Ananyev, Konstantin @ 2017-12-11 15:03 UTC (permalink / raw)
  To: Shahaf Shuler, dev

Hi Shahaf,


> +		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;
> +		}

Sort of generic question regarding most examples - wouldn't it be better to do rte_exit() if device doesn't
support the offloads we expect instead of masking off unsupported offloads and continue?
Konstantin 

>  		ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue,
>  					    &port_conf);

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

* Re: [dpdk-dev] [PATCH 30/39] examples/distributor: convert to new ethdev offloads API
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 30/39] examples/distributor: convert to new ethdev " Shahaf Shuler
@ 2017-12-11 16:20   ` Bruce Richardson
  0 siblings, 0 replies; 41+ messages in thread
From: Bruce Richardson @ 2017-12-11 16:20 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: dev

On Thu, Nov 23, 2017 at 02:19:32PM +0200, 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>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [dpdk-dev] [PATCH 37/39] examples/rxtx_callbacks: convert to new ethdev offloads API
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 37/39] examples/rxtx_callbacks: " Shahaf Shuler
@ 2017-12-11 16:22   ` Bruce Richardson
  0 siblings, 0 replies; 41+ messages in thread
From: Bruce Richardson @ 2017-12-11 16:22 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: dev

On Thu, Nov 23, 2017 at 02:19:39PM +0200, 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>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [dpdk-dev] [PATCH 39/39] examples/skeleton: convert to new ethdev offloads API
  2017-11-23 12:19 ` [dpdk-dev] [PATCH 39/39] examples/skeleton: " Shahaf Shuler
@ 2017-12-11 16:23   ` Bruce Richardson
  0 siblings, 0 replies; 41+ messages in thread
From: Bruce Richardson @ 2017-12-11 16:23 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: dev

On Thu, Nov 23, 2017 at 02:19:41PM +0200, 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>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [dpdk-dev] [PATCH 14/39] examples/ip_reassembly: convert to new ethdev offloads API
  2017-12-11 15:03   ` Ananyev, Konstantin
@ 2017-12-12  6:30     ` Shahaf Shuler
  2017-12-12  8:49       ` Ananyev, Konstantin
  0 siblings, 1 reply; 41+ messages in thread
From: Shahaf Shuler @ 2017-12-12  6:30 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev, Radu Nicolau

Monday, December 11, 2017 5:04 PM, Ananyev, Konstantin:
> > +		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;
> > +		}
> 
> Sort of generic question regarding most examples - wouldn't it be better to
> do rte_exit() if device doesn't support the offloads we expect instead of
> masking off unsupported offloads and continue?
> Konstantin

We already started to discuss this question, see [1].

I agree that it is wrong approach to mask the not supported offloads and continue the application. 
So now I we have 2 options:
1. report the warning and let the PMD to fail the device configuration.
2. like you suggested, report the error and exit the application.

While it is wrong for application to set offloads which are not reported by the device capabilities, the input I got from Radu is that there are a lot of PMDs that will break with option 2, see [1]. 
One example is ixgbe which expects to have CRC offload enabled with IPSEC but don't report it on its caps. 

So my current direction is to make the examples less strict, and give the option for the PMD to fail those if not supported.
Any objection? 

[1] http://dpdk.org/ml/archives/dev/2017-December/083441.html

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

* Re: [dpdk-dev] [PATCH 14/39] examples/ip_reassembly: convert to new ethdev offloads API
  2017-12-12  6:30     ` Shahaf Shuler
@ 2017-12-12  8:49       ` Ananyev, Konstantin
  0 siblings, 0 replies; 41+ messages in thread
From: Ananyev, Konstantin @ 2017-12-12  8:49 UTC (permalink / raw)
  To: Shahaf Shuler, dev, Nicolau, Radu



> -----Original Message-----
> From: Shahaf Shuler [mailto:shahafs@mellanox.com]
> Sent: Tuesday, December 12, 2017 6:31 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; dev@dpdk.org; Nicolau, Radu <radu.nicolau@intel.com>
> Subject: RE: [dpdk-dev] [PATCH 14/39] examples/ip_reassembly: convert to new ethdev offloads API
> 
> Monday, December 11, 2017 5:04 PM, Ananyev, Konstantin:
> > > +		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;
> > > +		}
> >
> > Sort of generic question regarding most examples - wouldn't it be better to
> > do rte_exit() if device doesn't support the offloads we expect instead of
> > masking off unsupported offloads and continue?
> > Konstantin
> 
> We already started to discuss this question, see [1].
> 
> I agree that it is wrong approach to mask the not supported offloads and continue the application.
> So now I we have 2 options:
> 1. report the warning and let the PMD to fail the device configuration.
> 2. like you suggested, report the error and exit the application.
> 
> While it is wrong for application to set offloads which are not reported by the device capabilities, the input I got from Radu is that there are
> a lot of PMDs that will break with option 2, see [1].
> One example is ixgbe which expects to have CRC offload enabled with IPSEC but don't report it on its caps.
> 
> So my current direction is to make the examples less strict, and give the option for the PMD to fail those if not supported.
> Any objection?

So basically option #1 from the above?
If so, none from me.

> 
> [1] http://dpdk.org/ml/archives/dev/2017-December/083441.html
> 

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

end of thread, other threads:[~2017-12-12  8:49 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-23 12:19 [dpdk-dev] [PATCH 10/39] examples/exception_path: convert to new ethdev offloads API Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 11/39] examples/kni: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 12/39] examples/ip_fragmentation: convert to new " Shahaf Shuler
2017-12-11 14:56   ` Ananyev, Konstantin
2017-11-23 12:19 ` [dpdk-dev] [PATCH 13/39] examples/ip_pipeline: convert to new ethdev " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 14/39] examples/ip_reassembly: " Shahaf Shuler
2017-12-11 15:03   ` Ananyev, Konstantin
2017-12-12  6:30     ` Shahaf Shuler
2017-12-12  8:49       ` Ananyev, Konstantin
2017-11-23 12:19 ` [dpdk-dev] [PATCH 15/39] examples/ipsec-secgw: " Shahaf Shuler
2017-12-11 11:47   ` Radu Nicolau
2017-12-11 12:33     ` Shahaf Shuler
2017-12-11 12:51       ` Radu Nicolau
2017-11-23 12:19 ` [dpdk-dev] [PATCH 16/39] examples/ipv4_multicast: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 17/39] examples/link_status_interrupt: convert to new " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 18/39] examples/load_balancer: convert to new ethdev " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 19/39] examples/multi_process: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 20/39] examples/netmap_compat: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 21/39] examples/performance-thread: convert to new " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 22/39] examples/qos_meter: convert to new ethdev " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 23/39] examples/qos_sched: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 24/39] examples/quota_watermark: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 25/39] examples/tep_termination: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 26/39] examples/vhost: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 27/39] examples/vmdq: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 28/39] examples/vmdq_dcb: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 29/39] examples/vm_power_manager: convert to new " Shahaf Shuler
2017-12-11 12:06   ` Hunt, David
2017-11-23 12:19 ` [dpdk-dev] [PATCH 30/39] examples/distributor: convert to new ethdev " Shahaf Shuler
2017-12-11 16:20   ` Bruce Richardson
2017-11-23 12:19 ` [dpdk-dev] [PATCH 31/39] examples/ethtool: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 32/39] examples/eventdev_pipeline: convert to new " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 33/39] examples/flow_classify: convert to new ethdev " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 34/39] examples/flow_filtering: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 35/39] examples/packet_ordering: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 36/39] examples/ptpclient: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 37/39] examples/rxtx_callbacks: " Shahaf Shuler
2017-12-11 16:22   ` Bruce Richardson
2017-11-23 12:19 ` [dpdk-dev] [PATCH 38/39] examples/server_node_efd: " Shahaf Shuler
2017-11-23 12:19 ` [dpdk-dev] [PATCH 39/39] examples/skeleton: " Shahaf Shuler
2017-12-11 16:23   ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).