Skip to content

Commit 0723090

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Handle stations tied to AP_VLANs properly during mac80211 hw reconfig. From Manikanta Pubbisetty. 2) Fix jump stack depth validation in nf_tables, from Taehee Yoo. 3) Fix quota handling in aRFS flow expiration of mlx5 driver, from Eran Ben Elisha. 4) Exit path handling fix in powerpc64 BPF JIT, from Daniel Borkmann. 5) Use ptr_ring_consume_bh() in page pool code, from Tariq Toukan. 6) Fix cached netdev name leak in nf_tables, from Florian Westphal. 7) Fix memory leaks on chain rename, also from Florian Westphal. 8) Several fixes to DCTCP congestion control ACK handling, from Yuchunk Cheng. 9) Missing rcu_read_unlock() in CAIF protocol code, from Yue Haibing. 10) Fix link local address handling with VRF, from David Ahern. 11) Don't clobber 'err' on a successful call to __skb_linearize() in skb_segment(). From Eric Dumazet. 12) Fix vxlan fdb notification races, from Roopa Prabhu. 13) Hash UDP fragments consistently, from Paolo Abeni. 14) If TCP receives lots of out of order tiny packets, we do really silly stuff. Make the out-of-order queue ending more robust to this kind of behavior, from Eric Dumazet. 15) Don't leak netlink dump state in nf_tables, from Florian Westphal. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (76 commits) net: axienet: Fix double deregister of mdio qmi_wwan: fix interface number for DW5821e production firmware ip: in cmsg IP(V6)_ORIGDSTADDR call pskb_may_pull bnx2x: Fix invalid memory access in rss hash config path. net/mlx4_core: Save the qpn from the input modifier in RST2INIT wrapper r8169: restore previous behavior to accept BIOS WoL settings cfg80211: never ignore user regulatory hint sock: fix sg page frag coalescing in sk_alloc_sg netfilter: nf_tables: move dumper state allocation into ->start tcp: add tcp_ooo_try_coalesce() helper tcp: call tcp_drop() from tcp_data_queue_ofo() tcp: detect malicious patterns in tcp_collapse_ofo_queue() tcp: avoid collapses in tcp_prune_queue() if possible tcp: free batches of packets in tcp_prune_ofo_queue() ip: hash fragments consistently ipv6: use fib6_info_hold_safe() when necessary can: xilinx_can: fix power management handling can: xilinx_can: fix incorrect clear of non-processed interrupts can: xilinx_can: fix RX overflow interrupt not being enabled can: xilinx_can: keep only 1-2 frames in TX FIFO to fix TX accounting ...
2 parents f89ed2f + 03bc7ca commit 0723090

Some content is hidden

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

75 files changed

+1029
-562
lines changed

arch/powerpc/net/bpf_jit_comp64.c

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
286286
u64 imm64;
287287
u8 *func;
288288
u32 true_cond;
289+
u32 tmp_idx;
289290

