Skip to content

Commit d30d0e4

Browse files
committed
Merge tag 'net-6.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from BPF and big collection of fixes for WiFi core and drivers. Current release - regressions: - vxlan: fix regression when dropping packets due to invalid src addresses - bpf: fix a potential use-after-free in bpf_link_free() - xdp: revert support for redirect to any xsk socket bound to the same UMEM as it can result in a corruption - virtio_net: - add missing lock protection when reading return code from control_buf - fix false-positive lockdep splat in DIM - Revert "wifi: wilc1000: convert list management to RCU" - wifi: ath11k: fix error path in ath11k_pcic_ext_irq_config Previous releases - regressions: - rtnetlink: make the "split" NLM_DONE handling generic, restore the old behavior for two cases where we started coalescing those messages with normal messages, breaking sloppily-coded userspace - wifi: - cfg80211: validate HE operation element parsing - cfg80211: fix 6 GHz scan request building - mt76: mt7615: add missing chanctx ops - ath11k: move power type check to ASSOC stage, fix connecting to 6 GHz AP - ath11k: fix WCN6750 firmware crash caused by 17 num_vdevs - rtlwifi: ignore IEEE80211_CONF_CHANGE_RETRY_LIMITS - iwlwifi: mvm: fix a crash on 7265 Previous releases - always broken: - ncsi: prevent multi-threaded channel probing, a spec violation - vmxnet3: disable rx data ring on dma allocation failure - ethtool: init tsinfo stats if requested, prevent unintentionally reporting all-zero stats on devices which don't implement any - dst_cache: fix possible races in less common IPv6 features - tcp: auth: don't consider TCP_CLOSE to be in TCP_AO_ESTABLISHED - ax25: fix two refcounting bugs - eth: ionic: fix kernel panic in XDP_TX action Misc: - tcp: count CLOSE-WAIT sockets for TCP_MIB_CURRESTAB" * tag 'net-6.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (107 commits) selftests: net: lib: set 'i' as local selftests: net: lib: avoid error removing empty netns name selftests: net: lib: support errexit with busywait net: ethtool: fix the error condition in ethtool_get_phy_stats_ethtool() ipv6: fix possible race in __fib6_drop_pcpu_from() af_unix: Annotate data-race of sk->sk_shutdown in sk_diag_fill(). af_unix: Use skb_queue_len_lockless() in sk_diag_show_rqlen(). af_unix: Use skb_queue_empty_lockless() in unix_release_sock(). af_unix: Use unix_recvq_full_lockless() in unix_stream_connect(). af_unix: Annotate data-race of net->unx.sysctl_max_dgram_qlen. af_unix: Annotate data-races around sk->sk_sndbuf. af_unix: Annotate data-races around sk->sk_state in UNIX_DIAG. af_unix: Annotate data-race of sk->sk_state in unix_stream_read_skb(). af_unix: Annotate data-races around sk->sk_state in sendmsg() and recvmsg(). af_unix: Annotate data-race of sk->sk_state in unix_accept(). af_unix: Annotate data-race of sk->sk_state in unix_stream_connect(). af_unix: Annotate data-races around sk->sk_state in unix_write_space() and poll(). af_unix: Annotate data-race of sk->sk_state in unix_inq_len(). af_unix: Annodate data-races around sk->sk_state for writers. af_unix: Set sk->sk_state under unix_state_lock() for truly disconencted peer. ...
2 parents 2faf633 + 27bc865 commit d30d0e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+1077
-567
lines changed

Documentation/networking/af_xdp.rst

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -329,24 +329,23 @@ XDP_SHARED_UMEM option and provide the initial socket's fd in the
329329
sxdp_shared_umem_fd field as you registered the UMEM on that
330330
socket. These two sockets will now share one and the same UMEM.
331331

332-
In this case, it is possible to use the NIC's packet steering
333-
capabilities to steer the packets to the right queue. This is not
334-
possible in the previous example as there is only one queue shared
335-
among sockets, so the NIC cannot do this steering as it can only steer
336-
between queues.
337-
338-
In libxdp (or libbpf prior to version 1.0), you need to use the
339-
xsk_socket__create_shared() API as it takes a reference to a FILL ring
340-
and a COMPLETION ring that will be created for you and bound to the
341-
shared UMEM. You can use this function for all the sockets you create,
342-
or you can use it for the second and following ones and use
343-
xsk_socket__create() for the first one. Both methods yield the same
344-
result.
332+
There is no need to supply an XDP program like the one in the previous
333+
case where sockets were bound to the same queue id and
334+
device. Instead, use the NIC's packet steering capabilities to steer
335+
the packets to the right queue. In the previous example, there is only
336+
one queue shared among sockets, so the NIC cannot do this steering. It
337+
can only steer between queues.
338+
339+
In libbpf, you need to use the xsk_socket__create_shared() API as it
340+
takes a reference to a FILL ring and a COMPLETION ring that will be
341+
created for you and bound to the shared UMEM. You can use this
342+
function for all the sockets you create, or you can use it for the
343+
second and following ones and use xsk_socket__create() for the first
344+
one. Both methods yield the same result.
345345

