Skip to content

Commit c3bfc5d

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Fix several scatter gather list issues in kTLS code, from Jakub Kicinski. 2) macb driver device remove has to kill the hresp_err_tasklet. From Chuhong Yuan. 3) Several memory leak and reference count bug fixes in tipc, from Tung Nguyen. 4) Fix mlx5 build error w/o ipv6, from Yue Haibing. 5) Fix jumbo frame and other regressions in r8169, from Heiner Kallweit. 6) Undo some BUG_ON()'s and replace them with WARN_ON_ONCE and proper error propagation/handling. From Paolo Abeni. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (24 commits) openvswitch: remove another BUG_ON() openvswitch: drop unneeded BUG_ON() in ovs_flow_cmd_build_info() net: phy: realtek: fix using paged operations with RTL8105e / RTL8208 r8169: fix resume on cable plug-in r8169: fix jumbo configuration for RTL8168evl net: emulex: benet: indent a Kconfig depends continuation line selftests: forwarding: fix race between packet receive and tc check net: sched: fix `tc -s class show` no bstats on class with nolock subqueues net: ethernet: ti: ale: ensure vlan/mdb deleted when no members net/mlx5e: Fix build error without IPV6 selftests: pmtu: use -oneline for ip route list cache tipc: fix duplicate SYN messages under link congestion tipc: fix wrong timeout input for tipc_wait_for_cond() tipc: fix wrong socket reference counter after tipc_sk_timeout() returns tipc: fix potential memory leak in __tipc_sendmsg() net: macb: add missed tasklet_kill selftests: bpf: correct perror strings selftests: bpf: test_sockmap: handle file creation failures gracefully net/tls: use sg_next() to walk sg entries net/tls: remove the dead inplace_crypto code ...
2 parents e5b3fc1 + c5d7281 commit c3bfc5d

24 files changed

Lines changed: 254 additions & 134 deletions

File tree

‎drivers/net/ethernet/cadence/macb_main.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4422,6 +4422,7 @@ static int macb_remove(struct platform_device *pdev)
44224422
mdiobus_free(bp->mii_bus);
44234423

44244424
unregister_netdev(dev);
4425+
tasklet_kill(&bp->hresp_err_tasklet);
44254426
pm_runtime_disable(&pdev->dev);
44264427
pm_runtime_dont_use_autosuspend(&pdev->dev);
44274428
if (!pm_runtime_suspended(&pdev->dev)) {

‎drivers/net/ethernet/emulex/benet/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ config BE2NET_SKYHAWK
4949

5050
comment "WARNING: be2net is useless without any enabled chip"
5151
depends on BE2NET_BE2=n && BE2NET_BE3=n && BE2NET_LANCER=n && \
52-
BE2NET_SKYHAWK=n && BE2NET
52+
BE2NET_SKYHAWK=n && BE2NET

‎drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c‎

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -130,42 +130,6 @@ static const char *mlx5e_netdev_kind(struct net_device *dev)
130130
return "unknown";
131131
}
132132

133-
static int mlx5e_route_lookup_ipv6(struct mlx5e_priv *priv,
134-
struct net_device *mirred_dev,
135-
struct net_device **out_dev,
136-
struct net_device **route_dev,
137-
struct flowi6 *fl6,
138-
struct neighbour **out_n,
139-
u8 *out_ttl)
140-
{
141-
struct dst_entry *dst;
142-
struct neighbour *n;
143-
144-
int ret;
145-
146-
ret = ipv6_stub->ipv6_dst_lookup(dev_net(mirred_dev), NULL, &dst,
147-
fl6);
148-
if (ret < 0)
149-
return ret;
150-
151-
if (!(*out_ttl))
152-
*out_ttl = ip6_dst_hoplimit(dst);
153-
154-
ret = get_route_and_out_devs(priv, dst->dev, route_dev, out_dev);
155-
if (ret < 0) {
156-
dst_release(dst);
157-
return ret;
158-
}
159-
160-
n = dst_neigh_lookup(dst, &fl6->daddr);
161-
dst_release(dst);
162-
if (!n)
163-
return -ENOMEM;
164-
165-
*out_n = n;
166-
return 0;
167-
}
168-
169133
static int mlx5e_gen_ip_tunnel_header(char buf[], __u8 *ip_proto,
170134
struct mlx5e_encap_entry *e)
171135
{
@@ -319,6 +283,43 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv,
319283
return err;
320284
}
321285

