2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 13:27:59 +00:00

netdev-dpdk: Use default NIC configuration.

This patch simplifies Rx/Tx NIC configuration by removing
custom values and using the defaults provided by the DPDK
PMDs. This also enables Rx vectorisation which improves
performance.

Signed-off-by: Kevin Traynor <kevin.traynor@intel.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
This commit is contained in:
Kevin Traynor 2015-05-21 17:26:48 +01:00 committed by Ethan Jackson
parent fc82e877ef
commit 9154f798ef

View File

@ -90,15 +90,6 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF / ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
#define NIC_PORT_RX_Q_SIZE 2048 /* Size of Physical NIC RX Queue, Max (n+32<=4096)*/ #define NIC_PORT_RX_Q_SIZE 2048 /* Size of Physical NIC RX Queue, Max (n+32<=4096)*/
#define NIC_PORT_TX_Q_SIZE 2048 /* Size of Physical NIC TX Queue, Max (n+32<=4096)*/ #define NIC_PORT_TX_Q_SIZE 2048 /* Size of Physical NIC TX Queue, Max (n+32<=4096)*/
/* XXX: Needs per NIC value for these constants. */
#define RX_PTHRESH 32 /* Default values of RX prefetch threshold reg. */
#define RX_HTHRESH 32 /* Default values of RX host threshold reg. */
#define RX_WTHRESH 16 /* Default values of RX write-back threshold reg. */
#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. */
/* Character device cuse_dev_name. */ /* Character device cuse_dev_name. */
static char *cuse_dev_name = NULL; static char *cuse_dev_name = NULL;
@ -128,25 +119,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,
.tx_rs_thresh = 0,
.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS|ETH_TXQ_FLAGS_NOOFFLOADS,
};
enum { MAX_TX_QUEUE_LEN = 384 }; enum { MAX_TX_QUEUE_LEN = 384 };
enum { DPDK_RING_SIZE = 256 }; enum { DPDK_RING_SIZE = 256 };
BUILD_ASSERT_DECL(IS_POW2(DPDK_RING_SIZE)); BUILD_ASSERT_DECL(IS_POW2(DPDK_RING_SIZE));
@ -449,7 +421,7 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev) OVS_REQUIRES(dpdk_mutex)
for (i = 0; i < dev->up.n_txq; i++) { for (i = 0; i < dev->up.n_txq; i++) {
diag = rte_eth_tx_queue_setup(dev->port_id, i, NIC_PORT_TX_Q_SIZE, diag = rte_eth_tx_queue_setup(dev->port_id, i, NIC_PORT_TX_Q_SIZE,
dev->socket_id, &tx_conf); dev->socket_id, NULL);
if (diag) { if (diag) {
VLOG_ERR("eth dev tx queue setup error %d",diag); VLOG_ERR("eth dev tx queue setup error %d",diag);
return -diag; return -diag;
@ -459,7 +431,7 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev) OVS_REQUIRES(dpdk_mutex)
for (i = 0; i < dev->up.n_rxq; i++) { for (i = 0; i < dev->up.n_rxq; i++) {
diag = rte_eth_rx_queue_setup(dev->port_id, i, NIC_PORT_RX_Q_SIZE, diag = rte_eth_rx_queue_setup(dev->port_id, i, NIC_PORT_RX_Q_SIZE,
dev->socket_id, dev->socket_id,
&rx_conf, dev->dpdk_mp->mp); NULL, dev->dpdk_mp->mp);
if (diag) { if (diag) {
VLOG_ERR("eth dev rx queue setup error %d",diag); VLOG_ERR("eth dev rx queue setup error %d",diag);
return -diag; return -diag;