Skip to content

Commit 91b1561

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
David writes: "Networking 1) Fix gro_cells leak in xfrm layer, from Li RongQing. 2) BPF selftests change RLIMIT_MEMLOCK blindly, don't do that. From Eric Dumazet. 3) AF_XDP calls synchronize_net() under RCU lock, fix from Björn Töpel. 4) Out of bounds packet access in _decode_session6(), from Alexei Starovoitov. 5) Several ethtool bugs, where we copy a struct into the kernel twice and our validations of the values in the first copy can be invalidated by the second copy due to asynchronous updates to the memory by the user. From Wenwen Wang. 6) Missing netlink attribute validation in cls_api, from Davide Caratti. 7) LLC SAP sockets neet to be SOCK_RCU FREE, from Cong Wang. 8) rxrpc operates on wrong kvec, from Yue Haibing. 9) A regression was introduced by the disassosciation of route neighbour references in rt6_probe(), causing probe for neighbourless routes to not be properly rate limited. Fix from Sabrina Dubroca. 10) Unsafe RCU locking in tipc, from Tung Nguyen. 11) Use after free in inet6_mc_check(), from Eric Dumazet. 12) PMTU from icmp packets should update the SCTP transport pathmtu, from Xin Long. 13) Missing peer put on error in rxrpc, from David Howells. 14) Fix pedit in nfp driver, from Pieter Jansen van Vuuren. 15) Fix overflowing shift statement in qla3xxx driver, from Nathan Chancellor. 16) Fix Spectre v1 in ptp code, from Gustavo A. R. Silva. 17) udp6_unicast_rcv_skb() interprets udpv6_queue_rcv_skb() return value in an inverted manner, fix from Paolo Abeni. 18) Fix missed unresolved entries in ipmr dumps, from Nikolay Aleksandrov. 19) Fix NAPI handling under high load, we can completely miss events when NAPI has to loop more than one time in a cycle. From Heiner Kallweit." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (49 commits) ip6_tunnel: Fix encapsulation layout tipc: fix info leak from kernel tipc_event net: socket: fix a missing-check bug net: sched: Fix for duplicate class dump r8169: fix NAPI handling under high load net: ipmr: fix unresolved entry dumps net: mscc: ocelot: Fix comment in ocelot_vlant_wait_for_completion() sctp: fix the data size calculation in sctp_data_size virtio_net: avoid using netif_tx_disable() for serializing tx routine udp6: fix encap return code for resubmitting mlxsw: core: Fix use-after-free when flashing firmware during init sctp: not free the new asoc when sctp_wait_for_connect returns err sctp: fix race on sctp_id2asoc r8169: re-enable MSI-X on RTL8168g net: bpfilter: use get_pid_task instead of pid_task ptp: fix Spectre v1 vulnerability net: qla3xxx: Remove overflowing shift statement geneve, vxlan: Don't set exceptions if skb->len < mtu geneve, vxlan: Don't check skb_dst() twice sctp: get pr_assoc and pr_stream all status with SCTP_PR_SCTP_ALL instead ...
2 parents 2a96661 + d4d576f commit 91b1561

Some content is hidden

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

57 files changed

+253
-187
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10122,7 +10122,6 @@ L: netdev@vger.kernel.org
1012210122
T: git git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git
1012310123
T: git git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git
1012410124
S: Maintained
10125-
F: net/core/flow.c
1012610125
F: net/xfrm/
1012710126
F: net/key/
1012810127
F: net/ipv4/xfrm*

drivers/net/ethernet/broadcom/genet/bcmmii.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,12 @@ int bcmgenet_mii_probe(struct net_device *dev)
321321
phydev->advertising = phydev->supported;
322322

323323
/* The internal PHY has its link interrupts routed to the
324-
* Ethernet MAC ISRs
324+
* Ethernet MAC ISRs. On GENETv5 there is a hardware issue
325+
* that prevents the signaling of link UP interrupts when
326+
* the link operates at 10Mbps, so fallback to polling for
327+
* those versions of GENET.
325328
*/
326-
if (priv->internal_phy)
329+
if (priv->internal_phy && !GENET_IS_V5(priv))
327330
dev->phydev->irq = PHY_IGNORE_INTERRUPT;
328331

