Skip to content

Commit e523a25

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Various sockmap fixes from John Fastabend (pinned map handling, blocking in recvmsg, double page put, error handling during redirect failures, etc.) 2) Fix dead code handling in x86-64 JIT, from Gianluca Borello. 3) Missing device put in RDS IB code, from Dag Moxnes. 4) Don't process fast open during repair mode in TCP< from Yuchung Cheng. 5) Move address/port comparison fixes in SCTP, from Xin Long. 6) Handle add a bond slave's master into a bridge properly, from Hangbin Liu. 7) IPv6 multipath code can operate on unitialized memory due to an assumption that the icmp header is in the linear SKB area. Fix from Eric Dumazet. 8) Don't invoke do_tcp_sendpages() recursively via TLS, from Dave Watson. 9) Fix memory leaks in x86-64 JIT, from Daniel Borkmann. 10) RDS leaks kernel memory to userspace, from Eric Dumazet. 11) DCCP can invoke a tasklet on a freed socket, take a refcount. Also from Eric Dumazet. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (78 commits) dccp: fix tasklet usage smc: fix sendpage() call net/smc: handle unregistered buffers net/smc: call consolidation qed: fix spelling mistake: "offloded" -> "offloaded" net/mlx5e: fix spelling mistake: "loobpack" -> "loopback" tcp: restore autocorking rds: do not leak kernel memory to user land qmi_wwan: do not steal interfaces from class drivers ipv4: fix fnhe usage by non-cached routes bpf: sockmap, fix error handling in redirect failures bpf: sockmap, zero sg_size on error when buffer is released bpf: sockmap, fix scatterlist update on error path in send with apply net_sched: fq: take care of throttled flows before reuse ipv6: Revert "ipv6: Allow non-gateway ECMP for IPv6" bpf, x64: fix memleak when not converging on calls bpf, x64: fix memleak when not converging after image net/smc: restrict non-blocking connect finish 8139too: Use disable_irq_nosync() in rtl8139_poll_controller() sctp: fix the issue that the cookie-ack with auth can't get processed ...
2 parents bb60931 + a8d7aa1 commit e523a25

File tree

70 files changed

+602
-316
lines changed

Some content is hidden

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

70 files changed

+602
-316
lines changed

Documentation/bpf/bpf_devel_QA.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,14 @@ A: Although LLVM IR generation and optimization try to stay architecture
557557
pulls in some header files containing file scope host assembly codes.
558558
- You can add "-fno-jump-tables" to work around the switch table issue.
559559

560-
Otherwise, you can use bpf target.
560+
Otherwise, you can use bpf target. Additionally, you _must_ use bpf target
561+
when:
562+
563+
- Your program uses data structures with pointer or long / unsigned long
564+
types that interface with BPF helpers or context data structures. Access
565+
into these structures is verified by the BPF verifier and may result
566+
in verification failures if the native architecture is not aligned with
567+
the BPF architecture, e.g. 64-bit. An example of this is
568+
BPF_PROG_TYPE_SK_MSG require '-target bpf'
561569

562570
Happy BPF hacking!

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9725,6 +9725,7 @@ W: https://fedorahosted.org/dropwatch/
97259725
F: net/core/drop_monitor.c
97269726

97279727
NETWORKING DRIVERS
9728+
M: "David S. Miller" <[email protected]>
97289729
97299730
W: http://www.linuxfoundation.org/en/Net
97309731
Q: http://patchwork.ozlabs.org/project/netdev/list/
@@ -12498,6 +12499,7 @@ F: drivers/scsi/st_*.h
1249812499
SCTP PROTOCOL
1249912500
M: Vlad Yasevich <[email protected]>
1250012501
M: Neil Horman <[email protected]>
12502+
M: Marcelo Ricardo Leitner <[email protected]>
1250112503
1250212504
W: http://lksctp.sourceforge.net
1250312505
S: Maintained

arch/x86/net/bpf_jit_comp.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,17 @@ xadd: if (is_imm8(insn->off))
10271027
break;
10281028

