summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorChenmin Sun <chenmin.sun@intel.com>2019-10-11 00:28:13 +0800
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-11-05 10:47:31 +0000
commit387123e675c222b52f720b6fd5ac0c7b3f016bcd (patch)
treed1ce821c08e2fb92132892857bc93d9b48e04fbb /src/plugins
parentc9ddd2eec1194b6517106d31a6e40238d4aec4e8 (diff)
dpdk: fix tso not properly check the 'enable-tcp-udp-checksum' option issue
Type: fix Fix tso did not properly check the 'enable-tcp-udp-checksum' option issue Add description of 'tso' and 'enable-tcp-udp-checksum' in startup.conf Signed-off-by: Chenmin Sun <chenmin.sun@intel.com> Change-Id: Id659067a9fa9e1db6c3f8dc533a2e90351b86831 (cherry picked from commit 5bec5f7860dafcef6aefd50b74de15d08910c6f4)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dpdk/device/init.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 6f3178fcf21..1045bf3251c 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -748,22 +748,21 @@ dpdk_lib_init (dpdk_main_t * dm)
if (xd->flags & DPDK_DEVICE_FLAG_TX_OFFLOAD && hi != NULL)
hi->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD;
- if (devconf->tso == DPDK_DEVICE_TSO_ON)
- {
- if (xd->flags & DPDK_DEVICE_FLAG_TX_OFFLOAD && hi != NULL)
- {
- /*tcp_udp checksum must be enabled*/
- if (hi->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD)
- {
- hi->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO;
- vnm->interface_main.gso_interface_count++;
- xd->port_conf.txmode.offloads |= DEV_TX_OFFLOAD_TCP_TSO |
- DEV_TX_OFFLOAD_UDP_TSO;
- }
- else
- return clib_error_return (0, "TSO: TCP/UDP checksum offload must be enabled");
- }
- }
+ if (devconf->tso == DPDK_DEVICE_TSO_ON && hi != NULL)
+ {
+ /*tcp_udp checksum must be enabled*/
+ if ((dm->conf->enable_tcp_udp_checksum) &&
+ (hi->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD))
+ {
+ hi->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO;
+ vnm->interface_main.gso_interface_count++;
+ xd->port_conf.txmode.offloads |= DEV_TX_OFFLOAD_TCP_TSO |
+ DEV_TX_OFFLOAD_UDP_TSO;
+ }
+ else
+ clib_warning ("%s: TCP/UDP checksum offload must be enabled",
+ hi->name);
+ }
dpdk_device_setup (xd);