329332
return 0;

drivers/net/ethernet/freescale/fec.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,10 @@ struct bufdesc_ex {
452452
* initialisation.
453453
*/
454454
#define FEC_QUIRK_MIB_CLEAR (1 << 15)
455+
/* Only i.MX25/i.MX27/i.MX28 controller supports FRBR,FRSR registers,
456+
* those FIFO receive registers are resolved in other platforms.
457+
*/
458+
#define FEC_QUIRK_HAS_FRREG (1 << 16)
455459

456460
struct bufdesc_prop {
457461
int qid;

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,16 @@ static struct platform_device_id fec_devtype[] = {
9191
.driver_data = 0,
9292
}, {
9393
.name = "imx25-fec",
94-
.driver_data = FEC_QUIRK_USE_GASKET | FEC_QUIRK_MIB_CLEAR,
94+
.driver_data = FEC_QUIRK_USE_GASKET | FEC_QUIRK_MIB_CLEAR |
95+
FEC_QUIRK_HAS_FRREG,
9596
}, {
9697
.name = "imx27-fec",
97-
.driver_data = FEC_QUIRK_MIB_CLEAR,
98+
.driver_data = FEC_QUIRK_MIB_CLEAR | FEC_QUIRK_HAS_FRREG,
9899
}, {
99100
.name = "imx28-fec",
100101
.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME |
101-
FEC_QUIRK_SINGLE_MDIO | FEC_QUIRK_HAS_RACC,
102+
FEC_QUIRK_SINGLE_MDIO | FEC_QUIRK_HAS_RACC |
103+
FEC_QUIRK_HAS_FRREG,
102104
}, {
103105
.name = "imx6q-fec",
104106
.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
@@ -2164,7 +2166,13 @@ static void fec_enet_get_regs(struct net_device *ndev,
21642166
memset(buf, 0, regs->len);
21652167

21662168
for (i = 0; i < ARRAY_SIZE(fec_enet_register_offset); i++) {
2167-
off = fec_enet_register_offset[i] / 4;
2169+
off = fec_enet_register_offset[i];
2170+
2171+
if ((off == FEC_R_BOUND || off == FEC_R_FSTART) &&
2172+
!(fep->quirks & FEC_QUIRK_HAS_FRREG))
2173+
continue;
2174+
2175+
off >>= 2;
21682176
buf[off] = readl(&theregs[off]);
21692177
}
21702178
}

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,9 @@ static inline u16 mlx5e_icosq_wrap_cnt(struct mlx5e_icosq *sq)
432432

433433
static inline void mlx5e_fill_icosq_frag_edge(struct mlx5e_icosq *sq,
434434
struct mlx5_wq_cyc *wq,
435-
u16 pi, u16 frag_pi)
435+
u16 pi, u16 nnops)
436436
{
437437
struct mlx5e_sq_wqe_info *edge_wi, *wi = &sq->db.ico_wqe[pi];
438-
u8 nnops = mlx5_wq_cyc_get_frag_size(wq) - frag_pi;
439438

440439
edge_wi = wi + nnops;
441440

@@ -454,15 +453,14 @@ static int mlx5e_alloc_rx_mpwqe(struct mlx5e_rq *rq, u16 ix)
454453
struct mlx5_wq_cyc *wq = &sq->wq;
455454
struct mlx5e_umr_wqe *umr_wqe;
456455
u16 xlt_offset = ix << (MLX5E_LOG_ALIGNED_MPWQE_PPW - 1);
457-
u16 pi, frag_pi;
456+
u16 pi, contig_wqebbs_room;
458457
int err;
459458
int i;
460459

461460
pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc);
462-
frag_pi = mlx5_wq_cyc_ctr2fragix(wq, sq->pc);
463-
464-
if (unlikely(frag_pi + MLX5E_UMR_WQEBBS > mlx5_wq_cyc_get_frag_size(wq))) {
465-
mlx5e_fill_icosq_frag_edge(sq, wq, pi, frag_pi);
461+
contig_wqebbs_room = mlx5_wq_cyc_get_contig_wqebbs(wq, pi);
462+
if (unlikely(contig_wqebbs_room < MLX5E_UMR_WQEBBS)) {
463+
mlx5e_fill_icosq_frag_edge(sq, wq, pi, contig_wqebbs_room);
466464
pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc);
467465
}
468466

drivers/net/ethernet/mellanox/mlx5/core/en_tx.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,9 @@ mlx5e_txwqe_build_dsegs(struct mlx5e_txqsq *sq, struct sk_buff *skb,
290290

291291
static inline void mlx5e_fill_sq_frag_edge(struct mlx5e_txqsq *sq,
292292
struct mlx5_wq_cyc *wq,
293-
u16 pi, u16 frag_pi)
293+
u16 pi, u16 nnops)
294294
{
295295
struct mlx5e_tx_wqe_info *edge_wi, *wi = &sq->db.wqe_info[pi];
296-
u8 nnops = mlx5_wq_cyc_get_frag_size(wq) - frag_pi;
297296

298297
edge_wi = wi + nnops;
299298

@@ -348,8 +347,8 @@ netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
348347
struct mlx5e_tx_wqe_info *wi;
349348

350349
struct mlx5e_sq_stats *stats = sq->stats;
350+
u16 headlen, ihs, contig_wqebbs_room;
351351
u16 ds_cnt, ds_cnt_inl = 0;
352-
u16 headlen, ihs, frag_pi;
353352
u8 num_wqebbs, opcode;
354353
u32 num_bytes;
355354
int num_dma;
@@ -386,9 +385,9 @@ netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
386385
}
387386

388387
num_wqebbs = DIV_ROUND_UP(ds_cnt, MLX5_SEND_WQEBB_NUM_DS);
389-
frag_pi = mlx5_wq_cyc_ctr2fragix(wq, sq->pc);
390-
if (unlikely(frag_pi + num_wqebbs > mlx5_wq_cyc_get_frag_size(wq))) {
391-
mlx5e_fill_sq_frag_edge(sq, wq, pi, frag_pi);
388+
contig_wqebbs_room = mlx5_wq_cyc_get_contig_wqebbs(wq, pi);
389+
if (unlikely(contig_wqebbs_room < num_wqebbs)) {
390+
mlx5e_fill_sq_frag_edge(sq, wq, pi, contig_wqebbs_room);
392391
mlx5e_sq_fetch_wqe(sq, &wqe, &pi);
393392
}
394393

@@ -636,7 +635,7 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
636635
struct mlx5e_tx_wqe_info *wi;
637636

638637
struct mlx5e_sq_stats *stats = sq->stats;
639-
u16 headlen, ihs, pi, frag_pi;
638+
u16 headlen, ihs, pi, contig_wqebbs_room;
640639
u16 ds_cnt, ds_cnt_inl = 0;
641640
u8 num_wqebbs, opcode;
642641
u32 num_bytes;
@@ -672,13 +671,14 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
672671
}
673672

674673
num_wqebbs = DIV_ROUND_UP(ds_cnt, MLX5_SEND_WQEBB_NUM_DS);
675-
frag_pi = mlx5_wq_cyc_ctr2fragix(wq, sq->pc);
676-
if (unlikely(frag_pi + num_wqebbs > mlx5_wq_cyc_get_frag_size(wq))) {
674+
pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc);
675+
contig_wqebbs_room = mlx5_wq_cyc_get_contig_wqebbs(wq, pi);
676+
if (unlikely(contig_wqebbs_room < num_wqebbs)) {
677+
mlx5e_fill_sq_frag_edge(sq, wq, pi, contig_wqebbs_room);
677678
pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc);
678-
mlx5e_fill_sq_frag_edge(sq, wq, pi, frag_pi);
679679
}
680680

681-
mlx5i_sq_fetch_wqe(sq, &wqe, &pi);
681+
mlx5i_sq_fetch_wqe(sq, &wqe, pi);
682682

683683
/* fill wqe */
684684
wi = &sq->db.wqe_info[pi];

drivers/net/ethernet/mellanox/mlx5/core/eq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static void eq_pf_process(struct mlx5_eq *eq)
273273
case MLX5_PFAULT_SUBTYPE_WQE:
274274
/* WQE based event */
275275
pfault->type =
276-
be32_to_cpu(pf_eqe->wqe.pftype_wq) >> 24;
276+
(be32_to_cpu(pf_eqe->wqe.pftype_wq) >> 24) & 0x7;
277277
pfault->token =
278278
be32_to_cpu(pf_eqe->wqe.token);
279279
pfault->wqe.wq_num =

drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static void *mlx5_fpga_ipsec_cmd_exec(struct mlx5_core_dev *mdev,
245245
return ERR_PTR(res);
246246
}
247247

248-
/* Context will be freed by wait func after completion */
248+
/* Context should be freed by the caller after completion. */
249249
return context;
250250
}
251251

