Fix the IP/TCP/UDP csum error of txmode offloads, refer #317.

This commit is contained in:
fengbojiang(姜凤波) 2019-01-18 18:05:18 +08:00
parent 2bc927fd77
commit d9665c93cb
1 changed files with 3 additions and 0 deletions

View File

@ -651,18 +651,21 @@ init_port_start(void)
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 (ff_global_cfg.dpdk.tso) {
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) {
printf("TSO is supported\n");
port_conf.txmode.offloads |= DEV_TX_OFFLOAD_TCP_TSO;
pconf->hw_features.tx_tso = 1;
}
} else {