Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'net-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Paolo Abeni:
"Including fixes from bpf, WiFi and netfilter.

Current release - regressions:

- ipv6: fix address dump when IPv6 is disabled on an interface

Current release - new code bugs:

- bpf: temporarily disable atomic operations in BPF arena

- nexthop: fix uninitialized variable in nla_put_nh_group_stats()

Previous releases - regressions:

- bpf: protect against int overflow for stack access size

- hsr: fix the promiscuous mode in offload mode

- wifi: don't always use FW dump trig

- tls: adjust recv return with async crypto and failed copy to
userspace

- tcp: properly terminate timers for kernel sockets

- ice: fix memory corruption bug with suspend and rebuild

- at803x: fix kernel panic with at8031_probe

- qeth: handle deferred cc1

Previous releases - always broken:

- bpf: fix bug in BPF_LDX_MEMSX

- netfilter: reject table flag and netdev basechain updates

- inet_defrag: prevent sk release while still in use

- wifi: pick the version of SESSION_PROTECTION_NOTIF

- wwan: t7xx: split 64bit accesses to fix alignment issues

- mlxbf_gige: call request_irq() after NAPI initialized

- hns3: fix kernel crash when devlink reload during pf
initialization"

* tag 'net-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (81 commits)
inet: inet_defrag: prevent sk release while still in use
Octeontx2-af: fix pause frame configuration in GMP mode
net: lan743x: Add set RFE read fifo threshold for PCI1x1x chips
net: bcmasp: Remove phy_{suspend/resume}
net: bcmasp: Bring up unimac after PHY link up
net: phy: qcom: at803x: fix kernel panic with at8031_probe
netfilter: arptables: Select NETFILTER_FAMILY_ARP when building arp_tables.c
netfilter: nf_tables: skip netdev hook unregistration if table is dormant
netfilter: nf_tables: reject table flag and netdev basechain updates
netfilter: nf_tables: reject destroy command to remove basechain hooks
bpf: update BPF LSM designated reviewer list
bpf: Protect against int overflow for stack access size
bpf: Check bloom filter map value size
bpf: fix warning for crash_kexec
selftests: netdevsim: set test timeout to 10 minutes
net: wan: framer: Add missing static inline qualifiers
mlxbf_gige: call request_irq() after NAPI initialized
tls: get psock ref after taking rxlock to avoid leak
selftests: tls: add test with a partially invalid iov
tls: adjust recv return with async crypto and failed copy to userspace
...

