Skip to content

Commit 1c715a6

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Various mptcp fixupes from Florian Westphal and Geery Uytterhoeven. 2) Don't clear the node/port GUIDs after we've assigned the correct values to them. From Leon Romanovsky. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: net/core: Do not clear VF index for node/port GUIDs query mptcp: Fix undefined mptcp_handle_ipv6_mapped for modular IPV6 net: drop_monitor: Use kstrdup udp: document udp_rcv_segment special case for looped packets mptcp: MPTCP_HMAC_TEST should depend on MPTCP mptcp: Fix incorrect IPV6 dependency check Revert "MAINTAINERS: mptcp@ mailing list is moderated" mptcp: handle tcp fallback when using syn cookies mptcp: avoid a lockdep splat when mcast group was joined mptcp: fix panic on user pointer access mptcp: defer freeing of cached ext until last moment net: mvneta: fix XDP support if sw bm is used as fallback sch_choke: Use kvcalloc mptcp: Fix build with PROC_FS disabled. MAINTAINERS: mptcp@ mailing list is moderated
2 parents 5e237e8 + 9fbf082 commit 1c715a6

File tree

14 files changed

+81
-52
lines changed

14 files changed

+81
-52
lines changed

drivers/net/ethernet/marvell/mvneta.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,7 @@
324324
ETH_HLEN + ETH_FCS_LEN, \
325325
cache_line_size())
326326

327-
#define MVNETA_SKB_HEADROOM (max(XDP_PACKET_HEADROOM, NET_SKB_PAD) + \
328-
NET_IP_ALIGN)
327+
#define MVNETA_SKB_HEADROOM max(XDP_PACKET_HEADROOM, NET_SKB_PAD)
329328
#define MVNETA_SKB_PAD (SKB_DATA_ALIGN(sizeof(struct skb_shared_info) + \
330329
MVNETA_SKB_HEADROOM))
331330
#define MVNETA_SKB_SIZE(len) (SKB_DATA_ALIGN(len) + MVNETA_SKB_PAD)
@@ -1167,6 +1166,7 @@ static void mvneta_bm_update_mtu(struct mvneta_port *pp, int mtu)
11671166
mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_short, 1 << pp->id);
11681167

11691168
pp->bm_priv = NULL;
1169+
pp->rx_offset_correction = MVNETA_SKB_HEADROOM;
11701170
mvreg_write(pp, MVNETA_ACC_MODE, MVNETA_ACC_MODE_EXT1);
11711171
netdev_info(pp->dev, "fail to update MTU, fall back to software BM\n");
11721172
}
@@ -4948,7 +4948,6 @@ static int mvneta_probe(struct platform_device *pdev)
49484948
SET_NETDEV_DEV(dev, &pdev->dev);
49494949

49504950
pp->id = global_port_id++;
4951-
pp->rx_offset_correction = MVNETA_SKB_HEADROOM;
49524951

49534952
/* Obtain access to BM resources if enabled and already initialized */
49544953
bm_node = of_parse_phandle(dn, "buffer-manager", 0);
@@ -4973,6 +4972,10 @@ static int mvneta_probe(struct platform_device *pdev)
49734972
}
49744973
of_node_put(bm_node);
49754974

4975+
/* sw buffer management */
4976+
if (!pp->bm_priv)
4977+
pp->rx_offset_correction = MVNETA_SKB_HEADROOM;
4978+
49764979
err = mvneta_init(&pdev->dev, pp);
49774980
if (err < 0)
49784981
goto err_netdev;
@@ -5130,6 +5133,7 @@ static int mvneta_resume(struct device *device)
51305133
err = mvneta_bm_port_init(pdev, pp);
51315134
if (err < 0) {
51325135
dev_info(&pdev->dev, "use SW buffer management\n");
5136+
pp->rx_offset_correction = MVNETA_SKB_HEADROOM;
51335137
pp->bm_priv = NULL;
51345138
}
51355139
}

