Skip to content

Commit 27eddbf

Browse files
committed
Merge tag 'net-6.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Smaller than usual with no fixes from any subtree. Current release - regressions: - core: fix race of rtnl_net_lock(dev_net(dev)) Previous releases - regressions: - core: remove the single page frag cache for good - flow_dissector: fix handling of mixed port and port-range keys - sched: cls_api: fix error handling causing NULL dereference - tcp: - adjust rcvq_space after updating scaling ratio - drop secpath at the same time as we currently drop dst - eth: gtp: suppress list corruption splat in gtp_net_exit_batch_rtnl(). Previous releases - always broken: - vsock: - fix variables initialization during resuming - for connectible sockets allow only connected - eth: - geneve: fix use-after-free in geneve_find_dev() - ibmvnic: don't reference skb after sending to VIOS" * tag 'net-6.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (34 commits) Revert "net: skb: introduce and use a single page frag cache" net: allow small head cache usage with large MAX_SKB_FRAGS values nfp: bpf: Add check for nfp_app_ctrl_msg_alloc() tcp: drop secpath at the same time as we currently drop dst net: axienet: Set mac_managed_pm arp: switch to dev_getbyhwaddr() in arp_req_set_public() net: Add non-RCU dev_getbyhwaddr() helper sctp: Fix undefined behavior in left shift operation selftests/bpf: Add a specific dst port matching flow_dissector: Fix port range key handling in BPF conversion selftests/net/forwarding: Add a test case for tc-flower of mixed port and port-range flow_dissector: Fix handling of mixed port and port-range keys geneve: Suppress list corruption splat in geneve_destroy_tunnels(). gtp: Suppress list corruption splat in gtp_net_exit_batch_rtnl(). dev: Use rtnl_net_dev_lock() in unregister_netdev(). net: Fix dev_net(dev) race in unregister_netdevice_notifier_dev_net(). net: Add net_passive_inc() and net_passive_dec(). net: pse-pd: pd692x0: Fix power limit retrieval MAINTAINERS: trim the GVE entry gve: set xdp redirect target only when it is available ...
2 parents e9a8cac + dd3188d commit 27eddbf

34 files changed

+365
-217
lines changed

MAINTAINERS

+7-2
Original file line numberDiff line numberDiff line change
@@ -9829,8 +9829,7 @@ F: drivers/input/touchscreen/goodix*
98299829

98309830
GOOGLE ETHERNET DRIVERS
98319831
M: Jeroen de Borst <[email protected]>
9832-
M: Praveen Kaligineedi <[email protected]>
9833-
R: Shailend Chand <[email protected]>
9832+
M: Harshitha Ramamurthy <[email protected]>
98349833
98359834
S: Maintained
98369835
F: Documentation/networking/device_drivers/ethernet/google/gve.rst
@@ -16472,6 +16471,12 @@ F: net/ethtool/cabletest.c
1647216471
F: tools/testing/selftests/drivers/net/*/ethtool*
1647316472
K: cable_test
1647416473

16474+
NETWORKING [ETHTOOL MAC MERGE]
16475+
M: Vladimir Oltean <[email protected]>
16476+
F: net/ethtool/mm.c
16477+
F: tools/testing/selftests/drivers/net/hw/ethtool_mm.sh
16478+
K: ethtool_mm
16479+
1647516480
NETWORKING [GENERAL]
1647616481
M: "David S. Miller" <[email protected]>
1647716482
M: Eric Dumazet <[email protected]>

drivers/net/ethernet/google/gve/gve.h

+10
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,16 @@ static inline u32 gve_xdp_tx_start_queue_id(struct gve_priv *priv)
11161116
return gve_xdp_tx_queue_id(priv, 0);
11171117
}
11181118

1119+
static inline bool gve_supports_xdp_xmit(struct gve_priv *priv)
1120+
{
1121+
switch (priv->queue_format) {
1122+
case GVE_GQI_QPL_FORMAT:
1123+
return true;
1124+
default:
1125+
return false;
1126+
}
1127+
}
1128+
11191129
/* gqi napi handler defined in gve_main.c */
11201130
int gve_napi_poll(struct napi_struct *napi, int budget);
11211131

