DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wei Zhao <wei.zhao1@intel.com>
To: dev@dpdk.org
Cc: orika@mellanox.com, Wei Zhao <wei.zhao1@intel.com>
Subject: [dpdk-dev] [PATCH v2] examples/flow_filtering: add Tx queues setup process
Date: Wed, 27 Dec 2017 16:32:15 +0800	[thread overview]
Message-ID: <20171227083215.112330-1-wei.zhao1@intel.com> (raw)
In-Reply-To: <20171226094905.83277-1-wei.zhao1@intel.com>

This example do not has the process of set up tx queues, but
some NIC start up process will be blocked if this is no tx queue
and only rx queues. So add tx queues setup process in main code.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

---

v2:
-add support the new tx offloads.
---
 examples/flow_filtering/main.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index 7d739b4..4a07b63 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -149,7 +149,18 @@ init_port(void)
 			/**< CRC stripped by hardware */
 			.hw_strip_crc   = 1,
 		},
+		.txmode = {
+			.offloads =
+				DEV_TX_OFFLOAD_VLAN_INSERT |
+				DEV_TX_OFFLOAD_IPV4_CKSUM  |
+				DEV_TX_OFFLOAD_UDP_CKSUM   |
+				DEV_TX_OFFLOAD_TCP_CKSUM   |
+				DEV_TX_OFFLOAD_SCTP_CKSUM  |
+				DEV_TX_OFFLOAD_TCP_TSO,
+		},
 	};
+	struct rte_eth_txconf txq_conf;
+	struct rte_eth_dev_info dev_info;
 
 	printf(":: initializing port: %d\n", port_id);
 	ret = rte_eth_dev_configure(port_id,
@@ -173,6 +184,21 @@ init_port(void)
 		}
 	}
 
+	rte_eth_dev_info_get(port_id, &dev_info);
+	txq_conf = dev_info.default_txconf;
+	txq_conf.offloads = port_conf.txmode.offloads;
+
+	for (i = 0; i < nr_queues; i++) {
+		ret = rte_eth_tx_queue_setup(port_id, i, 512,
+				rte_eth_dev_socket_id(port_id),
+				&txq_conf);
+		if (ret < 0) {
+			rte_exit(EXIT_FAILURE,
+				":: Tx queue setup failed: err=%d, port=%u\n",
+				ret, port_id);
+		}
+	}
+
 	rte_eth_promiscuous_enable(port_id);
 	ret = rte_eth_dev_start(port_id);
 	if (ret < 0) {
-- 
2.9.3

  parent reply	other threads:[~2017-12-27  8:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20  2:10 [dpdk-dev] [PATCH] net/ixgbe: add flow parser ntuple support Wei Zhao
2017-12-20  2:33 ` [dpdk-dev] [PATCH v2] " Wei Zhao
2017-12-26  9:28   ` [dpdk-dev] [PATCH v3] " Wei Zhao
2017-12-26  9:39     ` [dpdk-dev] [PATCH v4] " Wei Zhao
2017-12-26  9:49     ` Wei Zhao
2017-12-27  8:31       ` [dpdk-dev] [PATCH v2] examples/flow_filtering: add Tx queues setup process Wei Zhao
2017-12-27  8:32       ` Wei Zhao [this message]
2017-12-27 11:53         ` Ori Kam
2017-12-28  1:54           ` Zhao1, Wei
2018-01-08  6:31           ` Zhang, Helin
2018-01-12 12:25         ` Ferruh Yigit
2018-01-16 13:52           ` Shahaf Shuler
2018-01-04  8:27       ` [dpdk-dev] [PATCH v4] net/ixgbe: add flow parser ntuple support Lu, Wenzhuo
2018-01-04  8:41         ` Zhao1, Wei
2018-01-05  6:13       ` [dpdk-dev] [PATCH v5] " Wei Zhao
2018-01-05  7:57         ` Lu, Wenzhuo
2018-01-07  8:53           ` Zhang, Helin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171227083215.112330-1-wei.zhao1@intel.com \
    --to=wei.zhao1@intel.com \
    --cc=dev@dpdk.org \
    --cc=orika@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).