346346
Note that a UMEM can be shared between sockets on the same queue id
347347
and device, as well as between queues on the same device and between
348-
devices at the same time. It is also possible to redirect to any
349-
socket as long as it is bound to the same umem with XDP_SHARED_UMEM.
348+
devices at the same time.
350349

351350
XDP_USE_NEED_WAKEUP bind flag
352351
-----------------------------
@@ -823,10 +822,6 @@ A: The short answer is no, that is not supported at the moment. The
823822
switch, or other distribution mechanism, in your NIC to direct
824823
traffic to the correct queue id and socket.
825824

826-
Note that if you are using the XDP_SHARED_UMEM option, it is
827-
possible to switch traffic between any socket bound to the same
828-
umem.
829-
830825
Q: My packets are sometimes corrupted. What is wrong?
831826

832827
A: Care has to be taken not to feed the same buffer in the UMEM into

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15237,7 +15237,6 @@ F: drivers/staging/most/
1523715237
F: include/linux/most.h
1523815238

1523915239
MOTORCOMM PHY DRIVER
15240-
M: Peter Geis <[email protected]>
1524115240
1524215241
1524315242
S: Maintained

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ struct ice_vsi {
409409
struct ice_tc_cfg tc_cfg;
410410
struct bpf_prog *xdp_prog;
411411
struct ice_tx_ring **xdp_rings; /* XDP ring array */
412-
unsigned long *af_xdp_zc_qps; /* tracks AF_XDP ZC enabled qps */
413412
u16 num_xdp_txq; /* Used XDP queues */
414413
u8 xdp_mapping_mode; /* ICE_MAP_MODE_[CONTIG|SCATTER] */
415414

@@ -746,6 +745,25 @@ static inline void ice_set_ring_xdp(struct ice_tx_ring *ring)
746745
ring->flags |= ICE_TX_FLAGS_RING_XDP;
747746
}
748747

748+
/**
749+
* ice_get_xp_from_qid - get ZC XSK buffer pool bound to a queue ID
750+
* @vsi: pointer to VSI
751+
* @qid: index of a queue to look at XSK buff pool presence
752+
*
753+
* Return: A pointer to xsk_buff_pool structure if there is a buffer pool
754+
* attached and configured as zero-copy, NULL otherwise.
755+
*/
756+
static inline struct xsk_buff_pool *ice_get_xp_from_qid(struct ice_vsi *vsi,
757+
u16 qid)
758+
{
759+
struct xsk_buff_pool *pool = xsk_get_pool_from_qid(vsi->netdev, qid);
760+
761+
if (!ice_is_xdp_ena_vsi(vsi))
762+
return NULL;
763+
764+
return (pool && pool->dev) ? pool : NULL;
765+
}
766+
749767
/**
750768
* ice_xsk_pool - get XSK buffer pool bound to a ring
751769
* @ring: Rx ring to use
@@ -758,10 +776,7 @@ static inline struct xsk_buff_pool *ice_xsk_pool(struct ice_rx_ring *ring)
758776
struct ice_vsi *vsi = ring->vsi;
759777
u16 qid = ring->q_index;
760778

761-
if (!ice_is_xdp_ena_vsi(vsi) || !test_bit(qid, vsi->af_xdp_zc_qps))
762-
return NULL;
763-
764-
return xsk_get_pool_from_qid(vsi->netdev, qid);
779+
return ice_get_xp_from_qid(vsi, qid);
765780
}
766781

767782
/**
@@ -786,12 +801,7 @@ static inline void ice_tx_xsk_pool(struct ice_vsi *vsi, u16 qid)
786801
if (!ring)
787802
return;
788803

789-
if (!ice_is_xdp_ena_vsi(vsi) || !test_bit(qid, vsi->af_xdp_zc_qps)) {
790-
ring->xsk_pool = NULL;
791-
return;
792-
}
793-
794-
ring->xsk_pool = xsk_get_pool_from_qid(vsi->netdev, qid);
804+
ring->xsk_pool = ice_get_xp_from_qid(vsi, qid);
795805
}
796806

797807
/**
@@ -920,9 +930,17 @@ int ice_down(struct ice_vsi *vsi);
920930
int ice_down_up(struct ice_vsi *vsi);
921931
int ice_vsi_cfg_lan(struct ice_vsi *vsi);
922932
struct ice_vsi *ice_lb_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi);
933+
934+
enum ice_xdp_cfg {
935+
ICE_XDP_CFG_FULL, /* Fully apply new config in .ndo_bpf() */
936+
ICE_XDP_CFG_PART, /* Save/use part of config in VSI rebuild */
937+
};
938+
923939
int ice_vsi_determine_xdp_res(struct ice_vsi *vsi);
924-
int ice_prepare_xdp_rings(struct ice_vsi *vsi, struct bpf_prog *prog);
925-
int ice_destroy_xdp_rings(struct ice_vsi *vsi);
940+
int ice_prepare_xdp_rings(struct ice_vsi *vsi, struct bpf_prog *prog,
941+
enum ice_xdp_cfg cfg_type);
942+
int ice_destroy_xdp_rings(struct ice_vsi *vsi, enum ice_xdp_cfg cfg_type);
943+
void ice_map_xdp_rings(struct ice_vsi *vsi);
926944
int
927945
ice_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
928946
u32 flags);