290291
/*
291292
* addrs[] maps a BPF bytecode address into a real offset from
@@ -637,44 +638,24 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
637638
case BPF_STX | BPF_XADD | BPF_W:
638639
/* Get EA into TMP_REG_1 */
639640
PPC_ADDI(b2p[TMP_REG_1], dst_reg, off);
640-
/* error if EA is not word-aligned */
641-
PPC_ANDI(b2p[TMP_REG_2], b2p[TMP_REG_1], 0x03);
642-
PPC_BCC_SHORT(COND_EQ, (ctx->idx * 4) + 12);
643-
PPC_LI(b2p[BPF_REG_0], 0);
644-
PPC_JMP(exit_addr);
641+
tmp_idx = ctx->idx * 4;
645642
/* load value from memory into TMP_REG_2 */
646643
PPC_BPF_LWARX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1], 0);
647644
/* add value from src_reg into this */
648645
PPC_ADD(b2p[TMP_REG_2], b2p[TMP_REG_2], src_reg);
649646
/* store result back */
650647
PPC_BPF_STWCX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1]);
651648
/* we're done if this succeeded */
652-
PPC_BCC_SHORT(COND_EQ, (ctx->idx * 4) + (7*4));
653-
/* otherwise, let's try once more */
654-
PPC_BPF_LWARX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1], 0);
655-
PPC_ADD(b2p[TMP_REG_2], b2p[TMP_REG_2], src_reg);
656-
PPC_BPF_STWCX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1]);
657-
/* exit if the store was not successful */
658-
PPC_LI(b2p[BPF_REG_0], 0);
659-
PPC_BCC(COND_NE, exit_addr);
649+
PPC_BCC_SHORT(COND_NE, tmp_idx);
660650
break;
661651
/* *(u64 *)(dst + off) += src */
662652
case BPF_STX | BPF_XADD | BPF_DW:
663653
PPC_ADDI(b2p[TMP_REG_1], dst_reg, off);
664-
/* error if EA is not doubleword-aligned */
665-
PPC_ANDI(b2p[TMP_REG_2], b2p[TMP_REG_1], 0x07);
666-
PPC_BCC_SHORT(COND_EQ, (ctx->idx * 4) + (3*4));
667-
PPC_LI(b2p[BPF_REG_0], 0);
668-
PPC_JMP(exit_addr);
669-
PPC_BPF_LDARX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1], 0);
670-
PPC_ADD(b2p[TMP_REG_2], b2p[TMP_REG_2], src_reg);
671-
PPC_BPF_STDCX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1]);
672-
PPC_BCC_SHORT(COND_EQ, (ctx->idx * 4) + (7*4));
654+
tmp_idx = ctx->idx * 4;
673655
PPC_BPF_LDARX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1], 0);
674656
PPC_ADD(b2p[TMP_REG_2], b2p[TMP_REG_2], src_reg);
675657
PPC_BPF_STDCX(b2p[TMP_REG_2], 0, b2p[TMP_REG_1]);
676-
PPC_LI(b2p[BPF_REG_0], 0);
677-
PPC_BCC(COND_NE, exit_addr);
658+
PPC_BCC_SHORT(COND_NE, tmp_idx);
678659
break;
679660

680661
/*

drivers/net/bonding/bond_options.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -743,15 +743,20 @@ const struct bond_option *bond_opt_get(unsigned int option)
743743
static int bond_option_mode_set(struct bonding *bond,
744744
const struct bond_opt_value *newval)
745745
{
746-
if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) {
747-
netdev_dbg(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n",
748-
newval->string);
749-
/* disable arp monitoring */
750-
bond->params.arp_interval = 0;
751-
/* set miimon to default value */
752-
bond->params.miimon = BOND_DEFAULT_MIIMON;
753-
netdev_dbg(bond->dev, "Setting MII monitoring interval to %d\n",
754-
bond->params.miimon);
746+
if (!bond_mode_uses_arp(newval->value)) {
747+
if (bond->params.arp_interval) {
748+
netdev_dbg(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n",
749+
newval->string);
750+
/* disable arp monitoring */
751+
bond->params.arp_interval = 0;
752+
}
753+
754+
if (!bond->params.miimon) {
755+
/* set miimon to default value */
756+
bond->params.miimon = BOND_DEFAULT_MIIMON;
757+
netdev_dbg(bond->dev, "Setting MII monitoring interval to %d\n",
758+
bond->params.miimon);
759+
}
755760
}
756761

757762
if (newval->value == BOND_MODE_ALB)

drivers/net/can/m_can/m_can.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,12 @@ static int m_can_clk_start(struct m_can_priv *priv)
634634
int err;
635635

636636
err = pm_runtime_get_sync(priv->device);
637-
if (err)
637+
if (err < 0) {
638638
pm_runtime_put_noidle(priv->device);
639+
return err;
640+
}
639641

640-
return err;
642+
return 0;
641643
}
642644

643645
static void m_can_clk_stop(struct m_can_priv *priv)
@@ -1109,7 +1111,8 @@ static void m_can_chip_config(struct net_device *dev)
11091111

11101112
} else {
11111113
/* Version 3.1.x or 3.2.x */
1112-
cccr &= ~(CCCR_TEST | CCCR_MON | CCCR_BRSE | CCCR_FDOE);
1114+
cccr &= ~(CCCR_TEST | CCCR_MON | CCCR_BRSE | CCCR_FDOE |
1115+
CCCR_NISO);
11131116

11141117
/* Only 3.2.x has NISO Bit implemented */
11151118
if (priv->can.ctrlmode & CAN_CTRLMODE_FD_NON_ISO)
@@ -1642,8 +1645,6 @@ static int m_can_plat_probe(struct platform_device *pdev)
16421645
priv->can.clock.freq = clk_get_rate(cclk);
16431646
priv->mram_base = mram_addr;
16441647

1645-
m_can_of_parse_mram(priv, mram_config_vals);
1646-
16471648
platform_set_drvdata(pdev, dev);
16481649
SET_NETDEV_DEV(dev, &pdev->dev);
16491650

@@ -1666,6 +1667,8 @@ static int m_can_plat_probe(struct platform_device *pdev)
16661667
goto clk_disable;
16671668
}
16681669

