1. 29 6月, 2022 6 次提交
  2. 27 6月, 2022 2 次提交
  3. 25 6月, 2022 1 次提交
  4. 19 6月, 2022 2 次提交
  5. 02 6月, 2022 2 次提交
    • Í
      sfc/siena: fix wrong tx channel offset with efx_separate_tx_channels · 25bde571
      Íñigo Huguet 提交于
      tx_channel_offset is calculated in efx_allocate_msix_channels, but it is
      also calculated again in efx_set_channels because it was originally done
      there, and when efx_allocate_msix_channels was introduced it was
      forgotten to be removed from efx_set_channels.
      
      Moreover, the old calculation is wrong when using
      efx_separate_tx_channels because now we can have XDP channels after the
      TX channels, so n_channels - n_tx_channels doesn't point to the first TX
      channel.
      
      Remove the old calculation from efx_set_channels, and add the
      initialization of this variable if MSI or legacy interrupts are used,
      next to the initialization of the rest of the related variables, where
      it was missing.
      
      This has been already done for sfc, do it also for sfc_siena.
      
      Fixes: 3990a8ff ("sfc: allocate channels for XDP tx queues")
      Reported-by: NTianhao Zhao <tizhao@redhat.com>
      Signed-off-by: NÍñigo Huguet <ihuguet@redhat.com>
      Acked-by: NMartin Habets <habetsm.xilinx@gmail.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      25bde571
    • M
      sfc/siena: fix considering that all channels have TX queues · 183614bf
      Martin Habets 提交于
      Normally, all channels have RX and TX queues, but this is not true if
      modparam efx_separate_tx_channels=1 is used. In that cases, some
      channels only have RX queues and others only TX queues (or more
      preciselly, they have them allocated, but not initialized).
      
      Fix efx_channel_has_tx_queues to return the correct value for this case
      too.
      
      This has been already done for sfc, do it also for sfc_siena.
      
      Messages shown at probe time before the fix:
       sfc 0000:03:00.0 ens6f0np0: MC command 0x82 inlen 544 failed rc=-22 (raw=0) arg=0
       ------------[ cut here ]------------
       netdevice: ens6f0np0: failed to initialise TXQ -1
       WARNING: CPU: 1 PID: 626 at drivers/net/ethernet/sfc/ef10.c:2393 efx_ef10_tx_init+0x201/0x300 [sfc]
       [...] stripped
       RIP: 0010:efx_ef10_tx_init+0x201/0x300 [sfc]
       [...] stripped
       Call Trace:
        efx_init_tx_queue+0xaa/0xf0 [sfc]
        efx_start_channels+0x49/0x120 [sfc]
        efx_start_all+0x1f8/0x430 [sfc]
        efx_net_open+0x5a/0xe0 [sfc]
        __dev_open+0xd0/0x190
        __dev_change_flags+0x1b3/0x220
        dev_change_flags+0x21/0x60
       [...] stripped
      
      Messages shown at remove time before the fix:
       sfc 0000:03:00.0 ens6f0np0: failed to flush 10 queues
       sfc 0000:03:00.0 ens6f0np0: failed to flush queues
      
      Fixes: 8700aff0 ("sfc: fix channel allocation with brute force")
      Reported-by: NTianhao Zhao <tizhao@redhat.com>
      Signed-off-by: NMartin Habets <habetsm.xilinx@gmail.com>
      Tested-by: NÍñigo Huguet <ihuguet@redhat.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      183614bf
  6. 29 5月, 2022 2 次提交
    • Í
      sfc: fix wrong tx channel offset with efx_separate_tx_channels · c308dfd1
      Íñigo Huguet 提交于
      tx_channel_offset is calculated in efx_allocate_msix_channels, but it is
      also calculated again in efx_set_channels because it was originally done
      there, and when efx_allocate_msix_channels was introduced it was
      forgotten to be removed from efx_set_channels.
      
      Moreover, the old calculation is wrong when using
      efx_separate_tx_channels because now we can have XDP channels after the
      TX channels, so n_channels - n_tx_channels doesn't point to the first TX
      channel.
      
      Remove the old calculation from efx_set_channels, and add the
      initialization of this variable if MSI or legacy interrupts are used,
      next to the initialization of the rest of the related variables, where
      it was missing.
      
      Fixes: 3990a8ff ("sfc: allocate channels for XDP tx queues")
      Reported-by: NTianhao Zhao <tizhao@redhat.com>
      Signed-off-by: NÍñigo Huguet <ihuguet@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c308dfd1
    • M
      sfc: fix considering that all channels have TX queues · 2e102b53
      Martin Habets 提交于
      Normally, all channels have RX and TX queues, but this is not true if
      modparam efx_separate_tx_channels=1 is used. In that cases, some
      channels only have RX queues and others only TX queues (or more
      preciselly, they have them allocated, but not initialized).
      
      Fix efx_channel_has_tx_queues to return the correct value for this case
      too.
      
      Messages shown at probe time before the fix:
       sfc 0000:03:00.0 ens6f0np0: MC command 0x82 inlen 544 failed rc=-22 (raw=0) arg=0
       ------------[ cut here ]------------
       netdevice: ens6f0np0: failed to initialise TXQ -1
       WARNING: CPU: 1 PID: 626 at drivers/net/ethernet/sfc/ef10.c:2393 efx_ef10_tx_init+0x201/0x300 [sfc]
       [...] stripped
       RIP: 0010:efx_ef10_tx_init+0x201/0x300 [sfc]
       [...] stripped
       Call Trace:
        efx_init_tx_queue+0xaa/0xf0 [sfc]
        efx_start_channels+0x49/0x120 [sfc]
        efx_start_all+0x1f8/0x430 [sfc]
        efx_net_open+0x5a/0xe0 [sfc]
        __dev_open+0xd0/0x190
        __dev_change_flags+0x1b3/0x220
        dev_change_flags+0x21/0x60
       [...] stripped
      
      Messages shown at remove time before the fix:
       sfc 0000:03:00.0 ens6f0np0: failed to flush 10 queues
       sfc 0000:03:00.0 ens6f0np0: failed to flush queues
      
      Fixes: 8700aff0 ("sfc: fix channel allocation with brute force")
      Reported-by: NTianhao Zhao <tizhao@redhat.com>
      Signed-off-by: NMartin Habets <habetsm.xilinx@gmail.com>
      Tested-by: NÍñigo Huguet <ihuguet@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e102b53
  7. 21 5月, 2022 1 次提交
  8. 19 5月, 2022 1 次提交
  9. 16 5月, 2022 1 次提交
    • A
      net: allow gso_max_size to exceed 65536 · 7c4e983c
      Alexander Duyck 提交于
      The code for gso_max_size was added originally to allow for debugging and
      workaround of buggy devices that couldn't support TSO with blocks 64K in
      size. The original reason for limiting it to 64K was because that was the
      existing limits of IPv4 and non-jumbogram IPv6 length fields.
      
      With the addition of Big TCP we can remove this limit and allow the value
      to potentially go up to UINT_MAX and instead be limited by the tso_max_size
      value.
      
      So in order to support this we need to go through and clean up the
      remaining users of the gso_max_size value so that the values will cap at
      64K for non-TCPv6 flows. In addition we can clean up the GSO_MAX_SIZE value
      so that 64K becomes GSO_LEGACY_MAX_SIZE and UINT_MAX will now be the upper
      limit for GSO_MAX_SIZE.
      
      v6: (edumazet) fixed a compile error if CONFIG_IPV6=n,
                     in a new sk_trim_gso_size() helper.
                     netif_set_tso_max_size() caps the requested TSO size
                     with GSO_MAX_SIZE.
      Signed-off-by: NAlexander Duyck <alexanderduyck@fb.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c4e983c
  10. 14 5月, 2022 2 次提交
  11. 13 5月, 2022 7 次提交
  12. 11 5月, 2022 11 次提交
  13. 09 5月, 2022 1 次提交
    • T
      net: sfc: fix memory leak due to ptp channel · 49e6123c
      Taehee Yoo 提交于
      It fixes memory leak in ring buffer change logic.
      
      When ring buffer size is changed(ethtool -G eth0 rx 4096), sfc driver
      works like below.
      1. stop all channels and remove ring buffers.
      2. allocates new buffer array.
      3. allocates rx buffers.
      4. start channels.
      
      While the above steps are working, it skips some steps if the channel
      doesn't have a ->copy callback function.
      Due to ptp channel doesn't have ->copy callback, these above steps are
      skipped for ptp channel.
      It eventually makes some problems.
      a. ptp channel's ring buffer size is not changed, it works only
         1024(default).
      b. memory leak.
      
      The reason for memory leak is to use the wrong ring buffer values.
      There are some values, which is related to ring buffer size.
      a. efx->rxq_entries
       - This is global value of rx queue size.
      b. rx_queue->ptr_mask
       - used for access ring buffer as circular ring.
       - roundup_pow_of_two(efx->rxq_entries) - 1
      c. rx_queue->max_fill
       - efx->rxq_entries - EFX_RXD_HEAD_ROOM
      
      These all values should be based on ring buffer size consistently.
      But ptp channel's values are not.
      a. efx->rxq_entries
       - This is global(for sfc) value, always new ring buffer size.
      b. rx_queue->ptr_mask
       - This is always 1023(default).
      c. rx_queue->max_fill
       - This is new ring buffer size - EFX_RXD_HEAD_ROOM.
      
      Let's assume we set 4096 for rx ring buffer,
      
                            normal channel     ptp channel
      efx->rxq_entries      4096               4096
      rx_queue->ptr_mask    4095               1023
      rx_queue->max_fill    4086               4086
      
      sfc driver allocates rx ring buffers based on these values.
      When it allocates ptp channel's ring buffer, 4086 ring buffers are
      allocated then, these buffers are attached to the allocated array.
      But ptp channel's ring buffer array size is still 1024(default)
      and ptr_mask is still 1023 too.
      So, 3062 ring buffers will be overwritten to the array.
      This is the reason for memory leak.
      
      Test commands:
         ethtool -G <interface name> rx 4096
         while :
         do
             ip link set <interface name> up
             ip link set <interface name> down
         done
      
      In order to avoid this problem, it adds ->copy callback to ptp channel
      type.
      So that rx_queue->ptr_mask value will be updated correctly.
      
      Fixes: 7c236c43 ("sfc: Add support for IEEE-1588 PTP")
      Signed-off-by: NTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      49e6123c
  14. 08 5月, 2022 1 次提交