include/linux/tcp.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ struct tcp_request_sock {
148148
const struct tcp_request_sock_ops *af_specific;
149149
u64 snt_synack; /* first SYNACK sent time */
150150
bool tfo_listener;
151-
#if IS_ENABLED(CONFIG_MPTCP)
152151
bool is_mptcp;
153-
#endif
154152
u32 txhash;
155153
u32 rcv_isn;
156154
u32 snt_isn;

include/net/mptcp.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,12 @@ static inline bool mptcp_skb_can_collapse(const struct sk_buff *to,
174174

175175
#endif /* CONFIG_MPTCP */
176176

177-
void mptcp_handle_ipv6_mapped(struct sock *sk, bool mapped);
178-
179177
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
180178
int mptcpv6_init(void);
179+
void mptcpv6_handle_mapped(struct sock *sk, bool mapped);
181180
#elif IS_ENABLED(CONFIG_IPV6)
182-
static inline int mptcpv6_init(void)
183-
{
184-
return 0;
185-
}
181+
static inline int mptcpv6_init(void) { return 0; }
182+
static inline void mptcpv6_handle_mapped(struct sock *sk, bool mapped) { }
186183
#endif
187184

188185
#endif /* __NET_MPTCP_H */

include/net/udp.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,13 @@ static inline struct sk_buff *udp_rcv_segment(struct sock *sk,
476476
if (!inet_get_convert_csum(sk))
477477
features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
478478

479+
/* UDP segmentation expects packets of type CHECKSUM_PARTIAL or
480+
* CHECKSUM_NONE in __udp_gso_segment. UDP GRO indeed builds partial
481+
* packets in udp_gro_complete_segment. As does UDP GSO, verified by
482+
* udp_send_skb. But when those packets are looped in dev_loopback_xmit
483+
* their ip_summed is set to CHECKSUM_UNNECESSARY. Reset in this
484+
* specific case, where PARTIAL is both correct and required.
485+
*/
479486
if (skb->pkt_type == PACKET_LOOPBACK)
480487
skb->ip_summed = CHECKSUM_PARTIAL;
481488

net/core/drop_monitor.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -802,16 +802,12 @@ net_dm_hw_metadata_clone(const struct net_dm_hw_metadata *hw_metadata)
802802
if (!n_hw_metadata)
803803
return NULL;
804804

805-
trap_group_name = kmemdup(hw_metadata->trap_group_name,
806-
strlen(hw_metadata->trap_group_name) + 1,
807-
GFP_ATOMIC | __GFP_ZERO);
805+
trap_group_name = kstrdup(hw_metadata->trap_group_name, GFP_ATOMIC);
808806
if (!trap_group_name)
809807
goto free_hw_metadata;
810808
n_hw_metadata->trap_group_name = trap_group_name;
811809

812-
trap_name = kmemdup(hw_metadata->trap_name,
813-
strlen(hw_metadata->trap_name) + 1,
814-
GFP_ATOMIC | __GFP_ZERO);
810+
trap_name = kstrdup(hw_metadata->trap_name, GFP_ATOMIC);
815811
if (!trap_name)
816812
goto free_trap_group;
817813
n_hw_metadata->trap_name = trap_name;

net/core/rtnetlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,8 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
12421242
return 0;
12431243

12441244
memset(&vf_vlan_info, 0, sizeof(vf_vlan_info));
1245+
memset(&node_guid, 0, sizeof(node_guid));
1246+
memset(&port_guid, 0, sizeof(port_guid));
12451247

12461248
vf_mac.vf =
12471249
vf_vlan.vf =
@@ -1290,8 +1292,6 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
12901292
sizeof(vf_trust), &vf_trust))
12911293
goto nla_put_vf_failure;
12921294

1293-
memset(&node_guid, 0, sizeof(node_guid));
1294-
memset(&port_guid, 0, sizeof(port_guid));
12951295
if (dev->netdev_ops->ndo_get_vf_guid &&
12961296
!dev->netdev_ops->ndo_get_vf_guid(dev, vfs_num, &node_guid,
12971297
&port_guid)) {

net/ipv4/syncookies.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
349349
req->ts_recent = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsval : 0;
350350
treq->snt_synack = 0;
351351
treq->tfo_listener = false;
352+
353+
if (IS_ENABLED(CONFIG_MPTCP))
354+
treq->is_mptcp = 0;
355+
352356
if (IS_ENABLED(CONFIG_SMC))
353357
ireq->smc_ok = 0;
354358

net/ipv4/tcp_input.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6637,6 +6637,9 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
66376637

66386638
af_ops->init_req(req, sk, skb);
66396639

6640+
if (IS_ENABLED(CONFIG_MPTCP) && want_cookie)
6641+
tcp_rsk(req)->is_mptcp = 0;
6642+
66406643
if (security_inet_conn_request(sk, skb, req))
66416644
goto drop_and_free;
66426645

net/ipv6/syncookies.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
178178
treq = tcp_rsk(req);
179179
treq->tfo_listener = false;
180180

181+
if (IS_ENABLED(CONFIG_MPTCP))
182+
treq->is_mptcp = 0;
183+
181184
if (security_inet_conn_request(sk, skb, req))
182185
goto out_free;
183186

net/ipv6/tcp_ipv6.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
239239

240240
icsk->icsk_af_ops = &ipv6_mapped;
241241
if (sk_is_mptcp(sk))
242-
mptcp_handle_ipv6_mapped(sk, true);
242+
mptcpv6_handle_mapped(sk, true);
243243
sk->sk_backlog_rcv = tcp_v4_do_rcv;
244244
#ifdef CONFIG_TCP_MD5SIG
245245
tp->af_specific = &tcp_sock_ipv6_mapped_specific;
@@ -251,7 +251,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
251251
icsk->icsk_ext_hdr_len = exthdrlen;
252252
icsk->icsk_af_ops = &ipv6_specific;
253253
if (sk_is_mptcp(sk))
254-
mptcp_handle_ipv6_mapped(sk, false);
254+
mptcpv6_handle_mapped(sk, false);
255255
sk->sk_backlog_rcv = tcp_v6_do_rcv;
256256
#ifdef CONFIG_TCP_MD5SIG
257257
tp->af_specific = &tcp_sock_ipv6_specific;
@@ -1208,7 +1208,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
12081208

12091209
inet_csk(newsk)->icsk_af_ops = &ipv6_mapped;
12101210
if (sk_is_mptcp(newsk))
1211-
mptcp_handle_ipv6_mapped(newsk, true);
1211+
mptcpv6_handle_mapped(newsk, true);
12121212
newsk->sk_backlog_rcv = tcp_v4_do_rcv;
12131213
#ifdef CONFIG_TCP_MD5SIG
12141214
newtp->af_specific = &tcp_sock_ipv6_mapped_specific;

0 commit comments

Comments
 (0)