1. 20 Jan, 2023 1 commit
  2. 19 Jan, 2023 25 commits
  3. 18 Jan, 2023 14 commits
    • Magnus Karlsson's avatar
      xdp: document xdp_do_flush() before napi_complete_done() · 68e5b6aa
      Magnus Karlsson authored
      Document in the XDP_REDIRECT manual section that drivers must call
      xdp_do_flush() before napi_complete_done(). The two reasons behind
      this can be found following the links below.
      Signed-off-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
      Link: https://lore.kernel.org/r/20221220185903.1105011-1-sbohrer@cloudflare.com
      Link: https://lore.kernel.org/all/20210624160609.292325-1-toke@redhat.com/Acked-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      68e5b6aa
    • David S. Miller's avatar
      Merge branch 'sparx5-vcap-improve-locking' · bed91ac0
      David S. Miller authored
      Steen Hegelund says:
      
      ====================
      sparx5: Improve locking in the VCAP API
      
      This improves the VCAP cache and the VCAP rule list protection against
      access from different sources.
      
      The VCAP Admin lock protects the list of rules for the VCAP instance as
      well as the cache used for encoding and decoding rules.
      
      This series provides dedicated functions for accessing rule statistics,
      decoding rule content, verifying if a rule exists and getting a rule with
      the lock held, as well as ensuring the use of the lock when the list of
      rules or the cache is accessed.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bed91ac0
    • Steen Hegelund's avatar
      net: microchip: sparx5: Add lock initialization to the KUNIT tests · 595655e0
      Steen Hegelund authored
      Ensure that the KUNIT tests lock instance is initialized before the test is
      executed.
      Signed-off-by: default avatarSteen Hegelund <steen.hegelund@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      595655e0
    • Steen Hegelund's avatar
      net: microchip: sparx5: Improve VCAP admin locking in the VCAP API · 1972b6d9
      Steen Hegelund authored
      This improves the VCAP cache and the VCAP rule list protection against
      access from different sources.
      Signed-off-by: default avatarSteen Hegelund <steen.hegelund@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1972b6d9
    • Steen Hegelund's avatar
      net: microchip: sparx5: Add VCAP admin locking in debugFS · 9579e2c2
      Steen Hegelund authored
      This ensures that the admin lock is taken before the debugFS functions
      starts iterating the VCAP rules.
      It also adds a separate function to decode a rule, which expects the lock
      to have been taken before it is called.
      Signed-off-by: default avatarSteen Hegelund <steen.hegelund@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9579e2c2
    • Steen Hegelund's avatar
      net: microchip: sparx5: Add support to check for existing VCAP rule id · 975d86ac
      Steen Hegelund authored
      Add a new function that just checks if the VCAP rule id is already used by
      an existing rule.
      Signed-off-by: default avatarSteen Hegelund <steen.hegelund@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      975d86ac
    • Steen Hegelund's avatar
      net: microchip: sparx5: Add support for rule count by cookie · 27d293cc
      Steen Hegelund authored
      This adds support for TC clients to get the packet count for a TC filter
      identified by its cookie.
      Signed-off-by: default avatarSteen Hegelund <steen.hegelund@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      27d293cc
    • Hayes Wang's avatar
      r8152: avoid to change cfg for all devices · 0d4cda80
      Hayes Wang authored
      The rtl8152_cfgselector_probe() should set the USB configuration to the
      vendor mode only for the devices which the driver (r8152) supports.
      Otherwise, no driver would be used for such devices.
      
      Fixes: ec51fbd1 ("r8152: add USB device driver for config selection")
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0d4cda80
    • Robert Hancock's avatar
      net: macb: simplify TX timestamp handling · 8e7610e6
      Robert Hancock authored
      This driver was capturing the TX timestamp values from the TX ring
      during the TX completion path, but deferring the actual packet TX
      timestamp updating to a workqueue. There does not seem to be much of a
      reason for this with the current state of the driver. Simplify this to
      just do the TX timestamping as part of the TX completion path, to avoid
      the need for the extra timestamp buffer and workqueue.
      Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8e7610e6
    • Parav Pandit's avatar
      virtio_net: Reuse buffer free function · eb1d929f
      Parav Pandit authored
      virtnet_rq_free_unused_buf() helper function to free the buffer
      already exists. Avoid code duplication by reusing existing function.
      Reviewed-by: default avatarAlexander Duyck <alexanderduyck@fb.com>
      Reviewed-by: default avatarXuan Zhuo <xuanzhuo@linux.alibaba.com>
      Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eb1d929f
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next · 4218b0e2
      David S. Miller authored
      Florian Westphal says:
      
      ====================
      Netfilter updates for net-next
      
      following patch set includes netfilter updates for your *net-next* tree.
      
      1. Replace pr_debug use with nf_log infra for debugging in sctp
         conntrack.
      2. Remove pr_debug calls, they are either useless or we have better
         options in place.
      3. Avoid repeated load of ct->status in some spots.
         Some bit-flags cannot change during the lifeetime of
         a connection, so no need to re-fetch those.
      4. Avoid uneeded nesting of rcu_read_lock during tuple lookup.
      5. Remove the CLUSTERIP target.  Marked as obsolete for years,
         and we still have WARN splats wrt. races of the out-of-band
         /proc interface installed by this target.
      6. Add static key to nf_tables to avoid the retpoline mitigation
         if/else if cascade provided the cpu doesn't need the retpoline thunk.
      7. add nf_tables objref calls to the retpoline mitigation workaround.
      8. Split parts of nft_ct.c that do not need symbols exported by
         the conntrack modules and place them in nf_tables directly.
         This allows to avoid indirect call for 'ct status' checks.
      9. Add 'destroy' commands to nf_tables.  They are identical
         to the existing 'delete' commands, but do not indicate
         an error if the referenced object (set, chain, rule...)
         did not exist, from Fernando.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4218b0e2
    • David S. Miller's avatar
      Merge branch 'tsnep-xdp-support' · 387f5f7d
      David S. Miller authored
      Gerhard Engleder says:
      
      ====================
      tsnep: XDP support
      
      Implement XDP support for tsnep driver. I tried to follow existing
      drivers like igb/igc as far as possible. Some prework was already done
      in previous patch series, so in this series only actual XDP stuff is
      included.
      
      Thanks for the NetDev 0x14 slides "Add XDP support on a NIC driver".
      
      Some commits contain changes not related to XDP but found during review
      of XDP support patches.
      
      v5:
      - fix spelling of 'subtract' in commit message (Alexander Duyck)
      - call txq_trans_cond_update() only if TX is complete (Alexander Duyck)
      - remove const from static functions (Alexander Duyck)
      - replace TX spin_lock with __netif_tx_lock (Alexander Duyck)
      - use xdp_return_frame_rx_napi() instead of xdp_return_frame_bulk() (Alexander Duyck)
      - eliminate __TSNEP_DOWN (Alexander Duyck)
      - introduce single function for xdp_rxq and napi init (Alexander Duyck)
      - use TX queue of pair instead of expensive processor id modulo for XDP_TX (Alexander Duyck)
      - eliminate processor id modulo in tsnep_netdev_xdp_xmit (Alexander Duyck)
      - use bitmap for TX type and add fragment type (Alexander Duyck)
      - always use XDP_PACKET_HEADROOM and DMA_BIDIRECTIONAL
      
      v4:
      - remove process context from spin_lock_bh commit message (Alexander Lobakin)
      - move tsnep_adapter::state to prevent 4 byte hole (Alexander Lobakin)
      - braces for bitops in combination logical ops (Alexander Lobakin)
      - make various pointers const (Alexander Lobakin)
      - '!i' instead of 'i == 0' (Alexander Lobakin)
      - removed redundant braces (Alexander Lobakin)
      - squash variables into same line if same type (Alexander Lobakin)
      - use fact that ::skb and ::xdpf use same slot for simplification (Alexander Lobakin)
      - use u32 for smp_processor_id() (Alexander Lobakin)
      - don't add $(tsnep-y) to $(tsnep-objs) (Alexander Lobakin)
      - use rev xmas tree in tsnep_netdev_open() (Alexander Lobakin)
      - do not move tsnep_queue::napi (Alexander Lobakin)
      - call xdp_init_buff() only once (Alexander Lobakin)
      - get nq and tx only once for XDP TX (Alexander Lobakin)
      - move XDP BPF program setup to end of patch series (Alexander Lobakin)
      - check for XDP state change and prevent redundant down-ups (Alexander Lobakin)
      - access tsnep_adapter::xdp_prog only with READ_ONCE in RX path (Alexander Lobakin)
      - forward NAPI budget to napi_consume_skb() (Alexander Lobakin)
      - fix errno leftover in tsnep_xdp_xmit_back() (Dan Carpenter)
      - eliminate tsnep_xdp_is_enabled() by setting RX offset during init
      
      v3:
      - use spin_lock_bh for TX (Paolo Abeni)
      - add comment for XDP TX descriptor available check (Maciej Fijalkowski)
      - return value bool for tsnep_xdp_xmit_frame_ring() (Saeed Mahameed)
      - do not print DMA mapping error (Saeed Mahameed)
      - use reverse xmas tree variable declaration (Saeed Mahameed)
      - move struct xdp_rxq_info to end of struct tsnep_rx (Maciej Fijalkowski)
      - check __TSNEP_DOWN flag on close to prevent double free (Saeed Mahameed)
      - describe TSNEP_RX_INLINE_METADATA_SIZE in comment (Maciej Fijalkowski)
      - substract TSNEP_RX_INLINE_METADATA_SIZE after DMA sync (Maciej Fijalkowski)
      - use enum tsnep_tx_type for tsnep_xdp_tx_map (Saeed Mahameed)
      - use nxmit as loop iterator in tsnep_netdev_xdp_xmit (Saeed Mahameed)
      - stop netdev in tsnep_netdev_close() which is called during BPF prog setup
      
      v2:
      - move tsnep_xdp_xmit_back() to commit where it is used (Paolo Abeni)
      - remove inline from tsnep_rx_offset() (Paolo Abeni)
      - remove inline from tsnep_rx_offset_xdp() (Paolo Abeni)
      - simplify tsnep_xdp_run_prog() call by moving xdp_status update to it (Paolo Abeni)
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      387f5f7d
    • Gerhard Engleder's avatar
      tsnep: Support XDP BPF program setup · f0f6460f
      Gerhard Engleder authored
      Implement setup of BPF programs for XDP RX path with command
      XDP_SETUP_PROG of ndo_bpf(). This is the final step for XDP RX path
      support.
      
      There is no need to reinit the RX queues as they are always prepared for
      XDP.
      
      Additionally remove $(tsnep-y) from $(tsnep-objs) because it is added
      automatically.
      
      Test results with A53 1.2GHz:
      
      XDP_DROP (samples/bpf/xdp1)
      proto 17:     883878 pkt/s
      
      XDP_TX (samples/bpf/xdp2)
      proto 17:     255693 pkt/s
      
      XDP_REDIRECT (samples/bpf/xdpsock)
       sock0@eth2:0 rxdrop xdp-drv
                         pps            pkts           1.00
      rx                 855,582        5,404,523
      tx                 0              0
      
      XDP_REDIRECT (samples/bpf/xdp_redirect)
      eth2->eth1         613,267 rx/s   0 err,drop/s   613,272 xmit/s
      Signed-off-by: default avatarGerhard Engleder <gerhard@engleder-embedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f0f6460f
    • Gerhard Engleder's avatar
      tsnep: Add XDP RX support · 65b28c81
      Gerhard Engleder authored
      If BPF program is set up, then run BPF program for every received frame
      and execute the selected action.
      Signed-off-by: default avatarGerhard Engleder <gerhard@engleder-embedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      65b28c81