+865 -337
+2 -1
.mailmap
··· 498 498 Punit Agrawal <punitagrawal@gmail.com> <punit.agrawal@arm.com> 499 499 Qais Yousef <qyousef@layalina.io> <qais.yousef@imgtec.com> 500 500 Qais Yousef <qyousef@layalina.io> <qais.yousef@arm.com> 501 - Quentin Monnet <quentin@isovalent.com> <quentin.monnet@netronome.com> 501 + Quentin Monnet <qmo@kernel.org> <quentin.monnet@netronome.com> 502 + Quentin Monnet <qmo@kernel.org> <quentin@isovalent.com> 502 503 Quentin Perret <qperret@qperret.net> <quentin.perret@arm.com> 503 504 Rafael J. Wysocki <rjw@rjwysocki.net> <rjw@sisk.pl> 504 505 Rajeev Nandan <quic_rajeevny@quicinc.com> <rajeevny@codeaurora.org>
+33 -7
MAINTAINERS
··· 3942 3942 3943 3943 BPF [SECURITY & LSM] (Security Audit and Enforcement using BPF) 3944 3944 M: KP Singh <kpsingh@kernel.org> 3945 - R: Florent Revest <revest@chromium.org> 3946 - R: Brendan Jackman <jackmanb@chromium.org> 3945 + R: Matt Bobrowski <mattbobrowski@google.com> 3947 3946 L: bpf@vger.kernel.org 3948 3947 S: Maintained 3949 3948 F: Documentation/bpf/prog_lsm.rst ··· 3967 3968 F: kernel/bpf/cgroup.c 3968 3969 3969 3970 BPF [TOOLING] (bpftool) 3970 - M: Quentin Monnet <quentin@isovalent.com> 3971 + M: Quentin Monnet <qmo@kernel.org> 3971 3972 L: bpf@vger.kernel.org 3972 3973 S: Maintained 3973 3974 F: kernel/bpf/disasm.* ··· 13133 13134 13134 13135 MARVELL MWIFIEX WIRELESS DRIVER 13135 13136 M: Brian Norris <briannorris@chromium.org> 13137 + R: Francesco Dolcini <francesco@dolcini.it> 13136 13138 L: linux-wireless@vger.kernel.org 13137 13139 S: Odd Fixes 13138 13140 F: drivers/net/wireless/marvell/mwifiex/ ··· 18645 18645 M: Ping-Ke Shih <pkshih@realtek.com> 18646 18646 L: linux-wireless@vger.kernel.org 18647 18647 S: Maintained 18648 + T: git https://github.com/pkshih/rtw.git 18648 18649 F: drivers/net/wireless/realtek/rtlwifi/ 18649 18650 18650 18651 REALTEK WIRELESS DRIVER (rtw88) 18651 18652 M: Ping-Ke Shih <pkshih@realtek.com> 18652 18653 L: linux-wireless@vger.kernel.org 18653 18654 S: Maintained 18655 + T: git https://github.com/pkshih/rtw.git 18654 18656 F: drivers/net/wireless/realtek/rtw88/ 18655 18657 18656 18658 REALTEK WIRELESS DRIVER (rtw89) 18657 18659 M: Ping-Ke Shih <pkshih@realtek.com> 18658 18660 L: linux-wireless@vger.kernel.org 18659 18661 S: Maintained 18662 + T: git https://github.com/pkshih/rtw.git 18660 18663 F: drivers/net/wireless/realtek/rtw89/ 18661 18664 18662 18665 REDPINE WIRELESS DRIVER ··· 18730 18727 F: Documentation/devicetree/bindings/i2c/renesas,iic-emev2.yaml 18731 18728 F: drivers/i2c/busses/i2c-emev2.c 18732 18729 18733 - RENESAS ETHERNET DRIVERS 18730 + RENESAS ETHERNET AVB DRIVER 18734 18731 R: Sergey Shtylyov <s.shtylyov@omp.ru> 18735 18732 L: netdev@vger.kernel.org 18736 18733 L: linux-renesas-soc@vger.kernel.org 18737 - F: Documentation/devicetree/bindings/net/renesas,*.yaml 18738 - F: drivers/net/ethernet/renesas/ 18739 - F: include/linux/sh_eth.h 18734 + F: Documentation/devicetree/bindings/net/renesas,etheravb.yaml 18735 + F: drivers/net/ethernet/renesas/Kconfig 18736 + F: drivers/net/ethernet/renesas/Makefile 18737 + F: drivers/net/ethernet/renesas/ravb* 18738 + 18739 + RENESAS ETHERNET SWITCH DRIVER 18740 + R: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> 18741 + L: netdev@vger.kernel.org 18742 + L: linux-renesas-soc@vger.kernel.org 18743 + F: Documentation/devicetree/bindings/net/renesas,*ether-switch.yaml 18744 + F: drivers/net/ethernet/renesas/Kconfig 18745 + F: drivers/net/ethernet/renesas/Makefile 18746 + F: drivers/net/ethernet/renesas/rcar_gen4* 18747 + F: drivers/net/ethernet/renesas/rswitch* 18740 18748 18741 18749 RENESAS IDT821034 ASoC CODEC 18742 18750 M: Herve Codina <herve.codina@bootlin.com> ··· 18856 18842 S: Supported 18857 18843 F: Documentation/devicetree/bindings/i2c/renesas,rzv2m.yaml 18858 18844 F: drivers/i2c/busses/i2c-rzv2m.c 18845 + 18846 + RENESAS SUPERH ETHERNET DRIVER 18847 + R: Sergey Shtylyov <s.shtylyov@omp.ru> 18848 + L: netdev@vger.kernel.org 18849 + L: linux-renesas-soc@vger.kernel.org 18850 + F: Documentation/devicetree/bindings/net/renesas,ether.yaml 18851 + F: drivers/net/ethernet/renesas/Kconfig 18852 + F: drivers/net/ethernet/renesas/Makefile 18853 + F: drivers/net/ethernet/renesas/sh_eth* 18854 + F: include/linux/sh_eth.h 18859 18855 18860 18856 RENESAS USB PHY DRIVER 18861 18857 M: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> ··· 19203 19179 M: Larry Finger <Larry.Finger@lwfinger.net> 19204 19180 L: linux-wireless@vger.kernel.org 19205 19181 S: Maintained 19182 + T: git https://github.com/pkshih/rtw.git 19206 19183 F: drivers/net/wireless/realtek/rtl818x/rtl8187/ 19207 19184 19208 19185 RTL8XXXU WIRELESS DRIVER (rtl8xxxu) 19209 19186 M: Jes Sorensen <Jes.Sorensen@gmail.com> 19210 19187 L: linux-wireless@vger.kernel.org 19211 19188 S: Maintained 19189 + T: git https://github.com/pkshih/rtw.git 19212 19190 F: drivers/net/wireless/realtek/rtl8xxxu/ 19213 19191 19214 19192 RTRS TRANSPORT DRIVERS
+2 -2
arch/arm64/net/bpf_jit_comp.c
··· 943 943 emit(A64_UXTH(is64, dst, dst), ctx); 944 944 break; 945 945 case 32: 946 - emit(A64_REV32(is64, dst, dst), ctx); 946 + emit(A64_REV32(0, dst, dst), ctx); 947 947 /* upper 32 bits already cleared */ 948 948 break; 949 949 case 64: ··· 1256 1256 } else { 1257 1257 emit_a64_mov_i(1, tmp, off, ctx); 1258 1258 if (sign_extend) 1259 - emit(A64_LDRSW(dst, src_adj, off_adj), ctx); 1259 + emit(A64_LDRSW(dst, src, tmp), ctx); 1260 1260 else 1261 1261 emit(A64_LDR32(dst, src, tmp), ctx); 1262 1262 }
+16
arch/riscv/net/bpf_jit_comp64.c
··· 1463 1463 if (ret < 0) 1464 1464 return ret; 1465 1465 1466 + if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) { 1467 + const struct btf_func_model *fm; 1468 + int idx; 1469 + 1470 + fm = bpf_jit_find_kfunc_model(ctx->prog, insn); 1471 + if (!fm) 1472 + return -EINVAL; 1473 + 1474 + for (idx = 0; idx < fm->nr_args; idx++) { 1475 + u8 reg = bpf_to_rv_reg(BPF_REG_1 + idx, ctx); 1476 + 1477 + if (fm->arg_size[idx] == sizeof(int)) 1478 + emit_sextw(reg, reg, ctx); 1479 + } 1480 + } 1481 + 1466 1482 ret = emit_call(addr, fixed_addr, ctx); 1467 1483 if (ret) 1468 1484 return ret;
+20 -26
arch/s390/net/bpf_jit_comp.c
··· 516 516 * PLT for hotpatchable calls. The calling convention is the same as for the 517 517 * ftrace hotpatch trampolines: %r0 is return address, %r1 is clobbered. 518 518 */ 519 - extern const char bpf_plt[]; 520 - extern const char bpf_plt_ret[]; 521 - extern const char bpf_plt_target[]; 522 - extern const char bpf_plt_end[]; 523 - #define BPF_PLT_SIZE 32 519 + struct bpf_plt { 520 + char code[16]; 521 + void *ret; 522 + void *target; 523 + } __packed; 524 + extern const struct bpf_plt bpf_plt; 524 525 asm( 525 526 ".pushsection .rodata\n" 526 527 " .balign 8\n" ··· 532 531 " .balign 8\n" 533 532 "bpf_plt_ret: .quad 0\n" 534 533 "bpf_plt_target: .quad 0\n" 535 - "bpf_plt_end:\n" 536 534 " .popsection\n" 537 535 ); 538 536 539 - static void bpf_jit_plt(void *plt, void *ret, void *target) 537 + static void bpf_jit_plt(struct bpf_plt *plt, void *ret, void *target) 540 538 { 541 - memcpy(plt, bpf_plt, BPF_PLT_SIZE); 542 - *(void **)((char *)plt + (bpf_plt_ret - bpf_plt)) = ret; 543 - *(void **)((char *)plt + (bpf_plt_target - bpf_plt)) = target ?: ret; 539 + memcpy(plt, &bpf_plt, sizeof(*plt)); 540 + plt->ret = ret; 541 + plt->target = target; 544 542 } 545 543 546 544 /* ··· 662 662 jit->prg = ALIGN(jit->prg, 8); 663 663 jit->prologue_plt = jit->prg; 664 664 if (jit->prg_buf) 665 - bpf_jit_plt(jit->prg_buf + jit->prg, 665 + bpf_jit_plt((struct bpf_plt *)(jit->prg_buf + jit->prg), 666 666 jit->prg_buf + jit->prologue_plt_ret, NULL); 667 - jit->prg += BPF_PLT_SIZE; 667 + jit->prg += sizeof(struct bpf_plt); 668 668 } 669 669 670 670 static int get_probe_mem_regno(const u8 *insn) ··· 2040 2040 struct bpf_jit jit; 2041 2041 int pass; 2042 2042 2043 - if (WARN_ON_ONCE(bpf_plt_end - bpf_plt != BPF_PLT_SIZE)) 2044 - return orig_fp; 2045 - 2046 2043 if (!fp->jit_requested) 2047 2044 return orig_fp; 2048 2045 ··· 2145 2148 int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t, 2146 2149 void *old_addr, void *new_addr) 2147 2150 { 2151 + struct bpf_plt expected_plt, current_plt, new_plt, *plt; 2148 2152 struct { 2149 2153 u16 opc; 2150 2154 s32 disp; 2151 2155 } __packed insn; 2152 - char expected_plt[BPF_PLT_SIZE]; 2153 - char current_plt[BPF_PLT_SIZE]; 2154 - char new_plt[BPF_PLT_SIZE]; 2155 - char *plt; 2156 2156 char *ret; 2157 2157 int err; 2158 2158 ··· 2168 2174 */ 2169 2175 } else { 2170 2176 /* Verify the PLT. */ 2171 - plt = (char *)ip + (insn.disp << 1); 2172 - err = copy_from_kernel_nofault(current_plt, plt, BPF_PLT_SIZE); 2177 + plt = ip + (insn.disp << 1); 2178 + err = copy_from_kernel_nofault(&current_plt, plt, 2179 + sizeof(current_plt)); 2173 2180 if (err < 0) 2174 2181 return err; 2175 2182 ret = (char *)ip + 6; 2176 - bpf_jit_plt(expected_plt, ret, old_addr); 2177 - if (memcmp(current_plt, expected_plt, BPF_PLT_SIZE)) 2183 + bpf_jit_plt(&expected_plt, ret, old_addr); 2184 + if (memcmp(&current_plt, &expected_plt, sizeof(current_plt))) 2178 2185 return -EINVAL; 2179 2186 /* Adjust the call address. */ 2180 - bpf_jit_plt(new_plt, ret, new_addr); 2181 - s390_kernel_write(plt + (bpf_plt_target - bpf_plt), 2182 - new_plt + (bpf_plt_target - bpf_plt), 2187 + bpf_jit_plt(&new_plt, ret, new_addr); 2188 + s390_kernel_write(&plt->target, &new_plt.target, 2183 2189 sizeof(void *)); 2184 2190 } 2185 2191
+1 -1
drivers/dpll/Kconfig
··· 4 4 # 5 5 6 6 config DPLL 7 - bool 7 + bool
+3 -2
drivers/net/dsa/mt7530.c
··· 2268 2268 SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST | 2269 2269 SYS_CTRL_REG_RST); 2270 2270 2271 - mt7530_pll_setup(priv); 2272 - 2273 2271 /* Lower Tx driving for TRGMII path */ 2274 2272 for (i = 0; i < NUM_TRGMII_CTRL; i++) 2275 2273 mt7530_write(priv, MT7530_TRGMII_TD_ODT(i), ··· 2282 2284 val &= ~MHWTRAP_P6_DIS & ~MHWTRAP_PHY_ACCESS; 2283 2285 val |= MHWTRAP_MANUAL; 2284 2286 mt7530_write(priv, MT7530_MHWTRAP, val); 2287 + 2288 + if ((val & HWTRAP_XTAL_MASK) == HWTRAP_XTAL_40MHZ) 2289 + mt7530_pll_setup(priv); 2285 2290 2286 2291 mt753x_trap_frames(priv); 2287 2292
+20 -23
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
··· 392 392 umac_wl(intf, 0x0, UMC_CMD); 393 393 umac_wl(intf, UMC_CMD_SW_RESET, UMC_CMD); 394 394 usleep_range(10, 100); 395 - umac_wl(intf, 0x0, UMC_CMD); 395 + /* We hold the umac in reset and bring it out of 396 + * reset when phy link is up. 397 + */ 396 398 } 397 399 398 400 static void umac_set_hw_addr(struct bcmasp_intf *intf, ··· 414 412 u32 reg; 415 413 416 414 reg = umac_rl(intf, UMC_CMD); 415 + if (reg & UMC_CMD_SW_RESET) 416 + return; 417 417 if (enable) 418 418 reg |= mask; 419 419 else ··· 434 430 umac_wl(intf, 0x800, UMC_FRM_LEN); 435 431 umac_wl(intf, 0xffff, UMC_PAUSE_CNTRL); 436 432 umac_wl(intf, 0x800, UMC_RX_MAX_PKT_SZ); 437 - umac_enable_set(intf, UMC_CMD_PROMISC, 1); 438 433 } 439 434 440 435 static int bcmasp_tx_poll(struct napi_struct *napi, int budget) ··· 661 658 UMC_CMD_HD_EN | UMC_CMD_RX_PAUSE_IGNORE | 662 659 UMC_CMD_TX_PAUSE_IGNORE); 663 660 reg |= cmd_bits; 661 + if (reg & UMC_CMD_SW_RESET) { 662 + reg &= ~UMC_CMD_SW_RESET; 663 + umac_wl(intf, reg, UMC_CMD); 664 + udelay(2); 665 + reg |= UMC_CMD_TX_EN | UMC_CMD_RX_EN | UMC_CMD_PROMISC; 666 + } 664 667 umac_wl(intf, reg, UMC_CMD); 665 668 666 669 active = phy_init_eee(phydev, 0) >= 0; ··· 1044 1035 1045 1036 /* Indicate that the MAC is responsible for PHY PM */ 1046 1037 phydev->mac_managed_pm = true; 1047 - } else if (!intf->wolopts) { 1048 - ret = phy_resume(dev->phydev); 1049 - if (ret) 1050 - goto err_phy_disable; 1051 1038 } 1052 1039 1053 1040 umac_reset(intf); 1054 1041 1055 1042 umac_init(intf); 1056 - 1057 - /* Disable the UniMAC RX/TX */ 1058 - umac_enable_set(intf, (UMC_CMD_RX_EN | UMC_CMD_TX_EN), 0); 1059 1043 1060 1044 umac_set_hw_addr(intf, dev->dev_addr); 1061 1045 ··· 1063 1061 bcmasp_init_rx(intf); 1064 1062 netif_napi_add(intf->ndev, &intf->rx_napi, bcmasp_rx_poll); 1065 1063 bcmasp_enable_rx(intf, 1); 1066 - 1067 - /* Turn on UniMAC TX/RX */ 1068 - umac_enable_set(intf, (UMC_CMD_RX_EN | UMC_CMD_TX_EN), 1); 1069 1064 1070 1065 intf->crc_fwd = !!(umac_rl(intf, UMC_CMD) & UMC_CMD_CRC_FWD); 1071 1066 ··· 1305 1306 if (intf->wolopts & WAKE_FILTER) 1306 1307 bcmasp_netfilt_suspend(intf); 1307 1308 1308 - /* UniMAC receive needs to be turned on */ 1309 + /* Bring UniMAC out of reset if needed and enable RX */ 1310 + reg = umac_rl(intf, UMC_CMD); 1311 + if (reg & UMC_CMD_SW_RESET) 1312 + reg &= ~UMC_CMD_SW_RESET; 1313 + 1314 + reg |= UMC_CMD_RX_EN | UMC_CMD_PROMISC; 1315 + umac_wl(intf, reg, UMC_CMD); 1316 + 1309 1317 umac_enable_set(intf, UMC_CMD_RX_EN, 1); 1310 1318 1311 1319 if (intf->parent->wol_irq > 0) { ··· 1330 1324 { 1331 1325 struct device *kdev = &intf->parent->pdev->dev; 1332 1326 struct net_device *dev = intf->ndev; 1333 - int ret = 0; 1334 1327 1335 1328 if (!netif_running(dev)) 1336 1329 return 0; ··· 1339 1334 bcmasp_netif_deinit(dev); 1340 1335 1341 1336 if (!intf->wolopts) { 1342 - ret = phy_suspend(dev->phydev); 1343 - if (ret) 1344 - goto out; 1345 - 1346 1337 if (intf->internal_phy) 1347 1338 bcmasp_ephy_enable_set(intf, false); 1348 1339 else ··· 1355 1354 1356 1355 clk_disable_unprepare(intf->parent->clk); 1357 1356 1358 - return ret; 1359 - 1360 - out: 1361 - bcmasp_netif_init(dev, false); 1362 - return ret; 1357 + return 0; 1363 1358 } 1364 1359 1365 1360 static void bcmasp_resume_from_wol(struct bcmasp_intf *intf)
+1 -1
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
··· 85 85 hclge_comm_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_TX_STATS, 86 86 true); 87 87 88 - desc.data[0] = cpu_to_le32(tqp->index & 0x1ff); 88 + desc.data[0] = cpu_to_le32(tqp->index); 89 89 ret = hclge_comm_cmd_send(hw, &desc, 1); 90 90 if (ret) { 91 91 dev_err(&hw->cmq.csq.pdev->dev,
+17 -2
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
··· 78 78 #define HNS3_NIC_LB_TEST_NO_MEM_ERR 1 79 79 #define HNS3_NIC_LB_TEST_TX_CNT_ERR 2 80 80 #define HNS3_NIC_LB_TEST_RX_CNT_ERR 3 81 + #define HNS3_NIC_LB_TEST_UNEXECUTED 4 82 + 83 + static int hns3_get_sset_count(struct net_device *netdev, int stringset); 81 84 82 85 static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en) 83 86 { ··· 421 418 static void hns3_self_test(struct net_device *ndev, 422 419 struct ethtool_test *eth_test, u64 *data) 423 420 { 421 + int cnt = hns3_get_sset_count(ndev, ETH_SS_TEST); 424 422 struct hns3_nic_priv *priv = netdev_priv(ndev); 425 423 struct hnae3_handle *h = priv->ae_handle; 426 424 int st_param[HNAE3_LOOP_NONE][2]; 427 425 bool if_running = netif_running(ndev); 426 + int i; 427 + 428 + /* initialize the loopback test result, avoid marking an unexcuted 429 + * loopback test as PASS. 430 + */ 431 + for (i = 0; i < cnt; i++) 432 + data[i] = HNS3_NIC_LB_TEST_UNEXECUTED; 428 433 429 434 if (hns3_nic_resetting(ndev)) { 430 435 netdev_err(ndev, "dev resetting!"); 431 - return; 436 + goto failure; 432 437 } 433 438 434 439 if (!(eth_test->flags & ETH_TEST_FL_OFFLINE)) 435 - return; 440 + goto failure; 436 441 437 442 if (netif_msg_ifdown(h)) 438 443 netdev_info(ndev, "self test start\n"); ··· 462 451 463 452 if (netif_msg_ifdown(h)) 464 453 netdev_info(ndev, "self test end\n"); 454 + return; 455 + 456 + failure: 457 + eth_test->flags |= ETH_TEST_FL_FAILED; 465 458 } 466 459 467 460 static void hns3_update_limit_promisc_mode(struct net_device *netdev,
+4
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
··· 11626 11626 if (ret) 11627 11627 goto err_pci_uninit; 11628 11628 11629 + devl_lock(hdev->devlink); 11630 + 11629 11631 /* Firmware command queue initialize */ 11630 11632 ret = hclge_comm_cmd_queue_init(hdev->pdev, &hdev->hw.hw); 11631 11633 if (ret) ··· 11807 11805 11808 11806 hclge_task_schedule(hdev, round_jiffies_relative(HZ)); 11809 11807 11808 + devl_unlock(hdev->devlink); 11810 11809 return 0; 11811 11810 11812 11811 err_mdiobus_unreg: ··· 11820 11817 err_cmd_uninit: 11821 11818 hclge_comm_cmd_uninit(hdev->ae_dev, &hdev->hw.hw); 11822 11819 err_devlink_uninit: 11820 + devl_unlock(hdev->devlink); 11823 11821 hclge_devlink_uninit(hdev); 11824 11822 err_pci_uninit: 11825 11823 pcim_iounmap(pdev, hdev->hw.hw.io_base);
+2 -1
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
··· 593 593 struct ice_aqc_recipe_to_profile { 594 594 __le16 profile_id; 595 595 u8 rsvd[6]; 596 - DECLARE_BITMAP(recipe_assoc, ICE_MAX_NUM_RECIPES); 596 + __le64 recipe_assoc; 597 597 }; 598 + static_assert(sizeof(struct ice_aqc_recipe_to_profile) == 16); 598 599 599 600 /* Add/Update/Remove/Get switch rules (indirect 0x02A0, 0x02A1, 0x02A2, 0x02A3) 600 601 */
+2 -2
drivers/net/ethernet/intel/ice/ice_lag.c
··· 2041 2041 /* associate recipes to profiles */ 2042 2042 for (n = 0; n < ICE_PROFID_IPV6_GTPU_IPV6_TCP_INNER; n++) { 2043 2043 err = ice_aq_get_recipe_to_profile(&pf->hw, n, 2044 - (u8 *)&recipe_bits, NULL); 2044 + &recipe_bits, NULL); 2045 2045 if (err) 2046 2046 continue; 2047 2047 ··· 2049 2049 recipe_bits |= BIT(lag->pf_recipe) | 2050 2050 BIT(lag->lport_recipe); 2051 2051 ice_aq_map_recipe_to_profile(&pf->hw, n, 2052 - (u8 *)&recipe_bits, NULL); 2052 + recipe_bits, NULL); 2053 2053 } 2054 2054 } 2055 2055
+9 -9
drivers/net/ethernet/intel/ice/ice_lib.c
··· 3091 3091 { 3092 3092 struct ice_vsi_cfg_params params = {}; 3093 3093 struct ice_coalesce_stored *coalesce; 3094 - int prev_num_q_vectors = 0; 3094 + int prev_num_q_vectors; 3095 3095 struct ice_pf *pf; 3096 3096 int ret; 3097 3097 ··· 3105 3105 if (WARN_ON(vsi->type == ICE_VSI_VF && !vsi->vf)) 3106 3106 return -EINVAL; 3107 3107 3108 - coalesce = kcalloc(vsi->num_q_vectors, 3109 - sizeof(struct ice_coalesce_stored), GFP_KERNEL); 3110 - if (!coalesce) 3111 - return -ENOMEM; 3112 - 3113 - prev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi, coalesce); 3114 - 3115 3108 ret = ice_vsi_realloc_stat_arrays(vsi); 3116 3109 if (ret) 3117 3110 goto err_vsi_cfg; ··· 3113 3120 ret = ice_vsi_cfg_def(vsi, &params); 3114 3121 if (ret) 3115 3122 goto err_vsi_cfg; 3123 + 3124 + coalesce = kcalloc(vsi->num_q_vectors, 3125 + sizeof(struct ice_coalesce_stored), GFP_KERNEL); 3126 + if (!coalesce) 3127 + return -ENOMEM; 3128 + 3129 + prev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi, coalesce); 3116 3130 3117 3131 ret = ice_vsi_cfg_tc_lan(pf, vsi); 3118 3132 if (ret) { ··· 3139 3139 3140 3140 err_vsi_cfg_tc_lan: 3141 3141 ice_vsi_decfg(vsi); 3142 - err_vsi_cfg: 3143 3142 kfree(coalesce); 3143 + err_vsi_cfg: 3144 3144 return ret; 3145 3145 } 3146 3146
+14 -10
drivers/net/ethernet/intel/ice/ice_switch.c
··· 2025 2025 * ice_aq_map_recipe_to_profile - Map recipe to packet profile 2026 2026 * @hw: pointer to the HW struct 2027 2027 * @profile_id: package profile ID to associate the recipe with 2028 - * @r_bitmap: Recipe bitmap filled in and need to be returned as response 2028 + * @r_assoc: Recipe bitmap filled in and need to be returned as response 2029 2029 * @cd: pointer to command details structure or NULL 2030 2030 * Recipe to profile association (0x0291) 2031 2031 */ 2032 2032 int 2033 - ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, 2033 + ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 r_assoc, 2034 2034 struct ice_sq_cd *cd) 2035 2035 { 2036 2036 struct ice_aqc_recipe_to_profile *cmd; ··· 2042 2042 /* Set the recipe ID bit in the bitmask to let the device know which 2043 2043 * profile we are associating the recipe to 2044 2044 */ 2045 - memcpy(cmd->recipe_assoc, r_bitmap, sizeof(cmd->recipe_assoc)); 2045 + cmd->recipe_assoc = cpu_to_le64(r_assoc); 2046 2046 2047 2047 return ice_aq_send_cmd(hw, &desc, NULL, 0, cd); 2048 2048 } ··· 2051 2051 * ice_aq_get_recipe_to_profile - Map recipe to packet profile 2052 2052 * @hw: pointer to the HW struct 2053 2053 * @profile_id: package profile ID to associate the recipe with 2054 - * @r_bitmap: Recipe bitmap filled in and need to be returned as response 2054 + * @r_assoc: Recipe bitmap filled in and need to be returned as response 2055 2055 * @cd: pointer to command details structure or NULL 2056 2056 * Associate profile ID with given recipe (0x0293) 2057 2057 */ 2058 2058 int 2059 - ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, 2059 + ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 *r_assoc, 2060 2060 struct ice_sq_cd *cd) 2061 2061 { 2062 2062 struct ice_aqc_recipe_to_profile *cmd; ··· 2069 2069 2070 2070 status = ice_aq_send_cmd(hw, &desc, NULL, 0, cd); 2071 2071 if (!status) 2072 - memcpy(r_bitmap, cmd->recipe_assoc, sizeof(cmd->recipe_assoc)); 2072 + *r_assoc = le64_to_cpu(cmd->recipe_assoc); 2073 2073 2074 2074 return status; 2075 2075 } ··· 2108 2108 static void ice_get_recp_to_prof_map(struct ice_hw *hw) 2109 2109 { 2110 2110 DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES); 2111 + u64 recp_assoc; 2111 2112 u16 i; 2112 2113 2113 2114 for (i = 0; i < hw->switch_info->max_used_prof_index + 1; i++) { ··· 2116 2115 2117 2116 bitmap_zero(profile_to_recipe[i], ICE_MAX_NUM_RECIPES); 2118 2117 bitmap_zero(r_bitmap, ICE_MAX_NUM_RECIPES); 2119 - if (ice_aq_get_recipe_to_profile(hw, i, (u8 *)r_bitmap, NULL)) 2118 + if (ice_aq_get_recipe_to_profile(hw, i, &recp_assoc, NULL)) 2120 2119 continue; 2120 + bitmap_from_arr64(r_bitmap, &recp_assoc, ICE_MAX_NUM_RECIPES); 2121 2121 bitmap_copy(profile_to_recipe[i], r_bitmap, 2122 2122 ICE_MAX_NUM_RECIPES); 2123 2123 for_each_set_bit(j, r_bitmap, ICE_MAX_NUM_RECIPES) ··· 5392 5390 */ 5393 5391 list_for_each_entry(fvit, &rm->fv_list, list_entry) { 5394 5392 DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES); 5393 + u64 recp_assoc; 5395 5394 u16 j; 5396 5395 5397 5396 status = ice_aq_get_recipe_to_profile(hw, fvit->profile_id, 5398 - (u8 *)r_bitmap, NULL); 5397 + &recp_assoc, NULL); 5399 5398 if (status) 5400 5399 goto err_unroll; 5401 5400 5401 + bitmap_from_arr64(r_bitmap, &recp_assoc, ICE_MAX_NUM_RECIPES); 5402 5402 bitmap_or(r_bitmap, r_bitmap, rm->r_bitmap, 5403 5403 ICE_MAX_NUM_RECIPES); 5404 5404 status = ice_acquire_change_lock(hw, ICE_RES_WRITE); 5405 5405 if (status) 5406 5406 goto err_unroll; 5407 5407 5408 + bitmap_to_arr64(&recp_assoc, r_bitmap, ICE_MAX_NUM_RECIPES); 5408 5409 status = ice_aq_map_recipe_to_profile(hw, fvit->profile_id, 5409 - (u8 *)r_bitmap, 5410 - NULL); 5410 + recp_assoc, NULL); 5411 5411 ice_release_change_lock(hw); 5412 5412 5413 5413 if (status)
+2 -2
drivers/net/ethernet/intel/ice/ice_switch.h
··· 424 424 struct ice_aqc_recipe_data_elem *s_recipe_list, 425 425 u16 num_recipes, struct ice_sq_cd *cd); 426 426 int 427 - ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, 427 + ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 *r_assoc, 428 428 struct ice_sq_cd *cd); 429 429 int 430 - ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, 430 + ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 r_assoc, 431 431 struct ice_sq_cd *cd); 432 432 433 433 #endif /* _ICE_SWITCH_H_ */
-4
drivers/net/ethernet/intel/igc/igc_main.c
··· 1642 1642 1643 1643 if (unlikely(test_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags) && 1644 1644 skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) { 1645 - /* FIXME: add support for retrieving timestamps from 1646 - * the other timer registers before skipping the 1647 - * timestamping request. 1648 - */ 1649 1645 unsigned long flags; 1650 1646 u32 tstamp_flags; 1651 1647
+8 -8
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
··· 914 914 goto err_out; 915 915 } 916 916 917 - xs = kzalloc(sizeof(*xs), GFP_KERNEL); 917 + algo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1); 918 + if (unlikely(!algo)) { 919 + err = -ENOENT; 920 + goto err_out; 921 + } 922 + 923 + xs = kzalloc(sizeof(*xs), GFP_ATOMIC); 918 924 if (unlikely(!xs)) { 919 925 err = -ENOMEM; 920 926 goto err_out; ··· 936 930 memcpy(&xs->id.daddr.a4, sam->addr, sizeof(xs->id.daddr.a4)); 937 931 xs->xso.dev = adapter->netdev; 938 932 939 - algo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1); 940 - if (unlikely(!algo)) { 941 - err = -ENOENT; 942 - goto err_xs; 943 - } 944 - 945 933 aead_len = sizeof(*xs->aead) + IXGBE_IPSEC_KEY_BITS / 8; 946 - xs->aead = kzalloc(aead_len, GFP_KERNEL); 934 + xs->aead = kzalloc(aead_len, GFP_ATOMIC); 947 935 if (unlikely(!xs->aead)) { 948 936 err = -ENOMEM; 949 937 goto err_xs;
+5
drivers/net/ethernet/marvell/octeontx2/af/cgx.c
··· 808 808 if (!is_lmac_valid(cgx, lmac_id)) 809 809 return -ENODEV; 810 810 811 + cfg = cgx_read(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL); 812 + cfg &= ~CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK; 813 + cfg |= rx_pause ? CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK : 0x0; 814 + cgx_write(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL, cfg); 815 + 811 816 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL); 812 817 cfg &= ~CGX_SMUX_RX_FRM_CTL_CTL_BCK; 813 818 cfg |= rx_pause ? CGX_SMUX_RX_FRM_CTL_CTL_BCK : 0x0;
+14 -7
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
··· 139 139 control |= MLXBF_GIGE_CONTROL_PORT_EN; 140 140 writeq(control, priv->base + MLXBF_GIGE_CONTROL); 141 141 142 - err = mlxbf_gige_request_irqs(priv); 143 - if (err) 144 - return err; 145 142 mlxbf_gige_cache_stats(priv); 146 143 err = mlxbf_gige_clean_port(priv); 147 144 if (err) 148 - goto free_irqs; 145 + return err; 149 146 150 147 /* Clear driver's valid_polarity to match hardware, 151 148 * since the above call to clean_port() resets the ··· 154 157 155 158 err = mlxbf_gige_tx_init(priv); 156 159 if (err) 157 - goto free_irqs; 160 + goto phy_deinit; 158 161 err = mlxbf_gige_rx_init(priv); 159 162 if (err) 160 163 goto tx_deinit; ··· 162 165 netif_napi_add(netdev, &priv->napi, mlxbf_gige_poll); 163 166 napi_enable(&priv->napi); 164 167 netif_start_queue(netdev); 168 + 169 + err = mlxbf_gige_request_irqs(priv); 170 + if (err) 171 + goto napi_deinit; 165 172 166 173 /* Set bits in INT_EN that we care about */ 167 174 int_en = MLXBF_GIGE_INT_EN_HW_ACCESS_ERROR | ··· 183 182 184 183 return 0; 185 184 185 + napi_deinit: 186 + netif_stop_queue(netdev); 187 + napi_disable(&priv->napi); 188 + netif_napi_del(&priv->napi); 189 + mlxbf_gige_rx_deinit(priv); 190 + 186 191 tx_deinit: 187 192 mlxbf_gige_tx_deinit(priv); 188 193 189 - free_irqs: 190 - mlxbf_gige_free_irqs(priv); 194 + phy_deinit: 195 + phy_stop(phydev); 191 196 return err; 192 197 } 193 198
+18
drivers/net/ethernet/microchip/lan743x_main.c
··· 25 25 #define PCS_POWER_STATE_DOWN 0x6 26 26 #define PCS_POWER_STATE_UP 0x4 27 27 28 + #define RFE_RD_FIFO_TH_3_DWORDS 0x3 29 + 28 30 static void pci11x1x_strap_get_status(struct lan743x_adapter *adapter) 29 31 { 30 32 u32 chip_rev; ··· 3274 3272 lan743x_pci_cleanup(adapter); 3275 3273 } 3276 3274 3275 + static void pci11x1x_set_rfe_rd_fifo_threshold(struct lan743x_adapter *adapter) 3276 + { 3277 + u16 rev = adapter->csr.id_rev & ID_REV_CHIP_REV_MASK_; 3278 + 3279 + if (rev == ID_REV_CHIP_REV_PCI11X1X_B0_) { 3280 + u32 misc_ctl; 3281 + 3282 + misc_ctl = lan743x_csr_read(adapter, MISC_CTL_0); 3283 + misc_ctl &= ~MISC_CTL_0_RFE_READ_FIFO_MASK_; 3284 + misc_ctl |= FIELD_PREP(MISC_CTL_0_RFE_READ_FIFO_MASK_, 3285 + RFE_RD_FIFO_TH_3_DWORDS); 3286 + lan743x_csr_write(adapter, MISC_CTL_0, misc_ctl); 3287 + } 3288 + } 3289 + 3277 3290 static int lan743x_hardware_init(struct lan743x_adapter *adapter, 3278 3291 struct pci_dev *pdev) 3279 3292 { ··· 3304 3287 pci11x1x_strap_get_status(adapter); 3305 3288 spin_lock_init(&adapter->eth_syslock_spinlock); 3306 3289 mutex_init(&adapter->sgmii_rw_lock); 3290 + pci11x1x_set_rfe_rd_fifo_threshold(adapter); 3307 3291 } else { 3308 3292 adapter->max_tx_channels = LAN743X_MAX_TX_CHANNELS; 3309 3293 adapter->used_tx_channels = LAN743X_USED_TX_CHANNELS;
+4
drivers/net/ethernet/microchip/lan743x_main.h
··· 26 26 #define ID_REV_CHIP_REV_MASK_ (0x0000FFFF) 27 27 #define ID_REV_CHIP_REV_A0_ (0x00000000) 28 28 #define ID_REV_CHIP_REV_B0_ (0x00000010) 29 + #define ID_REV_CHIP_REV_PCI11X1X_B0_ (0x000000B0) 29 30 30 31 #define FPGA_REV (0x04) 31 32 #define FPGA_REV_GET_MINOR_(fpga_rev) (((fpga_rev) >> 8) & 0x000000FF) ··· 311 310 #define SGMII_CTL_SGMII_ENABLE_ BIT(31) 312 311 #define SGMII_CTL_LINK_STATUS_SOURCE_ BIT(8) 313 312 #define SGMII_CTL_SGMII_POWER_DN_ BIT(1) 313 + 314 + #define MISC_CTL_0 (0x920) 315 + #define MISC_CTL_0_RFE_READ_FIFO_MASK_ GENMASK(6, 4) 314 316 315 317 /* Vendor Specific SGMII MMD details */ 316 318 #define SR_VSMMD_PCS_ID1 0x0004
+1 -1
drivers/net/ethernet/xilinx/ll_temac_main.c
··· 1443 1443 } 1444 1444 1445 1445 /* map device registers */ 1446 - lp->regs = devm_platform_ioremap_resource_byname(pdev, 0); 1446 + lp->regs = devm_platform_ioremap_resource(pdev, 0); 1447 1447 if (IS_ERR(lp->regs)) { 1448 1448 dev_err(&pdev->dev, "could not map TEMAC registers\n"); 1449 1449 return -ENOMEM;
+3 -1
drivers/net/phy/qcom/at803x.c
··· 797 797 798 798 static int at8031_probe(struct phy_device *phydev) 799 799 { 800 - struct at803x_priv *priv = phydev->priv; 800 + struct at803x_priv *priv; 801 801 int mode_cfg; 802 802 int ccr; 803 803 int ret; ··· 805 805 ret = at803x_probe(phydev); 806 806 if (ret) 807 807 return ret; 808 + 809 + priv = phydev->priv; 808 810 809 811 /* Only supported on AR8031/AR8033, the AR8030/AR8035 use strapping 810 812 * options.
+8 -7
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
··· 3081 3081 struct iwl_fw_dbg_params params = {0}; 3082 3082 struct iwl_fwrt_dump_data *dump_data = 3083 3083 &fwrt->dump.wks[wk_idx].dump_data; 3084 - u32 policy; 3085 - u32 time_point; 3086 3084 if (!test_bit(wk_idx, &fwrt->dump.active_wks)) 3087 3085 return; 3088 3086 ··· 3111 3113 3112 3114 iwl_fw_dbg_stop_restart_recording(fwrt, &params, false); 3113 3115 3114 - policy = le32_to_cpu(dump_data->trig->apply_policy); 3115 - time_point = le32_to_cpu(dump_data->trig->time_point); 3116 + if (iwl_trans_dbg_ini_valid(fwrt->trans)) { 3117 + u32 policy = le32_to_cpu(dump_data->trig->apply_policy); 3118 + u32 time_point = le32_to_cpu(dump_data->trig->time_point); 3116 3119 3117 - if (policy & IWL_FW_INI_APPLY_POLICY_DUMP_COMPLETE_CMD) { 3118 - IWL_DEBUG_FW_INFO(fwrt, "WRT: sending dump complete\n"); 3119 - iwl_send_dbg_dump_complete_cmd(fwrt, time_point, 0); 3120 + if (policy & IWL_FW_INI_APPLY_POLICY_DUMP_COMPLETE_CMD) { 3121 + IWL_DEBUG_FW_INFO(fwrt, "WRT: sending dump complete\n"); 3122 + iwl_send_dbg_dump_complete_cmd(fwrt, time_point, 0); 3123 + } 3120 3124 } 3125 + 3121 3126 if (fwrt->trans->dbg.last_tp_resetfw == IWL_FW_INI_RESET_FW_MODE_STOP_FW_ONLY) 3122 3127 iwl_force_nmi(fwrt->trans); 3123 3128
+9 -7
drivers/net/wireless/intel/iwlwifi/mvm/d3.c
··· 1260 1260 if (IS_ERR_OR_NULL(vif)) 1261 1261 return 1; 1262 1262 1263 - if (ieee80211_vif_is_mld(vif) && vif->cfg.assoc) { 1263 + if (hweight16(vif->active_links) > 1) { 1264 1264 /* 1265 - * Select the 'best' link. May need to revisit, it seems 1266 - * better to not optimize for throughput but rather range, 1267 - * reliability and power here - and select 2.4 GHz ... 1265 + * Select the 'best' link. 1266 + * May need to revisit, it seems better to not optimize 1267 + * for throughput but rather range, reliability and 1268 + * power here - and select 2.4 GHz ... 1268 1269 */ 1269 - primary_link = 1270 - iwl_mvm_mld_get_primary_link(mvm, vif, 1271 - vif->active_links); 1270 + primary_link = iwl_mvm_mld_get_primary_link(mvm, vif, 1271 + vif->active_links); 1272 1272 1273 1273 if (WARN_ONCE(primary_link < 0, "no primary link in 0x%x\n", 1274 1274 vif->active_links)) ··· 1277 1277 ret = ieee80211_set_active_links(vif, BIT(primary_link)); 1278 1278 if (ret) 1279 1279 return ret; 1280 + } else if (vif->active_links) { 1281 + primary_link = __ffs(vif->active_links); 1280 1282 } else { 1281 1283 primary_link = 0; 1282 1284 }
+7 -4
drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
··· 748 748 { 749 749 struct dentry *dbgfs_dir = vif->debugfs_dir; 750 750 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 751 - char buf[100]; 751 + char buf[3 * 3 + 11 + (NL80211_WIPHY_NAME_MAXLEN + 1) + 752 + (7 + IFNAMSIZ + 1) + 6 + 1]; 753 + char name[7 + IFNAMSIZ + 1]; 752 754 753 755 /* this will happen in monitor mode */ 754 756 if (!dbgfs_dir) ··· 763 761 * find 764 762 * netdev:wlan0 -> ../../../ieee80211/phy0/netdev:wlan0/iwlmvm/ 765 763 */ 766 - snprintf(buf, 100, "../../../%pd3/iwlmvm", dbgfs_dir); 764 + snprintf(name, sizeof(name), "%pd", dbgfs_dir); 765 + snprintf(buf, sizeof(buf), "../../../%pd3/iwlmvm", dbgfs_dir); 767 766 768 - mvmvif->dbgfs_slink = debugfs_create_symlink(dbgfs_dir->d_name.name, 769 - mvm->debugfs_dir, buf); 767 + mvmvif->dbgfs_slink = 768 + debugfs_create_symlink(name, mvm->debugfs_dir, buf); 770 769 } 771 770 772 771 void iwl_mvm_vif_dbgfs_rm_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
+45 -14
drivers/net/wireless/intel/iwlwifi/mvm/link.c
··· 46 46 return ret; 47 47 } 48 48 49 + int iwl_mvm_set_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 50 + struct ieee80211_bss_conf *link_conf) 51 + { 52 + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 53 + struct iwl_mvm_vif_link_info *link_info = 54 + mvmvif->link[link_conf->link_id]; 55 + 56 + if (link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID) { 57 + link_info->fw_link_id = iwl_mvm_get_free_fw_link_id(mvm, 58 + mvmvif); 59 + if (link_info->fw_link_id >= 60 + ARRAY_SIZE(mvm->link_id_to_link_conf)) 61 + return -EINVAL; 62 + 63 + rcu_assign_pointer(mvm->link_id_to_link_conf[link_info->fw_link_id], 64 + link_conf); 65 + } 66 + 67 + return 0; 68 + } 69 + 49 70 int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 50 71 struct ieee80211_bss_conf *link_conf) 51 72 { ··· 76 55 struct iwl_link_config_cmd cmd = {}; 77 56 unsigned int cmd_id = WIDE_ID(MAC_CONF_GROUP, LINK_CONFIG_CMD); 78 57 u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 1); 58 + int ret; 79 59 80 60 if (WARN_ON_ONCE(!link_info)) 81 61 return -EINVAL; 82 62 83 - if (link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID) { 84 - link_info->fw_link_id = iwl_mvm_get_free_fw_link_id(mvm, 85 - mvmvif); 86 - if (link_info->fw_link_id >= ARRAY_SIZE(mvm->link_id_to_link_conf)) 87 - return -EINVAL; 88 - 89 - rcu_assign_pointer(mvm->link_id_to_link_conf[link_info->fw_link_id], 90 - link_conf); 91 - } 63 + ret = iwl_mvm_set_link_mapping(mvm, vif, link_conf); 64 + if (ret) 65 + return ret; 92 66 93 67 /* Update SF - Disable if needed. if this fails, SF might still be on 94 68 * while many macs are bound, which is forbidden - so fail the binding. ··· 264 248 return ret; 265 249 } 266 250 251 + int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 252 + struct ieee80211_bss_conf *link_conf) 253 + { 254 + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 255 + struct iwl_mvm_vif_link_info *link_info = 256 + mvmvif->link[link_conf->link_id]; 257 + 258 + /* mac80211 thought we have the link, but it was never configured */ 259 + if (WARN_ON(!link_info || 260 + link_info->fw_link_id >= 261 + ARRAY_SIZE(mvm->link_id_to_link_conf))) 262 + return -EINVAL; 263 + 264 + RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id], 265 + NULL); 266 + return 0; 267 + } 268 + 267 269 int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 268 270 struct ieee80211_bss_conf *link_conf) 269 271 { ··· 291 257 struct iwl_link_config_cmd cmd = {}; 292 258 int ret; 293 259 294 - /* mac80211 thought we have the link, but it was never configured */ 295 - if (WARN_ON(!link_info || 296 - link_info->fw_link_id >= ARRAY_SIZE(mvm->link_id_to_link_conf))) 260 + ret = iwl_mvm_unset_link_mapping(mvm, vif, link_conf); 261 + if (ret) 297 262 return 0; 298 263 299 - RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id], 300 - NULL); 301 264 cmd.link_id = cpu_to_le32(link_info->fw_link_id); 302 265 iwl_mvm_release_fw_link_id(mvm, link_info->fw_link_id); 303 266 link_info->fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;
+8 -1
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
··· 360 360 if (mvm->mld_api_is_used && mvm->nvm_data->sku_cap_11be_enable && 361 361 !iwlwifi_mod_params.disable_11ax && 362 362 !iwlwifi_mod_params.disable_11be) 363 - hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO; 363 + hw->wiphy->flags |= WIPHY_FLAG_DISABLE_WEXT; 364 364 365 365 /* With MLD FW API, it tracks timing by itself, 366 366 * no need for any timing from the host ··· 1577 1577 mvmvif->mvm = mvm; 1578 1578 1579 1579 /* the first link always points to the default one */ 1580 + mvmvif->deflink.fw_link_id = IWL_MVM_FW_LINK_ID_INVALID; 1581 + mvmvif->deflink.active = 0; 1580 1582 mvmvif->link[0] = &mvmvif->deflink; 1583 + 1584 + ret = iwl_mvm_set_link_mapping(mvm, vif, &vif->bss_conf); 1585 + if (ret) 1586 + goto out; 1581 1587 1582 1588 /* 1583 1589 * Not much to do here. The stack will not allow interface ··· 1789 1783 mvm->p2p_device_vif = NULL; 1790 1784 } 1791 1785 1786 + iwl_mvm_unset_link_mapping(mvm, vif, &vif->bss_conf); 1792 1787 iwl_mvm_mac_ctxt_remove(mvm, vif); 1793 1788 1794 1789 RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL);
+6 -1
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
··· 855 855 856 856 int iwl_mvm_mld_rm_sta_id(struct iwl_mvm *mvm, u8 sta_id) 857 857 { 858 - int ret = iwl_mvm_mld_rm_sta_from_fw(mvm, sta_id); 858 + int ret; 859 859 860 860 lockdep_assert_held(&mvm->mutex); 861 + 862 + if (WARN_ON(sta_id == IWL_MVM_INVALID_STA)) 863 + return 0; 864 + 865 + ret = iwl_mvm_mld_rm_sta_from_fw(mvm, sta_id); 861 866 862 867 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta_id], NULL); 863 868 RCU_INIT_POINTER(mvm->fw_id_to_link_sta[sta_id], NULL);
+4
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
··· 1916 1916 u32 iwl_mvm_get_lmac_id(struct iwl_mvm *mvm, enum nl80211_band band); 1917 1917 1918 1918 /* Links */ 1919 + int iwl_mvm_set_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 1920 + struct ieee80211_bss_conf *link_conf); 1919 1921 int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 1920 1922 struct ieee80211_bss_conf *link_conf); 1921 1923 int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 1922 1924 struct ieee80211_bss_conf *link_conf, 1923 1925 u32 changes, bool active); 1926 + int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 1927 + struct ieee80211_bss_conf *link_conf); 1924 1928 int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 1925 1929 struct ieee80211_bss_conf *link_conf); 1926 1930 int iwl_mvm_disable_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
+6 -2
drivers/net/wireless/intel/iwlwifi/mvm/rfi.c
··· 132 132 if (ret) 133 133 return ERR_PTR(ret); 134 134 135 - if (WARN_ON_ONCE(iwl_rx_packet_payload_len(cmd.resp_pkt) != resp_size)) 135 + if (WARN_ON_ONCE(iwl_rx_packet_payload_len(cmd.resp_pkt) != 136 + resp_size)) { 137 + iwl_free_resp(&cmd); 136 138 return ERR_PTR(-EIO); 139 + } 137 140 138 141 resp = kmemdup(cmd.resp_pkt->data, resp_size, GFP_KERNEL); 142 + iwl_free_resp(&cmd); 143 + 139 144 if (!resp) 140 145 return ERR_PTR(-ENOMEM); 141 146 142 - iwl_free_resp(&cmd); 143 147 return resp; 144 148 } 145 149
+8 -12
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
··· 236 236 static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm, 237 237 struct napi_struct *napi, 238 238 struct sk_buff *skb, int queue, 239 - struct ieee80211_sta *sta, 240 - struct ieee80211_link_sta *link_sta) 239 + struct ieee80211_sta *sta) 241 240 { 242 241 if (unlikely(iwl_mvm_check_pn(mvm, skb, queue, sta))) { 243 242 kfree_skb(skb); 244 243 return; 245 - } 246 - 247 - if (sta && sta->valid_links && link_sta) { 248 - struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); 249 - 250 - rx_status->link_valid = 1; 251 - rx_status->link_id = link_sta->link_id; 252 244 } 253 245 254 246 ieee80211_rx_napi(mvm->hw, sta, skb, napi); ··· 580 588 while ((skb = __skb_dequeue(skb_list))) { 581 589 iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, 582 590 reorder_buf->queue, 583 - sta, NULL /* FIXME */); 591 + sta); 584 592 reorder_buf->num_stored--; 585 593 } 586 594 } ··· 2205 2213 if (IS_ERR(sta)) 2206 2214 sta = NULL; 2207 2215 link_sta = rcu_dereference(mvm->fw_id_to_link_sta[id]); 2216 + 2217 + if (sta && sta->valid_links && link_sta) { 2218 + rx_status->link_valid = 1; 2219 + rx_status->link_id = link_sta->link_id; 2220 + } 2208 2221 } 2209 2222 } else if (!is_multicast_ether_addr(hdr->addr2)) { 2210 2223 /* ··· 2353 2356 !(desc->amsdu_info & IWL_RX_MPDU_AMSDU_LAST_SUBFRAME)) 2354 2357 rx_status->flag |= RX_FLAG_AMSDU_MORE; 2355 2358 2356 - iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta, 2357 - link_sta); 2359 + iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta); 2358 2360 } 2359 2361 out: 2360 2362 rcu_read_unlock();
+2 -3
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
··· 879 879 struct iwl_rx_packet *pkt = rxb_addr(rxb); 880 880 struct iwl_mvm_session_prot_notif *notif = (void *)pkt->data; 881 881 unsigned int ver = 882 - iwl_fw_lookup_cmd_ver(mvm->fw, 883 - WIDE_ID(MAC_CONF_GROUP, 884 - SESSION_PROTECTION_CMD), 2); 882 + iwl_fw_lookup_notif_ver(mvm->fw, MAC_CONF_GROUP, 883 + SESSION_PROTECTION_NOTIF, 2); 885 884 int id = le32_to_cpu(notif->mac_link_id); 886 885 struct ieee80211_vif *vif; 887 886 struct iwl_mvm_vif *mvmvif;
+1 -1
drivers/net/wireless/intel/iwlwifi/queue/tx.c
··· 1589 1589 return; 1590 1590 1591 1591 tfd_num = iwl_txq_get_cmd_index(txq, ssn); 1592 - read_ptr = iwl_txq_get_cmd_index(txq, txq->read_ptr); 1593 1592 1594 1593 spin_lock_bh(&txq->lock); 1594 + read_ptr = iwl_txq_get_cmd_index(txq, txq->read_ptr); 1595 1595 1596 1596 if (!test_bit(txq_id, trans->txqs.queue_used)) { 1597 1597 IWL_DEBUG_TX_QUEUES(trans, "Q %d inactive - ignoring idx %d\n",
+1 -1
drivers/net/wireless/realtek/rtw89/rtw8922a.c
··· 2233 2233 * Shared-Ant && BTG-path:WL mask(0x55f), others:WL THRU(0x5ff) 2234 2234 */ 2235 2235 if (btc->ant_type == BTC_ANT_SHARED && btc->btg_pos == path) 2236 - rtw8922a_set_trx_mask(rtwdev, path, BTC_BT_TX_GROUP, 0x5ff); 2236 + rtw8922a_set_trx_mask(rtwdev, path, BTC_BT_TX_GROUP, 0x55f); 2237 2237 else 2238 2238 rtw8922a_set_trx_mask(rtwdev, path, BTC_BT_TX_GROUP, 0x5ff); 2239 2239
+2 -2
drivers/net/wwan/t7xx/t7xx_cldma.c
··· 106 106 { 107 107 u32 offset = REG_CLDMA_UL_START_ADDRL_0 + qno * ADDR_SIZE; 108 108 109 - return ioread64(hw_info->ap_pdn_base + offset); 109 + return ioread64_lo_hi(hw_info->ap_pdn_base + offset); 110 110 } 111 111 112 112 void t7xx_cldma_hw_set_start_addr(struct t7xx_cldma_hw *hw_info, unsigned int qno, u64 address, ··· 117 117 118 118 reg = tx_rx == MTK_RX ? hw_info->ap_ao_base + REG_CLDMA_DL_START_ADDRL_0 : 119 119 hw_info->ap_pdn_base + REG_CLDMA_UL_START_ADDRL_0; 120 - iowrite64(address, reg + offset); 120 + iowrite64_lo_hi(address, reg + offset); 121 121 } 122 122 123 123 void t7xx_cldma_hw_resume_queue(struct t7xx_cldma_hw *hw_info, unsigned int qno,
+5 -4
drivers/net/wwan/t7xx/t7xx_hif_cldma.c
··· 137 137 return -ENODEV; 138 138 } 139 139 140 - gpd_addr = ioread64(hw_info->ap_pdn_base + REG_CLDMA_DL_CURRENT_ADDRL_0 + 141 - queue->index * sizeof(u64)); 140 + gpd_addr = ioread64_lo_hi(hw_info->ap_pdn_base + 141 + REG_CLDMA_DL_CURRENT_ADDRL_0 + 142 + queue->index * sizeof(u64)); 142 143 if (req->gpd_addr == gpd_addr || hwo_polling_count++ >= 100) 143 144 return 0; 144 145 ··· 317 316 struct t7xx_cldma_hw *hw_info = &md_ctrl->hw_info; 318 317 319 318 /* Check current processing TGPD, 64-bit address is in a table by Q index */ 320 - ul_curr_addr = ioread64(hw_info->ap_pdn_base + REG_CLDMA_UL_CURRENT_ADDRL_0 + 321 - queue->index * sizeof(u64)); 319 + ul_curr_addr = ioread64_lo_hi(hw_info->ap_pdn_base + REG_CLDMA_UL_CURRENT_ADDRL_0 + 320 + queue->index * sizeof(u64)); 322 321 if (req->gpd_addr != ul_curr_addr) { 323 322 spin_unlock_irqrestore(&md_ctrl->cldma_lock, flags); 324 323 dev_err(md_ctrl->dev, "CLDMA%d queue %d is not empty\n",
+4 -4
drivers/net/wwan/t7xx/t7xx_pcie_mac.c
··· 75 75 for (i = 0; i < ATR_TABLE_NUM_PER_ATR; i++) { 76 76 offset = ATR_PORT_OFFSET * port + ATR_TABLE_OFFSET * i; 77 77 reg = pbase + ATR_PCIE_WIN0_T0_ATR_PARAM_SRC_ADDR + offset; 78 - iowrite64(0, reg); 78 + iowrite64_lo_hi(0, reg); 79 79 } 80 80 } 81 81 ··· 112 112 113 113 reg = pbase + ATR_PCIE_WIN0_T0_TRSL_ADDR + offset; 114 114 value = cfg->trsl_addr & ATR_PCIE_WIN0_ADDR_ALGMT; 115 - iowrite64(value, reg); 115 + iowrite64_lo_hi(value, reg); 116 116 117 117 reg = pbase + ATR_PCIE_WIN0_T0_TRSL_PARAM + offset; 118 118 iowrite32(cfg->trsl_id, reg); 119 119 120 120 reg = pbase + ATR_PCIE_WIN0_T0_ATR_PARAM_SRC_ADDR + offset; 121 121 value = (cfg->src_addr & ATR_PCIE_WIN0_ADDR_ALGMT) | (atr_size << 1) | BIT(0); 122 - iowrite64(value, reg); 122 + iowrite64_lo_hi(value, reg); 123 123 124 124 /* Ensure ATR is set */ 125 - ioread64(reg); 125 + ioread64_lo_hi(reg); 126 126 return 0; 127 127 } 128 128
+36 -2
drivers/s390/net/qeth_core_main.c
··· 1179 1179 } 1180 1180 } 1181 1181 1182 + /** 1183 + * qeth_irq() - qeth interrupt handler 1184 + * @cdev: ccw device 1185 + * @intparm: expect pointer to iob 1186 + * @irb: Interruption Response Block 1187 + * 1188 + * In the good path: 1189 + * corresponding qeth channel is locked with last used iob as active_cmd. 1190 + * But this function is also called for error interrupts. 1191 + * 1192 + * Caller ensures that: 1193 + * Interrupts are disabled; ccw device lock is held; 1194 + * 1195 + */ 1182 1196 static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, 1183 1197 struct irb *irb) 1184 1198 { ··· 1234 1220 iob = (struct qeth_cmd_buffer *) (addr_t)intparm; 1235 1221 } 1236 1222 1237 - qeth_unlock_channel(card, channel); 1238 - 1239 1223 rc = qeth_check_irb_error(card, cdev, irb); 1240 1224 if (rc) { 1241 1225 /* IO was terminated, free its resources. */ 1226 + qeth_unlock_channel(card, channel); 1242 1227 if (iob) 1243 1228 qeth_cancel_cmd(iob, rc); 1244 1229 return; ··· 1281 1268 rc = qeth_get_problem(card, cdev, irb); 1282 1269 if (rc) { 1283 1270 card->read_or_write_problem = 1; 1271 + qeth_unlock_channel(card, channel); 1284 1272 if (iob) 1285 1273 qeth_cancel_cmd(iob, rc); 1286 1274 qeth_clear_ipacmd_list(card); ··· 1289 1275 return; 1290 1276 } 1291 1277 } 1278 + 1279 + if (scsw_cmd_is_valid_cc(&irb->scsw) && irb->scsw.cmd.cc == 1 && iob) { 1280 + /* channel command hasn't started: retry. 1281 + * active_cmd is still set to last iob 1282 + */ 1283 + QETH_CARD_TEXT(card, 2, "irqcc1"); 1284 + rc = ccw_device_start_timeout(cdev, __ccw_from_cmd(iob), 1285 + (addr_t)iob, 0, 0, iob->timeout); 1286 + if (rc) { 1287 + QETH_DBF_MESSAGE(2, 1288 + "ccw retry on %x failed, rc = %i\n", 1289 + CARD_DEVID(card), rc); 1290 + QETH_CARD_TEXT_(card, 2, " err%d", rc); 1291 + qeth_unlock_channel(card, channel); 1292 + qeth_cancel_cmd(iob, rc); 1293 + } 1294 + return; 1295 + } 1296 + 1297 + qeth_unlock_channel(card, channel); 1292 1298 1293 1299 if (iob) { 1294 1300 /* sanity check: */
+2 -2
include/linux/framer/framer.h
··· 181 181 return -ENOSYS; 182 182 } 183 183 184 - struct framer *framer_get(struct device *dev, const char *con_id) 184 + static inline struct framer *framer_get(struct device *dev, const char *con_id) 185 185 { 186 186 return ERR_PTR(-ENOSYS); 187 187 } 188 188 189 - void framer_put(struct device *dev, struct framer *framer) 189 + static inline void framer_put(struct device *dev, struct framer *framer) 190 190 { 191 191 } 192 192
+1 -6
include/linux/skbuff.h
··· 753 753 * @list: queue head 754 754 * @ll_node: anchor in an llist (eg socket defer_list) 755 755 * @sk: Socket we are owned by 756 - * @ip_defrag_offset: (aka @sk) alternate use of @sk, used in 757 - * fragmentation management 758 756 * @dev: Device we arrived on/are leaving by 759 757 * @dev_scratch: (aka @dev) alternate use of @dev when @dev would be %NULL 760 758 * @cb: Control buffer. Free for use by every layer. Put private vars here ··· 873 875 struct llist_node ll_node; 874 876 }; 875 877 876 - union { 877 - struct sock *sk; 878 - int ip_defrag_offset; 879 - }; 878 + struct sock *sk; 880 879 881 880 union { 882 881 ktime_t tstamp;
+2
include/net/cfg80211.h
··· 4991 4991 * set this flag to update channels on beacon hints. 4992 4992 * @WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY: support connection to non-primary link 4993 4993 * of an NSTR mobile AP MLD. 4994 + * @WIPHY_FLAG_DISABLE_WEXT: disable wireless extensions for this device 4994 4995 */ 4995 4996 enum wiphy_flags { 4996 4997 WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(0), ··· 5003 5002 WIPHY_FLAG_4ADDR_STATION = BIT(6), 5004 5003 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), 5005 5004 WIPHY_FLAG_IBSS_RSN = BIT(8), 5005 + WIPHY_FLAG_DISABLE_WEXT = BIT(9), 5006 5006 WIPHY_FLAG_MESH_AUTH = BIT(10), 5007 5007 WIPHY_FLAG_SUPPORTS_EXT_KCK_32 = BIT(11), 5008 5008 WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY = BIT(12),
+1
include/net/inet_connection_sock.h
··· 175 175 void (*delack_handler)(struct timer_list *), 176 176 void (*keepalive_handler)(struct timer_list *)); 177 177 void inet_csk_clear_xmit_timers(struct sock *sk); 178 + void inet_csk_clear_xmit_timers_sync(struct sock *sk); 178 179 179 180 static inline void inet_csk_schedule_ack(struct sock *sk) 180 181 {
+7
include/net/sock.h
··· 1759 1759 #endif 1760 1760 } 1761 1761 1762 + static inline void sock_not_owned_by_me(const struct sock *sk) 1763 + { 1764 + #ifdef CONFIG_LOCKDEP 1765 + WARN_ON_ONCE(lockdep_sock_is_held(sk) && debug_locks); 1766 + #endif 1767 + } 1768 + 1762 1769 static inline bool sock_owned_by_user(const struct sock *sk) 1763 1770 { 1764 1771 sock_owned_by_me(sk);
+2
include/net/xdp_sock.h
··· 188 188 { 189 189 if (!compl) 190 190 return; 191 + if (!compl->tx_timestamp) 192 + return; 191 193 192 194 *compl->tx_timestamp = ops->tmo_fill_timestamp(priv); 193 195 }
+18 -7
kernel/bpf/arena.c
··· 38 38 39 39 /* number of bytes addressable by LDX/STX insn with 16-bit 'off' field */ 40 40 #define GUARD_SZ (1ull << sizeof(((struct bpf_insn *)0)->off) * 8) 41 - #define KERN_VM_SZ ((1ull << 32) + GUARD_SZ) 41 + #define KERN_VM_SZ (SZ_4G + GUARD_SZ) 42 42 43 43 struct bpf_arena { 44 44 struct bpf_map map; ··· 110 110 return ERR_PTR(-EINVAL); 111 111 112 112 vm_range = (u64)attr->max_entries * PAGE_SIZE; 113 - if (vm_range > (1ull << 32)) 113 + if (vm_range > SZ_4G) 114 114 return ERR_PTR(-E2BIG); 115 115 116 116 if ((attr->map_extra >> 32) != ((attr->map_extra + vm_range - 1) >> 32)) ··· 301 301 302 302 if (pgoff) 303 303 return -EINVAL; 304 - if (len > (1ull << 32)) 304 + if (len > SZ_4G) 305 305 return -E2BIG; 306 306 307 307 /* if user_vm_start was specified at arena creation time */ ··· 322 322 if (WARN_ON_ONCE(arena->user_vm_start)) 323 323 /* checks at map creation time should prevent this */ 324 324 return -EFAULT; 325 - return round_up(ret, 1ull << 32); 325 + return round_up(ret, SZ_4G); 326 326 } 327 327 328 328 static int arena_map_mmap(struct bpf_map *map, struct vm_area_struct *vma) ··· 346 346 return -EBUSY; 347 347 348 348 /* Earlier checks should prevent this */ 349 - if (WARN_ON_ONCE(vma->vm_end - vma->vm_start > (1ull << 32) || vma->vm_pgoff)) 349 + if (WARN_ON_ONCE(vma->vm_end - vma->vm_start > SZ_4G || vma->vm_pgoff)) 350 350 return -EFAULT; 351 351 352 352 if (remember_vma(arena, vma)) ··· 420 420 if (uaddr & ~PAGE_MASK) 421 421 return 0; 422 422 pgoff = compute_pgoff(arena, uaddr); 423 - if (pgoff + page_cnt > page_cnt_max) 423 + if (pgoff > page_cnt_max - page_cnt) 424 424 /* requested address will be outside of user VMA */ 425 425 return 0; 426 426 } ··· 447 447 goto out; 448 448 449 449 uaddr32 = (u32)(arena->user_vm_start + pgoff * PAGE_SIZE); 450 - /* Earlier checks make sure that uaddr32 + page_cnt * PAGE_SIZE will not overflow 32-bit */ 450 + /* Earlier checks made sure that uaddr32 + page_cnt * PAGE_SIZE - 1 451 + * will not overflow 32-bit. Lower 32-bit need to represent 452 + * contiguous user address range. 453 + * Map these pages at kern_vm_start base. 454 + * kern_vm_start + uaddr32 + page_cnt * PAGE_SIZE - 1 can overflow 455 + * lower 32-bit and it's ok. 456 + */ 451 457 ret = vm_area_map_pages(arena->kern_vm, kern_vm_start + uaddr32, 452 458 kern_vm_start + uaddr32 + page_cnt * PAGE_SIZE, pages); 453 459 if (ret) { ··· 516 510 if (!page) 517 511 continue; 518 512 if (page_cnt == 1 && page_mapped(page)) /* mapped by some user process */ 513 + /* Optimization for the common case of page_cnt==1: 514 + * If page wasn't mapped into some user vma there 515 + * is no need to call zap_pages which is slow. When 516 + * page_cnt is big it's faster to do the batched zap. 517 + */ 519 518 zap_pages(arena, full_uaddr, 1); 520 519 vm_area_unmap_pages(arena->kern_vm, kaddr, kaddr + PAGE_SIZE); 521 520 __free_page(page);
+13
kernel/bpf/bloom_filter.c
··· 80 80 return -EOPNOTSUPP; 81 81 } 82 82 83 + /* Called from syscall */ 84 + static int bloom_map_alloc_check(union bpf_attr *attr) 85 + { 86 + if (attr->value_size > KMALLOC_MAX_SIZE) 87 + /* if value_size is bigger, the user space won't be able to 88 + * access the elements. 89 + */ 90 + return -E2BIG; 91 + 92 + return 0; 93 + } 94 + 83 95 static struct bpf_map *bloom_map_alloc(union bpf_attr *attr) 84 96 { 85 97 u32 bitset_bytes, bitset_mask, nr_hash_funcs, nr_bits; ··· 203 191 BTF_ID_LIST_SINGLE(bpf_bloom_map_btf_ids, struct, bpf_bloom_filter) 204 192 const struct bpf_map_ops bloom_filter_map_ops = { 205 193 .map_meta_equal = bpf_map_meta_equal, 194 + .map_alloc_check = bloom_map_alloc_check, 206 195 .map_alloc = bloom_map_alloc, 207 196 .map_free = bloom_map_free, 208 197 .map_get_next_key = bloom_map_get_next_key,
+1 -1
kernel/bpf/helpers.c
··· 2548 2548 __bpf_kfunc_end_defs(); 2549 2549 2550 2550 BTF_KFUNCS_START(generic_btf_ids) 2551 - #ifdef CONFIG_KEXEC_CORE 2551 + #ifdef CONFIG_CRASH_DUMP 2552 2552 BTF_ID_FLAGS(func, crash_kexec, KF_DESTRUCTIVE) 2553 2553 #endif 2554 2554 BTF_ID_FLAGS(func, bpf_obj_new_impl, KF_ACQUIRE | KF_RET_NULL)
+24 -3
kernel/bpf/verifier.c
··· 5682 5682 return reg->type == PTR_TO_FLOW_KEYS; 5683 5683 } 5684 5684 5685 + static bool is_arena_reg(struct bpf_verifier_env *env, int regno) 5686 + { 5687 + const struct bpf_reg_state *reg = reg_state(env, regno); 5688 + 5689 + return reg->type == PTR_TO_ARENA; 5690 + } 5691 + 5685 5692 static u32 *reg2btf_ids[__BPF_REG_TYPE_MAX] = { 5686 5693 #ifdef CONFIG_NET 5687 5694 [PTR_TO_SOCKET] = &btf_sock_ids[BTF_SOCK_TYPE_SOCK], ··· 6701 6694 err = check_stack_slot_within_bounds(env, min_off, state, type); 6702 6695 if (!err && max_off > 0) 6703 6696 err = -EINVAL; /* out of stack access into non-negative offsets */ 6697 + if (!err && access_size < 0) 6698 + /* access_size should not be negative (or overflow an int); others checks 6699 + * along the way should have prevented such an access. 6700 + */ 6701 + err = -EFAULT; /* invalid negative access size; integer overflow? */ 6704 6702 6705 6703 if (err) { 6706 6704 if (tnum_is_const(reg->var_off)) { ··· 7031 7019 if (is_ctx_reg(env, insn->dst_reg) || 7032 7020 is_pkt_reg(env, insn->dst_reg) || 7033 7021 is_flow_key_reg(env, insn->dst_reg) || 7034 - is_sk_reg(env, insn->dst_reg)) { 7022 + is_sk_reg(env, insn->dst_reg) || 7023 + is_arena_reg(env, insn->dst_reg)) { 7035 7024 verbose(env, "BPF_ATOMIC stores into R%d %s is not allowed\n", 7036 7025 insn->dst_reg, 7037 7026 reg_type_str(env, reg_state(env, insn->dst_reg)->type)); ··· 14027 14014 verbose(env, "addr_space_cast insn can only convert between address space 1 and 0\n"); 14028 14015 return -EINVAL; 14029 14016 } 14017 + if (!env->prog->aux->arena) { 14018 + verbose(env, "addr_space_cast insn can only be used in a program that has an associated arena\n"); 14019 + return -EINVAL; 14020 + } 14030 14021 } else { 14031 14022 if ((insn->off != 0 && insn->off != 8 && insn->off != 16 && 14032 14023 insn->off != 32) || insn->imm) { ··· 14063 14046 if (insn->imm) { 14064 14047 /* off == BPF_ADDR_SPACE_CAST */ 14065 14048 mark_reg_unknown(env, regs, insn->dst_reg); 14066 - if (insn->imm == 1) /* cast from as(1) to as(0) */ 14049 + if (insn->imm == 1) { /* cast from as(1) to as(0) */ 14067 14050 dst_reg->type = PTR_TO_ARENA; 14051 + /* PTR_TO_ARENA is 32-bit */ 14052 + dst_reg->subreg_def = env->insn_idx + 1; 14053 + } 14068 14054 } else if (insn->off == 0) { 14069 14055 /* case: R1 = R2 14070 14056 * copy register state to dest reg ··· 19621 19601 (((struct bpf_map *)env->prog->aux->arena)->map_flags & BPF_F_NO_USER_CONV)) { 19622 19602 /* convert to 32-bit mov that clears upper 32-bit */ 19623 19603 insn->code = BPF_ALU | BPF_MOV | BPF_X; 19624 - /* clear off, so it's a normal 'wX = wY' from JIT pov */ 19604 + /* clear off and imm, so it's a normal 'wX = wY' from JIT pov */ 19625 19605 insn->off = 0; 19606 + insn->imm = 0; 19626 19607 } /* cast from as(0) to as(1) should be handled by JIT */ 19627 19608 goto next_insn; 19628 19609 }
+2 -2
net/core/sock.c
··· 482 482 unsigned long flags; 483 483 struct sk_buff_head *list = &sk->sk_receive_queue; 484 484 485 - if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) { 485 + if (atomic_read(&sk->sk_rmem_alloc) >= READ_ONCE(sk->sk_rcvbuf)) { 486 486 atomic_inc(&sk->sk_drops); 487 487 trace_sock_rcvqueue_full(sk, skb); 488 488 return -ENOMEM; ··· 552 552 553 553 skb->dev = NULL; 554 554 555 - if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) { 555 + if (sk_rcvqueues_full(sk, READ_ONCE(sk->sk_rcvbuf))) { 556 556 atomic_inc(&sk->sk_drops); 557 557 goto discard_and_relse; 558 558 }
+2 -1
net/hsr/hsr_slave.c
··· 220 220 netdev_update_features(master->dev); 221 221 dev_set_mtu(master->dev, hsr_get_max_mtu(hsr)); 222 222 netdev_rx_handler_unregister(port->dev); 223 - dev_set_promiscuity(port->dev, -1); 223 + if (!port->hsr->fwd_offloaded) 224 + dev_set_promiscuity(port->dev, -1); 224 225 netdev_upper_dev_unlink(port->dev, master->dev); 225 226 } 226 227
+14
net/ipv4/inet_connection_sock.c
··· 771 771 } 772 772 EXPORT_SYMBOL(inet_csk_clear_xmit_timers); 773 773 774 + void inet_csk_clear_xmit_timers_sync(struct sock *sk) 775 + { 776 + struct inet_connection_sock *icsk = inet_csk(sk); 777 + 778 + /* ongoing timer handlers need to acquire socket lock. */ 779 + sock_not_owned_by_me(sk); 780 + 781 + icsk->icsk_pending = icsk->icsk_ack.pending = 0; 782 + 783 + sk_stop_timer_sync(sk, &icsk->icsk_retransmit_timer); 784 + sk_stop_timer_sync(sk, &icsk->icsk_delack_timer); 785 + sk_stop_timer_sync(sk, &sk->sk_timer); 786 + } 787 + 774 788 void inet_csk_delete_keepalive_timer(struct sock *sk) 775 789 { 776 790 sk_stop_timer(sk, &sk->sk_timer);
+57 -13
net/ipv4/inet_fragment.c
··· 24 24 #include <net/ip.h> 25 25 #include <net/ipv6.h> 26 26 27 + #include "../core/sock_destructor.h" 28 + 27 29 /* Use skb->cb to track consecutive/adjacent fragments coming at 28 30 * the end of the queue. Nodes in the rb-tree queue will 29 31 * contain "runs" of one or more adjacent fragments. ··· 41 39 }; 42 40 struct sk_buff *next_frag; 43 41 int frag_run_len; 42 + int ip_defrag_offset; 44 43 }; 45 44 46 45 #define FRAG_CB(skb) ((struct ipfrag_skb_cb *)((skb)->cb)) ··· 399 396 */ 400 397 if (!last) 401 398 fragrun_create(q, skb); /* First fragment. */ 402 - else if (last->ip_defrag_offset + last->len < end) { 399 + else if (FRAG_CB(last)->ip_defrag_offset + last->len < end) { 403 400 /* This is the common case: skb goes to the end. */ 404 401 /* Detect and discard overlaps. */ 405 - if (offset < last->ip_defrag_offset + last->len) 402 + if (offset < FRAG_CB(last)->ip_defrag_offset + last->len) 406 403 return IPFRAG_OVERLAP; 407 - if (offset == last->ip_defrag_offset + last->len) 404 + if (offset == FRAG_CB(last)->ip_defrag_offset + last->len) 408 405 fragrun_append_to_last(q, skb); 409 406 else 410 407 fragrun_create(q, skb); ··· 421 418 422 419 parent = *rbn; 423 420 curr = rb_to_skb(parent); 424 - curr_run_end = curr->ip_defrag_offset + 421 + curr_run_end = FRAG_CB(curr)->ip_defrag_offset + 425 422 FRAG_CB(curr)->frag_run_len; 426 - if (end <= curr->ip_defrag_offset) 423 + if (end <= FRAG_CB(curr)->ip_defrag_offset) 427 424 rbn = &parent->rb_left; 428 425 else if (offset >= curr_run_end) 429 426 rbn = &parent->rb_right; 430 - else if (offset >= curr->ip_defrag_offset && 427 + else if (offset >= FRAG_CB(curr)->ip_defrag_offset && 431 428 end <= curr_run_end) 432 429 return IPFRAG_DUP; 433 430 else ··· 441 438 rb_insert_color(&skb->rbnode, &q->rb_fragments); 442 439 } 443 440 444 - skb->ip_defrag_offset = offset; 441 + FRAG_CB(skb)->ip_defrag_offset = offset; 445 442 446 443 return IPFRAG_OK; 447 444 } ··· 451 448 struct sk_buff *parent) 452 449 { 453 450 struct sk_buff *fp, *head = skb_rb_first(&q->rb_fragments); 454 - struct sk_buff **nextp; 451 + void (*destructor)(struct sk_buff *); 452 + unsigned int orig_truesize = 0; 453 + struct sk_buff **nextp = NULL; 454 + struct sock *sk = skb->sk; 455 455 int delta; 456 + 457 + if (sk && is_skb_wmem(skb)) { 458 + /* TX: skb->sk might have been passed as argument to 459 + * dst->output and must remain valid until tx completes. 460 + * 461 + * Move sk to reassembled skb and fix up wmem accounting. 462 + */ 463 + orig_truesize = skb->truesize; 464 + destructor = skb->destructor; 465 + } 456 466 457 467 if (head != skb) { 458 468 fp = skb_clone(skb, GFP_ATOMIC); 459 - if (!fp) 460 - return NULL; 469 + if (!fp) { 470 + head = skb; 471 + goto out_restore_sk; 472 + } 461 473 FRAG_CB(fp)->next_frag = FRAG_CB(skb)->next_frag; 462 474 if (RB_EMPTY_NODE(&skb->rbnode)) 463 475 FRAG_CB(parent)->next_frag = fp; ··· 481 463 &q->rb_fragments); 482 464 if (q->fragments_tail == skb) 483 465 q->fragments_tail = fp; 466 + 467 + if (orig_truesize) { 468 + /* prevent skb_morph from releasing sk */ 469 + skb->sk = NULL; 470 + skb->destructor = NULL; 471 + } 484 472 skb_morph(skb, head); 485 473 FRAG_CB(skb)->next_frag = FRAG_CB(head)->next_frag; 486 474 rb_replace_node(&head->rbnode, &skb->rbnode, ··· 494 470 consume_skb(head); 495 471 head = skb; 496 472 } 497 - WARN_ON(head->ip_defrag_offset != 0); 473 + WARN_ON(FRAG_CB(head)->ip_defrag_offset != 0); 498 474 499 475 delta = -head->truesize; 500 476 501 477 /* Head of list must not be cloned. */ 502 478 if (skb_unclone(head, GFP_ATOMIC)) 503 - return NULL; 479 + goto out_restore_sk; 504 480 505 481 delta += head->truesize; 506 482 if (delta) ··· 516 492 517 493 clone = alloc_skb(0, GFP_ATOMIC); 518 494 if (!clone) 519 - return NULL; 495 + goto out_restore_sk; 520 496 skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; 521 497 skb_frag_list_init(head); 522 498 for (i = 0; i < skb_shinfo(head)->nr_frags; i++) ··· 533 509 nextp = &skb_shinfo(head)->frag_list; 534 510 } 535 511 512 + out_restore_sk: 513 + if (orig_truesize) { 514 + int ts_delta = head->truesize - orig_truesize; 515 + 516 + /* if this reassembled skb is fragmented later, 517 + * fraglist skbs will get skb->sk assigned from head->sk, 518 + * and each frag skb will be released via sock_wfree. 519 + * 520 + * Update sk_wmem_alloc. 521 + */ 522 + head->sk = sk; 523 + head->destructor = destructor; 524 + refcount_add(ts_delta, &sk->sk_wmem_alloc); 525 + } 526 + 536 527 return nextp; 537 528 } 538 529 EXPORT_SYMBOL(inet_frag_reasm_prepare); ··· 555 516 void inet_frag_reasm_finish(struct inet_frag_queue *q, struct sk_buff *head, 556 517 void *reasm_data, bool try_coalesce) 557 518 { 519 + struct sock *sk = is_skb_wmem(head) ? head->sk : NULL; 520 + const unsigned int head_truesize = head->truesize; 558 521 struct sk_buff **nextp = reasm_data; 559 522 struct rb_node *rbn; 560 523 struct sk_buff *fp; ··· 620 579 head->prev = NULL; 621 580 head->tstamp = q->stamp; 622 581 head->mono_delivery_time = q->mono_delivery_time; 582 + 583 + if (sk) 584 + refcount_add(sum_truesize - head_truesize, &sk->sk_wmem_alloc); 623 585 } 624 586 EXPORT_SYMBOL(inet_frag_reasm_finish); 625 587
+1 -1
net/ipv4/ip_fragment.c
··· 384 384 } 385 385 386 386 skb_dst_drop(skb); 387 + skb_orphan(skb); 387 388 return -EINPROGRESS; 388 389 389 390 insert_error: ··· 488 487 struct ipq *qp; 489 488 490 489 __IP_INC_STATS(net, IPSTATS_MIB_REASMREQDS); 491 - skb_orphan(skb); 492 490 493 491 /* Lookup (or create) queue header */ 494 492 qp = ip_find(net, ip_hdr(skb), user, vif);
+1
net/ipv4/netfilter/Kconfig
··· 329 329 config IP_NF_ARPFILTER 330 330 tristate "arptables-legacy packet filtering support" 331 331 select IP_NF_ARPTABLES 332 + select NETFILTER_FAMILY_ARP 332 333 depends on NETFILTER_XTABLES 333 334 help 334 335 ARP packet filtering defines a table `filter', which has a series of
+3 -1
net/ipv4/nexthop.c
··· 768 768 struct net *net = nh->net; 769 769 int err; 770 770 771 - if (nexthop_notifiers_is_empty(net)) 771 + if (nexthop_notifiers_is_empty(net)) { 772 + *hw_stats_used = false; 772 773 return 0; 774 + } 773 775 774 776 err = nh_notifier_grp_hw_stats_init(&info, nh); 775 777 if (err)
+2
net/ipv4/tcp.c
··· 2931 2931 lock_sock(sk); 2932 2932 __tcp_close(sk, timeout); 2933 2933 release_sock(sk); 2934 + if (!sk->sk_net_refcnt) 2935 + inet_csk_clear_xmit_timers_sync(sk); 2934 2936 sock_put(sk); 2935 2937 } 2936 2938 EXPORT_SYMBOL(tcp_close);
+3 -2
net/ipv6/addrconf.c
··· 5416 5416 5417 5417 err = 0; 5418 5418 if (fillargs.ifindex) { 5419 - err = -ENODEV; 5420 5419 dev = dev_get_by_index_rcu(tgt_net, fillargs.ifindex); 5421 - if (!dev) 5420 + if (!dev) { 5421 + err = -ENODEV; 5422 5422 goto done; 5423 + } 5423 5424 idev = __in6_dev_get(dev); 5424 5425 if (idev) 5425 5426 err = in6_dump_addrs(idev, skb, cb,
+1 -1
net/ipv6/netfilter/nf_conntrack_reasm.c
··· 294 294 } 295 295 296 296 skb_dst_drop(skb); 297 + skb_orphan(skb); 297 298 return -EINPROGRESS; 298 299 299 300 insert_error: ··· 470 469 hdr = ipv6_hdr(skb); 471 470 fhdr = (struct frag_hdr *)skb_transport_header(skb); 472 471 473 - skb_orphan(skb); 474 472 fq = fq_find(net, fhdr->identification, user, hdr, 475 473 skb->dev ? skb->dev->ifindex : 0); 476 474 if (fq == NULL) {
+2 -3
net/mac80211/cfg.c
··· 2199 2199 } 2200 2200 2201 2201 if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && 2202 - sta->sdata->u.vlan.sta) { 2203 - ieee80211_clear_fast_rx(sta); 2202 + sta->sdata->u.vlan.sta) 2204 2203 RCU_INIT_POINTER(sta->sdata->u.vlan.sta, NULL); 2205 - } 2206 2204 2207 2205 if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) 2208 2206 ieee80211_vif_dec_num_mcast(sta->sdata); 2209 2207 2210 2208 sta->sdata = vlansdata; 2209 + ieee80211_check_fast_rx(sta); 2211 2210 ieee80211_check_fast_xmit(sta); 2212 2211 2213 2212 if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) {
+1 -1
net/mac80211/debug.h
··· 158 158 _sdata_dbg(print, sdata, "[link %d] " fmt, \ 159 159 link_id, ##__VA_ARGS__); \ 160 160 else \ 161 - _sdata_dbg(1, sdata, fmt, ##__VA_ARGS__); \ 161 + _sdata_dbg(print, sdata, fmt, ##__VA_ARGS__); \ 162 162 } while (0) 163 163 #define link_dbg(link, fmt, ...) \ 164 164 _link_id_dbg(1, (link)->sdata, (link)->link_id, \
+2 -2
net/mac80211/ieee80211_i.h
··· 131 131 }; 132 132 133 133 /** 134 - * enum ieee80211_corrupt_data_flags - BSS data corruption flags 134 + * enum ieee80211_bss_corrupt_data_flags - BSS data corruption flags 135 135 * @IEEE80211_BSS_CORRUPT_BEACON: last beacon frame received was corrupted 136 136 * @IEEE80211_BSS_CORRUPT_PROBE_RESP: last probe response received was corrupted 137 137 * ··· 144 144 }; 145 145 146 146 /** 147 - * enum ieee80211_valid_data_flags - BSS valid data flags 147 + * enum ieee80211_bss_valid_data_flags - BSS valid data flags 148 148 * @IEEE80211_BSS_VALID_WMM: WMM/UAPSD data was gathered from non-corrupt IE 149 149 * @IEEE80211_BSS_VALID_RATES: Supported rates were gathered from non-corrupt IE 150 150 * @IEEE80211_BSS_VALID_ERP: ERP flag was gathered from non-corrupt IE
+12 -3
net/mac80211/mlme.c
··· 5874 5874 } 5875 5875 5876 5876 if (sdata->vif.active_links != active_links) { 5877 + /* usable links are affected when active_links are changed, 5878 + * so notify the driver about the status change 5879 + */ 5880 + changed |= BSS_CHANGED_MLD_VALID_LINKS; 5881 + active_links &= sdata->vif.active_links; 5882 + if (!active_links) 5883 + active_links = 5884 + BIT(__ffs(sdata->vif.valid_links & 5885 + ~dormant_links)); 5877 5886 ret = ieee80211_set_active_links(&sdata->vif, active_links); 5878 5887 if (ret) { 5879 5888 sdata_info(sdata, "Failed to set TTLM active links\n"); ··· 5897 5888 goto out; 5898 5889 } 5899 5890 5900 - changed |= BSS_CHANGED_MLD_VALID_LINKS; 5901 5891 sdata->vif.suspended_links = suspended_links; 5902 5892 if (sdata->vif.suspended_links) 5903 5893 changed |= BSS_CHANGED_MLD_TTLM; ··· 7660 7652 sdata_info(sdata, 7661 7653 "failed to insert STA entry for the AP (error %d)\n", 7662 7654 err); 7663 - goto out_err; 7655 + goto out_release_chan; 7664 7656 } 7665 7657 } else 7666 7658 WARN_ON_ONCE(!ether_addr_equal(link->u.mgd.bssid, cbss->bssid)); ··· 7671 7663 7672 7664 return 0; 7673 7665 7666 + out_release_chan: 7667 + ieee80211_link_release_channel(link); 7674 7668 out_err: 7675 - ieee80211_link_release_channel(&sdata->deflink); 7676 7669 ieee80211_vif_set_links(sdata, 0, 0); 7677 7670 return err; 7678 7671 }
+42 -8
net/netfilter/nf_tables_api.c
··· 1200 1200 __NFT_TABLE_F_WAS_AWAKEN | \ 1201 1201 __NFT_TABLE_F_WAS_ORPHAN) 1202 1202 1203 + static bool nft_table_pending_update(const struct nft_ctx *ctx) 1204 + { 1205 + struct nftables_pernet *nft_net = nft_pernet(ctx->net); 1206 + struct nft_trans *trans; 1207 + 1208 + if (ctx->table->flags & __NFT_TABLE_F_UPDATE) 1209 + return true; 1210 + 1211 + list_for_each_entry(trans, &nft_net->commit_list, list) { 1212 + if ((trans->msg_type == NFT_MSG_NEWCHAIN || 1213 + trans->msg_type == NFT_MSG_DELCHAIN) && 1214 + trans->ctx.table == ctx->table && 1215 + nft_trans_chain_update(trans)) 1216 + return true; 1217 + } 1218 + 1219 + return false; 1220 + } 1221 + 1203 1222 static int nf_tables_updtable(struct nft_ctx *ctx) 1204 1223 { 1205 1224 struct nft_trans *trans; ··· 1245 1226 return -EOPNOTSUPP; 1246 1227 1247 1228 /* No dormant off/on/off/on games in single transaction */ 1248 - if (ctx->table->flags & __NFT_TABLE_F_UPDATE) 1229 + if (nft_table_pending_update(ctx)) 1249 1230 return -EINVAL; 1250 1231 1251 1232 trans = nft_trans_alloc(ctx, NFT_MSG_NEWTABLE, ··· 2650 2631 } 2651 2632 } 2652 2633 2634 + if (table->flags & __NFT_TABLE_F_UPDATE && 2635 + !list_empty(&hook.list)) { 2636 + NL_SET_BAD_ATTR(extack, attr); 2637 + err = -EOPNOTSUPP; 2638 + goto err_hooks; 2639 + } 2640 + 2653 2641 if (!(table->flags & NFT_TABLE_F_DORMANT) && 2654 2642 nft_is_base_chain(chain) && 2655 2643 !list_empty(&hook.list)) { ··· 2886 2860 struct nft_trans *trans; 2887 2861 int err; 2888 2862 2863 + if (ctx->table->flags & __NFT_TABLE_F_UPDATE) 2864 + return -EOPNOTSUPP; 2865 + 2889 2866 err = nft_chain_parse_hook(ctx->net, basechain, nla, &chain_hook, 2890 2867 ctx->family, chain->flags, extack); 2891 2868 if (err < 0) ··· 2973 2944 nft_ctx_init(&ctx, net, skb, info->nlh, family, table, chain, nla); 2974 2945 2975 2946 if (nla[NFTA_CHAIN_HOOK]) { 2976 - if (chain->flags & NFT_CHAIN_HW_OFFLOAD) 2947 + if (NFNL_MSG_TYPE(info->nlh->nlmsg_type) == NFT_MSG_DESTROYCHAIN || 2948 + chain->flags & NFT_CHAIN_HW_OFFLOAD) 2977 2949 return -EOPNOTSUPP; 2978 2950 2979 2951 if (nft_is_base_chain(chain)) { ··· 10212 10182 if (nft_trans_chain_update(trans)) { 10213 10183 nf_tables_chain_notify(&trans->ctx, NFT_MSG_DELCHAIN, 10214 10184 &nft_trans_chain_hooks(trans)); 10215 - nft_netdev_unregister_hooks(net, 10216 - &nft_trans_chain_hooks(trans), 10217 - true); 10185 + if (!(trans->ctx.table->flags & NFT_TABLE_F_DORMANT)) { 10186 + nft_netdev_unregister_hooks(net, 10187 + &nft_trans_chain_hooks(trans), 10188 + true); 10189 + } 10218 10190 } else { 10219 10191 nft_chain_del(trans->ctx.chain); 10220 10192 nf_tables_chain_notify(&trans->ctx, NFT_MSG_DELCHAIN, ··· 10492 10460 break; 10493 10461 case NFT_MSG_NEWCHAIN: 10494 10462 if (nft_trans_chain_update(trans)) { 10495 - nft_netdev_unregister_hooks(net, 10496 - &nft_trans_chain_hooks(trans), 10497 - true); 10463 + if (!(trans->ctx.table->flags & NFT_TABLE_F_DORMANT)) { 10464 + nft_netdev_unregister_hooks(net, 10465 + &nft_trans_chain_hooks(trans), 10466 + true); 10467 + } 10498 10468 free_percpu(nft_trans_chain_stats(trans)); 10499 10469 kfree(nft_trans_chain_name(trans)); 10500 10470 nft_trans_destroy(trans);
+5
net/nfc/nci/core.c
··· 1516 1516 nfc_send_to_raw_sock(ndev->nfc_dev, skb, 1517 1517 RAW_PAYLOAD_NCI, NFC_DIRECTION_RX); 1518 1518 1519 + if (!nci_plen(skb->data)) { 1520 + kfree_skb(skb); 1521 + break; 1522 + } 1523 + 1519 1524 /* Process frame */ 1520 1525 switch (nci_mt(skb->data)) { 1521 1526 case NCI_MT_RSP_PKT:
+5 -2
net/tls/tls_sw.c
··· 1976 1976 if (unlikely(flags & MSG_ERRQUEUE)) 1977 1977 return sock_recv_errqueue(sk, msg, len, SOL_IP, IP_RECVERR); 1978 1978 1979 - psock = sk_psock_get(sk); 1980 1979 err = tls_rx_reader_lock(sk, ctx, flags & MSG_DONTWAIT); 1981 1980 if (err < 0) 1982 1981 return err; 1982 + psock = sk_psock_get(sk); 1983 1983 bpf_strp_enabled = sk_psock_strp_enabled(psock); 1984 1984 1985 1985 /* If crypto failed the connection is broken */ ··· 2152 2152 } 2153 2153 2154 2154 /* Drain records from the rx_list & copy if required */ 2155 - if (is_peek || is_kvec) 2155 + if (is_peek) 2156 2156 err = process_rx_list(ctx, msg, &control, copied + peeked, 2157 2157 decrypted - peeked, is_peek, NULL); 2158 2158 else 2159 2159 err = process_rx_list(ctx, msg, &control, 0, 2160 2160 async_copy_bytes, is_peek, NULL); 2161 + 2162 + /* we could have copied less than we wanted, and possibly nothing */ 2163 + decrypted += max(err, 0) - async_copy_bytes; 2161 2164 } 2162 2165 2163 2166 copied += decrypted;
+1 -1
net/wireless/trace.h
··· 1024 1024 TRACE_EVENT(rdev_dump_mpp, 1025 1025 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx, 1026 1026 u8 *dst, u8 *mpp), 1027 - TP_ARGS(wiphy, netdev, _idx, mpp, dst), 1027 + TP_ARGS(wiphy, netdev, _idx, dst, mpp), 1028 1028 TP_STRUCT__entry( 1029 1029 WIPHY_ENTRY 1030 1030 NETDEV_ENTRY
+5 -2
net/wireless/wext-core.c
··· 4 4 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> 5 5 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved. 6 6 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> 7 + * Copyright (C) 2024 Intel Corporation 7 8 * 8 9 * (As all part of the Linux kernel, this file is GPL) 9 10 */ ··· 663 662 dev->ieee80211_ptr->wiphy->wext && 664 663 dev->ieee80211_ptr->wiphy->wext->get_wireless_stats) { 665 664 wireless_warn_cfg80211_wext(); 666 - if (dev->ieee80211_ptr->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO) 665 + if (dev->ieee80211_ptr->wiphy->flags & (WIPHY_FLAG_SUPPORTS_MLO | 666 + WIPHY_FLAG_DISABLE_WEXT)) 667 667 return NULL; 668 668 return dev->ieee80211_ptr->wiphy->wext->get_wireless_stats(dev); 669 669 } ··· 706 704 #ifdef CONFIG_CFG80211_WEXT 707 705 if (dev->ieee80211_ptr && dev->ieee80211_ptr->wiphy) { 708 706 wireless_warn_cfg80211_wext(); 709 - if (dev->ieee80211_ptr->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO) 707 + if (dev->ieee80211_ptr->wiphy->flags & (WIPHY_FLAG_SUPPORTS_MLO | 708 + WIPHY_FLAG_DISABLE_WEXT)) 710 709 return NULL; 711 710 handlers = dev->ieee80211_ptr->wiphy->wext; 712 711 }
+2 -2
scripts/bpf_doc.py
··· 414 414 version = version.stdout.decode().rstrip() 415 415 except: 416 416 try: 417 - version = subprocess.run(['make', 'kernelversion'], cwd=linuxRoot, 418 - capture_output=True, check=True) 417 + version = subprocess.run(['make', '-s', '--no-print-directory', 'kernelversion'], 418 + cwd=linuxRoot, capture_output=True, check=True) 419 419 version = version.stdout.decode().rstrip() 420 420 except: 421 421 return 'Linux'
+1 -1
tools/bpf/bpftool/gen.c
··· 121 121 int i, n; 122 122 123 123 /* recognize hard coded LLVM section name */ 124 - if (strcmp(sec_name, ".arena.1") == 0) { 124 + if (strcmp(sec_name, ".addr_space.1") == 0) { 125 125 /* this is the name to use in skeleton */ 126 126 snprintf(buf, buf_sz, "arena"); 127 127 return true;
+7 -3
tools/lib/bpf/libbpf.c
··· 498 498 #define KSYMS_SEC ".ksyms" 499 499 #define STRUCT_OPS_SEC ".struct_ops" 500 500 #define STRUCT_OPS_LINK_SEC ".struct_ops.link" 501 - #define ARENA_SEC ".arena.1" 501 + #define ARENA_SEC ".addr_space.1" 502 502 503 503 enum libbpf_map_type { 504 504 LIBBPF_MAP_UNSPEC, ··· 1649 1649 { 1650 1650 return syscall(__NR_memfd_create, name, flags); 1651 1651 } 1652 + 1653 + #ifndef MFD_CLOEXEC 1654 + #define MFD_CLOEXEC 0x0001U 1655 + #endif 1652 1656 1653 1657 static int create_placeholder_fd(void) 1654 1658 { ··· 5356 5352 goto err_out; 5357 5353 } 5358 5354 if (map->def.type == BPF_MAP_TYPE_ARENA) { 5359 - map->mmaped = mmap((void *)map->map_extra, bpf_map_mmap_sz(map), 5360 - PROT_READ | PROT_WRITE, 5355 + map->mmaped = mmap((void *)(long)map->map_extra, 5356 + bpf_map_mmap_sz(map), PROT_READ | PROT_WRITE, 5361 5357 map->map_extra ? MAP_SHARED | MAP_FIXED : MAP_SHARED, 5362 5358 map->fd, 0); 5363 5359 if (map->mmaped == MAP_FAILED) {
+5 -2
tools/net/ynl/ynl-gen-c.py
··· 228 228 presence = '' 229 229 for i in range(0, len(ref)): 230 230 presence = f"{var}->{'.'.join(ref[:i] + [''])}_present.{ref[i]}" 231 - if self.presence_type() == 'bit': 232 - code.append(presence + ' = 1;') 231 + # Every layer below last is a nest, so we know it uses bit presence 232 + # last layer is "self" and may be a complex type 233 + if i == len(ref) - 1 and self.presence_type() != 'bit': 234 + continue 235 + code.append(presence + ' = 1;') 233 236 code += self._setter_lines(ri, member, presence) 234 237 235 238 func_name = f"{op_prefix(ri, direction, deref=deref)}_set_{'_'.join(ref)}"
+2
tools/testing/kunit/configs/all_tests.config
··· 28 28 CONFIG_INET=y 29 29 CONFIG_MPTCP=y 30 30 31 + CONFIG_NETDEVICES=y 32 + CONFIG_WLAN=y 31 33 CONFIG_CFG80211=y 32 34 CONFIG_MAC80211=y 33 35 CONFIG_WLAN_VENDOR_INTEL=y
+1 -1
tools/testing/selftests/bpf/bpf_arena_common.h
··· 32 32 */ 33 33 #endif 34 34 35 - #if defined(__BPF_FEATURE_ARENA_CAST) && !defined(BPF_ARENA_FORCE_ASM) 35 + #if defined(__BPF_FEATURE_ADDR_SPACE_CAST) && !defined(BPF_ARENA_FORCE_ASM) 36 36 #define __arena __attribute__((address_space(1))) 37 37 #define cast_kern(ptr) /* nop for bpf prog. emitted by LLVM */ 38 38 #define cast_user(ptr) /* nop for bpf prog. emitted by LLVM */
+5 -3
tools/testing/selftests/bpf/prog_tests/arena_htab.c
··· 3 3 #include <test_progs.h> 4 4 #include <sys/mman.h> 5 5 #include <network_helpers.h> 6 - 6 + #include <sys/user.h> 7 + #ifndef PAGE_SIZE /* on some archs it comes in sys/user.h */ 8 + #include <unistd.h> 9 + #define PAGE_SIZE getpagesize() 10 + #endif 7 11 #include "arena_htab_asm.skel.h" 8 12 #include "arena_htab.skel.h" 9 - 10 - #define PAGE_SIZE 4096 11 13 12 14 #include "bpf_arena_htab.h" 13 15
+5 -2
tools/testing/selftests/bpf/prog_tests/arena_list.c
··· 3 3 #include <test_progs.h> 4 4 #include <sys/mman.h> 5 5 #include <network_helpers.h> 6 - 7 - #define PAGE_SIZE 4096 6 + #include <sys/user.h> 7 + #ifndef PAGE_SIZE /* on some archs it comes in sys/user.h */ 8 + #include <unistd.h> 9 + #define PAGE_SIZE getpagesize() 10 + #endif 8 11 9 12 #include "bpf_arena_list.h" 10 13 #include "arena_list.skel.h"
+6
tools/testing/selftests/bpf/prog_tests/bloom_filter_map.c
··· 2 2 /* Copyright (c) 2021 Facebook */ 3 3 4 4 #include <sys/syscall.h> 5 + #include <limits.h> 5 6 #include <test_progs.h> 6 7 #include "bloom_filter_map.skel.h" 7 8 ··· 20 19 /* Invalid value size */ 21 20 fd = bpf_map_create(BPF_MAP_TYPE_BLOOM_FILTER, NULL, 0, 0, 100, NULL); 22 21 if (!ASSERT_LT(fd, 0, "bpf_map_create bloom filter invalid value size 0")) 22 + close(fd); 23 + 24 + /* Invalid value size: too big */ 25 + fd = bpf_map_create(BPF_MAP_TYPE_BLOOM_FILTER, NULL, 0, INT32_MAX, 100, NULL); 26 + if (!ASSERT_LT(fd, 0, "bpf_map_create bloom filter invalid value too large")) 23 27 close(fd); 24 28 25 29 /* Invalid max entries size */
+2
tools/testing/selftests/bpf/prog_tests/verifier.c
··· 5 5 #include "cap_helpers.h" 6 6 #include "verifier_and.skel.h" 7 7 #include "verifier_arena.skel.h" 8 + #include "verifier_arena_large.skel.h" 8 9 #include "verifier_array_access.skel.h" 9 10 #include "verifier_basic_stack.skel.h" 10 11 #include "verifier_bitfield_write.skel.h" ··· 121 120 122 121 void test_verifier_and(void) { RUN(verifier_and); } 123 122 void test_verifier_arena(void) { RUN(verifier_arena); } 123 + void test_verifier_arena_large(void) { RUN(verifier_arena_large); } 124 124 void test_verifier_basic_stack(void) { RUN(verifier_basic_stack); } 125 125 void test_verifier_bitfield_write(void) { RUN(verifier_bitfield_write); } 126 126 void test_verifier_bounds(void) { RUN(verifier_bounds); }
+1 -1
tools/testing/selftests/bpf/progs/arena_htab.c
··· 22 22 SEC("syscall") 23 23 int arena_htab_llvm(void *ctx) 24 24 { 25 - #if defined(__BPF_FEATURE_ARENA_CAST) || defined(BPF_ARENA_FORCE_ASM) 25 + #if defined(__BPF_FEATURE_ADDR_SPACE_CAST) || defined(BPF_ARENA_FORCE_ASM) 26 26 struct htab __arena *htab; 27 27 __u64 i; 28 28
+5 -5
tools/testing/selftests/bpf/progs/arena_list.c
··· 30 30 int cnt; 31 31 bool skip = false; 32 32 33 - #ifdef __BPF_FEATURE_ARENA_CAST 33 + #ifdef __BPF_FEATURE_ADDR_SPACE_CAST 34 34 long __arena arena_sum; 35 35 int __arena test_val = 1; 36 36 struct arena_list_head __arena global_head; 37 37 #else 38 - long arena_sum SEC(".arena.1"); 39 - int test_val SEC(".arena.1"); 38 + long arena_sum SEC(".addr_space.1"); 39 + int test_val SEC(".addr_space.1"); 40 40 #endif 41 41 42 42 int zero; ··· 44 44 SEC("syscall") 45 45 int arena_list_add(void *ctx) 46 46 { 47 - #ifdef __BPF_FEATURE_ARENA_CAST 47 + #ifdef __BPF_FEATURE_ADDR_SPACE_CAST 48 48 __u64 i; 49 49 50 50 list_head = &global_head; ··· 66 66 SEC("syscall") 67 67 int arena_list_del(void *ctx) 68 68 { 69 - #ifdef __BPF_FEATURE_ARENA_CAST 69 + #ifdef __BPF_FEATURE_ADDR_SPACE_CAST 70 70 struct elem __arena *n; 71 71 int sum = 0; 72 72
+7 -3
tools/testing/selftests/bpf/progs/verifier_arena.c
··· 12 12 __uint(type, BPF_MAP_TYPE_ARENA); 13 13 __uint(map_flags, BPF_F_MMAPABLE); 14 14 __uint(max_entries, 2); /* arena of two pages close to 32-bit boundary*/ 15 - __ulong(map_extra, (1ull << 44) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */ 15 + #ifdef __TARGET_ARCH_arm64 16 + __ulong(map_extra, (1ull << 32) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */ 17 + #else 18 + __ulong(map_extra, (1ull << 44) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */ 19 + #endif 16 20 } arena SEC(".maps"); 17 21 18 22 SEC("syscall") 19 23 __success __retval(0) 20 24 int basic_alloc1(void *ctx) 21 25 { 22 - #if defined(__BPF_FEATURE_ARENA_CAST) 26 + #if defined(__BPF_FEATURE_ADDR_SPACE_CAST) 23 27 volatile int __arena *page1, *page2, *no_page, *page3; 24 28 25 29 page1 = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0); ··· 62 58 __success __retval(0) 63 59 int basic_alloc2(void *ctx) 64 60 { 65 - #if defined(__BPF_FEATURE_ARENA_CAST) 61 + #if defined(__BPF_FEATURE_ADDR_SPACE_CAST) 66 62 volatile char __arena *page1, *page2, *page3, *page4; 67 63 68 64 page1 = bpf_arena_alloc_pages(&arena, NULL, 2, NUMA_NO_NODE, 0);
+68
tools/testing/selftests/bpf/progs/verifier_arena_large.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ 3 + 4 + #include <vmlinux.h> 5 + #include <bpf/bpf_helpers.h> 6 + #include <bpf/bpf_tracing.h> 7 + #include "bpf_misc.h" 8 + #include "bpf_experimental.h" 9 + #include "bpf_arena_common.h" 10 + 11 + #define ARENA_SIZE (1ull << 32) 12 + 13 + struct { 14 + __uint(type, BPF_MAP_TYPE_ARENA); 15 + __uint(map_flags, BPF_F_MMAPABLE); 16 + __uint(max_entries, ARENA_SIZE / PAGE_SIZE); 17 + } arena SEC(".maps"); 18 + 19 + SEC("syscall") 20 + __success __retval(0) 21 + int big_alloc1(void *ctx) 22 + { 23 + #if defined(__BPF_FEATURE_ADDR_SPACE_CAST) 24 + volatile char __arena *page1, *page2, *no_page, *page3; 25 + void __arena *base; 26 + 27 + page1 = base = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0); 28 + if (!page1) 29 + return 1; 30 + *page1 = 1; 31 + page2 = bpf_arena_alloc_pages(&arena, base + ARENA_SIZE - PAGE_SIZE, 32 + 1, NUMA_NO_NODE, 0); 33 + if (!page2) 34 + return 2; 35 + *page2 = 2; 36 + no_page = bpf_arena_alloc_pages(&arena, base + ARENA_SIZE, 37 + 1, NUMA_NO_NODE, 0); 38 + if (no_page) 39 + return 3; 40 + if (*page1 != 1) 41 + return 4; 42 + if (*page2 != 2) 43 + return 5; 44 + bpf_arena_free_pages(&arena, (void __arena *)page1, 1); 45 + if (*page2 != 2) 46 + return 6; 47 + if (*page1 != 0) /* use-after-free should return 0 */ 48 + return 7; 49 + page3 = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0); 50 + if (!page3) 51 + return 8; 52 + *page3 = 3; 53 + if (page1 != page3) 54 + return 9; 55 + if (*page2 != 2) 56 + return 10; 57 + if (*(page1 + PAGE_SIZE) != 0) 58 + return 11; 59 + if (*(page1 - PAGE_SIZE) != 0) 60 + return 12; 61 + if (*(page2 + PAGE_SIZE) != 0) 62 + return 13; 63 + if (*(page2 - PAGE_SIZE) != 0) 64 + return 14; 65 + #endif 66 + return 0; 67 + } 68 + char _license[] SEC("license") = "GPL";
+1
tools/testing/selftests/drivers/net/netdevsim/settings
··· 1 + timeout=600
+128 -77
tools/testing/selftests/net/test_vxlan_mdb.sh
··· 1177 1177 local plen=$1; shift 1178 1178 local enc_ethtype=$1; shift 1179 1179 local grp=$1; shift 1180 + local grp_dmac=$1; shift 1180 1181 local src=$1; shift 1181 1182 local mz=$1; shift 1182 1183 ··· 1196 1195 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep2_ip src_vni 10020" 1197 1196 1198 1197 run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_dst_ip $vtep1_ip action pass" 1199 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1198 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1200 1199 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1201 1200 log_test $? 0 "Destination IP - match" 1202 1201 1203 - run_cmd "ip netns exec $ns1 $mz br0.20 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1202 + run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1204 1203 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1205 1204 log_test $? 0 "Destination IP - no match" 1206 1205 ··· 1213 1212 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip dst_port 1111 src_vni 10020" 1214 1213 1215 1214 run_cmd "tc -n $ns2 filter replace dev veth0 ingress pref 1 handle 101 proto $enc_ethtype flower ip_proto udp dst_port 4789 action pass" 1216 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1215 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1217 1216 tc_check_packets "$ns2" "dev veth0 ingress" 101 1 1218 1217 log_test $? 0 "Default destination port - match" 1219 1218 1220 - run_cmd "ip netns exec $ns1 $mz br0.20 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1219 + run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1221 1220 tc_check_packets "$ns2" "dev veth0 ingress" 101 1 1222 1221 log_test $? 0 "Default destination port - no match" 1223 1222 1224 1223 run_cmd "tc -n $ns2 filter replace dev veth0 ingress pref 1 handle 101 proto $enc_ethtype flower ip_proto udp dst_port 1111 action pass" 1225 - run_cmd "ip netns exec $ns1 $mz br0.20 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1224 + run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1226 1225 tc_check_packets "$ns2" "dev veth0 ingress" 101 1 1227 1226 log_test $? 0 "Non-default destination port - match" 1228 1227 1229 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1228 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1230 1229 tc_check_packets "$ns2" "dev veth0 ingress" 101 1 1231 1230 log_test $? 0 "Non-default destination port - no match" 1232 1231 ··· 1239 1238 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip src_vni 10020" 1240 1239 1241 1240 run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_key_id 10010 action pass" 1242 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1241 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1243 1242 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1244 1243 log_test $? 0 "Default destination VNI - match" 1245 1244 1246 - run_cmd "ip netns exec $ns1 $mz br0.20 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1245 + run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1247 1246 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1248 1247 log_test $? 0 "Default destination VNI - no match" 1249 1248 ··· 1251 1250 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip vni 10010 src_vni 10020" 1252 1251 1253 1252 run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_key_id 10020 action pass" 1254 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1253 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1255 1254 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1256 1255 log_test $? 0 "Non-default destination VNI - match" 1257 1256 1258 - run_cmd "ip netns exec $ns1 $mz br0.20 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1257 + run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1259 1258 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1260 1259 log_test $? 0 "Non-default destination VNI - no match" 1261 1260 ··· 1273 1272 local plen=32 1274 1273 local enc_ethtype="ip" 1275 1274 local grp=239.1.1.1 1275 + local grp_dmac=01:00:5e:01:01:01 1276 1276 local src=192.0.2.129 1277 1277 1278 1278 echo ··· 1281 1279 echo "------------------------------------------------------------------" 1282 1280 1283 1281 encap_params_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $enc_ethtype \ 1284 - $grp $src "mausezahn" 1282 + $grp $grp_dmac $src "mausezahn" 1285 1283 } 1286 1284 1287 1285 encap_params_ipv6_ipv4() ··· 1293 1291 local plen=32 1294 1292 local enc_ethtype="ip" 1295 1293 local grp=ff0e::1 1294 + local grp_dmac=33:33:00:00:00:01 1296 1295 local src=2001:db8:100::1 1297 1296 1298 1297 echo ··· 1301 1298 echo "------------------------------------------------------------------" 1302 1299 1303 1300 encap_params_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $enc_ethtype \ 1304 - $grp $src "mausezahn -6" 1301 + $grp $grp_dmac $src "mausezahn -6" 1305 1302 } 1306 1303 1307 1304 encap_params_ipv4_ipv6() ··· 1313 1310 local plen=128 1314 1311 local enc_ethtype="ipv6" 1315 1312 local grp=239.1.1.1 1313 + local grp_dmac=01:00:5e:01:01:01 1316 1314 local src=192.0.2.129 1317 1315 1318 1316 echo ··· 1321 1317 echo "------------------------------------------------------------------" 1322 1318 1323 1319 encap_params_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $enc_ethtype \ 1324 - $grp $src "mausezahn" 1320 + $grp $grp_dmac $src "mausezahn" 1325 1321 } 1326 1322 1327 1323 encap_params_ipv6_ipv6() ··· 1333 1329 local plen=128 1334 1330 local enc_ethtype="ipv6" 1335 1331 local grp=ff0e::1 1332 + local grp_dmac=33:33:00:00:00:01 1336 1333 local src=2001:db8:100::1 1337 1334 1338 1335 echo ··· 1341 1336 echo "------------------------------------------------------------------" 1342 1337 1343 1338 encap_params_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $enc_ethtype \ 1344 - $grp $src "mausezahn -6" 1339 + $grp $grp_dmac $src "mausezahn -6" 1345 1340 } 1346 1341 1347 1342 starg_exclude_ir_common() ··· 1352 1347 local vtep2_ip=$1; shift 1353 1348 local plen=$1; shift 1354 1349 local grp=$1; shift 1350 + local grp_dmac=$1; shift 1355 1351 local valid_src=$1; shift 1356 1352 local invalid_src=$1; shift 1357 1353 local mz=$1; shift ··· 1374 1368 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source_list $invalid_src dst $vtep2_ip src_vni 10010" 1375 1369 1376 1370 # Check that invalid source is not forwarded to any VTEP. 1377 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1371 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1378 1372 tc_check_packets "$ns2" "dev vx0 ingress" 101 0 1379 1373 log_test $? 0 "Block excluded source - first VTEP" 1380 1374 tc_check_packets "$ns2" "dev vx0 ingress" 102 0 1381 1375 log_test $? 0 "Block excluded source - second VTEP" 1382 1376 1383 1377 # Check that valid source is forwarded to both VTEPs. 1384 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1378 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1385 1379 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1386 1380 log_test $? 0 "Forward valid source - first VTEP" 1387 1381 tc_check_packets "$ns2" "dev vx0 ingress" 102 1 ··· 1391 1385 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep2_ip src_vni 10010" 1392 1386 1393 1387 # Check that invalid source is not forwarded to any VTEP. 1394 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1388 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1395 1389 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1396 1390 log_test $? 0 "Block excluded source after removal - first VTEP" 1397 1391 tc_check_packets "$ns2" "dev vx0 ingress" 102 1 1398 1392 log_test $? 0 "Block excluded source after removal - second VTEP" 1399 1393 1400 1394 # Check that valid source is forwarded to the remaining VTEP. 1401 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1395 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1402 1396 tc_check_packets "$ns2" "dev vx0 ingress" 101 2 1403 1397 log_test $? 0 "Forward valid source after removal - first VTEP" 1404 1398 tc_check_packets "$ns2" "dev vx0 ingress" 102 1 ··· 1413 1407 local vtep2_ip=198.51.100.200 1414 1408 local plen=32 1415 1409 local grp=239.1.1.1 1410 + local grp_dmac=01:00:5e:01:01:01 1416 1411 local valid_src=192.0.2.129 1417 1412 local invalid_src=192.0.2.145 1418 1413 ··· 1422 1415 echo "-------------------------------------------------------------" 1423 1416 1424 1417 starg_exclude_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \ 1425 - $valid_src $invalid_src "mausezahn" 1418 + $grp_dmac $valid_src $invalid_src "mausezahn" 1426 1419 } 1427 1420 1428 1421 starg_exclude_ir_ipv6_ipv4() ··· 1433 1426 local vtep2_ip=198.51.100.200 1434 1427 local plen=32 1435 1428 local grp=ff0e::1 1429 + local grp_dmac=33:33:00:00:00:01 1436 1430 local valid_src=2001:db8:100::1 1437 1431 local invalid_src=2001:db8:200::1 1438 1432 ··· 1442 1434 echo "-------------------------------------------------------------" 1443 1435 1444 1436 starg_exclude_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \ 1445 - $valid_src $invalid_src "mausezahn -6" 1437 + $grp_dmac $valid_src $invalid_src "mausezahn -6" 1446 1438 } 1447 1439 1448 1440 starg_exclude_ir_ipv4_ipv6() ··· 1453 1445 local vtep2_ip=2001:db8:2000::1 1454 1446 local plen=128 1455 1447 local grp=239.1.1.1 1448 + local grp_dmac=01:00:5e:01:01:01 1456 1449 local valid_src=192.0.2.129 1457 1450 local invalid_src=192.0.2.145 1458 1451 ··· 1462 1453 echo "-------------------------------------------------------------" 1463 1454 1464 1455 starg_exclude_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \ 1465 - $valid_src $invalid_src "mausezahn" 1456 + $grp_dmac $valid_src $invalid_src "mausezahn" 1466 1457 } 1467 1458 1468 1459 starg_exclude_ir_ipv6_ipv6() ··· 1473 1464 local vtep2_ip=2001:db8:2000::1 1474 1465 local plen=128 1475 1466 local grp=ff0e::1 1467 + local grp_dmac=33:33:00:00:00:01 1476 1468 local valid_src=2001:db8:100::1 1477 1469 local invalid_src=2001:db8:200::1 1478 1470 ··· 1482 1472 echo "-------------------------------------------------------------" 1483 1473 1484 1474 starg_exclude_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \ 1485 - $valid_src $invalid_src "mausezahn -6" 1475 + $grp_dmac $valid_src $invalid_src "mausezahn -6" 1486 1476 } 1487 1477 1488 1478 starg_include_ir_common() ··· 1493 1483 local vtep2_ip=$1; shift 1494 1484 local plen=$1; shift 1495 1485 local grp=$1; shift 1486 + local grp_dmac=$1; shift 1496 1487 local valid_src=$1; shift 1497 1488 local invalid_src=$1; shift 1498 1489 local mz=$1; shift ··· 1515 1504 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode include source_list $valid_src dst $vtep2_ip src_vni 10010" 1516 1505 1517 1506 # Check that invalid source is not forwarded to any VTEP. 1518 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1507 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1519 1508 tc_check_packets "$ns2" "dev vx0 ingress" 101 0 1520 1509 log_test $? 0 "Block excluded source - first VTEP" 1521 1510 tc_check_packets "$ns2" "dev vx0 ingress" 102 0 1522 1511 log_test $? 0 "Block excluded source - second VTEP" 1523 1512 1524 1513 # Check that valid source is forwarded to both VTEPs. 1525 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1514 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1526 1515 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1527 1516 log_test $? 0 "Forward valid source - first VTEP" 1528 1517 tc_check_packets "$ns2" "dev vx0 ingress" 102 1 ··· 1532 1521 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep2_ip src_vni 10010" 1533 1522 1534 1523 # Check that invalid source is not forwarded to any VTEP. 1535 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1524 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1536 1525 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1537 1526 log_test $? 0 "Block excluded source after removal - first VTEP" 1538 1527 tc_check_packets "$ns2" "dev vx0 ingress" 102 1 1539 1528 log_test $? 0 "Block excluded source after removal - second VTEP" 1540 1529 1541 1530 # Check that valid source is forwarded to the remaining VTEP. 1542 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1531 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1543 1532 tc_check_packets "$ns2" "dev vx0 ingress" 101 2 1544 1533 log_test $? 0 "Forward valid source after removal - first VTEP" 1545 1534 tc_check_packets "$ns2" "dev vx0 ingress" 102 1 ··· 1554 1543 local vtep2_ip=198.51.100.200 1555 1544 local plen=32 1556 1545 local grp=239.1.1.1 1546 + local grp_dmac=01:00:5e:01:01:01 1557 1547 local valid_src=192.0.2.129 1558 1548 local invalid_src=192.0.2.145 1559 1549 ··· 1563 1551 echo "-------------------------------------------------------------" 1564 1552 1565 1553 starg_include_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \ 1566 - $valid_src $invalid_src "mausezahn" 1554 + $grp_dmac $valid_src $invalid_src "mausezahn" 1567 1555 } 1568 1556 1569 1557 starg_include_ir_ipv6_ipv4() ··· 1574 1562 local vtep2_ip=198.51.100.200 1575 1563 local plen=32 1576 1564 local grp=ff0e::1 1565 + local grp_dmac=33:33:00:00:00:01 1577 1566 local valid_src=2001:db8:100::1 1578 1567 local invalid_src=2001:db8:200::1 1579 1568 ··· 1583 1570 echo "-------------------------------------------------------------" 1584 1571 1585 1572 starg_include_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \ 1586 - $valid_src $invalid_src "mausezahn -6" 1573 + $grp_dmac $valid_src $invalid_src "mausezahn -6" 1587 1574 } 1588 1575 1589 1576 starg_include_ir_ipv4_ipv6() ··· 1594 1581 local vtep2_ip=2001:db8:2000::1 1595 1582 local plen=128 1596 1583 local grp=239.1.1.1 1584 + local grp_dmac=01:00:5e:01:01:01 1597 1585 local valid_src=192.0.2.129 1598 1586 local invalid_src=192.0.2.145 1599 1587 ··· 1603 1589 echo "-------------------------------------------------------------" 1604 1590 1605 1591 starg_include_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \ 1606 - $valid_src $invalid_src "mausezahn" 1592 + $grp_dmac $valid_src $invalid_src "mausezahn" 1607 1593 } 1608 1594 1609 1595 starg_include_ir_ipv6_ipv6() ··· 1614 1600 local vtep2_ip=2001:db8:2000::1 1615 1601 local plen=128 1616 1602 local grp=ff0e::1 1603 + local grp_dmac=33:33:00:00:00:01 1617 1604 local valid_src=2001:db8:100::1 1618 1605 local invalid_src=2001:db8:200::1 1619 1606 ··· 1623 1608 echo "-------------------------------------------------------------" 1624 1609 1625 1610 starg_include_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \ 1626 - $valid_src $invalid_src "mausezahn -6" 1611 + $grp_dmac $valid_src $invalid_src "mausezahn -6" 1627 1612 } 1628 1613 1629 1614 starg_exclude_p2mp_common() ··· 1633 1618 local mcast_grp=$1; shift 1634 1619 local plen=$1; shift 1635 1620 local grp=$1; shift 1621 + local grp_dmac=$1; shift 1636 1622 local valid_src=$1; shift 1637 1623 local invalid_src=$1; shift 1638 1624 local mz=$1; shift ··· 1651 1635 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source_list $invalid_src dst $mcast_grp src_vni 10010 via veth0" 1652 1636 1653 1637 # Check that invalid source is not forwarded. 1654 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1638 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1655 1639 tc_check_packets "$ns2" "dev vx0 ingress" 101 0 1656 1640 log_test $? 0 "Block excluded source" 1657 1641 1658 1642 # Check that valid source is forwarded. 1659 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1643 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1660 1644 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1661 1645 log_test $? 0 "Forward valid source" 1662 1646 ··· 1664 1648 run_cmd "ip -n $ns2 address del $mcast_grp/$plen dev veth0" 1665 1649 1666 1650 # Check that valid source is not received anymore. 1667 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1651 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1668 1652 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1669 1653 log_test $? 0 "Receive of valid source after removal from group" 1670 1654 } ··· 1676 1660 local mcast_grp=238.1.1.1 1677 1661 local plen=32 1678 1662 local grp=239.1.1.1 1663 + local grp_dmac=01:00:5e:01:01:01 1679 1664 local valid_src=192.0.2.129 1680 1665 local invalid_src=192.0.2.145 1681 1666 ··· 1684 1667 echo "Data path: (*, G) EXCLUDE - P2MP - IPv4 overlay / IPv4 underlay" 1685 1668 echo "---------------------------------------------------------------" 1686 1669 1687 - starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \ 1670 + starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \ 1688 1671 $valid_src $invalid_src "mausezahn" 1689 1672 } 1690 1673 ··· 1695 1678 local mcast_grp=238.1.1.1 1696 1679 local plen=32 1697 1680 local grp=ff0e::1 1681 + local grp_dmac=33:33:00:00:00:01 1698 1682 local valid_src=2001:db8:100::1 1699 1683 local invalid_src=2001:db8:200::1 1700 1684 ··· 1703 1685 echo "Data path: (*, G) EXCLUDE - P2MP - IPv6 overlay / IPv4 underlay" 1704 1686 echo "---------------------------------------------------------------" 1705 1687 1706 - starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \ 1688 + starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \ 1707 1689 $valid_src $invalid_src "mausezahn -6" 1708 1690 } 1709 1691 ··· 1714 1696 local mcast_grp=ff0e::2 1715 1697 local plen=128 1716 1698 local grp=239.1.1.1 1699 + local grp_dmac=01:00:5e:01:01:01 1717 1700 local valid_src=192.0.2.129 1718 1701 local invalid_src=192.0.2.145 1719 1702 ··· 1722 1703 echo "Data path: (*, G) EXCLUDE - P2MP - IPv4 overlay / IPv6 underlay" 1723 1704 echo "---------------------------------------------------------------" 1724 1705 1725 - starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \ 1706 + starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \ 1726 1707 $valid_src $invalid_src "mausezahn" 1727 1708 } 1728 1709 ··· 1733 1714 local mcast_grp=ff0e::2 1734 1715 local plen=128 1735 1716 local grp=ff0e::1 1717 + local grp_dmac=33:33:00:00:00:01 1736 1718 local valid_src=2001:db8:100::1 1737 1719 local invalid_src=2001:db8:200::1 1738 1720 ··· 1741 1721 echo "Data path: (*, G) EXCLUDE - P2MP - IPv6 overlay / IPv6 underlay" 1742 1722 echo "---------------------------------------------------------------" 1743 1723 1744 - starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \ 1724 + starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \ 1745 1725 $valid_src $invalid_src "mausezahn -6" 1746 1726 } 1747 1727 ··· 1752 1732 local mcast_grp=$1; shift 1753 1733 local plen=$1; shift 1754 1734 local grp=$1; shift 1735 + local grp_dmac=$1; shift 1755 1736 local valid_src=$1; shift 1756 1737 local invalid_src=$1; shift 1757 1738 local mz=$1; shift ··· 1770 1749 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode include source_list $valid_src dst $mcast_grp src_vni 10010 via veth0" 1771 1750 1772 1751 # Check that invalid source is not forwarded. 1773 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1752 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1774 1753 tc_check_packets "$ns2" "dev vx0 ingress" 101 0 1775 1754 log_test $? 0 "Block excluded source" 1776 1755 1777 1756 # Check that valid source is forwarded. 1778 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1757 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1779 1758 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1780 1759 log_test $? 0 "Forward valid source" 1781 1760 ··· 1783 1762 run_cmd "ip -n $ns2 address del $mcast_grp/$plen dev veth0" 1784 1763 1785 1764 # Check that valid source is not received anymore. 1786 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1765 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1787 1766 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 1788 1767 log_test $? 0 "Receive of valid source after removal from group" 1789 1768 } ··· 1795 1774 local mcast_grp=238.1.1.1 1796 1775 local plen=32 1797 1776 local grp=239.1.1.1 1777 + local grp_dmac=01:00:5e:01:01:01 1798 1778 local valid_src=192.0.2.129 1799 1779 local invalid_src=192.0.2.145 1800 1780 ··· 1803 1781 echo "Data path: (*, G) INCLUDE - P2MP - IPv4 overlay / IPv4 underlay" 1804 1782 echo "---------------------------------------------------------------" 1805 1783 1806 - starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \ 1784 + starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \ 1807 1785 $valid_src $invalid_src "mausezahn" 1808 1786 } 1809 1787 ··· 1814 1792 local mcast_grp=238.1.1.1 1815 1793 local plen=32 1816 1794 local grp=ff0e::1 1795 + local grp_dmac=33:33:00:00:00:01 1817 1796 local valid_src=2001:db8:100::1 1818 1797 local invalid_src=2001:db8:200::1 1819 1798 ··· 1822 1799 echo "Data path: (*, G) INCLUDE - P2MP - IPv6 overlay / IPv4 underlay" 1823 1800 echo "---------------------------------------------------------------" 1824 1801 1825 - starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \ 1802 + starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \ 1826 1803 $valid_src $invalid_src "mausezahn -6" 1827 1804 } 1828 1805 ··· 1833 1810 local mcast_grp=ff0e::2 1834 1811 local plen=128 1835 1812 local grp=239.1.1.1 1813 + local grp_dmac=01:00:5e:01:01:01 1836 1814 local valid_src=192.0.2.129 1837 1815 local invalid_src=192.0.2.145 1838 1816 ··· 1841 1817 echo "Data path: (*, G) INCLUDE - P2MP - IPv4 overlay / IPv6 underlay" 1842 1818 echo "---------------------------------------------------------------" 1843 1819 1844 - starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \ 1820 + starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \ 1845 1821 $valid_src $invalid_src "mausezahn" 1846 1822 } 1847 1823 ··· 1852 1828 local mcast_grp=ff0e::2 1853 1829 local plen=128 1854 1830 local grp=ff0e::1 1831 + local grp_dmac=33:33:00:00:00:01 1855 1832 local valid_src=2001:db8:100::1 1856 1833 local invalid_src=2001:db8:200::1 1857 1834 ··· 1860 1835 echo "Data path: (*, G) INCLUDE - P2MP - IPv6 overlay / IPv6 underlay" 1861 1836 echo "---------------------------------------------------------------" 1862 1837 1863 - starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \ 1838 + starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \ 1864 1839 $valid_src $invalid_src "mausezahn -6" 1865 1840 } 1866 1841 ··· 1872 1847 local plen=$1; shift 1873 1848 local proto=$1; shift 1874 1849 local grp=$1; shift 1850 + local grp_dmac=$1; shift 1875 1851 local src=$1; shift 1876 1852 local mz=$1; shift 1877 1853 ··· 1908 1882 # Make sure that packets sent from the first VTEP over VLAN 10 are 1909 1883 # received by the SVI corresponding to the L3VNI (14000 / VLAN 4000) on 1910 1884 # the second VTEP, since it is configured as PVID. 1911 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1885 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1912 1886 tc_check_packets "$ns2" "dev br0.4000 ingress" 101 1 1913 1887 log_test $? 0 "Egress VNI translation - PVID configured" 1914 1888 1915 1889 # Remove PVID flag from VLAN 4000 on the second VTEP and make sure 1916 1890 # packets are no longer received by the SVI interface. 1917 1891 run_cmd "bridge -n $ns2 vlan add vid 4000 dev vx0" 1918 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1892 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1919 1893 tc_check_packets "$ns2" "dev br0.4000 ingress" 101 1 1920 1894 log_test $? 0 "Egress VNI translation - no PVID configured" 1921 1895 1922 1896 # Reconfigure the PVID and make sure packets are received again. 1923 1897 run_cmd "bridge -n $ns2 vlan add vid 4000 dev vx0 pvid" 1924 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1898 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 1925 1899 tc_check_packets "$ns2" "dev br0.4000 ingress" 101 2 1926 1900 log_test $? 0 "Egress VNI translation - PVID reconfigured" 1927 1901 } ··· 1934 1908 local plen=32 1935 1909 local proto="ipv4" 1936 1910 local grp=239.1.1.1 1911 + local grp_dmac=01:00:5e:01:01:01 1937 1912 local src=192.0.2.129 1938 1913 1939 1914 echo ··· 1942 1915 echo "----------------------------------------------------------------" 1943 1916 1944 1917 egress_vni_translation_common $ns1 $ns2 $mcast_grp $plen $proto $grp \ 1945 - $src "mausezahn" 1918 + $grp_dmac $src "mausezahn" 1946 1919 } 1947 1920 1948 1921 egress_vni_translation_ipv6_ipv4() ··· 1953 1926 local plen=32 1954 1927 local proto="ipv6" 1955 1928 local grp=ff0e::1 1929 + local grp_dmac=33:33:00:00:00:01 1956 1930 local src=2001:db8:100::1 1957 1931 1958 1932 echo ··· 1961 1933 echo "----------------------------------------------------------------" 1962 1934 1963 1935 egress_vni_translation_common $ns1 $ns2 $mcast_grp $plen $proto $grp \ 1964 - $src "mausezahn -6" 1936 + $grp_dmac $src "mausezahn -6" 1965 1937 } 1966 1938 1967 1939 egress_vni_translation_ipv4_ipv6() ··· 1972 1944 local plen=128 1973 1945 local proto="ipv4" 1974 1946 local grp=239.1.1.1 1947 + local grp_dmac=01:00:5e:01:01:01 1975 1948 local src=192.0.2.129 1976 1949 1977 1950 echo ··· 1980 1951 echo "----------------------------------------------------------------" 1981 1952 1982 1953 egress_vni_translation_common $ns1 $ns2 $mcast_grp $plen $proto $grp \ 1983 - $src "mausezahn" 1954 + $grp_dmac $src "mausezahn" 1984 1955 } 1985 1956 1986 1957 egress_vni_translation_ipv6_ipv6() ··· 1991 1962 local plen=128 1992 1963 local proto="ipv6" 1993 1964 local grp=ff0e::1 1965 + local grp_dmac=33:33:00:00:00:01 1994 1966 local src=2001:db8:100::1 1995 1967 1996 1968 echo ··· 1999 1969 echo "----------------------------------------------------------------" 2000 1970 2001 1971 egress_vni_translation_common $ns1 $ns2 $mcast_grp $plen $proto $grp \ 2002 - $src "mausezahn -6" 1972 + $grp_dmac $src "mausezahn -6" 2003 1973 } 2004 1974 2005 1975 all_zeros_mdb_common() ··· 2012 1982 local vtep4_ip=$1; shift 2013 1983 local plen=$1; shift 2014 1984 local ipv4_grp=239.1.1.1 1985 + local ipv4_grp_dmac=01:00:5e:01:01:01 2015 1986 local ipv4_unreg_grp=239.2.2.2 1987 + local ipv4_unreg_grp_dmac=01:00:5e:02:02:02 2016 1988 local ipv4_ll_grp=224.0.0.100 1989 + local ipv4_ll_grp_dmac=01:00:5e:00:00:64 2017 1990 local ipv4_src=192.0.2.129 2018 1991 local ipv6_grp=ff0e::1 1992 + local ipv6_grp_dmac=33:33:00:00:00:01 2019 1993 local ipv6_unreg_grp=ff0e::2 1994 + local ipv6_unreg_grp_dmac=33:33:00:00:00:02 2020 1995 local ipv6_ll_grp=ff02::1 1996 + local ipv6_ll_grp_dmac=33:33:00:00:00:01 2021 1997 local ipv6_src=2001:db8:100::1 2022 1998 2023 1999 # Install all-zeros (catchall) MDB entries for IPv4 and IPv6 traffic ··· 2059 2023 2060 2024 # Send registered IPv4 multicast and make sure it only arrives to the 2061 2025 # first VTEP. 2062 - run_cmd "ip netns exec $ns1 mausezahn br0.10 -A $ipv4_src -B $ipv4_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2026 + run_cmd "ip netns exec $ns1 mausezahn br0.10 -a own -b $ipv4_grp_dmac -A $ipv4_src -B $ipv4_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2063 2027 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 2064 2028 log_test $? 0 "Registered IPv4 multicast - first VTEP" 2065 2029 tc_check_packets "$ns2" "dev vx0 ingress" 102 0 ··· 2067 2031 2068 2032 # Send unregistered IPv4 multicast that is not link-local and make sure 2069 2033 # it arrives to the first and second VTEPs. 2070 - run_cmd "ip netns exec $ns1 mausezahn br0.10 -A $ipv4_src -B $ipv4_unreg_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2034 + run_cmd "ip netns exec $ns1 mausezahn br0.10 -a own -b $ipv4_unreg_grp_dmac -A $ipv4_src -B $ipv4_unreg_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2071 2035 tc_check_packets "$ns2" "dev vx0 ingress" 101 2 2072 2036 log_test $? 0 "Unregistered IPv4 multicast - first VTEP" 2073 2037 tc_check_packets "$ns2" "dev vx0 ingress" 102 1 ··· 2075 2039 2076 2040 # Send IPv4 link-local multicast traffic and make sure it does not 2077 2041 # arrive to any VTEP. 2078 - run_cmd "ip netns exec $ns1 mausezahn br0.10 -A $ipv4_src -B $ipv4_ll_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2042 + run_cmd "ip netns exec $ns1 mausezahn br0.10 -a own -b $ipv4_ll_grp_dmac -A $ipv4_src -B $ipv4_ll_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2079 2043 tc_check_packets "$ns2" "dev vx0 ingress" 101 2 2080 2044 log_test $? 0 "Link-local IPv4 multicast - first VTEP" 2081 2045 tc_check_packets "$ns2" "dev vx0 ingress" 102 1 ··· 2110 2074 2111 2075 # Send registered IPv6 multicast and make sure it only arrives to the 2112 2076 # third VTEP. 2113 - run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -A $ipv6_src -B $ipv6_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2077 + run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -a own -b $ipv6_grp_dmac -A $ipv6_src -B $ipv6_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2114 2078 tc_check_packets "$ns2" "dev vx0 ingress" 103 1 2115 2079 log_test $? 0 "Registered IPv6 multicast - third VTEP" 2116 2080 tc_check_packets "$ns2" "dev vx0 ingress" 104 0 ··· 2118 2082 2119 2083 # Send unregistered IPv6 multicast that is not link-local and make sure 2120 2084 # it arrives to the third and fourth VTEPs. 2121 - run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -A $ipv6_src -B $ipv6_unreg_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2085 + run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -a own -b $ipv6_unreg_grp_dmac -A $ipv6_src -B $ipv6_unreg_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2122 2086 tc_check_packets "$ns2" "dev vx0 ingress" 103 2 2123 2087 log_test $? 0 "Unregistered IPv6 multicast - third VTEP" 2124 2088 tc_check_packets "$ns2" "dev vx0 ingress" 104 1 ··· 2126 2090 2127 2091 # Send IPv6 link-local multicast traffic and make sure it does not 2128 2092 # arrive to any VTEP. 2129 - run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -A $ipv6_src -B $ipv6_ll_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2093 + run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -a own -b $ipv6_ll_grp_dmac -A $ipv6_src -B $ipv6_ll_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2130 2094 tc_check_packets "$ns2" "dev vx0 ingress" 103 2 2131 2095 log_test $? 0 "Link-local IPv6 multicast - third VTEP" 2132 2096 tc_check_packets "$ns2" "dev vx0 ingress" 104 1 ··· 2201 2165 local plen=$1; shift 2202 2166 local proto=$1; shift 2203 2167 local grp=$1; shift 2168 + local grp_dmac=$1; shift 2204 2169 local src=$1; shift 2205 2170 local mz=$1; shift 2206 2171 ··· 2225 2188 2226 2189 # Send IP multicast traffic and make sure it is forwarded by the MDB 2227 2190 # and only arrives to the first VTEP. 2228 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2191 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2229 2192 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 2230 2193 log_test $? 0 "IP multicast - first VTEP" 2231 2194 tc_check_packets "$ns2" "dev vx0 ingress" 102 0 ··· 2242 2205 # Remove the MDB entry and make sure that IP multicast is now forwarded 2243 2206 # by the FDB to the second VTEP. 2244 2207 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep1_ip src_vni 10010" 2245 - run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2208 + run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q" 2246 2209 tc_check_packets "$ns2" "dev vx0 ingress" 101 1 2247 2210 log_test $? 0 "IP multicast after removal - first VTEP" 2248 2211 tc_check_packets "$ns2" "dev vx0 ingress" 102 2 ··· 2258 2221 local plen=32 2259 2222 local proto="ipv4" 2260 2223 local grp=239.1.1.1 2224 + local grp_dmac=01:00:5e:01:01:01 2261 2225 local src=192.0.2.129 2262 2226 2263 2227 echo 2264 2228 echo "Data path: MDB with FDB - IPv4 overlay / IPv4 underlay" 2265 2229 echo "------------------------------------------------------" 2266 2230 2267 - mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp $src \ 2268 - "mausezahn" 2231 + mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp \ 2232 + $grp_dmac $src "mausezahn" 2269 2233 } 2270 2234 2271 2235 mdb_fdb_ipv6_ipv4() ··· 2278 2240 local plen=32 2279 2241 local proto="ipv6" 2280 2242 local grp=ff0e::1 2243 + local grp_dmac=33:33:00:00:00:01 2281 2244 local src=2001:db8:100::1 2282 2245 2283 2246 echo 2284 2247 echo "Data path: MDB with FDB - IPv6 overlay / IPv4 underlay" 2285 2248 echo "------------------------------------------------------" 2286 2249 2287 - mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp $src \ 2288 - "mausezahn -6" 2250 + mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp \ 2251 + $grp_dmac $src "mausezahn -6" 2289 2252 } 2290 2253 2291 2254 mdb_fdb_ipv4_ipv6() ··· 2298 2259 local plen=128 2299 2260 local proto="ipv4" 2300 2261 local grp=239.1.1.1 2262 + local grp_dmac=01:00:5e:01:01:01 2301 2263 local src=192.0.2.129 2302 2264 2303 2265 echo 2304 2266 echo "Data path: MDB with FDB - IPv4 overlay / IPv6 underlay" 2305 2267 echo "------------------------------------------------------" 2306 2268 2307 - mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp $src \ 2308 - "mausezahn" 2269 + mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp \ 2270 + $grp_dmac $src "mausezahn" 2309 2271 } 2310 2272 2311 2273 mdb_fdb_ipv6_ipv6() ··· 2318 2278 local plen=128 2319 2279 local proto="ipv6" 2320 2280 local grp=ff0e::1 2281 + local grp_dmac=33:33:00:00:00:01 2321 2282 local src=2001:db8:100::1 2322 2283 2323 2284 echo 2324 2285 echo "Data path: MDB with FDB - IPv6 overlay / IPv6 underlay" 2325 2286 echo "------------------------------------------------------" 2326 2287 2327 - mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp $src \ 2328 - "mausezahn -6" 2288 + mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp \ 2289 + $grp_dmac $src "mausezahn -6" 2329 2290 } 2330 2291 2331 2292 mdb_grp1_loop() ··· 2361 2320 local vtep1_ip=$1; shift 2362 2321 local vtep2_ip=$1; shift 2363 2322 local grp1=$1; shift 2323 + local grp1_dmac=$1; shift 2364 2324 local grp2=$1; shift 2325 + local grp2_dmac=$1; shift 2365 2326 local src=$1; shift 2366 2327 local mz=$1; shift 2367 2328 local pid1 ··· 2388 2345 pid1=$! 2389 2346 mdb_grp2_loop $ns1 $vtep1_ip $vtep2_ip $grp2 & 2390 2347 pid2=$! 2391 - ip netns exec $ns1 $mz br0.10 -A $src -B $grp1 -t udp sp=12345,dp=54321 -p 100 -c 0 -q & 2348 + ip netns exec $ns1 $mz br0.10 -a own -b $grp1_dmac -A $src -B $grp1 -t udp sp=12345,dp=54321 -p 100 -c 0 -q & 2392 2349 pid3=$! 2393 - ip netns exec $ns1 $mz br0.10 -A $src -B $grp2 -t udp sp=12345,dp=54321 -p 100 -c 0 -q & 2350 + ip netns exec $ns1 $mz br0.10 -a own -b $grp2_dmac -A $src -B $grp2 -t udp sp=12345,dp=54321 -p 100 -c 0 -q & 2394 2351 pid4=$! 2395 2352 2396 2353 sleep 30 ··· 2406 2363 local vtep1_ip=198.51.100.100 2407 2364 local vtep2_ip=198.51.100.200 2408 2365 local grp1=239.1.1.1 2366 + local grp1_dmac=01:00:5e:01:01:01 2409 2367 local grp2=239.2.2.2 2368 + local grp2_dmac=01:00:5e:02:02:02 2410 2369 local src=192.0.2.129 2411 2370 2412 2371 echo 2413 2372 echo "Data path: MDB torture test - IPv4 overlay / IPv4 underlay" 2414 2373 echo "----------------------------------------------------------" 2415 2374 2416 - mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp2 $src \ 2417 - "mausezahn" 2375 + mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp1_dmac $grp2 \ 2376 + $grp2_dmac $src "mausezahn" 2418 2377 } 2419 2378 2420 2379 mdb_torture_ipv6_ipv4() ··· 2425 2380 local vtep1_ip=198.51.100.100 2426 2381 local vtep2_ip=198.51.100.200 2427 2382 local grp1=ff0e::1 2383 + local grp1_dmac=33:33:00:00:00:01 2428 2384 local grp2=ff0e::2 2385 + local grp2_dmac=33:33:00:00:00:02 2429 2386 local src=2001:db8:100::1 2430 2387 2431 2388 echo 2432 2389 echo "Data path: MDB torture test - IPv6 overlay / IPv4 underlay" 2433 2390 echo "----------------------------------------------------------" 2434 2391 2435 - mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp2 $src \ 2436 - "mausezahn -6" 2392 + mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp1_dmac $grp2 \ 2393 + $grp2_dmac $src "mausezahn -6" 2437 2394 } 2438 2395 2439 2396 mdb_torture_ipv4_ipv6() ··· 2444 2397 local vtep1_ip=2001:db8:1000::1 2445 2398 local vtep2_ip=2001:db8:2000::1 2446 2399 local grp1=239.1.1.1 2400 + local grp1_dmac=01:00:5e:01:01:01 2447 2401 local grp2=239.2.2.2 2402 + local grp2_dmac=01:00:5e:02:02:02 2448 2403 local src=192.0.2.129 2449 2404 2450 2405 echo 2451 2406 echo "Data path: MDB torture test - IPv4 overlay / IPv6 underlay" 2452 2407 echo "----------------------------------------------------------" 2453 2408 2454 - mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp2 $src \ 2455 - "mausezahn" 2409 + mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp1_dmac $grp2 \ 2410 + $grp2_dmac $src "mausezahn" 2456 2411 } 2457 2412 2458 2413 mdb_torture_ipv6_ipv6() ··· 2463 2414 local vtep1_ip=2001:db8:1000::1 2464 2415 local vtep2_ip=2001:db8:2000::1 2465 2416 local grp1=ff0e::1 2417 + local grp1_dmac=33:33:00:00:00:01 2466 2418 local grp2=ff0e::2 2419 + local grp2_dmac=33:33:00:00:00:02 2467 2420 local src=2001:db8:100::1 2468 2421 2469 2422 echo 2470 2423 echo "Data path: MDB torture test - IPv6 overlay / IPv6 underlay" 2471 2424 echo "----------------------------------------------------------" 2472 2425 2473 - mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp2 $src \ 2474 - "mausezahn -6" 2426 + mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp1_dmac $grp2 \ 2427 + $grp2_dmac $src "mausezahn -6" 2475 2428 } 2476 2429 2477 2430 ################################################################################
+34
tools/testing/selftests/net/tls.c
··· 1615 1615 EXPECT_EQ(errno, EINVAL); 1616 1616 } 1617 1617 1618 + TEST_F(tls, recv_efault) 1619 + { 1620 + char *rec1 = "1111111111"; 1621 + char *rec2 = "2222222222"; 1622 + struct msghdr hdr = {}; 1623 + struct iovec iov[2]; 1624 + char recv_mem[12]; 1625 + int ret; 1626 + 1627 + if (self->notls) 1628 + SKIP(return, "no TLS support"); 1629 + 1630 + EXPECT_EQ(send(self->fd, rec1, 10, 0), 10); 1631 + EXPECT_EQ(send(self->fd, rec2, 10, 0), 10); 1632 + 1633 + iov[0].iov_base = recv_mem; 1634 + iov[0].iov_len = sizeof(recv_mem); 1635 + iov[1].iov_base = NULL; /* broken iov to make process_rx_list fail */ 1636 + iov[1].iov_len = 1; 1637 + 1638 + hdr.msg_iovlen = 2; 1639 + hdr.msg_iov = iov; 1640 + 1641 + EXPECT_EQ(recv(self->cfd, recv_mem, 1, 0), 1); 1642 + EXPECT_EQ(recv_mem[0], rec1[0]); 1643 + 1644 + ret = recvmsg(self->cfd, &hdr, 0); 1645 + EXPECT_LE(ret, sizeof(recv_mem)); 1646 + EXPECT_GE(ret, 9); 1647 + EXPECT_EQ(memcmp(rec1, recv_mem, 9), 0); 1648 + if (ret > 9) 1649 + EXPECT_EQ(memcmp(rec2, recv_mem + 9, ret - 9), 0); 1650 + } 1651 + 1618 1652 FIXTURE(tls_err) 1619 1653 { 1620 1654 int fd, cfd;