@@ -418,10 +418,8 @@ static int mlx5_fpga_ipsec_set_caps(struct mlx5_core_dev *mdev, u32 flags)
418418
cmd.cmd = htonl(MLX5_FPGA_IPSEC_CMD_OP_SET_CAP);
419419
cmd.flags = htonl(flags);
420420
context = mlx5_fpga_ipsec_cmd_exec(mdev, &cmd, sizeof(cmd));
421-
if (IS_ERR(context)) {
422-
err = PTR_ERR(context);
423-
goto out;
424-
}
421+
if (IS_ERR(context))
422+
return PTR_ERR(context);
425423

426424
err = mlx5_fpga_ipsec_cmd_wait(context);
427425
if (err)
@@ -435,6 +433,7 @@ static int mlx5_fpga_ipsec_set_caps(struct mlx5_core_dev *mdev, u32 flags)
435433
}
436434

437435
out:
436+
kfree(context);
438437
return err;
439438
}
440439

drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,11 @@ struct mlx5i_tx_wqe {
109109

110110
static inline void mlx5i_sq_fetch_wqe(struct mlx5e_txqsq *sq,
111111
struct mlx5i_tx_wqe **wqe,
112-
u16 *pi)
112+
u16 pi)
113113
{
114114
struct mlx5_wq_cyc *wq = &sq->wq;
115115

116-
*pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc);
117-
*wqe = mlx5_wq_cyc_get_wqe(wq, *pi);
116+
*wqe = mlx5_wq_cyc_get_wqe(wq, pi);
118117
memset(*wqe, 0, sizeof(**wqe));
119118
}
120119

