Skip to content

Commit

Permalink
virtio-l2fwd: reset TCP TSO offload
Browse files Browse the repository at this point in the history
Reset TCP TSO offload config is required before setting
new offload config based on negotiated features.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Change-Id: Ied220c9255cd4cee43f01863ebd205cde7b2b01c
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpu-offload/+/132829
Tested-by: sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com>
Reviewed-by: Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>
  • Loading branch information
rbhansali authored and jerinjacobk committed Aug 12, 2024
1 parent 16456cc commit b07d46b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/virtio-l2fwd/virtio_l2fwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2023,18 +2023,19 @@ chksum_offload_configure(uint16_t virtio_devid)
uint16_t virt_q_count, portid;
int rc;

#define TX_OFFLOADS (RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | RTE_ETH_TX_OFFLOAD_TCP_TSO)
#define RX_OFFLOADS (RTE_ETH_RX_OFFLOAD_CHECKSUM)

csum_offload = dao_virtio_netdev_feature_bits_get(virtio_devid) & 0x3;
tso_offload = dao_virtio_netdev_feature_bits_get(virtio_devid) & 0XFFFF;

portid = virtio_map[virtio_devid].id;
local_port_conf = &eth_dev_conf[portid];
virt_q_count = eth_dev_q_count[portid];

tx_offloads = local_port_conf->txmode.offloads;
rx_offloads = local_port_conf->rxmode.offloads;
tx_offloads = local_port_conf->txmode.offloads & ~(TX_OFFLOADS);
rx_offloads = local_port_conf->rxmode.offloads & ~(RX_OFFLOADS);

tx_offloads &= ~(RTE_ETH_TX_OFFLOAD_IPV4_CKSUM);
rx_offloads &= ~(RTE_ETH_RX_OFFLOAD_CHECKSUM);
if (csum_offload & RTE_BIT64(VIRTIO_NET_F_CSUM)) {
tx_offloads |= RTE_ETH_TX_OFFLOAD_IPV4_CKSUM;
if (tso_offload & RTE_BIT64(VIRTIO_NET_F_HOST_TSO4) ||
Expand Down

0 comments on commit b07d46b

Please sign in to comment.