summaryrefslogtreecommitdiff
path: root/examples/flow_filtering
diff options
context:
space:
mode:
authorWei Zhao <wei.zhao1@intel.com>2017-12-27 16:32:15 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-01-16 18:47:49 +0100
commitfeca6c428a5e36102bb2ef45f8ea7855e4453b0e (patch)
tree3c0408c92361f5e04c778dc2a1fb086ec9d369f9 /examples/flow_filtering
parent0ecc6d6c663bc9906db9f82833f7c49c97df8321 (diff)
downloaddpdk-feca6c428a5e36102bb2ef45f8ea7855e4453b0e.zip
dpdk-feca6c428a5e36102bb2ef45f8ea7855e4453b0e.tar.gz
dpdk-feca6c428a5e36102bb2ef45f8ea7855e4453b0e.tar.xz
examples/flow_filtering: add Tx queues setup process
This example does not have the process to set up the Tx queues, which is required by Intel NICs. So this patch adds that Tx setup to the application. Signed-off-by: Wei Zhao <wei.zhao1@intel.com> Acked-by: Ori Kam <orika@mellanox.com>
Diffstat (limited to 'examples/flow_filtering')
-rw-r--r--examples/flow_filtering/main.c26
1 files changed, 26 insertions, 0 deletions
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) {