drivers/net/ethernet/mellanox/mlx5/core/wq.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq)
3939
return (u32)wq->fbc.sz_m1 + 1;
4040
}
4141

42-
u16 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq)
43-
{
44-
return wq->fbc.frag_sz_m1 + 1;
45-
}
46-
4742
u32 mlx5_cqwq_get_size(struct mlx5_cqwq *wq)
4843
{
4944
return wq->fbc.sz_m1 + 1;

drivers/net/ethernet/mellanox/mlx5/core/wq.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ int mlx5_wq_cyc_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,
8080
void *wqc, struct mlx5_wq_cyc *wq,
8181
struct mlx5_wq_ctrl *wq_ctrl);
8282
u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq);
83-
u16 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq);
8483

8584
int mlx5_wq_qp_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,
8685
void *qpc, struct mlx5_wq_qp *wq,
@@ -140,11 +139,6 @@ static inline u16 mlx5_wq_cyc_ctr2ix(struct mlx5_wq_cyc *wq, u16 ctr)
140139
return ctr & wq->fbc.sz_m1;
141140
}
142141

143-
static inline u16 mlx5_wq_cyc_ctr2fragix(struct mlx5_wq_cyc *wq, u16 ctr)
144-
{
145-
return ctr & wq->fbc.frag_sz_m1;
146-
}
147-
148142
static inline u16 mlx5_wq_cyc_get_head(struct mlx5_wq_cyc *wq)
149143
{
150144
return mlx5_wq_cyc_ctr2ix(wq, wq->wqe_ctr);
@@ -160,6 +154,11 @@ static inline void *mlx5_wq_cyc_get_wqe(struct mlx5_wq_cyc *wq, u16 ix)
160154
return mlx5_frag_buf_get_wqe(&wq->fbc, ix);
161155
}
162156

