Project

General

Profile

Feature #12676

want better offloads for vnics

Added by Patrick Mooney 9 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
bhyve
Gerrit CR:

Description

This is part of the bhyve upstreaming effort. It represents several tickets from SmartOS:

- OS-6701 mac_fix_cksum breaks ethernet header
- OS-2340 vnics should support LSO
- OS-6778 MAC loopback traffic should avoid cksum work
- OS-6794 want LSO support in viona
- OS-7319 Kernel BAD TRAP in mac module, mac_protect_check()
- OS-7331 mac_sw_cksum() drops valid UDP traffic
- OS-7556 IPv6 packets dropped after crossing MAC-loopback
- OS-7564 panic in mac_hw_emul()
- OS-7520 OS-6778 broke IPv4 forwarding
- OS-6878 mac_fix_cksum is incomplete
- OS-7806 cannot move link from NGZ to GZ
- OS-7924 OS-7520 regressed some instances of IP forwarding
- OS-8027 reinstate mac-loopback hardware emulation on Tx (undo OS-6778)
- A small update to copyb() from OS-4600

Exposing hardware offloads and efficient loopback to vnics was obviously challenging. All of these changes will be squashed into a single unified wad, rather than subjecting the gate to those trials and tribulations.

#1

Updated by Patrick Mooney 9 months ago

  • Description updated (diff)
#2

Updated by Patrick Mooney 9 months ago

  • Description updated (diff)
#3

Updated by Patrick Mooney 8 months ago

Test results from rpz:

rpz@thunderhead:/var/tmp/net-tests$ pfexec ./mac-tests -a igb2 igb3 ixgbe4 ixgbe5
PASS [test_mac_aggr_primary<aggr_recv1>]
PASS [test_mac_aggr_primary_vlan<aggr_recv1>]
PASS [test_mac_aggr_vnic<aggr_recv1>]
PASS [test_mac_aggr_two_vnics<aggr_recv1>]
PASS [test_mac_aggr_vlan<aggr_recv1>]
PASS [test_mac_aggr_two_vlans<aggr_recv1>]
PASS [test_mac_aggr_vlans_shared_addr<aggr_recv1>]
PASS [test_mac_aggr_steal_group<aggr_recv1>]
PASS [test_mac_aggr_vlan_steal_group<aggr_recv1>]
PASS [test_mac_aggr_vlan_ref_count<aggr_recv1>]
PASS [test_mac_aggr_vnic_and_vlan<aggr_recv1>]

rpz@thunderhead:/var/tmp/net-tests$ pfexec ./mac-tests -a ixgbe4 ixgbe5 igb2 igb3
PASS [test_mac_aggr_primary<aggr_recv1>]
PASS [test_mac_aggr_primary_vlan<aggr_recv1>]
PASS [test_mac_aggr_vnic<aggr_recv1>]
PASS [test_mac_aggr_two_vnics<aggr_recv1>]
PASS [test_mac_aggr_vlan<aggr_recv1>]
PASS [test_mac_aggr_two_vlans<aggr_recv1>]
PASS [test_mac_aggr_vlans_shared_addr<aggr_recv1>]
SKIP [test_mac_aggr_steal_group<aggr_recv1>]: both ports must have group support
SKIP [test_mac_aggr_vlan_steal_group<aggr_recv1>]: both ports must have group support
SKIP [test_mac_aggr_vlan_ref_count<aggr_recv1>]: both ports must have group support
SKIP [test_mac_aggr_vnic_and_vlan<aggr_recv1>]: both ports must have group support

rpz@thunderhead:/var/tmp/net-tests$ pfexec ./mac-tests ixgbe4 ixgbe5
PASS [test_mac_vnic_rx<ixgbe5>]
PASS [test_mac_vlan_rx<ixgbe5>]
PASS [test_mac_sw_to_hw<ixgbe5>]
PASS [test_mac_promisc<ixgbe5>]
PASS [test_mac_promisc_vlan<ixgbe5>]
PASS [test_mac_all_groups<ixgbe5>]
PASS [test_mac_vlan_all_groups<ixgbe5>]
PASS [test_mac_steal_group<ixgbe5>]
PASS [test_mac_vlan_steal_group<ixgbe5>]
PASS [test_mac_groups_vlan_shared_addr<ixgbe5>]
PASS [test_mac_vlan_shared_addr<ixgbe5>]
PASS [test_mac_two_vlans_on_default<ixgbe5>]
PASS [test_mac_ixgbe_many_vlans<ixgbe5>]
PASS [test_mac_ixgbe_vfta_repeated_vid<ixgbe5>]
PASS [test_mac_ixgbe_vlvfb_missing_default<ixgbe5>]