drivers/net/ethernet/intel/ice/ice_base.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,9 @@ void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi)
842842
}
843843
rx_rings_rem -= rx_rings_per_v;
844844
}
845+
846+
if (ice_is_xdp_ena_vsi(vsi))
847+
ice_map_xdp_rings(vsi);
845848
}
846849

847850
/**

drivers/net/ethernet/intel/ice/ice_lib.c

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,8 @@ static int ice_vsi_alloc_arrays(struct ice_vsi *vsi)
114114
if (!vsi->q_vectors)
115115
goto err_vectors;
116116

117-
vsi->af_xdp_zc_qps = bitmap_zalloc(max_t(int, vsi->alloc_txq, vsi->alloc_rxq), GFP_KERNEL);
118-
if (!vsi->af_xdp_zc_qps)
119-
goto err_zc_qps;
120-
121117
return 0;
122118

123-
err_zc_qps:
124-
devm_kfree(dev, vsi->q_vectors);
125119
err_vectors:
126120
devm_kfree(dev, vsi->rxq_map);
127121
err_rxq_map:
@@ -309,8 +303,6 @@ static void ice_vsi_free_arrays(struct ice_vsi *vsi)
309303

310304
dev = ice_pf_to_dev(pf);
311305

312-
bitmap_free(vsi->af_xdp_zc_qps);
313-
vsi->af_xdp_zc_qps = NULL;
314306
/* free the ring and vector containers */
315307
devm_kfree(dev, vsi->q_vectors);
316308
vsi->q_vectors = NULL;
@@ -2282,22 +2274,23 @@ static int ice_vsi_cfg_def(struct ice_vsi *vsi)
22822274
if (ret)
22832275
goto unroll_vector_base;
22842276

2285-
ice_vsi_map_rings_to_vectors(vsi);
2286-
2287-
/* Associate q_vector rings to napi */
2288-
ice_vsi_set_napi_queues(vsi);
2289-
2290-
vsi->stat_offsets_loaded = false;
2291-
22922277
if (ice_is_xdp_ena_vsi(vsi)) {
22932278
ret = ice_vsi_determine_xdp_res(vsi);
22942279
if (ret)
22952280
goto unroll_vector_base;
2296-
ret = ice_prepare_xdp_rings(vsi, vsi->xdp_prog);
2281+
ret = ice_prepare_xdp_rings(vsi, vsi->xdp_prog,
2282+
ICE_XDP_CFG_PART);
22972283
if (ret)
22982284
goto unroll_vector_base;
22992285
}
23002286

2287+
ice_vsi_map_rings_to_vectors(vsi);
2288+
2289+
/* Associate q_vector rings to napi */
2290+
ice_vsi_set_napi_queues(vsi);
2291+
2292+
vsi->stat_offsets_loaded = false;
2293+
23012294
/* ICE_VSI_CTRL does not need RSS so skip RSS processing */
23022295
if (vsi->type != ICE_VSI_CTRL)
23032296
/* Do not exit if configuring RSS had an issue, at
@@ -2437,7 +2430,7 @@ void ice_vsi_decfg(struct ice_vsi *vsi)
24372430
/* return value check can be skipped here, it always returns
24382431
* 0 if reset is in progress
24392432
*/
2440-
ice_destroy_xdp_rings(vsi);
2433+
ice_destroy_xdp_rings(vsi, ICE_XDP_CFG_PART);
24412434

24422435
ice_vsi_clear_rings(vsi);
24432436
ice_vsi_free_q_vectors(vsi);

0 commit comments

Comments
 (0)