Skip to content

Commit

Permalink
Fix crc offloads.
Browse files Browse the repository at this point in the history
When configuring a port, prox configures queue flags.
For historitical reasons, offloads had to be disabled on
some pmds.
There is now an API to query the ports and gets their
capabilities. This fix sets now the flags based on the capabilities,
and not the driver name.

Change-Id: Ic72d15001992f26910f653c70d31e4381fff8089
Signed-off-by: Xavier Simonart <[email protected]>
  • Loading branch information
xsimonar authored and sdeepak2 committed Apr 26, 2018
1 parent 11b2dcd commit 4685c59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions VNFs/DPPD-PROX/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static void configure_if_tx_queues(struct task_args *targ, uint8_t socket)
}
/* Set the ETH_TXQ_FLAGS_NOREFCOUNT flag if none of
the tasks up to the task transmitting to the port
does not use refcnt. */
use refcnt. */
if (!chain_flag_state(targ, TASK_FEATURE_TXQ_FLAGS_REFCOUNT, 1)) {
prox_port_cfg[if_port].tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOREFCOUNT;
plog_info("\t\tEnabling No refcnt on port %d\n", if_port);
Expand All @@ -262,7 +262,7 @@ static void configure_if_tx_queues(struct task_args *targ, uint8_t socket)
chain has NOOFFLOADS set all the way until the
first task that receives from a port, it will be
disabled for the destination port. */
if (chain_flag_state(targ, TASK_FEATURE_TXQ_FLAGS_NOOFFLOADS, 1)) {
if (!chain_flag_state(targ, TASK_FEATURE_TXQ_FLAGS_NOOFFLOADS, 0)) {
prox_port_cfg[if_port].tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOOFFLOADS;
plog_info("\t\tDisabling TX offloads on port %d\n", if_port);
} else {
Expand All @@ -271,8 +271,8 @@ static void configure_if_tx_queues(struct task_args *targ, uint8_t socket)

/* By default NOMULTSEGS is disabled, as drivers/NIC might split packets on RX
It should only be enabled when we know for sure that the RX does not split packets.
Set the ETH_TXQ_FLAGS_NOMULTSEGS flag if none of the tasks up to the task
transmitting to the port does not use multsegs. */
Set the ETH_TXQ_FLAGS_NOMULTSEGS flag if all of the tasks up to the task
transmitting to the port use no_multsegs. */
if (!chain_flag_state(targ, TASK_FEATURE_TXQ_FLAGS_NOMULTSEGS, 0)) {
prox_port_cfg[if_port].tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOMULTSEGS;
plog_info("\t\tEnabling No MultiSegs on port %d\n", if_port);
Expand Down
8 changes: 4 additions & 4 deletions VNFs/DPPD-PROX/prox_port_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,14 @@ static void init_port(struct prox_port_cfg *port_cfg)

PROX_PANIC(ret < 0, "\t\t\trte_eth_rx_queue_setup() failed on port %u: error %s (%d)\n", port_id, strerror(-ret), ret);
}
if (!strcmp(port_cfg->short_name, "virtio")) {
if (port_cfg->capabilities.tx_offload_cksum == 0) {
port_cfg->tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOOFFLOADS;
plog_info("\t\tDisabling TX offloads (virtio does not support TX offloads)\n");
plog_info("\t\tDisabling TX offloads as pmd reports that it does not support them)\n");
}

if (!strcmp(port_cfg->short_name, "vmxnet3")) {
port_cfg->tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOOFFLOADS | ETH_TXQ_FLAGS_NOMULTSEGS;
plog_info("\t\tDisabling TX offloads and multsegs on port %d as vmxnet3 does not support them\n", port_id);
port_cfg->tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOMULTSEGS;
plog_info("\t\tDisabling multsegs on port %d as vmxnet3 does not support them\n", port_id);
}
/* initialize one TX queue per logical core on each port */
for (uint16_t queue_id = 0; queue_id < port_cfg->n_txq; ++queue_id) {
Expand Down

0 comments on commit 4685c59

Please sign in to comment.