rpz@thunderhead:/var/tmp/net-tests$ pfexec ./mac-tests igb2 igb3
PASS [test_mac_vnic_rx<igb3>]
PASS [test_mac_vlan_rx<igb3>]
SKIP [test_mac_sw_to_hw<igb3>]: igb3 does not support groups
PASS [test_mac_promisc<igb3>]
PASS [test_mac_promisc_vlan<igb3>]
SKIP [test_mac_all_groups<igb3>]: igb3 does not support groups
SKIP [test_mac_vlan_all_groups<igb3>]: igb3 does not support groups
SKIP [test_mac_steal_group<igb3>]: igb3 does not support groups
SKIP [test_mac_vlan_steal_group<igb3>]: igb3 does not support groups
SKIP [test_mac_groups_vlan_shared_addr<igb3>]: igb3 does not support groups
PASS [test_mac_vlan_shared_addr<igb3>]
SKIP [test_mac_two_vlans_on_default<igb3>]: igb3 does not support groups

rpz@thunderhead:/var/tmp/net-tests$ pfexec ./mac-tests i40e0 i40e1
PASS [test_mac_vnic_rx<i40e1>]
PASS [test_mac_vlan_rx<i40e1>]
PASS [test_mac_sw_to_hw<i40e1>]
PASS [test_mac_promisc<i40e1>]
PASS [test_mac_promisc_vlan<i40e1>]
PASS [test_mac_all_groups<i40e1>]
PASS [test_mac_vlan_all_groups<i40e1>]
PASS [test_mac_steal_group<i40e1>]
PASS [test_mac_vlan_steal_group<i40e1>]
PASS [test_mac_groups_vlan_shared_addr<i40e1>]
PASS [test_mac_vlan_shared_addr<i40e1>]
PASS [test_mac_two_vlans_on_default<i40e1>]

rpz@thunderhead:/var/tmp/net-tests$ pfexec ./lso-tests i40e0 i40e1
PASS [test_lso_ip4_primary<i40e0>]
PASS [test_lso_ip4_vnic<i40e0>]
PASS [test_lso_ip4_mac_loopback<i40e0>]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The following tests will elide the LSO check until the   %
% mac sw LSO is updated to handle IPv6 -- for now these    %
& tests only verify that traffic is sent, not LSO.         %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PASS [test_lso_ip6_primary<i40e0>]
PASS [test_lso_ip6_vnic<i40e0>]
PASS [test_lso_ip6_mac_loopback<i40e0>]

root@thunderhead:~# /opt/net-tests/bin/nettest 
Test: /opt/net-tests/tests/forwarding/ip_fwd_001 (run as root)    [01:27] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_002 (run as root)    [01:27] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_003 (run as root)    [01:26] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_004 (run as root)    [01:24] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_005 (run as root)    [01:26] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_006 (run as root)    [01:27] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_007 (run as root)    [01:25] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_008 (run as root)    [01:26] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_009 (run as root)    [01:25] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_010 (run as root)    [01:26] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_011 (run as root)    [01:25] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_012 (run as root)    [01:26] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_013 (run as root)    [01:26] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_014 (run as root)    [01:26] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_015 (run as root)    [01:28] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_016 (run as root)    [01:25] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_017 (run as root)    [01:25] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_018 (run as root)    [01:26] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_019 (run as root)    [01:26] [PASS]
Test: /opt/net-tests/tests/forwarding/ip_fwd_020 (run as root)    [01:25] [PASS]

Results Summary
PASS      20

Running Time:   00:28:49
Percent passed: 100.0%

#4

Updated by Patrick Mooney 8 months ago

These changes have been in SmartOS for a while. OmniOSce has also side-pulled them for bhyve.

#5

Updated by Electric Monk 8 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit c61a1653a4d73dbc950dac7d96350fd6cb517486

commit  c61a1653a4d73dbc950dac7d96350fd6cb517486
Author: Ryan Zezeski <rpz@joyent.com>
Date:   2020-05-18T18:37:51.000Z

    12676 want better offloads for vnics
    12677 simnet has bogus mi_tx_cksum_flags
    12678 mac_tx() is too eager to emulate hardware offloads
    Portions contributed by: Patrick Mooney <patrick.mooney@joyent.com>
    Portions contributed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Patrick Mooney <pmooney@oxide.computer>
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

#6

Updated by Ryan Zezeski 8 months ago

Just want to note that the following SmartOS tickets were also upstreamed in this wad.

OS-7904 simnet has bougs mi_tx_cksum_flags
OS-7905 mac_tx() is too eager to emulate hardware offloads

Also available in: Atom PDF