1. 07 9月, 2022 2 次提交
  2. 01 9月, 2022 1 次提交
  3. 16 8月, 2022 1 次提交
  4. 26 7月, 2022 1 次提交
  5. 23 7月, 2022 1 次提交
  6. 19 7月, 2022 1 次提交
  7. 01 7月, 2022 2 次提交
  8. 22 6月, 2022 1 次提交
  9. 09 6月, 2022 1 次提交
  10. 08 6月, 2022 1 次提交
    • M
      i40e: Add VF VLAN pruning · c87c938f
      Mateusz Palczewski 提交于
      VFs by default are able to see all tagged traffic regardless of trust
      and VLAN filters configured.
      
      Add new private flag vf-vlan-pruning that allows changing of default
      VF behavior for tagged traffic. When the flag is turned on
      untrusted VF will only be able to receive untagged traffic
      or traffic with VLAN tags it has created interfaces for
      
      The flag is off by default and can only be changed if
      there are no VFs spawned on the PF. This flag will only be effective
      when no PVID is set on VF and VF is not trusted.
      Add new function that computes the correct VLAN ID for VF VLAN filters
      based on trust, PVID, vf-vlan-prune-disable flag and current VLAN ID.
      
      Testing Hints:
      
      Test 1: vf-vlan-pruning == off
      ==============================
      1. Set the private flag
      > ethtool --set-priv-flag eth0 vf-vlan-pruning off (default setting)
      2. Use scapy to send any VLAN tagged traffic and make sure the VF
      receives all VLAN tagged traffic that matches its destination MAC
      filters (unicast, multicast, and broadcast).
      
      Test 2: vf-vlan-pruning == on
      ==============================
      1. Set the private flag
      > ethtool --set-priv-flag eth0 vf-vlan-pruning on
      2. Use scapy to send any VLAN tagged traffic and make sure the VF does
      not receive any VLAN tagged traffic that matches its destination MAC
      filters (unicast, multicast, and broadcast).
      3. Add a VLAN filter on the VF netdev
      > ip link add link eth0v0 name vlan10 type vlan id 10
      4. Bring the VLAN netdev up
      > ip link set vlan10 up
      4. Use scapy to send traffic with VLAN 10, VLAN 11 (anything not VLAN
      10), and untagged traffic. Make sure the VF only receives VLAN 10
      and untagged traffic when the link partner is sending.
      
      Test 3: vf-vlan-pruning == off && VF is in a port VLAN
      ==============================
      1. Set the private flag
      > ethtool --set-priv-flag eth0 vf-vlan-pruning off (default setting)
      2. Create a VF
      > echo 1 > sriov_numvfs
      3. Put the VF in a port VLAN
      > ip link set eth0 vf 0 vlan 10
      4. Use scapy to send traffic with VLAN 10 and VLAN 11 (anything not VLAN
      10) and make sure the VF only receives untagged traffic when the link
      partner is sending VLAN 10 tagged traffic as the VLAN tag is expected
      to be stripped by HW for port VLANs and not visible to the VF.
      
      Test 4: Change vf-vlan-pruning while VFs are created
      ==============================
      echo 0 > sriov_numvfs
      ethtool --set-priv-flag eth0 vf-vlan-pruning off
      echo 1 > sriov_numvfs
      ethtool --set-priv-flag eth0 vf-vlan-pruning on (expect failure)
      Signed-off-by: NSylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
      Signed-off-by: NPrzemyslaw Patynowski <przemyslawx.patynowski@intel.com>
      Signed-off-by: NMateusz Palczewski <mateusz.palczewski@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      c87c938f
  11. 12 5月, 2022 1 次提交
  12. 13 4月, 2022 3 次提交
    • M
      i40e: Add Ethernet Connection X722 for 10GbE SFP+ support · a941d5ee
      Mateusz Palczewski 提交于
      Add support for Ethernet Connection X722 for 10GbE SFP+ cards.
      Make possible for the driver to bind to the card.
      Signed-off-by: NPrzemyslaw Patynowski <przemyslawx.patynowski@intel.com>
      Signed-off-by: NMateusz Palczewski <mateusz.palczewski@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      a941d5ee
    • J
      i40e: Add tx_stopped stat · f728fa01
      Joe Damato 提交于
      Track TX queue stop events and export the new stat with ethtool.
      Signed-off-by: NJoe Damato <jdamato@fastly.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      f728fa01
    • J
      i40e: Add support for MPLS + TSO · b4fb2d33
      Joe Damato 提交于
      This change adds support for TSO of MPLS packets.
      
      In my tests with tcpdump it seems to work. Note this test setup has
      a 9000 byte MTU:
      
      MPLS (label 100, exp 0, [S], ttl 64) IP srcip.50086 > dstip.1234:
        Flags [P.], seq 593345:644401, ack 0, win 420,
        options [nop,nop,TS val 45022534 ecr 1722291395], length 51056
      
      IP dstip.1234 > srcip.50086: Flags [.], ack 593345, win 122,
        options [nop,nop,TS val 1722291395 ecr 45022534], length 0
      
      IP dstip.1234 > srcip.50086: Flags [.], ack 602289, win 105,
        options [nop,nop,TS val 1722291395 ecr 45022534], length 0
      
      IP dstip.1234 > srcip.50086: Flags [.], ack 620177, win 71,
        options [nop,nop,TS val 1722291395 ecr 45022534], length 0
      
      MPLS (label 100, exp 0, [S], ttl 64) IP srcip.50086 > dstip.1234:
        Flags [P.], seq 644401:655953, ack 0, win 420,
        options [nop,nop,TS val 45022534 ecr 1722291395], length 11552
      
      IP dstip.1234 > srcip.50086: Flags [.], ack 638065, win 37,
        options [nop,nop,TS val 1722291395 ecr 45022534], length 0
      
      IP dstip.1234 > srcip.50086: Flags [.], ack 644401, win 25,
        options [nop,nop,TS val 1722291395 ecr 45022534], length 0
      
      IP dstip.1234 > srcip.50086: Flags [.], ack 653345, win 8,
        options [nop,nop,TS val 1722291395 ecr 45022534], length 0
      
      IP dstip.1234 > srcip.50086: Flags [.], ack 655953, win 3,
        options [nop,nop,TS val 1722291395 ecr 45022534], length 0
      Signed-off-by: NJoe Damato <jdamato@fastly.com>
      Co-developed-by: NMike Gallo <mgallo@fastly.com>
      Signed-off-by: NMike Gallo <mgallo@fastly.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      b4fb2d33
  13. 25 2月, 2022 1 次提交
  14. 09 2月, 2022 4 次提交
  15. 04 2月, 2022 2 次提交
  16. 01 2月, 2022 2 次提交
  17. 28 1月, 2022 1 次提交
  18. 21 1月, 2022 4 次提交
  19. 05 1月, 2022 3 次提交
    • J
      i40e: Fix incorrect netdev's real number of RX/TX queues · e738451d
      Jedrzej Jagielski 提交于
      There was a wrong queues representation in sysfs during
      driver's reinitialization in case of online cpus number is
      less than combined queues. It was caused by stopped
      NetworkManager, which is responsible for calling vsi_open
      function during driver's initialization.
      In specific situation (ex. 12 cpus online) there were 16 queues
      in /sys/class/net/<iface>/queues. In case of modifying queues with
      value higher, than number of online cpus, then it caused write
      errors and other errors.
      Add updating of sysfs's queues representation during driver
      initialization.
      
      Fixes: 41c445ff ("i40e: main driver core")
      Signed-off-by: NLukasz Cieplicki <lukaszx.cieplicki@intel.com>
      Signed-off-by: NJedrzej Jagielski <jedrzej.jagielski@intel.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      e738451d
    • M
      i40e: Fix for displaying message regarding NVM version · 40feded8
      Mateusz Palczewski 提交于
      When loading the i40e driver, it prints a message like: 'The driver for the
      device detected a newer version of the NVM image v1.x than expected v1.y.
      Please install the most recent version of the network driver.' This is
      misleading as the driver is working as expected.
      
      Fix that by removing the second part of message and changing it from
      dev_info to dev_dbg.
      
      Fixes: 4fb29bdd ("i40e: The driver now prints the API version in error message")
      Signed-off-by: NMateusz Palczewski <mateusz.palczewski@intel.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      40feded8
    • D
      i40e: fix use-after-free in i40e_sync_filters_subtask() · 3116f59c
      Di Zhu 提交于
      Using ifconfig command to delete the ipv6 address will cause
      the i40e network card driver to delete its internal mac_filter and
      i40e_service_task kernel thread will concurrently access the mac_filter.
      These two processes are not protected by lock
      so causing the following use-after-free problems.
      
       print_address_description+0x70/0x360
       ? vprintk_func+0x5e/0xf0
       kasan_report+0x1b2/0x330
       i40e_sync_vsi_filters+0x4f0/0x1850 [i40e]
       i40e_sync_filters_subtask+0xe3/0x130 [i40e]
       i40e_service_task+0x195/0x24c0 [i40e]
       process_one_work+0x3f5/0x7d0
       worker_thread+0x61/0x6c0
       ? process_one_work+0x7d0/0x7d0
       kthread+0x1c3/0x1f0
       ? kthread_park+0xc0/0xc0
       ret_from_fork+0x35/0x40
      
      Allocated by task 2279810:
       kasan_kmalloc+0xa0/0xd0
       kmem_cache_alloc_trace+0xf3/0x1e0
       i40e_add_filter+0x127/0x2b0 [i40e]
       i40e_add_mac_filter+0x156/0x190 [i40e]
       i40e_addr_sync+0x2d/0x40 [i40e]
       __hw_addr_sync_dev+0x154/0x210
       i40e_set_rx_mode+0x6d/0xf0 [i40e]
       __dev_set_rx_mode+0xfb/0x1f0
       __dev_mc_add+0x6c/0x90
       igmp6_group_added+0x214/0x230
       __ipv6_dev_mc_inc+0x338/0x4f0
       addrconf_join_solict.part.7+0xa2/0xd0
       addrconf_dad_work+0x500/0x980
       process_one_work+0x3f5/0x7d0
       worker_thread+0x61/0x6c0
       kthread+0x1c3/0x1f0
       ret_from_fork+0x35/0x40
      
      Freed by task 2547073:
       __kasan_slab_free+0x130/0x180
       kfree+0x90/0x1b0
       __i40e_del_filter+0xa3/0xf0 [i40e]
       i40e_del_mac_filter+0xf3/0x130 [i40e]
       i40e_addr_unsync+0x85/0xa0 [i40e]
       __hw_addr_sync_dev+0x9d/0x210
       i40e_set_rx_mode+0x6d/0xf0 [i40e]
       __dev_set_rx_mode+0xfb/0x1f0
       __dev_mc_del+0x69/0x80
       igmp6_group_dropped+0x279/0x510
       __ipv6_dev_mc_dec+0x174/0x220
       addrconf_leave_solict.part.8+0xa2/0xd0
       __ipv6_ifa_notify+0x4cd/0x570
       ipv6_ifa_notify+0x58/0x80
       ipv6_del_addr+0x259/0x4a0
       inet6_addr_del+0x188/0x260
       addrconf_del_ifaddr+0xcc/0x130
       inet6_ioctl+0x152/0x190
       sock_do_ioctl+0xd8/0x2b0
       sock_ioctl+0x2e5/0x4c0
       do_vfs_ioctl+0x14e/0xa80
       ksys_ioctl+0x7c/0xa0
       __x64_sys_ioctl+0x42/0x50
       do_syscall_64+0x98/0x2c0
       entry_SYSCALL_64_after_hwframe+0x65/0xca
      
      Fixes: 41c445ff ("i40e: main driver core")
      Signed-off-by: NDi Zhu <zhudi2@huawei.com>
      Signed-off-by: NRui Zhang <zhangrui182@huawei.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      3116f59c
  20. 11 12月, 2021 1 次提交
    • N
      i40e: Use irq_update_affinity_hint() · d34c54d1
      Nitesh Narayan Lal 提交于
      The driver uses irq_set_affinity_hint() for two purposes:
      
       - To set the affinity_hint which is consumed by the userspace for
         distributing the interrupts
      
       - To apply an affinity that it provides for the i40e interrupts
      
      The latter is done to ensure that all the interrupts are evenly spread
      across all available CPUs. However, since commit a0c9259d ("irq/matrix:
      Spread interrupts on allocation") the spreading of interrupts is
      dynamically performed at the time of allocation. Hence, there is no need
      for the drivers to enforce their own affinity for the spreading of
      interrupts.
      
      Also, irq_set_affinity_hint() applying the provided cpumask as an affinity
      for the interrupt is an undocumented side effect. To remove this side
      effect irq_set_affinity_hint() has been marked as deprecated and new
      interfaces have been introduced. Hence, replace the irq_set_affinity_hint()
      with the new interface irq_update_affinity_hint() that only sets the
      pointer for the affinity_hint.
      Signed-off-by: NNitesh Narayan Lal <nitesh@redhat.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Link: https://lore.kernel.org/r/20210903152430.244937-4-nitesh@redhat.com
      d34c54d1
  21. 18 11月, 2021 5 次提交
  22. 07 10月, 2021 1 次提交
    • S
      i40e: Fix freeing of uninitialized misc IRQ vector · 2e5a2057
      Sylwester Dziedziuch 提交于
      When VSI set up failed in i40e_probe() as part of PF switch set up
      driver was trying to free misc IRQ vectors in
      i40e_clear_interrupt_scheme and produced a kernel Oops:
      
         Trying to free already-free IRQ 266
         WARNING: CPU: 0 PID: 5 at kernel/irq/manage.c:1731 __free_irq+0x9a/0x300
         Workqueue: events work_for_cpu_fn
         RIP: 0010:__free_irq+0x9a/0x300
         Call Trace:
         ? synchronize_irq+0x3a/0xa0
         free_irq+0x2e/0x60
         i40e_clear_interrupt_scheme+0x53/0x190 [i40e]
         i40e_probe.part.108+0x134b/0x1a40 [i40e]
         ? kmem_cache_alloc+0x158/0x1c0
         ? acpi_ut_update_ref_count.part.1+0x8e/0x345
         ? acpi_ut_update_object_reference+0x15e/0x1e2
         ? strstr+0x21/0x70
         ? irq_get_irq_data+0xa/0x20
         ? mp_check_pin_attr+0x13/0xc0
         ? irq_get_irq_data+0xa/0x20
         ? mp_map_pin_to_irq+0xd3/0x2f0
         ? acpi_register_gsi_ioapic+0x93/0x170
         ? pci_conf1_read+0xa4/0x100
         ? pci_bus_read_config_word+0x49/0x70
         ? do_pci_enable_device+0xcc/0x100
         local_pci_probe+0x41/0x90
         work_for_cpu_fn+0x16/0x20
         process_one_work+0x1a7/0x360
         worker_thread+0x1cf/0x390
         ? create_worker+0x1a0/0x1a0
         kthread+0x112/0x130
         ? kthread_flush_work_fn+0x10/0x10
         ret_from_fork+0x1f/0x40
      
      The problem is that at that point misc IRQ vectors
      were not allocated yet and we get a call trace
      that driver is trying to free already free IRQ vectors.
      
      Add a check in i40e_clear_interrupt_scheme for __I40E_MISC_IRQ_REQUESTED
      PF state before calling i40e_free_misc_vector. This state is set only if
      misc IRQ vectors were properly initialized.
      
      Fixes: c17401a1 ("i40e: use separate state bit for miscellaneous IRQ setup")
      Reported-by: NPJ Waskiewicz <pwaskiewicz@jumptrading.com>
      Signed-off-by: NSylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
      Signed-off-by: NMateusz Palczewski <mateusz.palczewski@intel.com>
      Tested-by: NDave Switzer <david.switzer@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      2e5a2057