drivers/net/ethernet/google/gve/gve_main.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -1903,6 +1903,8 @@ static void gve_turndown(struct gve_priv *priv)
19031903
/* Stop tx queues */
19041904
netif_tx_disable(priv->dev);
19051905

1906+
xdp_features_clear_redirect_target(priv->dev);
1907+
19061908
gve_clear_napi_enabled(priv);
19071909
gve_clear_report_stats(priv);
19081910

@@ -1972,6 +1974,9 @@ static void gve_turnup(struct gve_priv *priv)
19721974
napi_schedule(&block->napi);
19731975
}
19741976

1977+
if (priv->num_xdp_queues && gve_supports_xdp_xmit(priv))
1978+
xdp_features_set_redirect_target(priv->dev, false);
1979+
19751980
gve_set_napi_enabled(priv);
19761981
}
19771982

@@ -2246,7 +2251,6 @@ static void gve_set_netdev_xdp_features(struct gve_priv *priv)
22462251
if (priv->queue_format == GVE_GQI_QPL_FORMAT) {
22472252
xdp_features = NETDEV_XDP_ACT_BASIC;
22482253
xdp_features |= NETDEV_XDP_ACT_REDIRECT;
2249-
xdp_features |= NETDEV_XDP_ACT_NDO_XMIT;
22502254
xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY;
22512255
} else {
22522256
xdp_features = 0;

drivers/net/ethernet/ibm/ibmvnic.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -2408,6 +2408,7 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
24082408
dma_addr_t data_dma_addr;
24092409
struct netdev_queue *txq;
24102410
unsigned long lpar_rc;
2411+
unsigned int skblen;
24112412
union sub_crq tx_crq;
24122413
unsigned int offset;
24132414
bool use_scrq_send_direct = false;
@@ -2522,6 +2523,7 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
25222523
tx_buff->skb = skb;
25232524
tx_buff->index = bufidx;
25242525
tx_buff->pool_index = queue_num;
2526+
skblen = skb->len;
25252527

25262528
memset(&tx_crq, 0, sizeof(tx_crq));
25272529
tx_crq.v1.first = IBMVNIC_CRQ_CMD;
@@ -2614,7 +2616,7 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
26142616
netif_stop_subqueue(netdev, queue_num);
26152617
}
26162618

2617-
tx_bytes += skb->len;
2619+
tx_bytes += skblen;
26182620
txq_trans_cond_update(txq);
26192621
ret = NETDEV_TX_OK;
26202622
goto out;

drivers/net/ethernet/netronome/nfp/bpf/cmsg.c

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ nfp_bpf_cmsg_alloc(struct nfp_app_bpf *bpf, unsigned int size)
2020
struct sk_buff *skb;
2121

2222
skb = nfp_app_ctrl_msg_alloc(bpf->app, size, GFP_KERNEL);
23+
if (!skb)
24+
return NULL;
2325
skb_put(skb, size);
2426

2527
return skb;

drivers/net/ethernet/xilinx/xilinx_axienet_main.c

+1
Original file line numberDiff line numberDiff line change
@@ -2897,6 +2897,7 @@ static int axienet_probe(struct platform_device *pdev)
28972897

28982898
lp->phylink_config.dev = &ndev->dev;
28992899
lp->phylink_config.type = PHYLINK_NETDEV;
2900+
lp->phylink_config.mac_managed_pm = true;
29002901
lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
29012902
MAC_10FD | MAC_100FD | MAC_1000FD;
29022903

drivers/net/geneve.c

