Merge patch of Configuration param to skip "TX checksum offload", refer #448.

This commit is contained in:
Jayath Sathyanarayana 2019-11-04 13:00:17 +08:00 committed by root
parent 7f7be099b6
commit 3a3642c7f7
4 changed files with 23 additions and 10 deletions

View File

@ -12,6 +12,12 @@ channel=4
promiscuous=1
numa_on=1
# TX checksum offload skip, default: disabled.
# We need this switch enabled in the following cases:
# -> The application want to enforce wrong checksum for testing purposes
# -> Some cards advertize the offload capability. However, doesn't calculate checksum.
tx_csum_offoad_skip=0
# TCP segment offload, default: disabled.
tso=0

View File

@ -579,6 +579,8 @@ ini_parse_handler(void* user, const char* section, const char* name,
pconfig->dpdk.numa_on = atoi(value);
} else if (MATCH("dpdk", "tso")) {
pconfig->dpdk.tso = atoi(value);
} else if (MATCH("dpdk", "tx_csum_offoad_skip")) {
pconfig->dpdk.tx_csum_offoad_skip = atoi(value);
} else if (MATCH("dpdk", "vlan_strip")) {
pconfig->dpdk.vlan_strip = atoi(value);
} else if (MATCH("dpdk", "idle_sleep")) {

View File

@ -122,6 +122,7 @@ struct ff_config {
int nb_bond;
int numa_on;
int tso;
int tx_csum_offoad_skip;
int vlan_strip;
/* sleep x microseconds when no pkts incomming */

View File

@ -634,17 +634,21 @@ init_port_start(void)
pconf->hw_features.rx_csum = 1;
}
if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM)) {
printf("TX ip checksum offload supported\n");
port_conf.txmode.offloads |= DEV_TX_OFFLOAD_IPV4_CKSUM;
pconf->hw_features.tx_csum_ip = 1;
}
if (ff_global_cfg.dpdk.tx_csum_offoad_skip == 0) {
if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM)) {
printf("TX ip checksum offload supported\n");
port_conf.txmode.offloads |= DEV_TX_OFFLOAD_IPV4_CKSUM;
pconf->hw_features.tx_csum_ip = 1;
}
if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_CKSUM) &&
(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_CKSUM)) {
printf("TX TCP&UDP checksum offload supported\n");
port_conf.txmode.offloads |= DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM;
pconf->hw_features.tx_csum_l4 = 1;
if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_CKSUM) &&
(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_CKSUM)) {
printf("TX TCP&UDP checksum offload supported\n");
port_conf.txmode.offloads |= DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM;
pconf->hw_features.tx_csum_l4 = 1;
}
} else {
printf("TX checksum offoad is disabled\n");
}
if (ff_global_cfg.dpdk.tso) {