1. 28 3月, 2020 1 次提交
  2. 15 1月, 2020 1 次提交
    • I
      mlxsw: switchx2: Do not modify cloned SKBs during xmit · 63963d0f
      Ido Schimmel 提交于
      The driver needs to prepend a Tx header to each packet it is
      transmitting. The header includes information such as the egress port
      and traffic class.
      
      The addition of the header requires the driver to modify the SKB's
      header and therefore it must not be shared. Otherwise, we risk hitting
      various race conditions.
      
      For example, when a packet is flooded (cloned) by the bridge driver to
      two switch ports swp1 and swp2:
      
      t0 - mlxsw_sp_port_xmit() is called for swp1. Tx header is prepended with
           swp1's port number
      t1 - mlxsw_sp_port_xmit() is called for swp2. Tx header is prepended with
           swp2's port number, overwriting swp1's port number
      t2 - The device processes data buffer from t0. Packet is transmitted via
           swp2
      t3 - The device processes data buffer from t1. Packet is transmitted via
           swp2
      
      Usually, the device is fast enough and transmits the packet before its
      Tx header is overwritten, but this is not the case in emulated
      environments.
      
      Fix this by making sure the SKB's header is writable by calling
      skb_cow_head(). Since the function ensures we have headroom to push the
      Tx header, the check further in the function can be removed.
      
      v2:
      * Use skb_cow_head() instead of skb_unshare() as suggested by Jakub
      * Remove unnecessary check regarding headroom
      
      Fixes: 31557f0f ("mlxsw: Introduce Mellanox SwitchX-2 ASIC support")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reported-by: NShalom Toledo <shalomt@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63963d0f
  3. 05 10月, 2019 2 次提交
  4. 29 8月, 2019 1 次提交
  5. 02 7月, 2019 1 次提交
  6. 05 4月, 2019 2 次提交
  7. 29 3月, 2019 2 次提交
  8. 25 3月, 2019 1 次提交
  9. 07 2月, 2019 1 次提交
  10. 10 8月, 2018 1 次提交
  11. 20 5月, 2018 2 次提交
  12. 01 4月, 2018 1 次提交
  13. 23 3月, 2018 1 次提交
  14. 12 8月, 2017 1 次提交
  15. 25 3月, 2017 1 次提交
  16. 09 2月, 2017 1 次提交
  17. 12 1月, 2017 1 次提交
  18. 09 1月, 2017 1 次提交
  19. 26 11月, 2016 7 次提交
  20. 06 11月, 2016 1 次提交
  21. 31 10月, 2016 10 次提交