summaryrefslogtreecommitdiffstats
path: root/src/vnet
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/vnet
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/vnet')
-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)
{
esources/tools/testbed-setup?h=rls2306&id=c6cd03e08d9429168b0e183b8dcbce991112f279'>testbed-setup/cimc/cimc.py
blob: 2e0fc42a251dea19872d80d0f411e3cbfed6b0a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/python
#
# Copyright (c) 2016 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import cimclib
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("ip", help="CIMC IP address")
parser.add_argument("-u", "--username", help="CIMC username (admin)",
                    default="admin")
parser.add_argument("-p", "--password", help="CIMC password (cisco123)",
                    default="cisco123")
parser.add_argument("-d", "--debug", help="Enable debugging", action="count",
                    default=0)

parser.add_argument("-i", "--initialize",
                    help="Initialize args.ip: Power-Off, reset BIOS defaults, Enable console redir, get LOM MAC addr",
                    action='store_true')
parser.add_argument("-s", "--set",
                    help="Set specific BIOS settings", action='append')
parser.add_argument("--wipe", help="Delete all virtual drives",
                    action='store_true')
parser.add_argument("-r", "--raid", help="Create RAID array",
                    action='store_true')
parser.add_argument("-rl", "--raid-level", help="RAID level", default='10')
parser.add_argument("-rs", "--raid-size", help="RAID size", default=3*571250)
parser.add_argument("-rd", "--raid-disks",
                    help="RAID disks ('[1,2][3,4][5,6]')",
                    default='[1,2][3,4][5,6]')
parser.add_argument("-pxe", "--boot-pxe", help="Reboot using PXE",
                    action='store_true')
parser.add_argument("-hdd", "--boot-hdd", help="Boot using HDD on next boot",
                    action='store_true')
parser.add_argument("-poff", "--power-off", help="Power Off",
                    action='store_true')
parser.add_argument("-pon", "--power-on", help="Power On", action='store_true')
parser.add_argument("-m", "--mac-table",
                    help="Show interface MAC address table",
                    action='store_true')

args = parser.parse_args()

cookie = cimclib.login(args.ip, args.username, args.password)

if args.wipe:
    cimclib.deleteAllVirtualDrives(args.ip, cookie, args.debug)

if args.raid:
    cimclib.createRaid(args.ip, cookie, "raid-virl", args.raid_level, args.raid_size, args.raid_disks, args.debug)

if args.initialize:
    cimclib.powerOff(args.ip, cookie)
    cimclib.restoreBiosDefaultSettings(args.ip, cookie, args.debug)
    cimclib.enableConsoleRedir(args.ip, cookie, args.debug)
    cimclib.powerOn(args.ip, cookie, args.debug)
    cimclib.bootIntoUefi(args.ip, cookie, args.debug)
    lom_mac = cimclib.getLOMMacAddress(args.ip, cookie, args.debug)
    print "Host {} LOM MAC address: {}".format(args.ip, lom_mac)

if args.set:
    cimclib.setBiosSettings(args.ip, cookie, args.set, args.debug)

if args.boot_pxe:
    cimclib.bootPXE(args.ip, cookie, args.debug)

if args.boot_hdd:
    cimclib.bootHDDPXE(args.ip, cookie, args.debug)

if args.power_off:
    cimclib.powerOff(args.ip, cookie, args.debug)

if args.power_on:
    cimclib.powerOn(args.ip, cookie, args.debug)

if args.mac_table:
    maclist = cimclib.getMacAddresses(args.ip, cookie, args.debug)

    for k in sorted(maclist.keys()):
        print "{}:".format(k)
        for p in sorted(maclist[k].keys()):
            print "  {} - {}".format(p, maclist[k][p])

cimclib.logout(args.ip, cookie)