286+
#if IS_ENABLED(CONFIG_INET) && IS_ENABLED(CONFIG_IPV6)
287+
static int mlx5e_route_lookup_ipv6(struct mlx5e_priv *priv,
288+
struct net_device *mirred_dev,
289+
struct net_device **out_dev,
290+
struct net_device **route_dev,
291+
struct flowi6 *fl6,
292+
struct neighbour **out_n,
293+
u8 *out_ttl)
294+
{
295+
struct dst_entry *dst;
296+
struct neighbour *n;
297+
298+
int ret;
299+
300+
ret = ipv6_stub->ipv6_dst_lookup(dev_net(mirred_dev), NULL, &dst,
301+
fl6);
302+
if (ret < 0)
303+
return ret;
304+
305+
if (!(*out_ttl))
306+
*out_ttl = ip6_dst_hoplimit(dst);
307+
308+
ret = get_route_and_out_devs(priv, dst->dev, route_dev, out_dev);
309+
if (ret < 0) {
310+
dst_release(dst);
311+
return ret;
312+
}
313+
314+
n = dst_neigh_lookup(dst, &fl6->daddr);
315+
dst_release(dst);
316+
if (!n)
317+
return -ENOMEM;
318+
319+
*out_n = n;
320+
return 0;
321+
}
322+
322323
int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv,
323324
struct net_device *mirred_dev,
324325
struct mlx5e_encap_entry *e)
@@ -436,6 +437,7 @@ int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv,
436437
neigh_release(n);
437438
return err;
438439
}
440+
#endif
439441

440442
bool mlx5e_tc_tun_device_to_offload(struct mlx5e_priv *priv,
441443
struct net_device *netdev)

‎drivers/net/ethernet/realtek/r8169_main.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,7 @@ static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
15421542
rtl_lock_config_regs(tp);
15431543

15441544
device_set_wakeup_enable(tp_to_dev(tp), wolopts);
1545+
tp->dev->wol_enabled = wolopts ? 1 : 0;
15451546
}
15461547

15471548
static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
@@ -3872,7 +3873,7 @@ static void rtl_hw_jumbo_enable(struct rtl8169_private *tp)
38723873
case RTL_GIGA_MAC_VER_27 ... RTL_GIGA_MAC_VER_28:
38733874
r8168dp_hw_jumbo_enable(tp);
38743875
break;
3875-
case RTL_GIGA_MAC_VER_31 ... RTL_GIGA_MAC_VER_34:
3876+
case RTL_GIGA_MAC_VER_31 ... RTL_GIGA_MAC_VER_33:
38763877
r8168e_hw_jumbo_enable(tp);
38773878
break;
38783879
default:

‎drivers/net/ethernet/ti/cpsw_ale.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ int cpsw_ale_del_mcast(struct cpsw_ale *ale, const u8 *addr, int port_mask,
384384
int flags, u16 vid)
385385
{
386386
u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
387-
int mcast_members;
387+
int mcast_members = 0;
388388
int idx;
389389

390390
idx = cpsw_ale_match_addr(ale, addr, (flags & ALE_VLAN) ? vid : 0);
@@ -397,11 +397,13 @@ int cpsw_ale_del_mcast(struct cpsw_ale *ale, const u8 *addr, int port_mask,
397397
mcast_members = cpsw_ale_get_port_mask(ale_entry,
398398
ale->port_mask_bits);
399399
mcast_members &= ~port_mask;
400+
}
401+
402+
if (mcast_members)
400403
cpsw_ale_set_port_mask(ale_entry, mcast_members,
401404
ale->port_mask_bits);
402-
} else {
405+
else
403406
cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
404-
}
405407