10291029
case BPF_JMP | BPF_JA:
1030-
jmp_offset = addrs[i + insn->off] - addrs[i];
1030+
if (insn->off == -1)
1031+
/* -1 jmp instructions will always jump
1032+
* backwards two bytes. Explicitly handling
1033+
* this case avoids wasting too many passes
1034+
* when there are long sequences of replaced
1035+
* dead code.
1036+
*/
1037+
jmp_offset = -2;
1038+
else
1039+
jmp_offset = addrs[i + insn->off] - addrs[i];
1040+
10311041
if (!jmp_offset)
10321042
/* optimize out nop jumps */
10331043
break;
@@ -1226,6 +1236,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
12261236
for (pass = 0; pass < 20 || image; pass++) {
12271237
proglen = do_jit(prog, addrs, image, oldproglen, &ctx);
12281238
if (proglen <= 0) {
1239+
out_image:
12291240
image = NULL;
12301241
if (header)
12311242
bpf_jit_binary_free(header);
@@ -1236,8 +1247,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
12361247
if (proglen != oldproglen) {
12371248
pr_err("bpf_jit: proglen=%d != oldproglen=%d\n",
12381249
proglen, oldproglen);
1239-
prog = orig_prog;
1240-
goto out_addrs;
1250+
goto out_image;
12411251
}
12421252
break;
12431253
}
@@ -1273,7 +1283,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
12731283
prog = orig_prog;
12741284
}
12751285