1670+
m_can_of_parse_mram(priv, mram_config_vals);
1671+
16691672
devm_can_led_init(dev);
16701673

16711674
of_can_transceiver(dev);
@@ -1687,8 +1690,6 @@ static int m_can_plat_probe(struct platform_device *pdev)
16871690
return ret;
16881691
}
16891692

1690-
/* TODO: runtime PM with power down or sleep mode */
1691-
16921693
static __maybe_unused int m_can_suspend(struct device *dev)
16931694
{
16941695
struct net_device *ndev = dev_get_drvdata(dev);
@@ -1715,8 +1716,6 @@ static __maybe_unused int m_can_resume(struct device *dev)
17151716

17161717
pinctrl_pm_select_default_state(dev);
17171718

1718-
m_can_init_ram(priv);
1719-
17201719
priv->can.state = CAN_STATE_ERROR_ACTIVE;
17211720

17221721
if (netif_running(ndev)) {
@@ -1726,6 +1725,7 @@ static __maybe_unused int m_can_resume(struct device *dev)
17261725
if (ret)
17271726
return ret;
17281727

1728+
m_can_init_ram(priv);
17291729
m_can_start(ndev);
17301730
netif_device_attach(ndev);
17311731
netif_start_queue(ndev);

drivers/net/can/mscan/mpc5xxx_can.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ static u32 mpc52xx_can_get_clock(struct platform_device *ofdev,
8686
return 0;
8787
}
8888
cdm = of_iomap(np_cdm, 0);
89+
if (!cdm) {
90+
of_node_put(np_cdm);
91+
dev_err(&ofdev->dev, "can't map clock node!\n");
92+
return 0;
93+
}
8994

9095
if (in_8(&cdm->ipb_clk_sel) & 0x1)
9196
freq *= 2;

drivers/net/can/peak_canfd/peak_pciefd_main.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ MODULE_LICENSE("GPL v2");
5858
#define PCIEFD_REG_SYS_VER1 0x0040 /* version reg #1 */
5959
#define PCIEFD_REG_SYS_VER2 0x0044 /* version reg #2 */
6060

61+
#define PCIEFD_FW_VERSION(x, y, z) (((u32)(x) << 24) | \
62+
((u32)(y) << 16) | \
63+
((u32)(z) << 8))
64+
6165
/* System Control Registers Bits */
6266
#define PCIEFD_SYS_CTL_TS_RST 0x00000001 /* timestamp clock */
6367
#define PCIEFD_SYS_CTL_CLK_EN 0x00000002 /* system clock */
@@ -782,6 +786,21 @@ static int peak_pciefd_probe(struct pci_dev *pdev,
782786
"%ux CAN-FD PCAN-PCIe FPGA v%u.%u.%u:\n", can_count,
783787
hw_ver_major, hw_ver_minor, hw_ver_sub);
784788

789+
#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
790+
/* FW < v3.3.0 DMA logic doesn't handle correctly the mix of 32-bit and
791+
* 64-bit logical addresses: this workaround forces usage of 32-bit
792+
* DMA addresses only when such a fw is detected.
793+
*/
794+
if (PCIEFD_FW_VERSION(hw_ver_major, hw_ver_minor, hw_ver_sub) <
795+
PCIEFD_FW_VERSION(3, 3, 0)) {
796+
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
797+
if (err)
798+
dev_warn(&pdev->dev,
799+
"warning: can't set DMA mask %llxh (err %d)\n",
800+
DMA_BIT_MASK(32), err);
801+
}
802+
#endif
803+
785804
/* stop system clock */
786805
pciefd_sys_writereg(pciefd, PCIEFD_SYS_CTL_CLK_EN,
787806
PCIEFD_REG_SYS_CTL_CLR);

0 commit comments

Comments
 (0)