values in rte_eth_rxconf and rte_eth_txconf are not optimal

Bug #1787114 reported by Yi-y-yang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
Undecided
Unassigned
OpenContrail
New
Undecided
Unassigned

Bug Description

In dpdk/vr_dpdk_ethdev.c, values in rte_eth_rxconf and rte_eth_txconf are not optimal.

Here are current values:

/* RX ring configuration */
static const struct rte_eth_rxconf rx_queue_conf = {
    .rx_thresh = {
        .pthresh = 8, /* Ring prefetch threshold */
        .hthresh = 8, /* Ring host threshold */
        .wthresh = 4, /* Ring writeback threshold */
    },
    /* Do not immediately free RX descriptors */
    .rx_free_thresh = VR_DPDK_RX_BURST_SZ, //32
};

/* TX ring configuration */
static const struct rte_eth_txconf tx_queue_conf = {
    .tx_thresh = {
        .pthresh = 36, /* Ring prefetch threshold */
        .hthresh = 0, /* Ring host threshold */
        .wthresh = 0, /* Ring writeback threshold */
    },
    .tx_free_thresh = 0,
    .tx_rs_thresh = 0, /* Use PMD default values */
    .txq_flags = 0 /* Set flags for the Tx queue */
};

I got some optimal values from dpdk source code test/test/test_pmd_perf.c

/*
 * 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 0 /**< 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 32 /**< 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. */

static 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 = 32, /* Use PMD default values */
        .tx_rs_thresh = 32, /* 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)
};

I tried these values, they are obviously better than previous ones.

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/45580
Submitter: Yi Yang (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/45580
Committed: http://github.com/Juniper/contrail-vrouter/commit/9462ef00336aa58a1c46543f702ee89120072aff
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 9462ef00336aa58a1c46543f702ee89120072aff
Author: Yi Yang <email address hidden>
Date: Wed Aug 15 16:38:24 2018 +0800

Use optimal Tx config for physical ethenet NIC

struct rte_eth_txconf tx_queue_conf = {
.tx_thresh = {
.pthresh = 32, /* Ring prefetch threshold */
.hthresh = 0, /* Ring host threshold */
.wthresh = 0, /* Ring writeback threshold */
},
.tx_free_thresh = 32,
.tx_rs_thresh = 32, /* Use PMD default values */
.txq_flags = 0 /* Set flags for the Tx queue */
};

This can improve Tx performance obviously.

Change-Id: I63ad2cf61e00255dc8e2f3a3e9caa4c1653ec23c
Closes-Bug: #1787114
Signed-off-by: Yi Yang <email address hidden>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.