406408
cpsw_ale_write(ale, idx, ale_entry);
407409
return 0;
@@ -478,6 +480,10 @@ static void cpsw_ale_del_vlan_modify(struct cpsw_ale *ale, u32 *ale_entry,
478480
members = cpsw_ale_get_vlan_member_list(ale_entry,
479481
ale->vlan_field_bits);
480482
members &= ~port_mask;
483+
if (!members) {
484+
cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
485+
return;
486+
}
481487

482488
untag = cpsw_ale_get_vlan_untag_force(ale_entry,
483489
ale->vlan_field_bits);

‎drivers/net/phy/realtek.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,15 @@ static struct phy_driver realtek_drvs[] = {
439439
.resume = genphy_resume,
440440
.read_page = rtl821x_read_page,
441441
.write_page = rtl821x_write_page,
442+
}, {
443+
PHY_ID_MATCH_MODEL(0x001cc880),
444+
.name = "RTL8208 Fast Ethernet",
445+
.read_mmd = genphy_read_mmd_unsupported,
446+
.write_mmd = genphy_write_mmd_unsupported,
447+
.suspend = genphy_suspend,
448+
.resume = genphy_resume,
449+
.read_page = rtl821x_read_page,
450+
.write_page = rtl821x_write_page,
442451
}, {
443452
PHY_ID_MATCH_EXACT(0x001cc910),
444453
.name = "RTL8211 Gigabit Ethernet",

‎include/linux/skmsg.h‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <net/strparser.h>
1515

1616
#define MAX_MSG_FRAGS MAX_SKB_FRAGS
17+
#define NR_MSG_FRAG_IDS (MAX_MSG_FRAGS + 1)
1718

1819
enum __sk_action {
1920
__SK_DROP = 0,
@@ -29,13 +30,15 @@ struct sk_msg_sg {
2930
u32 size;
3031
u32 copybreak;
3132
unsigned long copy;
32-
/* The extra element is used for chaining the front and sections when
33-
* the list becomes partitioned (e.g. end < start). The crypto APIs
34-
* require the chaining.
33+
/* The extra two elements:
34+
* 1) used for chaining the front and sections when the list becomes
35+
* partitioned (e.g. end < start). The crypto APIs require the
36+
* chaining;
37+
* 2) to chain tailer SG entries after the message.
3538
*/
36-
struct scatterlist data[MAX_MSG_FRAGS + 1];
39+
struct scatterlist data[MAX_MSG_FRAGS + 2];
3740
};
38-
static_assert(BITS_PER_LONG >= MAX_MSG_FRAGS);
41+
static_assert(BITS_PER_LONG >= NR_MSG_FRAG_IDS);
3942

4043
/* UAPI in filter.c depends on struct sk_msg_sg being first element. */
4144
struct sk_msg {
@@ -142,21 +145,21 @@ static inline void sk_msg_apply_bytes(struct sk_psock *psock, u32 bytes)
142145

143146
static inline u32 sk_msg_iter_dist(u32 start, u32 end)
144147
{
145-
return end >= start ? end - start : end + (MAX_MSG_FRAGS - start);
148+
return end >= start ? end - start : end + (NR_MSG_FRAG_IDS - start);
146149
}
147150

148151
#define sk_msg_iter_var_prev(var) \
149152
do { \
150153
if (var == 0) \
151-
var = MAX_MSG_FRAGS - 1; \
154+
var = NR_MSG_FRAG_IDS - 1; \
152155
else \
153156
var--; \
154157
} while (0)
155158

156159
#define sk_msg_iter_var_next(var) \
157160
do { \
158161
var++; \
159-
if (var == MAX_MSG_FRAGS) \
162+
if (var == NR_MSG_FRAG_IDS) \
160163
var = 0; \
161164
} while (0)
162165

@@ -173,9 +176,9 @@ static inline void sk_msg_clear_meta(struct sk_msg *msg)
173176

174177
static inline void sk_msg_init(struct sk_msg *msg)
175178
{
176-
BUILD_BUG_ON(ARRAY_SIZE(msg->sg.data) - 1 != MAX_MSG_FRAGS);
179+
BUILD_BUG_ON(ARRAY_SIZE(msg->sg.data) - 1 != NR_MSG_FRAG_IDS);
177180
memset(msg, 0, sizeof(*msg));
178-
sg_init_marker(msg->sg.data, MAX_MSG_FRAGS);
181+
sg_init_marker(msg->sg.data, NR_MSG_FRAG_IDS);
179182
}
180183

181184
static inline void sk_msg_xfer(struct sk_msg *dst, struct sk_msg *src,
@@ -196,14 +199,11 @@ static inline void sk_msg_xfer_full(struct sk_msg *dst, struct sk_msg *src)
196199

197200
static inline bool sk_msg_full(const struct sk_msg *msg)
198201
{
199-
return (msg->sg.end == msg->sg.start) && msg->sg.size;
202+
return sk_msg_iter_dist(msg->sg.start, msg->sg.end) == MAX_MSG_FRAGS;
200203
}
201204

202205
static inline u32 sk_msg_elem_used(const struct sk_msg *msg)
203206
{
204-
if (sk_msg_full(msg))
205-
return MAX_MSG_FRAGS;
206-
207207
return sk_msg_iter_dist(msg->sg.start, msg->sg.end);
208208
}
209209

‎include/net/tls.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ struct tls_rec {
100100
struct list_head list;
101101
int tx_ready;
102102
int tx_flags;
103-
int inplace_crypto;
104103

105104
struct sk_msg msg_plaintext;
106105
struct sk_msg msg_encrypted;
@@ -377,7 +376,7 @@ int tls_push_sg(struct sock *sk, struct tls_context *ctx,
377376
int flags);
378377
int tls_push_partial_record(struct sock *sk, struct tls_context *ctx,
379378
int flags);
380-
bool tls_free_partial_record(struct sock *sk, struct tls_context *ctx);
379+
void tls_free_partial_record(struct sock *sk, struct tls_context *ctx);
381380

382381
static inline struct tls_msg *tls_msg(struct sk_buff *skb)
383382
{

‎net/core/filter.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2299,7 +2299,7 @@ BPF_CALL_4(bpf_msg_pull_data, struct sk_msg *, msg, u32, start,
22992299
WARN_ON_ONCE(last_sge == first_sge);
23002300
shift = last_sge > first_sge ?
23012301
last_sge - first_sge - 1 :
2302-
MAX_SKB_FRAGS - first_sge + last_sge - 1;
2302+
NR_MSG_FRAG_IDS - first_sge + last_sge - 1;
23032303
if (!shift)
23042304
goto out;
23052305

@@ -2308,8 +2308,8 @@ BPF_CALL_4(bpf_msg_pull_data, struct sk_msg *, msg, u32, start,
23082308
do {
23092309
u32 move_from;
23102310

2311-
if (i + shift >= MAX_MSG_FRAGS)
2312-
move_from = i + shift - MAX_MSG_FRAGS;
2311+
if (i + shift >= NR_MSG_FRAG_IDS)
2312+
move_from = i + shift - NR_MSG_FRAG_IDS;
23132313
else
23142314
move_from = i + shift;
23152315
if (move_from == msg->sg.end)
@@ -2323,7 +2323,7 @@ BPF_CALL_4(bpf_msg_pull_data, struct sk_msg *, msg, u32, start,
23232323
} while (1);
23242324

23252325
msg->sg.end = msg->sg.end - shift > msg->sg.end ?
2326-
msg->sg.end - shift + MAX_MSG_FRAGS :
2326+
msg->sg.end - shift + NR_MSG_FRAG_IDS :
23272327
msg->sg.end - shift;
23282328
out:
23292329
msg->data = sg_virt(&msg->sg.data[first_sge]) + start - offset;

‎net/core/skmsg.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ static int sk_psock_skb_ingress(struct sk_psock *psock, struct sk_buff *skb)
421421
copied = skb->len;
422422
msg->sg.start = 0;
423423
msg->sg.size = copied;
424-
msg->sg.end = num_sge == MAX_MSG_FRAGS ? 0 : num_sge;
424+
msg->sg.end = num_sge;
425425
msg->skb = skb;
426426

427427
sk_psock_queue_msg(psock, msg);

0 commit comments

Comments
 (0)