1276-
if (!prog->is_func || extra_pass) {
1286+
if (!image || !prog->is_func || extra_pass) {
12771287
out_addrs:
12781288
kfree(addrs);
12791289
kfree(jit_data);

drivers/infiniband/hw/mlx5/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4757,7 +4757,7 @@ mlx5_ib_get_vector_affinity(struct ib_device *ibdev, int comp_vector)
47574757
{
47584758
struct mlx5_ib_dev *dev = to_mdev(ibdev);
47594759

4760-
return mlx5_get_vector_affinity(dev->mdev, comp_vector);
4760+
return mlx5_get_vector_affinity_hint(dev->mdev, comp_vector);
47614761
}
47624762

47634763
/* The mlx5_ib_multiport_mutex should be held when calling this function */

drivers/net/ethernet/broadcom/bcmsysport.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,14 +2144,21 @@ static const struct net_device_ops bcm_sysport_netdev_ops = {
21442144
.ndo_select_queue = bcm_sysport_select_queue,
21452145
};
21462146

2147-
static int bcm_sysport_map_queues(struct net_device *dev,
2147+
static int bcm_sysport_map_queues(struct notifier_block *nb,
21482148
struct dsa_notifier_register_info *info)
21492149
{
2150-
struct bcm_sysport_priv *priv = netdev_priv(dev);
21512150
struct bcm_sysport_tx_ring *ring;
2151+
struct bcm_sysport_priv *priv;
21522152
struct net_device *slave_dev;
21532153
unsigned int num_tx_queues;
21542154
unsigned int q, start, port;
2155+
struct net_device *dev;
2156+
2157+
priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier);
2158+
if (priv->netdev != info->master)
2159+
return 0;
2160+
2161+
dev = info->master;
21552162

21562163
/* We can't be setting up queue inspection for non directly attached
21572164
* switches
@@ -2174,11 +2181,12 @@ static int bcm_sysport_map_queues(struct net_device *dev,
21742181
if (priv->is_lite)
21752182
netif_set_real_num_tx_queues(slave_dev,
21762183
slave_dev->num_tx_queues / 2);
2184+
21772185
num_tx_queues = slave_dev->real_num_tx_queues;
21782186

21792187
if (priv->per_port_num_tx_queues &&
21802188
priv->per_port_num_tx_queues != num_tx_queues)
2181-
netdev_warn(slave_dev, "asymetric number of per-port queues\n");
2189+
netdev_warn(slave_dev, "asymmetric number of per-port queues\n");
21822190

21832191
priv->per_port_num_tx_queues = num_tx_queues;
21842192

@@ -2201,7 +2209,7 @@ static int bcm_sysport_map_queues(struct net_device *dev,
22012209
return 0;
22022210
}
22032211

2204-
static int bcm_sysport_dsa_notifier(struct notifier_block *unused,
2212+
static int bcm_sysport_dsa_notifier(struct notifier_block *nb,
22052213
unsigned long event, void *ptr)
22062214
{
22072215
struct dsa_notifier_register_info *info;
@@ -2211,7 +2219,7 @@ static int bcm_sysport_dsa_notifier(struct notifier_block *unused,
22112219

22122220
info = ptr;
22132221

2214-
return notifier_from_errno(bcm_sysport_map_queues(info->master, info));
2222+
return notifier_from_errno(bcm_sysport_map_queues(nb, info));
22152223
}
22162224

22172225
#define REV_FMT "v%2x.%02x"

drivers/net/ethernet/freescale/ucc_geth_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static const char hw_stat_gstrings[][ETH_GSTRING_LEN] = {
6161
static const char tx_fw_stat_gstrings[][ETH_GSTRING_LEN] = {
6262
"tx-single-collision",
6363
"tx-multiple-collision",
64-
"tx-late-collsion",
64+
"tx-late-collision",
6565
"tx-aborted-frames",
6666
"tx-lost-frames",
6767
"tx-carrier-sense-errors",

drivers/net/ethernet/marvell/mvpp2.c

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ struct mvpp2 {
942942
struct clk *pp_clk;
943943
struct clk *gop_clk;
944944
struct clk *mg_clk;
945+
struct clk *mg_core_clk;
945946
struct clk *axi_clk;
946947

947948
/* List of pointers to port structures */
@@ -8768,18 +8769,27 @@ static int mvpp2_probe(struct platform_device *pdev)
87688769
err = clk_prepare_enable(priv->mg_clk);
87698770
if (err < 0)
87708771
goto err_gop_clk;
8772+
8773+
priv->mg_core_clk = devm_clk_get(&pdev->dev, "mg_core_clk");
8774+
if (IS_ERR(priv->mg_core_clk)) {
8775+
priv->mg_core_clk = NULL;
8776+
} else {
8777+
err = clk_prepare_enable(priv->mg_core_clk);
8778+
if (err < 0)
8779+
goto err_mg_clk;
8780+
}
87718781
}
87728782

87738783
priv->axi_clk = devm_clk_get(&pdev->dev, "axi_clk");
87748784
if (IS_ERR(priv->axi_clk)) {
87758785
err = PTR_ERR(priv->axi_clk);
87768786
if (err == -EPROBE_DEFER)
8777-
goto err_gop_clk;
8787+
goto err_mg_core_clk;
87788788
priv->axi_clk = NULL;
87798789
} else {
87808790
err = clk_prepare_enable(priv->axi_clk);
87818791
if (err < 0)
8782-
goto err_gop_clk;
8792+
goto err_mg_core_clk;
87838793
}
87848794

87858795
/* Get system's tclk rate */
@@ -8793,22 +8803,22 @@ static int mvpp2_probe(struct platform_device *pdev)
87938803
if (priv->hw_version == MVPP22) {
87948804
err = dma_set_mask(&pdev->dev, MVPP2_DESC_DMA_MASK);
87958805
if (err)
8796-
goto err_mg_clk;
8806+
goto err_axi_clk;
87978807
/* Sadly, the BM pools all share the same register to
87988808
* store the high 32 bits of their address. So they
87998809
* must all have the same high 32 bits, which forces
88008810
* us to restrict coherent memory to DMA_BIT_MASK(32).
88018811
*/
88028812
err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
88038813
if (err)
8804-
goto err_mg_clk;
8814+
goto err_axi_clk;
88058815
}
88068816

88078817
/* Initialize network controller */
88088818
err = mvpp2_init(pdev, priv);
88098819
if (err < 0) {
88108820
dev_err(&pdev->dev, "failed to initialize controller\n");
8811-
goto err_mg_clk;
8821+
goto err_axi_clk;
88128822
}
88138823

88148824
/* Initialize ports */
@@ -8821,7 +8831,7 @@ static int mvpp2_probe(struct platform_device *pdev)
88218831
if (priv->port_count == 0) {
88228832
dev_err(&pdev->dev, "no ports enabled\n");
88238833
err = -ENODEV;
8824-
goto err_mg_clk;
8834+
goto err_axi_clk;
88258835
}
88268836

88278837
/* Statistics must be gathered regularly because some of them (like
@@ -8849,8 +8859,13 @@ static int mvpp2_probe(struct platform_device *pdev)
88498859
mvpp2_port_remove(priv->port_list[i]);
88508860
i++;
88518861
}
8852-
err_mg_clk:
8862+
err_axi_clk:
88538863
clk_disable_unprepare(priv->axi_clk);
8864+
8865+
err_mg_core_clk:
8866+
if (priv->hw_version == MVPP22)
8867+
clk_disable_unprepare(priv->mg_core_clk);
8868+
err_mg_clk:
88548869
if (priv->hw_version == MVPP22)
88558870
clk_disable_unprepare(priv->mg_clk);
88568871
err_gop_clk:
@@ -8897,6 +8912,7 @@ static int mvpp2_remove(struct platform_device *pdev)
88978912
return 0;
88988913

88998914
clk_disable_unprepare(priv->axi_clk);
8915+
clk_disable_unprepare(priv->mg_core_clk);
89008916
clk_disable_unprepare(priv->mg_clk);
89018917
clk_disable_unprepare(priv->pp_clk);
89028918
clk_disable_unprepare(priv->gop_clk);

drivers/net/ethernet/mellanox/mlx4/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ static int mlx4_mf_unbond(struct mlx4_dev *dev)
13171317

13181318
ret = mlx4_unbond_fs_rules(dev);
13191319
if (ret)
1320-
mlx4_warn(dev, "multifunction unbond for flow rules failedi (%d)\n", ret);
1320+
mlx4_warn(dev, "multifunction unbond for flow rules failed (%d)\n", ret);
13211321
ret1 = mlx4_unbond_mac_table(dev);
13221322
if (ret1) {
13231323
mlx4_warn(dev, "multifunction unbond for MAC table failed (%d)\n", ret1);

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,12 +1007,14 @@ static void mlx5e_trust_update_sq_inline_mode(struct mlx5e_priv *priv)
10071007

10081008
mutex_lock(&priv->state_lock);
10091009

1010-
if (!test_bit(MLX5E_STATE_OPENED, &priv->state))
1011-
goto out;
1012-
10131010
new_channels.params = priv->channels.params;
10141011
mlx5e_trust_update_tx_min_inline_mode(priv, &new_channels.params);
10151012

1013+
if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
1014+
priv->channels.params = new_channels.params;
1015+
goto out;
1016+
}
1017+
10161018
/* Skip if tx_min_inline is the same */
10171019
if (new_channels.params.tx_min_inline_mode ==
10181020
priv->channels.params.tx_min_inline_mode)

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,13 +877,14 @@ static const struct net_device_ops mlx5e_netdev_ops_rep = {
877877
};
878878

879879
static void mlx5e_build_rep_params(struct mlx5_core_dev *mdev,
880-
struct mlx5e_params *params)
880+
struct mlx5e_params *params, u16 mtu)
881881
{
882882
u8 cq_period_mode = MLX5_CAP_GEN(mdev, cq_period_start_from_cqe) ?
883883
MLX5_CQ_PERIOD_MODE_START_FROM_CQE :
884884
MLX5_CQ_PERIOD_MODE_START_FROM_EQE;
885885

886886
params->hard_mtu = MLX5E_ETH_HARD_MTU;
887+
params->sw_mtu = mtu;
887888
params->log_sq_size = MLX5E_REP_PARAMS_LOG_SQ_SIZE;
888889
params->rq_wq_type = MLX5_WQ_TYPE_LINKED_LIST;
889890
params->log_rq_mtu_frames = MLX5E_REP_PARAMS_LOG_RQ_SIZE;
@@ -931,7 +932,7 @@ static void mlx5e_init_rep(struct mlx5_core_dev *mdev,
931932

932933
priv->channels.params.num_channels = profile->max_nch(mdev);
933934

934-
mlx5e_build_rep_params(mdev, &priv->channels.params);
935+
mlx5e_build_rep_params(mdev, &priv->channels.params, netdev->mtu);
935936
mlx5e_build_rep_netdev(netdev);
936937

937938
mlx5e_timestamp_init(priv);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static int mlx5e_test_loopback(struct mlx5e_priv *priv)
290290

291291
if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
292292
netdev_err(priv->netdev,
293-
"\tCan't perform loobpack test while device is down\n");
293+
"\tCan't perform loopback test while device is down\n");
294294
return -ENODEV;
295295
}
296296

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,8 @@ static bool modify_header_match_supported(struct mlx5_flow_spec *spec,
18641864
}
18651865

18661866
ip_proto = MLX5_GET(fte_match_set_lyr_2_4, headers_v, ip_protocol);
1867-
if (modify_ip_header && ip_proto != IPPROTO_TCP && ip_proto != IPPROTO_UDP) {
1867+
if (modify_ip_header && ip_proto != IPPROTO_TCP &&
1868+
ip_proto != IPPROTO_UDP && ip_proto != IPPROTO_ICMP) {
18681869
pr_info("can't offload re-write of ip proto %d\n", ip_proto);
18691870
return false;
18701871
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ mlx5e_txwqe_build_dsegs(struct mlx5e_txqsq *sq, struct sk_buff *skb,
255255
dma_addr = dma_map_single(sq->pdev, skb_data, headlen,
256256
DMA_TO_DEVICE);
257257
if (unlikely(dma_mapping_error(sq->pdev, dma_addr)))
258-
return -ENOMEM;
258+
goto dma_unmap_wqe_err;
259259

260260
dseg->addr = cpu_to_be64(dma_addr);
261261
dseg->lkey = sq->mkey_be;
@@ -273,7 +273,7 @@ mlx5e_txwqe_build_dsegs(struct mlx5e_txqsq *sq, struct sk_buff *skb,
273273
dma_addr = skb_frag_dma_map(sq->pdev, frag, 0, fsz,
274274
DMA_TO_DEVICE);
275275
if (unlikely(dma_mapping_error(sq->pdev, dma_addr)))
276-
return -ENOMEM;
276+
goto dma_unmap_wqe_err;
277277

278278
dseg->addr = cpu_to_be64(dma_addr);
279279
dseg->lkey = sq->mkey_be;
@@ -285,6 +285,10 @@ mlx5e_txwqe_build_dsegs(struct mlx5e_txqsq *sq, struct sk_buff *skb,
285285
}
286286

287287
return num_dma;
288+
289+
dma_unmap_wqe_err:
290+
mlx5e_dma_unmap_wqe_err(sq, num_dma);
291+
return -ENOMEM;
288292
}
289293

290294
static inline void
@@ -380,17 +384,15 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
380384
num_dma = mlx5e_txwqe_build_dsegs(sq, skb, skb_data, headlen,
381385
(struct mlx5_wqe_data_seg *)cseg + ds_cnt);
382386
if (unlikely(num_dma < 0))
383-
goto dma_unmap_wqe_err;
387+
goto err_drop;
384388

385389
mlx5e_txwqe_complete(sq, skb, opcode, ds_cnt + num_dma,
386390
num_bytes, num_dma, wi, cseg);
387391

388392
return NETDEV_TX_OK;
389393

390-
dma_unmap_wqe_err:
394+
err_drop:
391395
sq->stats.dropped++;
392-
mlx5e_dma_unmap_wqe_err(sq, wi->num_dma);
393-
394396
dev_kfree_skb_any(skb);
395397

396398
return NETDEV_TX_OK;
@@ -645,17 +647,15 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
645647
num_dma = mlx5e_txwqe_build_dsegs(sq, skb, skb_data, headlen,
646648
(struct mlx5_wqe_data_seg *)cseg + ds_cnt);
647649
if (unlikely(num_dma < 0))
648-
goto dma_unmap_wqe_err;
650+
goto err_drop;
649651

650652
mlx5e_txwqe_complete(sq, skb, opcode, ds_cnt + num_dma,
651653
num_bytes, num_dma, wi, cseg);
652654

653655
return NETDEV_TX_OK;
654656

655-
dma_unmap_wqe_err:
657+
err_drop:
656658
sq->stats.dropped++;
657-
mlx5e_dma_unmap_wqe_err(sq, wi->num_dma);
658-
659659
dev_kfree_skb_any(skb);
660660

661661
return NETDEV_TX_OK;

0 commit comments

Comments
 (0)