157+
static inline u16 mlx5_wq_cyc_get_contig_wqebbs(struct mlx5_wq_cyc *wq, u16 ix)
158+
{
159+
return mlx5_frag_buf_get_idx_last_contig_stride(&wq->fbc, ix) - ix + 1;
160+
}
161+
163162
static inline int mlx5_wq_cyc_cc_bigger(u16 cc1, u16 cc2)
164163
{
165164
int equal = (cc1 == cc2);

drivers/net/ethernet/mellanox/mlxsw/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,7 @@ int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
10551055
err_driver_init:
10561056
mlxsw_thermal_fini(mlxsw_core->thermal);
10571057
err_thermal_init:
1058+
mlxsw_hwmon_fini(mlxsw_core->hwmon);
10581059
err_hwmon_init:
10591060
if (!reload)
10601061
devlink_unregister(devlink);
@@ -1088,6 +1089,7 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core,
10881089
if (mlxsw_core->driver->fini)
10891090
mlxsw_core->driver->fini(mlxsw_core);
10901091
mlxsw_thermal_fini(mlxsw_core->thermal);
1092+
mlxsw_hwmon_fini(mlxsw_core->hwmon);
10911093
if (!reload)
10921094
devlink_unregister(devlink);
10931095
mlxsw_emad_fini(mlxsw_core);

drivers/net/ethernet/mellanox/mlxsw/core.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ static inline int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core,
359359
return 0;
360360
}
361361

362+
static inline void mlxsw_hwmon_fini(struct mlxsw_hwmon *mlxsw_hwmon)
363+
{
364+
}
365+
362366
#endif
363367

364368
struct mlxsw_thermal;

drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,7 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core,
303303
struct device *hwmon_dev;
304304
int err;
305305

306-
mlxsw_hwmon = devm_kzalloc(mlxsw_bus_info->dev, sizeof(*mlxsw_hwmon),
307-
GFP_KERNEL);
306+
mlxsw_hwmon = kzalloc(sizeof(*mlxsw_hwmon), GFP_KERNEL);
308307
if (!mlxsw_hwmon)
309308
return -ENOMEM;
310309
mlxsw_hwmon->core = mlxsw_core;
@@ -321,10 +320,9 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core,
321320
mlxsw_hwmon->groups[0] = &mlxsw_hwmon->group;
322321
mlxsw_hwmon->group.attrs = mlxsw_hwmon->attrs;
323322

324-
hwmon_dev = devm_hwmon_device_register_with_groups(mlxsw_bus_info->dev,
325-
"mlxsw",
326-
mlxsw_hwmon,
327-
mlxsw_hwmon->groups);
323+
hwmon_dev = hwmon_device_register_with_groups(mlxsw_bus_info->dev,
324+
"mlxsw", mlxsw_hwmon,
325+
mlxsw_hwmon->groups);
328326
if (IS_ERR(hwmon_dev)) {
329327
err = PTR_ERR(hwmon_dev);
330328
goto err_hwmon_register;
@@ -337,5 +335,12 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core,
337335
err_hwmon_register:
338336
err_fans_init:
339337
err_temp_init:
338+
kfree(mlxsw_hwmon);
340339
return err;
341340
}
341+
342+
void mlxsw_hwmon_fini(struct mlxsw_hwmon *mlxsw_hwmon)
343+
{
344+
hwmon_device_unregister(mlxsw_hwmon->hwmon_dev);
345+
kfree(mlxsw_hwmon);
346+
}

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ static inline int ocelot_vlant_wait_for_completion(struct ocelot *ocelot)
133133
{
134134
unsigned int val, timeout = 10;
135135

136-
/* Wait for the issued mac table command to be completed, or timeout.
137-
* When the command read from ANA_TABLES_MACACCESS is
138-
* MACACCESS_CMD_IDLE, the issued command completed successfully.
136+
/* Wait for the issued vlan table command to be completed, or timeout.
137+
* When the command read from ANA_TABLES_VLANACCESS is
138+
* VLANACCESS_CMD_IDLE, the issued command completed successfully.
139139
*/
140140
do {
141141
val = ocelot_read(ocelot, ANA_TABLES_VLANACCESS);

0 commit comments

Comments
 (0)