From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 9256D7DFF for ; Fri, 26 Sep 2014 16:13:02 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 26 Sep 2014 07:17:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,604,1406617200"; d="scan'208";a="609119926" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 26 Sep 2014 07:19:21 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s8QEJJQH017949 for ; Fri, 26 Sep 2014 15:19:19 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s8QEJJO5006729 for ; Fri, 26 Sep 2014 15:19:19 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id s8QEJJJh006725 for dev@dpdk.org; Fri, 26 Sep 2014 15:19:19 +0100 From: Pablo de Lara To: dev@dpdk.org Date: Fri, 26 Sep 2014 15:19:19 +0100 Message-Id: <1411741159-6671-3-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1411741159-6671-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1411741159-6671-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH 2/2] app: Used rte_eth_rxconf_defaults and rte_eth_txconf_defaults in apps X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 14:13:04 -0000 For apps that were using default rte_eth_rxconf and rte_eth_txconf structures, these have been removed and now they are obtained by calling rte_eth_rxconf_defaults and rte_eth_txconf_defaults, just before setting up RX/TX queues. Signed-off-by: Pablo de Lara --- examples/dpdk_qat/main.c | 44 ++------------- examples/exception_path/main.c | 30 +--------- examples/ip_fragmentation/main.c | 42 ++------------ examples/ip_reassembly/main.c | 44 ++------------- examples/ipv4_multicast/main.c | 44 ++------------ examples/kni/main.c | 34 +---------- examples/l2fwd-ivshmem/host/host.c | 43 +------------- examples/l2fwd/main.c | 48 +-------------- examples/l3fwd-acl/main.c | 46 ++------------- examples/l3fwd-power/main.c | 46 ++------------- examples/l3fwd-vf/main.c | 31 ++-------- examples/l3fwd/main.c | 54 +++--------------- examples/link_status_interrupt/main.c | 43 +------------- examples/load_balancer/init.c | 24 +------- .../client_server_mp/mp_server/init.c | 41 +------------ examples/multi_process/l2fwd_fork/main.c | 44 +------------- examples/multi_process/symmetric_mp/main.c | 36 +---------- examples/netmap_compat/bridge/bridge.c | 25 -------- examples/netmap_compat/lib/compat_netmap.c | 6 +- examples/netmap_compat/lib/compat_netmap.h | 2 - examples/qos_meter/main.c | 36 ++++-------- examples/quota_watermark/qw/init.c | 26 ++------- examples/vhost_xen/main.c | 31 ++-------- examples/vmdq/main.c | 60 +++----------------- examples/vmdq_dcb/main.c | 36 +---------- 25 files changed, 118 insertions(+), 798 deletions(-) diff --git a/examples/dpdk_qat/main.c b/examples/dpdk_qat/main.c index d61db4c..69b8e6a 100644 --- a/examples/dpdk_qat/main.c +++ b/examples/dpdk_qat/main.c @@ -75,25 +75,6 @@ #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) #define NB_MBUF (32 * 1024) -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define MAX_PKT_BURST 32 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -178,24 +159,6 @@ static struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; - static struct rte_mempool * pktmbuf_pool[RTE_MAX_NUMA_NODES]; struct lcore_conf { @@ -785,7 +748,8 @@ MAIN(int argc, char **argv) printf("txq=%u,%d,%d ", lcoreid, queueid, socketid); fflush(stdout); ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, - socketid, &tx_conf); + socketid, + NULL); if (ret < 0) rte_panic("rte_eth_tx_queue_setup: err=%d, " "port=%d\n", ret, portid); @@ -810,7 +774,9 @@ MAIN(int argc, char **argv) fflush(stdout); ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, - socketid, &rx_conf, pktmbuf_pool[socketid]); + socketid, + NULL, + pktmbuf_pool[socketid]); if (ret < 0) rte_panic("rte_eth_rx_queue_setup: err=%d," "port=%d\n", ret, portid); diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index 0204116..8f89dc6 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -109,31 +109,6 @@ * controller's datasheet and supporting DPDK documentation for guidance * on how these parameters should be set. */ -/* RX ring configuration */ -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = 8, /* Ring prefetch threshold */ - .hthresh = 8, /* Ring host threshold */ - .wthresh = 4, /* Ring writeback threshold */ - }, - .rx_free_thresh = 0, /* Immediately free RX descriptors */ -}; - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -/* TX ring configuration */ -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = 36, /* Ring prefetch threshold */ - .hthresh = 0, /* Ring host threshold */ - .wthresh = 0, /* Ring writeback threshold */ - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; /* Options for configuring ethernet port */ static const struct rte_eth_conf port_conf = { @@ -460,13 +435,14 @@ init_port(uint8_t port) (unsigned)port, ret); ret = rte_eth_rx_queue_setup(port, 0, NB_RXD, rte_eth_dev_socket_id(port), - &rx_conf, pktmbuf_pool); + NULL, + pktmbuf_pool); if (ret < 0) FATAL_ERROR("Could not setup up RX queue for port%u (%d)", (unsigned)port, ret); ret = rte_eth_tx_queue_setup(port, 0, NB_TXD, rte_eth_dev_socket_id(port), - &tx_conf); + NULL); if (ret < 0) FATAL_ERROR("Could not setup up TX queue for port%u (%d)", (unsigned)port, ret); diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 72cd2b2..964c513 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -106,25 +106,6 @@ #define NB_MBUF 8192 -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define MAX_PKT_BURST 32 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -208,23 +189,7 @@ static const struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; +static struct rte_eth_txconf tx_conf; /* * IPv4 forwarding table @@ -942,7 +907,7 @@ MAIN(int argc, char **argv) /* init one RX queue */ ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, - socket, &rx_conf, + socket, NULL, socket_direct_pool[socket]); if (ret < 0) { printf("\n"); @@ -964,6 +929,9 @@ MAIN(int argc, char **argv) socket = (int) rte_lcore_to_socket_id(lcore_id); printf("txq=%u,%d ", lcore_id, queueid); fflush(stdout); + + rte_eth_txconf_defaults(portid, &tx_conf); + tx_conf.txq_flags = 0; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, socket, &tx_conf); if (ret < 0) { diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 3bb6afd..a8c659d 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -114,25 +114,6 @@ static uint32_t max_flow_num = DEF_FLOW_NUM; static uint32_t max_flow_ttl = DEF_FLOW_TTL; -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ #define NB_SOCKETS 8 @@ -236,25 +217,7 @@ static struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, - .rx_free_thresh = 32, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ - .txq_flags = 0x0, -}; +static struct rte_eth_txconf tx_conf; /* * IPv4 forwarding table @@ -1149,7 +1112,7 @@ MAIN(int argc, char **argv) /* init one RX queue */ ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, - socket, &rx_conf, + socket, NULL, rxq->pool); if (ret < 0) { printf("\n"); @@ -1172,6 +1135,9 @@ MAIN(int argc, char **argv) printf("txq=%u,%d,%d ", lcore_id, queueid, socket); fflush(stdout); + + rte_eth_txconf_defaults(portid, &tx_conf); + tx_conf.txq_flags = 0; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, socket, &tx_conf); if (ret < 0) diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index dfa0075..d136b87 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -92,25 +92,6 @@ /* allow max jumbo frame 9.5 KB */ #define JUMBO_FRAME_MAX_SIZE 0x2600 -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define MAX_PKT_BURST 32 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -175,24 +156,7 @@ static const struct rte_eth_conf port_conf = { .mq_mode = ETH_MQ_TX_NONE, }, }; - -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; +static struct rte_eth_txconf tx_conf; static struct rte_mempool *packet_pool, *header_pool, *clone_pool; @@ -810,7 +774,8 @@ MAIN(int argc, char **argv) printf("rxq=%hu ", queueid); fflush(stdout); ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, - rte_eth_dev_socket_id(portid), &rx_conf, + rte_eth_dev_socket_id(portid), + NULL, packet_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, port=%d\n", @@ -824,6 +789,9 @@ MAIN(int argc, char **argv) continue; printf("txq=%u,%hu ", lcore_id, queueid); fflush(stdout); + + rte_eth_txconf_defaults(portid, &tx_conf); + tx_conf.txq_flags = 0; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, rte_lcore_to_socket_id(lcore_id), &tx_conf); if (ret < 0) diff --git a/examples/kni/main.c b/examples/kni/main.c index 7df1b36..6cfd8fe 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -125,36 +125,6 @@ struct kni_port_params { static struct kni_port_params *kni_port_params_array[RTE_MAX_ETHPORTS]; -/* RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -/* RX ring configuration */ -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = 8, /* Ring prefetch threshold */ - .hthresh = 8, /* Ring host threshold */ - .wthresh = 4, /* Ring writeback threshold */ - }, - .rx_free_thresh = 0, /* Immediately free RX descriptors */ -}; - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -/* TX ring configuration */ -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = 36, /* Ring prefetch threshold */ - .hthresh = 0, /* Ring host threshold */ - .wthresh = 0, /* Ring writeback threshold */ - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; /* Options for configuring ethernet port */ static struct rte_eth_conf port_conf = { @@ -631,13 +601,13 @@ init_port(uint8_t port) (unsigned)port, ret); ret = rte_eth_rx_queue_setup(port, 0, NB_RXD, - rte_eth_dev_socket_id(port), &rx_conf, pktmbuf_pool); + rte_eth_dev_socket_id(port), NULL, pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "Could not setup up RX queue for " "port%u (%d)\n", (unsigned)port, ret); ret = rte_eth_tx_queue_setup(port, 0, NB_TXD, - rte_eth_dev_socket_id(port), &tx_conf); + rte_eth_dev_socket_id(port), NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "Could not setup up TX queue for " "port%u (%d)\n", (unsigned)port, ret); diff --git a/examples/l2fwd-ivshmem/host/host.c b/examples/l2fwd-ivshmem/host/host.c index 02e65b9..706a7b3 100644 --- a/examples/l2fwd-ivshmem/host/host.c +++ b/examples/l2fwd-ivshmem/host/host.c @@ -63,25 +63,6 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ /* mask of enabled ports */ @@ -117,24 +98,6 @@ static const struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; - #define METADATA_NAME "l2fwd_ivshmem" #define CMDLINE_OPT_FWD_CONF "fwd-conf" @@ -792,7 +755,8 @@ int main(int argc, char **argv) /* init one RX queue */ fflush(stdout); ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, - rte_eth_dev_socket_id(portid), &rx_conf, + rte_eth_dev_socket_id(portid), + NULL, l2fwd_ivshmem_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", @@ -801,7 +765,8 @@ int main(int argc, char **argv) /* init one TX queue on each port */ fflush(stdout); ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, - rte_eth_dev_socket_id(portid), &tx_conf); + rte_eth_dev_socket_id(portid), + NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", ret, (unsigned) portid); diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 4069d7c..c6131a7 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -77,25 +77,6 @@ #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) #define NB_MBUF 8192 -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define MAX_PKT_BURST 32 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -147,29 +128,6 @@ static const struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ - /* - * As the example won't handle mult-segments and offload cases, - * set the flag by default. - */ - .txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS, -}; - struct rte_mempool * l2fwd_pktmbuf_pool = NULL; /* Per-port statistics struct */ @@ -704,7 +662,8 @@ MAIN(int argc, char **argv) /* init one RX queue */ fflush(stdout); ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, - rte_eth_dev_socket_id(portid), &rx_conf, + rte_eth_dev_socket_id(portid), + NULL, l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", @@ -713,7 +672,8 @@ MAIN(int argc, char **argv) /* init one TX queue on each port */ fflush(stdout); ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, - rte_eth_dev_socket_id(portid), &tx_conf); + rte_eth_dev_socket_id(portid), + NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", ret, (unsigned) portid); diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 9b2c21b..99d7cd9 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -100,25 +100,6 @@ nb_lcores * MEMPOOL_CACHE_SIZE), \ (unsigned)8192) -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define MAX_PKT_BURST 32 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -206,26 +187,7 @@ static struct rte_eth_conf port_conf = { .mq_mode = ETH_MQ_TX_NONE, }, }; - -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, - .rx_free_thresh = 32, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ - .txq_flags = 0x0, -}; +static struct rte_eth_txconf tx_conf; static struct rte_mempool *pktmbuf_pool[NB_SOCKETS]; @@ -2063,6 +2025,10 @@ MAIN(int argc, char **argv) printf("txq=%u,%d,%d ", lcore_id, queueid, socketid); fflush(stdout); + + rte_eth_txconf_defaults(portid, &tx_conf); + if (port_conf.rxmode.jumbo_frame) + tx_conf.txq_flags = 0; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, socketid, &tx_conf); if (ret < 0) @@ -2098,7 +2064,7 @@ MAIN(int argc, char **argv) fflush(stdout); ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, - socketid, &rx_conf, + socketid, NULL, pktmbuf_pool[socketid]); if (ret < 0) rte_exit(EXIT_FAILURE, diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 57fc371..2eedf1b 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -140,25 +140,6 @@ nb_lcores*MEMPOOL_CACHE_SIZE), \ (unsigned)8192) -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ #define NB_SOCKETS 8 @@ -255,25 +236,7 @@ static struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, - .rx_free_thresh = 32, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ - .txq_flags = 0x0, -}; +static struct rte_eth_txconf tx_conf; static struct rte_mempool * pktmbuf_pool[NB_SOCKETS]; @@ -1606,6 +1569,10 @@ MAIN(int argc, char **argv) printf("txq=%u,%d,%d ", lcore_id, queueid, socketid); fflush(stdout); + + rte_eth_txconf_defaults(portid, &tx_conf); + if (port_conf.rxmode.jumbo_frame) + tx_conf.txq_flags = 0; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, socketid, &tx_conf); if (ret < 0) @@ -1655,7 +1622,8 @@ MAIN(int argc, char **argv) fflush(stdout); ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, - socketid, &rx_conf, pktmbuf_pool[socketid]); + socketid, NULL, + pktmbuf_pool[socketid]); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, " diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 2ca5c21..ca1cf4e 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -215,29 +215,7 @@ static struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, - .rx_free_thresh = 32, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ - .txq_flags = (ETH_TXQ_FLAGS_NOMULTSEGS | - ETH_TXQ_FLAGS_NOVLANOFFL | - ETH_TXQ_FLAGS_NOXSUMSCTP | - ETH_TXQ_FLAGS_NOXSUMUDP | - ETH_TXQ_FLAGS_NOXSUMTCP) -}; +static struct rte_eth_txconf tx_conf; static struct rte_mempool * pktmbuf_pool[NB_SOCKETS]; @@ -1055,6 +1033,10 @@ MAIN(int argc, char **argv) printf("txq=%d,%d,%d ", portid, 0, socketid); fflush(stdout); + + rte_eth_txconf_defaults(portid, &tx_conf); + if (port_conf.rxmode.jumbo_frame) + tx_conf.txq_flags = 0; ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, socketid, &tx_conf); if (ret < 0) @@ -1086,7 +1068,8 @@ MAIN(int argc, char **argv) fflush(stdout); ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, - socketid, &rx_conf, pktmbuf_pool[socketid]); + socketid, NULL, + pktmbuf_pool[socketid]); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d," "port=%d\n", ret, portid); diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index bef409a..a84f9fb 100755 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -137,25 +137,6 @@ nb_lcores*MEMPOOL_CACHE_SIZE), \ (unsigned)8192) -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define MAX_PKT_BURST 32 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -259,30 +240,7 @@ static struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, - .rx_free_thresh = 32, -}; - -static struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ - .txq_flags = (ETH_TXQ_FLAGS_NOMULTSEGS | - ETH_TXQ_FLAGS_NOVLANOFFL | - ETH_TXQ_FLAGS_NOXSUMSCTP | - ETH_TXQ_FLAGS_NOXSUMUDP | - ETH_TXQ_FLAGS_NOXSUMTCP) - -}; +static struct rte_eth_txconf tx_conf; static struct rte_mempool * pktmbuf_pool[NB_SOCKETS]; @@ -1974,7 +1932,6 @@ parse_args(int argc, char **argv) printf("jumbo frame is enabled - disabling simple TX path\n"); port_conf.rxmode.jumbo_frame = 1; - tx_conf.txq_flags = 0; /* if no max-pkt-len set, use the default value ETHER_MAX_LEN */ if (0 == getopt_long(argc, argvopt, "", &lenopts, &option_index)) { @@ -2541,6 +2498,11 @@ MAIN(int argc, char **argv) printf("txq=%u,%d,%d ", lcore_id, queueid, socketid); fflush(stdout); + + rte_eth_txconf_defaults(portid, &tx_conf); + if (port_conf.rxmode.jumbo_frame) + tx_conf.txq_flags = 0; + ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, socketid, &tx_conf); if (ret < 0) @@ -2574,7 +2536,9 @@ MAIN(int argc, char **argv) fflush(stdout); ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, - socketid, &rx_conf, pktmbuf_pool[socketid]); + socketid, + NULL, + pktmbuf_pool[socketid]); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d," "port=%d\n", ret, portid); diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index 1a87551..9dc0df8 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -78,25 +78,6 @@ #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) #define NB_MBUF 8192 -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define MAX_PKT_BURST 32 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -153,24 +134,6 @@ static const struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; - struct rte_mempool * lsi_pktmbuf_pool = NULL; /* Per-port statistics struct */ @@ -754,7 +717,8 @@ MAIN(int argc, char **argv) /* init one RX queue */ fflush(stdout); ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, - rte_eth_dev_socket_id(portid), &rx_conf, + rte_eth_dev_socket_id(portid), + NULL, lsi_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, port=%u\n", @@ -763,7 +727,8 @@ MAIN(int argc, char **argv) /* init one TX queue logical core on each port */ fflush(stdout); ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, - rte_eth_dev_socket_id(portid), &tx_conf); + rte_eth_dev_socket_id(portid), + NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d,port=%u\n", ret, (unsigned) portid); diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index 2f00a70..448425b 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -95,26 +95,6 @@ static struct rte_eth_conf port_conf = { }, }; -static struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = APP_DEFAULT_NIC_RX_PTHRESH, - .hthresh = APP_DEFAULT_NIC_RX_HTHRESH, - .wthresh = APP_DEFAULT_NIC_RX_WTHRESH, - }, - .rx_free_thresh = APP_DEFAULT_NIC_RX_FREE_THRESH, - .rx_drop_en = APP_DEFAULT_NIC_RX_DROP_EN, -}; - -static struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = APP_DEFAULT_NIC_TX_PTHRESH, - .hthresh = APP_DEFAULT_NIC_TX_HTHRESH, - .wthresh = APP_DEFAULT_NIC_TX_WTHRESH, - }, - .tx_free_thresh = APP_DEFAULT_NIC_TX_FREE_THRESH, - .tx_rs_thresh = APP_DEFAULT_NIC_TX_RS_THRESH, -}; - static void app_assign_worker_ids(void) { @@ -495,7 +475,7 @@ app_init_nics(void) queue, (uint16_t) app.nic_rx_ring_size, socket, - &rx_conf, + NULL, pool); if (ret < 0) { rte_panic("Cannot init RX queue %u for port %u (%d)\n", @@ -516,7 +496,7 @@ app_init_nics(void) 0, (uint16_t) app.nic_tx_ring_size, socket, - &tx_conf); + NULL); if (ret < 0) { rte_panic("Cannot init TX queue 0 for port %d (%d)\n", port, diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c index a84d1ee..5b3f06e 100644 --- a/examples/multi_process/client_server_mp/mp_server/init.c +++ b/examples/multi_process/client_server_mp/mp_server/init.c @@ -84,41 +84,6 @@ #define NO_FLAGS 0 -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -/* Default configuration for rx and tx thresholds etc. */ -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define MP_DEFAULT_PTHRESH 36 -#define MP_DEFAULT_RX_HTHRESH 8 -#define MP_DEFAULT_TX_HTHRESH 0 -#define MP_DEFAULT_WTHRESH 0 - -static const struct rte_eth_rxconf rx_conf_default = { - .rx_thresh = { - .pthresh = MP_DEFAULT_PTHRESH, - .hthresh = MP_DEFAULT_RX_HTHRESH, - .wthresh = MP_DEFAULT_WTHRESH, - }, -}; - -static const struct rte_eth_txconf tx_conf_default = { - .tx_thresh = { - .pthresh = MP_DEFAULT_PTHRESH, - .hthresh = MP_DEFAULT_TX_HTHRESH, - .wthresh = MP_DEFAULT_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; - /* The mbuf pool for packet rx */ struct rte_mempool *pktmbuf_pool; @@ -184,13 +149,15 @@ init_port(uint8_t port_num) for (q = 0; q < rx_rings; q++) { retval = rte_eth_rx_queue_setup(port_num, q, rx_ring_size, - rte_eth_dev_socket_id(port_num), &rx_conf_default, pktmbuf_pool); + rte_eth_dev_socket_id(port_num), + NULL, pktmbuf_pool); if (retval < 0) return retval; } 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), &tx_conf_default); + rte_eth_dev_socket_id(port_num), + NULL); if (retval < 0) return retval; } diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c index 03fba55..5899875 100644 --- a/examples/multi_process/l2fwd_fork/main.c +++ b/examples/multi_process/l2fwd_fork/main.c @@ -96,25 +96,6 @@ enum l2fwd_cmd{ CMD_STOP, }; -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define MAX_PKT_BURST 32 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ @@ -190,25 +171,6 @@ static const struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ - .txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS, -}; - static struct rte_mempool * l2fwd_pktmbuf_pool[RTE_MAX_ETHPORTS]; /* Per-port statistics struct */ @@ -1170,7 +1132,8 @@ MAIN(int argc, char **argv) /* init one RX queue */ fflush(stdout); ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, - rte_eth_dev_socket_id(portid), &rx_conf, + rte_eth_dev_socket_id(portid), + NULL, l2fwd_pktmbuf_pool[portid]); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", @@ -1179,7 +1142,8 @@ MAIN(int argc, char **argv) /* init one TX queue on each port */ fflush(stdout); ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, - rte_eth_dev_socket_id(portid), &tx_conf); + rte_eth_dev_socket_id(portid), + NULL); 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 b8f31b3..638d167 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -89,36 +89,6 @@ #define PARAM_PROC_ID "proc-id" #define PARAM_NUM_PROCS "num-procs" -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -/* Default configuration for rx and tx thresholds etc. */ -static const struct rte_eth_rxconf rx_conf_default = { - .rx_thresh = { - .pthresh = 8, - .hthresh = 8, - .wthresh = 4, - }, -}; - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -static const struct rte_eth_txconf tx_conf_default = { - .tx_thresh = { - .pthresh = 36, - .hthresh = 0, - .wthresh = 0, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; - /* for each lcore, record the elements of the ports array to use */ struct lcore_ports{ unsigned start_port; @@ -277,7 +247,8 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues) for (q = 0; q < rx_rings; q ++) { retval = rte_eth_rx_queue_setup(port, q, RX_RING_SIZE, - rte_eth_dev_socket_id(port), &rx_conf_default, + rte_eth_dev_socket_id(port), + NULL, mbuf_pool); if (retval < 0) return retval; @@ -285,7 +256,8 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues) for (q = 0; q < tx_rings; q ++) { retval = rte_eth_tx_queue_setup(port, q, TX_RING_SIZE, - rte_eth_dev_socket_id(port), &tx_conf_default); + rte_eth_dev_socket_id(port), + NULL); if (retval < 0) return retval; } diff --git a/examples/netmap_compat/bridge/bridge.c b/examples/netmap_compat/bridge/bridge.c index 898277e..f935b3b 100644 --- a/examples/netmap_compat/bridge/bridge.c +++ b/examples/netmap_compat/bridge/bridge.c @@ -67,29 +67,6 @@ struct rte_eth_conf eth_conf = { }, }; -struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = 36, - .hthresh = 0, - .wthresh = 0, - }, - .tx_free_thresh = 0, - .tx_rs_thresh = 0, - .txq_flags = (ETH_TXQ_FLAGS_NOMULTSEGS | - ETH_TXQ_FLAGS_NOVLANOFFL | - ETH_TXQ_FLAGS_NOXSUMSCTP | - ETH_TXQ_FLAGS_NOXSUMUDP | - ETH_TXQ_FLAGS_NOXSUMTCP) -}; - -struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = 8, - .hthresh = 8, - .wthresh = 4, - }, -}; - #define MAX_QUEUE_NUM 1 #define RX_QUEUE_NUM 1 #define TX_QUEUE_NUM 1 @@ -103,8 +80,6 @@ struct rte_eth_rxconf rx_conf = { struct rte_netmap_port_conf port_conf = { .eth_conf = ð_conf, - .tx_conf = &tx_conf, - .rx_conf = &rx_conf, .socket_id = SOCKET_ID_ANY, .nr_tx_rings = TX_QUEUE_NUM, .nr_rx_rings = RX_QUEUE_NUM, diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c index 44b3f8e..2348366 100644 --- a/examples/netmap_compat/lib/compat_netmap.c +++ b/examples/netmap_compat/lib/compat_netmap.c @@ -713,7 +713,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) for (i = 0; i < conf->nr_tx_rings; i++) { ret = rte_eth_tx_queue_setup(portid, i, tx_slots, - conf->socket_id, conf->tx_conf); + conf->socket_id, NULL); if (ret < 0) { RTE_LOG(ERR, USER1, @@ -724,7 +724,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) } ret = rte_eth_rx_queue_setup(portid, i, rx_slots, - conf->socket_id, conf->rx_conf, conf->pool); + conf->socket_id, NULL, conf->pool); if (ret < 0) { RTE_LOG(ERR, USER1, @@ -737,8 +737,6 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) /* copy config to the private storage. */ ports[portid].eth_conf = conf->eth_conf[0]; - ports[portid].rx_conf = conf->rx_conf[0]; - ports[portid].tx_conf = conf->tx_conf[0]; ports[portid].pool = conf->pool; ports[portid].socket_id = conf->socket_id; ports[portid].nr_tx_rings = conf->nr_tx_rings; diff --git a/examples/netmap_compat/lib/compat_netmap.h b/examples/netmap_compat/lib/compat_netmap.h index f7f2276..f8a7812 100644 --- a/examples/netmap_compat/lib/compat_netmap.h +++ b/examples/netmap_compat/lib/compat_netmap.h @@ -56,8 +56,6 @@ struct rte_netmap_conf { struct rte_netmap_port_conf { struct rte_eth_conf *eth_conf; - struct rte_eth_txconf *tx_conf; - struct rte_eth_rxconf *rx_conf; struct rte_mempool *pool; int32_t socket_id; uint16_t nr_tx_rings; diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index b4b8c4f..a942249 100755 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -102,26 +102,6 @@ static struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = 8, /* RX prefetch threshold reg */ - .hthresh = 8, /* RX host threshold reg */ - .wthresh = 4, /* RX write-back threshold reg */ - }, - .rx_free_thresh = 32, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = 36, /* TX prefetch threshold reg */ - .hthresh = 0, /* TX host threshold reg */ - .wthresh = 0, /* TX write-back threshold reg */ - }, - .tx_free_thresh = 0, - .tx_rs_thresh = 0, - .txq_flags = 0x0, -}; - #define NIC_RX_QUEUE_DESC 128 #define NIC_TX_QUEUE_DESC 512 @@ -394,11 +374,15 @@ MAIN(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_rx, ret); - ret = rte_eth_rx_queue_setup(port_rx, NIC_RX_QUEUE, NIC_RX_QUEUE_DESC, rte_eth_dev_socket_id(port_rx), &rx_conf, pool); + ret = rte_eth_rx_queue_setup(port_rx, NIC_RX_QUEUE, NIC_RX_QUEUE_DESC, + rte_eth_dev_socket_id(port_rx), + NULL, pool); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d RX queue setup error (%d)\n", port_rx, ret); - ret = rte_eth_tx_queue_setup(port_rx, NIC_TX_QUEUE, NIC_TX_QUEUE_DESC, rte_eth_dev_socket_id(port_rx), &tx_conf); + ret = rte_eth_tx_queue_setup(port_rx, NIC_TX_QUEUE, NIC_TX_QUEUE_DESC, + rte_eth_dev_socket_id(port_rx), + NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_rx, ret); @@ -406,11 +390,15 @@ MAIN(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_tx, ret); - ret = rte_eth_rx_queue_setup(port_tx, NIC_RX_QUEUE, NIC_RX_QUEUE_DESC, rte_eth_dev_socket_id(port_tx), &rx_conf, pool); + ret = rte_eth_rx_queue_setup(port_tx, NIC_RX_QUEUE, NIC_RX_QUEUE_DESC, + 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); - ret = rte_eth_tx_queue_setup(port_tx, NIC_TX_QUEUE, NIC_TX_QUEUE_DESC, rte_eth_dev_socket_id(port_tx), &tx_conf); + ret = rte_eth_tx_queue_setup(port_tx, NIC_TX_QUEUE, NIC_TX_QUEUE_DESC, + rte_eth_dev_socket_id(port_tx), + rte_eth_txconf_defaults(port_tx, NULL)); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_tx, ret); diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index a7f8c85..5adb906 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -64,24 +64,6 @@ static const struct rte_eth_conf port_conf = { }, }; -static const struct rte_eth_rxconf rx_conf = { - .rx_thresh = { - .pthresh = 8, - .hthresh = 8, - .wthresh = 4, - }, -}; - -static const struct rte_eth_txconf tx_conf = { - .tx_thresh = { - .pthresh = 36, - .hthresh = 0, - .wthresh = 0, - }, - .tx_free_thresh = 0, - .tx_rs_thresh = 0, -}; - static struct rte_eth_fc_conf fc_conf = { .mode = RTE_FC_TX_PAUSE, .high_water = 80 * 510 / 100, @@ -104,15 +86,17 @@ void configure_eth_port(uint8_t port_id) /* Initialize the port's RX queue */ ret = rte_eth_rx_queue_setup(port_id, 0, RX_DESC_PER_QUEUE, - rte_eth_dev_socket_id(port_id), &rx_conf, - mbuf_pool); + rte_eth_dev_socket_id(port_id), + NULL, + mbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "Failed to setup RX queue on " "port %u (error %d)\n", (unsigned) port_id, ret); /* Initialize the port's TX queue */ ret = rte_eth_tx_queue_setup(port_id, 0, TX_DESC_PER_QUEUE, - rte_eth_dev_socket_id(port_id), &tx_conf); + rte_eth_dev_socket_id(port_id), + NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "Failed to setup TX queue on " "port %u (error %d)\n", (unsigned) port_id, ret); diff --git a/examples/vhost_xen/main.c b/examples/vhost_xen/main.c index b275747..f5c801c 100644 --- a/examples/vhost_xen/main.c +++ b/examples/vhost_xen/main.c @@ -136,29 +136,7 @@ static uint32_t enable_vm2vm = 1; static uint32_t enable_stats = 0; /* Default configuration for rx and tx thresholds etc. */ -static const struct rte_eth_rxconf rx_conf_default = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, - .rx_drop_en = 1, -}; - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe/igb PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -static const struct rte_eth_txconf tx_conf_default = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; +static struct rte_eth_rxconf rx_conf; /* empty vmdq configuration structure. Filled in programatically */ static const struct rte_eth_conf vmdq_conf_default = { @@ -331,17 +309,20 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) if (retval != 0) return retval; + rte_eth_rxconf_defaults(port, &rx_conf); + rx_conf.rx_drop_en = 1; /* Setup the queues. */ for (q = 0; q < rx_rings; q ++) { retval = rte_eth_rx_queue_setup(port, q, rx_ring_size, - rte_eth_dev_socket_id(port), &rx_conf_default, + rte_eth_dev_socket_id(port), &rx_conf, mbuf_pool); if (retval < 0) return retval; } for (q = 0; q < tx_rings; q ++) { retval = rte_eth_tx_queue_setup(port, q, tx_ring_size, - rte_eth_dev_socket_id(port), &tx_conf_default); + rte_eth_dev_socket_id(port), + NULL); if (retval < 0) return retval; } diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c index 35df234..8353e89 100644 --- a/examples/vmdq/main.c +++ b/examples/vmdq/main.c @@ -81,25 +81,6 @@ #define MBUF_CACHE_SIZE 64 #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - #define MAX_PKT_BURST 32 /* @@ -117,36 +98,7 @@ static uint32_t enabled_port_mask = 0; static uint32_t num_queues = 8; static uint32_t num_pools = 8; -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -/* Default configuration for rx and tx thresholds etc. */ -static const struct rte_eth_rxconf rx_conf_default = { - .rx_thresh = { - .pthresh = RX_PTHRESH, - .hthresh = RX_HTHRESH, - .wthresh = RX_WTHRESH, - }, - .rx_drop_en = 1, -}; - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe/igb PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -static const struct rte_eth_txconf tx_conf_default = { - .tx_thresh = { - .pthresh = TX_PTHRESH, - .hthresh = TX_HTHRESH, - .wthresh = TX_WTHRESH, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; +static struct rte_eth_rxconf rx_conf; /* empty vmdq configuration structure. Filled in programatically */ static const struct rte_eth_conf vmdq_conf_default = { @@ -308,17 +260,21 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) if (retval != 0) return retval; + rte_eth_rxconf_defaults(port, &rx_conf); + rx_conf.rx_drop_en = 1; for (q = 0; q < rxRings; q ++) { retval = rte_eth_rx_queue_setup(port, q, rxRingSize, - rte_eth_dev_socket_id(port), &rx_conf_default, - mbuf_pool); + rte_eth_dev_socket_id(port), + &rx_conf, + mbuf_pool); if (retval < 0) return retval; } for (q = 0; q < txRings; q ++) { retval = rte_eth_tx_queue_setup(port, q, txRingSize, - rte_eth_dev_socket_id(port), &tx_conf_default); + rte_eth_dev_socket_id(port), + NULL); if (retval < 0) return retval; } diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c index 2f708a1..20726e5 100644 --- a/examples/vmdq_dcb/main.c +++ b/examples/vmdq_dcb/main.c @@ -87,36 +87,6 @@ static uint32_t enabled_port_mask = 0; /* number of pools (if user does not specify any, 16 by default */ static enum rte_eth_nb_pools num_pools = ETH_16_POOLS; -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -/* Default configuration for rx and tx thresholds etc. */ -static const struct rte_eth_rxconf rx_conf_default = { - .rx_thresh = { - .pthresh = 8, - .hthresh = 8, - .wthresh = 4, - }, -}; - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -static const struct rte_eth_txconf tx_conf_default = { - .tx_thresh = { - .pthresh = 36, - .hthresh = 0, - .wthresh = 0, - }, - .tx_free_thresh = 0, /* Use PMD default values */ - .tx_rs_thresh = 0, /* Use PMD default values */ -}; - /* empty vmdq+dcb configuration structure. Filled in programatically */ static const struct rte_eth_conf vmdq_dcb_conf_default = { .rxmode = { @@ -212,7 +182,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) for (q = 0; q < rxRings; q ++) { retval = rte_eth_rx_queue_setup(port, q, rxRingSize, - rte_eth_dev_socket_id(port), &rx_conf_default, + rte_eth_dev_socket_id(port), + NULL, mbuf_pool); if (retval < 0) return retval; @@ -220,7 +191,8 @@ port_init(uint8_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), &tx_conf_default); + rte_eth_dev_socket_id(port), + NULL); if (retval < 0) return retval; } -- 1.7.7.6