aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2022-10-25 19:27:08 +0000
committerMohsin Kazmi <sykazmi@cisco.com>2022-10-25 19:29:33 +0000
commit5efc0cdf48e45ff457c5ddead157165b725e78f3 (patch)
treede7de09422934a36d73a0564aa75130dac39e998 /src
parent4561d6d251844b504a024d569de8d876203047ac (diff)
virtio: use current_data as l2_hdr_offset
Type: fix virtio transmit node uses header offsets to set the appropriate metadata for packet with offloads. But l2_hdr_offset is not correctly set by previous node(s). This patch makes use of curren_data field as l2_hdr_offset. Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Id2f41a7650be45c9cc1ebacc7bec298be79bf218
Diffstat (limited to 'src')
-rw-r--r--src/vnet/devices/virtio/device.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vnet/devices/virtio/device.c b/src/vnet/devices/virtio/device.c
index e97da1d4204..2063865f8ab 100644
--- a/src/vnet/devices/virtio/device.c
+++ b/src/vnet/devices/virtio/device.c
@@ -309,8 +309,7 @@ set_checksum_offsets (vlib_buffer_t *b, vnet_virtio_net_hdr_v1_t *hdr,
const int is_l2)
{
vnet_buffer_oflags_t oflags = vnet_buffer (b)->oflags;
- i16 l4_hdr_offset =
- vnet_buffer (b)->l4_hdr_offset - vnet_buffer (b)->l2_hdr_offset;
+ i16 l4_hdr_offset = vnet_buffer (b)->l4_hdr_offset - b->current_data;
if (b->flags & VNET_BUFFER_F_IS_IP4)
{
ip4_header_t *ip4;
@@ -377,8 +376,7 @@ set_gso_offsets (vlib_buffer_t *b, vnet_virtio_net_hdr_v1_t *hdr,
const int is_l2)
{
vnet_buffer_oflags_t oflags = vnet_buffer (b)->oflags;
- i16 l4_hdr_offset =
- vnet_buffer (b)->l4_hdr_offset - vnet_buffer (b)->l2_hdr_offset;
+ i16 l4_hdr_offset = vnet_buffer (b)->l4_hdr_offset - b->current_data;
if (b->flags & VNET_BUFFER_F_IS_IP4)
{