+2-14
Original file line numberDiff line numberDiff line change
@@ -1902,21 +1902,9 @@ static void geneve_destroy_tunnels(struct net *net, struct list_head *head)
19021902
{
19031903
struct geneve_net *gn = net_generic(net, geneve_net_id);
19041904
struct geneve_dev *geneve, *next;
1905-
struct net_device *dev, *aux;
19061905

1907-
/* gather any geneve devices that were moved into this ns */
1908-
for_each_netdev_safe(net, dev, aux)
1909-
if (dev->rtnl_link_ops == &geneve_link_ops)
1910-
unregister_netdevice_queue(dev, head);
1911-
1912-
/* now gather any other geneve devices that were created in this ns */
1913-
list_for_each_entry_safe(geneve, next, &gn->geneve_list, next) {
1914-
/* If geneve->dev is in the same netns, it was already added
1915-
* to the list by the previous loop.
1916-
*/
1917-
if (!net_eq(dev_net(geneve->dev), net))
1918-
unregister_netdevice_queue(geneve->dev, head);
1919-
}
1906+
list_for_each_entry_safe(geneve, next, &gn->geneve_list, next)
1907+
geneve_dellink(geneve->dev, head);
19201908
}
19211909

19221910
static void __net_exit geneve_exit_batch_rtnl(struct list_head *net_list,

drivers/net/gtp.c

-5
Original file line numberDiff line numberDiff line change
@@ -2481,11 +2481,6 @@ static void __net_exit gtp_net_exit_batch_rtnl(struct list_head *net_list,
24812481
list_for_each_entry(net, net_list, exit_list) {
24822482
struct gtp_net *gn = net_generic(net, gtp_net_id);
24832483
struct gtp_dev *gtp, *gtp_next;
2484-
struct net_device *dev;
2485-
2486-
for_each_netdev(net, dev)
2487-
if (dev->rtnl_link_ops == &gtp_link_ops)
2488-
gtp_dellink(dev, dev_to_kill);
24892484

24902485
list_for_each_entry_safe(gtp, gtp_next, &gn->gtp_dev_list, list)
24912486
gtp_dellink(gtp->dev, dev_to_kill);

drivers/net/pse-pd/pd692x0.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ static int pd692x0_pi_get_pw_limit(struct pse_controller_dev *pcdev,
10471047
if (ret < 0)
10481048
return ret;
10491049

1050-
return pd692x0_pi_get_pw_from_table(buf.data[2], buf.data[3]);
1050+
return pd692x0_pi_get_pw_from_table(buf.data[0], buf.data[1]);
10511051
}
10521052

10531053
static int pd692x0_pi_set_pw_limit(struct pse_controller_dev *pcdev,

drivers/net/wwan/mhi_wwan_mbim.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static int mbim_rx_verify_nth16(struct mhi_mbim_context *mbim, struct sk_buff *s
220220
if (mbim->rx_seq + 1 != le16_to_cpu(nth16->wSequence) &&
221221
(mbim->rx_seq || le16_to_cpu(nth16->wSequence)) &&
222222
!(mbim->rx_seq == 0xffff && !le16_to_cpu(nth16->wSequence))) {
223-
net_err_ratelimited("sequence number glitch prev=%d curr=%d\n",
223+
net_dbg_ratelimited("sequence number glitch prev=%d curr=%d\n",
224224
mbim->rx_seq, le16_to_cpu(nth16->wSequence));
225225
}
226226
mbim->rx_seq = le16_to_cpu(nth16->wSequence);

drivers/s390/net/ism_drv.c

+12-2
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,15 @@ static int ism_dev_init(struct ism_dev *ism)
588588
return ret;
589589
}
590590

591+
static void ism_dev_release(struct device *dev)
592+
{
593+
struct ism_dev *ism;
594+
595+
ism = container_of(dev, struct ism_dev, dev);
596+
597+
kfree(ism);
598+
}
599+
591600
static int ism_probe(struct pci_dev *pdev, const struct pci_device_id *id)
592601
{
593602
struct ism_dev *ism;
@@ -601,6 +610,7 @@ static int ism_probe(struct pci_dev *pdev, const struct pci_device_id *id)
601610
dev_set_drvdata(&pdev->dev, ism);
602611
ism->pdev = pdev;
603612
ism->dev.parent = &pdev->dev;
613+
ism->dev.release = ism_dev_release;
604614
device_initialize(&ism->dev);
605615
dev_set_name(&ism->dev, dev_name(&pdev->dev));
606616
ret = device_add(&ism->dev);
@@ -637,7 +647,7 @@ static int ism_probe(struct pci_dev *pdev, const struct pci_device_id *id)
637647
device_del(&ism->dev);
638648
err_dev:
639649
dev_set_drvdata(&pdev->dev, NULL);
640-
kfree(ism);
650+
put_device(&ism->dev);
641651

642652
return ret;
643653
}
@@ -682,7 +692,7 @@ static void ism_remove(struct pci_dev *pdev)
682692
pci_disable_device(pdev);
683693
device_del(&ism->dev);
684694
dev_set_drvdata(&pdev->dev, NULL);
685-
kfree(ism);
695+
put_device(&ism->dev);
686696
}
687697

688698
static struct pci_driver ism_driver = {

include/linux/netdevice.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -3275,6 +3275,8 @@ static inline struct net_device *first_net_device_rcu(struct net *net)
32753275
}
32763276

32773277
int netdev_boot_setup_check(struct net_device *dev);
3278+
struct net_device *dev_getbyhwaddr(struct net *net, unsigned short type,
3279+
const char *hwaddr);
32783280
struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type,
32793281
const char *hwaddr);
32803282
struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type);
@@ -4115,7 +4117,6 @@ void netif_receive_skb_list(struct list_head *head);
41154117
gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb);
41164118
void napi_gro_flush(struct napi_struct *napi, bool flush_old);
41174119
struct sk_buff *napi_get_frags(struct napi_struct *napi);
4118-
void napi_get_frags_check(struct napi_struct *napi);
41194120
gro_result_t napi_gro_frags(struct napi_struct *napi);
41204121

41214122
static inline void napi_free_frags(struct napi_struct *napi)

include/net/gro.h

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#include <net/udp.h>
1212
#include <net/hotdata.h>
1313

14+
/* This should be increased if a protocol with a bigger head is added. */
15+
#define GRO_MAX_HEAD (MAX_HEADER + 128)
16+
1417
struct napi_gro_cb {
1518
union {
1619
struct {

include/net/net_namespace.h

+11
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ static inline int check_net(const struct net *net)
297297
}
298298

299299
void net_drop_ns(void *);
300+
void net_passive_dec(struct net *net);
300301

301302
#else
302303

@@ -326,8 +327,18 @@ static inline int check_net(const struct net *net)
326327
}
327328

328329
#define net_drop_ns NULL
330+
331+
static inline void net_passive_dec(struct net *net)
332+
{
333+
refcount_dec(&net->passive);
334+
}
329335
#endif
330336

337+
static inline void net_passive_inc(struct net *net)
338+
{
339+
refcount_inc(&net->passive);
340+
}
341+
331342
/* Returns true if the netns initialization is completed successfully */
332343
static inline bool net_initialized(const struct net *net)
333344
{

include/net/tcp.h

+14
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <net/inet_ecn.h>
4242
#include <net/dst.h>
4343
#include <net/mptcp.h>
44+
#include <net/xfrm.h>
4445

4546
#include <linux/seq_file.h>
4647
#include <linux/memcontrol.h>
@@ -683,6 +684,19 @@ void tcp_fin(struct sock *sk);
683684
void tcp_check_space(struct sock *sk);
684685
void tcp_sack_compress_send_ack(struct sock *sk);
685686

687+
static inline void tcp_cleanup_skb(struct sk_buff *skb)
688+
{
689+
skb_dst_drop(skb);
690+
secpath_reset(skb);
691+
}
692+
693+
static inline void tcp_add_receive_queue(struct sock *sk, struct sk_buff *skb)
694+
{
695+
DEBUG_NET_WARN_ON_ONCE(skb_dst(skb));
696+
DEBUG_NET_WARN_ON_ONCE(secpath_exists(skb));
697+
__skb_queue_tail(&sk->sk_receive_queue, skb);
698+
}
699+
686700
/* tcp_timer.c */
687701
void tcp_init_xmit_timers(struct sock *);
688702
static inline void tcp_clear_xmit_timers(struct sock *sk)

0 commit comments

Comments
 (0)