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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Merge in late fixes to prepare for the 6.15 net-next PR.

No conflicts, adjacent changes:

drivers/net/ethernet/broadcom/bnxt/bnxt.c
919f9f497dbc ("eth: bnxt: fix out-of-range access of vnic_info array")
fe96d717d38e ("bnxt_en: Extend queue stop/start for TX rings")

Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+356 -498
+4
CREDITS
··· 3233 3233 E: rprior@inescn.pt 3234 3234 D: ATM device driver for NICStAR based cards 3235 3235 3236 + N: Roopa Prabhu 3237 + E: roopa@nvidia.com 3238 + D: Bridge co-maintainer, vxlan and networking contributor 3239 + 3236 3240 N: Stefan Probst 3237 3241 E: sp@caldera.de 3238 3242 D: The Linux Support Team Erlangen, 1993-97
+3 -1
MAINTAINERS
··· 8593 8593 F: drivers/net/can/usb/etas_es58x/ 8594 8594 8595 8595 ETHERNET BRIDGE 8596 - M: Roopa Prabhu <roopa@nvidia.com> 8597 8596 M: Nikolay Aleksandrov <razor@blackwall.org> 8597 + M: Ido Schimmel <idosch@nvidia.com> 8598 8598 L: bridge@lists.linux.dev 8599 8599 L: netdev@vger.kernel.org 8600 8600 S: Maintained 8601 8601 W: http://www.linuxfoundation.org/en/Net:Bridge 8602 + F: include/linux/if_bridge.h 8603 + F: include/uapi/linux/if_bridge.h 8602 8604 F: include/linux/netfilter_bridge/ 8603 8605 F: net/bridge/ 8604 8606
+6 -6
arch/parisc/include/uapi/asm/socket.h
··· 132 132 #define SO_PASSPIDFD 0x404A 133 133 #define SO_PEERPIDFD 0x404B 134 134 135 - #define SO_DEVMEM_LINEAR 78 136 - #define SCM_DEVMEM_LINEAR SO_DEVMEM_LINEAR 137 - #define SO_DEVMEM_DMABUF 79 138 - #define SCM_DEVMEM_DMABUF SO_DEVMEM_DMABUF 139 - #define SO_DEVMEM_DONTNEED 80 140 - 141 135 #define SCM_TS_OPT_ID 0x404C 142 136 143 137 #define SO_RCVPRIORITY 0x404D 138 + 139 + #define SO_DEVMEM_LINEAR 0x404E 140 + #define SCM_DEVMEM_LINEAR SO_DEVMEM_LINEAR 141 + #define SO_DEVMEM_DMABUF 0x404F 142 + #define SCM_DEVMEM_DMABUF SO_DEVMEM_DMABUF 143 + #define SO_DEVMEM_DONTNEED 0x4050 144 144 145 145 #if !defined(__KERNEL__) 146 146
+4 -4
drivers/net/bonding/bond_main.c
··· 323 323 } 324 324 } 325 325 326 - static bool bond_xdp_check(struct bonding *bond) 326 + bool bond_xdp_check(struct bonding *bond, int mode) 327 327 { 328 - switch (BOND_MODE(bond)) { 328 + switch (mode) { 329 329 case BOND_MODE_ROUNDROBIN: 330 330 case BOND_MODE_ACTIVEBACKUP: 331 331 return true; ··· 1928 1928 1929 1929 ASSERT_RTNL(); 1930 1930 1931 - if (!bond_xdp_check(bond) || !bond_has_slaves(bond)) { 1931 + if (!bond_xdp_check(bond, BOND_MODE(bond)) || !bond_has_slaves(bond)) { 1932 1932 xdp_clear_features_flag(bond_dev); 1933 1933 return; 1934 1934 } ··· 5693 5693 5694 5694 ASSERT_RTNL(); 5695 5695 5696 - if (!bond_xdp_check(bond)) { 5696 + if (!bond_xdp_check(bond, BOND_MODE(bond))) { 5697 5697 BOND_NL_ERR(dev, extack, 5698 5698 "No native XDP support for the current bonding mode"); 5699 5699 return -EOPNOTSUPP;
+3
drivers/net/bonding/bond_options.c
··· 868 868 static int bond_option_mode_set(struct bonding *bond, 869 869 const struct bond_opt_value *newval) 870 870 { 871 + if (bond->xdp_prog && !bond_xdp_check(bond, newval->value)) 872 + return -EOPNOTSUPP; 873 + 871 874 if (!bond_mode_uses_arp(newval->value)) { 872 875 if (bond->params.arp_interval) { 873 876 netdev_dbg(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n",
+1 -10
drivers/net/dsa/microchip/ksz8.c
··· 1625 1625 const u16 *regs = dev->info->regs; 1626 1626 struct dsa_switch *ds = dev->ds; 1627 1627 const u32 *masks; 1628 - int queues; 1629 1628 u8 member; 1630 1629 1631 1630 masks = dev->info->masks; ··· 1632 1633 /* enable broadcast storm limit */ 1633 1634 ksz_port_cfg(dev, port, P_BCAST_STORM_CTRL, PORT_BROADCAST_STORM, true); 1634 1635 1635 - /* For KSZ88x3 enable only one queue by default, otherwise we won't 1636 - * be able to get rid of PCP prios on Port 2. 1637 - */ 1638 - if (ksz_is_ksz88x3(dev)) 1639 - queues = 1; 1640 - else 1641 - queues = dev->info->num_tx_queues; 1642 - 1643 - ksz8_port_queue_split(dev, port, queues); 1636 + ksz8_port_queue_split(dev, port, dev->info->num_tx_queues); 1644 1637 1645 1638 /* replace priority */ 1646 1639 ksz_port_cfg(dev, port, P_802_1P_CTRL,
+8 -223
drivers/net/dsa/microchip/ksz_dcb.c
··· 10 10 #include "ksz_dcb.h" 11 11 #include "ksz8.h" 12 12 13 - #define KSZ8_REG_PORT_1_CTRL_0 0x10 13 + /* Port X Control 0 register. 14 + * The datasheet specifies: Port 1 - 0x10, Port 2 - 0x20, Port 3 - 0x30. 15 + * However, the driver uses get_port_addr(), which maps Port 1 to offset 0. 16 + * Therefore, we define the base offset as 0x00 here to align with that logic. 17 + */ 18 + #define KSZ8_REG_PORT_1_CTRL_0 0x00 14 19 #define KSZ8_PORT_DIFFSERV_ENABLE BIT(6) 15 20 #define KSZ8_PORT_802_1P_ENABLE BIT(5) 16 21 #define KSZ8_PORT_BASED_PRIO_M GENMASK(4, 3) ··· 187 182 } 188 183 189 184 /** 190 - * ksz88x3_port_set_default_prio_quirks - Quirks for default priority 191 - * @dev: Pointer to the KSZ switch device structure 192 - * @port: Port number for which to set the default priority 193 - * @prio: Priority value to set 194 - * 195 - * This function implements quirks for setting the default priority on KSZ88x3 196 - * devices. On Port 2, no other priority providers are working 197 - * except of PCP. So, configuring default priority on Port 2 is not possible. 198 - * On Port 1, it is not possible to configure port priority if PCP 199 - * apptrust on Port 2 is disabled. Since we disable multiple queues on the 200 - * switch to disable PCP on Port 2, we need to ensure that the default priority 201 - * configuration on Port 1 is in agreement with the configuration on Port 2. 202 - * 203 - * Return: 0 on success, or a negative error code on failure 204 - */ 205 - static int ksz88x3_port_set_default_prio_quirks(struct ksz_device *dev, int port, 206 - u8 prio) 207 - { 208 - if (!prio) 209 - return 0; 210 - 211 - if (port == KSZ_PORT_2) { 212 - dev_err(dev->dev, "Port priority configuration is not working on Port 2\n"); 213 - return -EINVAL; 214 - } else if (port == KSZ_PORT_1) { 215 - u8 port2_data; 216 - int ret; 217 - 218 - ret = ksz_pread8(dev, KSZ_PORT_2, KSZ8_REG_PORT_1_CTRL_0, 219 - &port2_data); 220 - if (ret) 221 - return ret; 222 - 223 - if (!(port2_data & KSZ8_PORT_802_1P_ENABLE)) { 224 - dev_err(dev->dev, "Not possible to configure port priority on Port 1 if PCP apptrust on Port 2 is disabled\n"); 225 - return -EINVAL; 226 - } 227 - } 228 - 229 - return 0; 230 - } 231 - 232 - /** 233 185 * ksz_port_set_default_prio - Sets the default priority for a port on a KSZ 234 186 * switch 235 187 * @ds: Pointer to the DSA switch structure ··· 201 239 int ksz_port_set_default_prio(struct dsa_switch *ds, int port, u8 prio) 202 240 { 203 241 struct ksz_device *dev = ds->priv; 204 - int reg, shift, ret; 242 + int reg, shift; 205 243 u8 mask; 206 244 207 245 if (prio >= dev->info->num_ipms) 208 246 return -EINVAL; 209 - 210 - if (ksz_is_ksz88x3(dev)) { 211 - ret = ksz88x3_port_set_default_prio_quirks(dev, port, prio); 212 - if (ret) 213 - return ret; 214 - } 215 247 216 248 ksz_get_default_port_prio_reg(dev, &reg, &mask, &shift); 217 249 ··· 475 519 } 476 520 477 521 /** 478 - * ksz88x3_port1_apptrust_quirk - Quirk for apptrust configuration on Port 1 479 - * of KSZ88x3 devices 480 - * @dev: Pointer to the KSZ switch device structure 481 - * @port: Port number for which to set the apptrust selectors 482 - * @reg: Register address for the apptrust configuration 483 - * @port1_data: Data to set for the apptrust configuration 484 - * 485 - * This function implements a quirk for apptrust configuration on Port 1 of 486 - * KSZ88x3 devices. It ensures that apptrust configuration on Port 1 is not 487 - * possible if PCP apptrust on Port 2 is disabled. This is because the Port 2 488 - * seems to be permanently hardwired to PCP classification, so we need to 489 - * do Port 1 configuration always in agreement with Port 2 configuration. 490 - * 491 - * Return: 0 on success, or a negative error code on failure 492 - */ 493 - static int ksz88x3_port1_apptrust_quirk(struct ksz_device *dev, int port, 494 - int reg, u8 port1_data) 495 - { 496 - u8 port2_data; 497 - int ret; 498 - 499 - /* If no apptrust is requested for Port 1, no need to care about Port 2 500 - * configuration. 501 - */ 502 - if (!(port1_data & (KSZ8_PORT_802_1P_ENABLE | KSZ8_PORT_DIFFSERV_ENABLE))) 503 - return 0; 504 - 505 - /* We got request to enable any apptrust on Port 1. To make it possible, 506 - * we need to enable multiple queues on the switch. If we enable 507 - * multiqueue support, PCP classification on Port 2 will be 508 - * automatically activated by HW. 509 - */ 510 - ret = ksz_pread8(dev, KSZ_PORT_2, reg, &port2_data); 511 - if (ret) 512 - return ret; 513 - 514 - /* If KSZ8_PORT_802_1P_ENABLE bit is set on Port 2, the driver showed 515 - * the interest in PCP classification on Port 2. In this case, 516 - * multiqueue support is enabled and we can enable any apptrust on 517 - * Port 1. 518 - * If KSZ8_PORT_802_1P_ENABLE bit is not set on Port 2, the PCP 519 - * classification on Port 2 is still active, but the driver disabled 520 - * multiqueue support and made frame prioritization inactive for 521 - * all ports. In this case, we can't enable any apptrust on Port 1. 522 - */ 523 - if (!(port2_data & KSZ8_PORT_802_1P_ENABLE)) { 524 - dev_err(dev->dev, "Not possible to enable any apptrust on Port 1 if PCP apptrust on Port 2 is disabled\n"); 525 - return -EINVAL; 526 - } 527 - 528 - return 0; 529 - } 530 - 531 - /** 532 - * ksz88x3_port2_apptrust_quirk - Quirk for apptrust configuration on Port 2 533 - * of KSZ88x3 devices 534 - * @dev: Pointer to the KSZ switch device structure 535 - * @port: Port number for which to set the apptrust selectors 536 - * @reg: Register address for the apptrust configuration 537 - * @port2_data: Data to set for the apptrust configuration 538 - * 539 - * This function implements a quirk for apptrust configuration on Port 2 of 540 - * KSZ88x3 devices. It ensures that DSCP apptrust is not working on Port 2 and 541 - * that it is not possible to disable PCP on Port 2. The only way to disable PCP 542 - * on Port 2 is to disable multiple queues on the switch. 543 - * 544 - * Return: 0 on success, or a negative error code on failure 545 - */ 546 - static int ksz88x3_port2_apptrust_quirk(struct ksz_device *dev, int port, 547 - int reg, u8 port2_data) 548 - { 549 - struct dsa_switch *ds = dev->ds; 550 - u8 port1_data; 551 - int ret; 552 - 553 - /* First validate Port 2 configuration. DiffServ/DSCP is not working 554 - * on this port. 555 - */ 556 - if (port2_data & KSZ8_PORT_DIFFSERV_ENABLE) { 557 - dev_err(dev->dev, "DSCP apptrust is not working on Port 2\n"); 558 - return -EINVAL; 559 - } 560 - 561 - /* If PCP support is requested, we need to enable all queues on the 562 - * switch to make PCP priority working on Port 2. 563 - */ 564 - if (port2_data & KSZ8_PORT_802_1P_ENABLE) 565 - return ksz8_all_queues_split(dev, dev->info->num_tx_queues); 566 - 567 - /* We got request to disable PCP priority on Port 2. 568 - * Now, we need to compare Port 2 configuration with Port 1 569 - * configuration. 570 - */ 571 - ret = ksz_pread8(dev, KSZ_PORT_1, reg, &port1_data); 572 - if (ret) 573 - return ret; 574 - 575 - /* If Port 1 has any apptrust enabled, we can't disable multiple queues 576 - * on the switch, so we can't disable PCP on Port 2. 577 - */ 578 - if (port1_data & (KSZ8_PORT_802_1P_ENABLE | KSZ8_PORT_DIFFSERV_ENABLE)) { 579 - dev_err(dev->dev, "Not possible to disable PCP on Port 2 if any apptrust is enabled on Port 1\n"); 580 - return -EINVAL; 581 - } 582 - 583 - /* Now we need to ensure that default priority on Port 1 is set to 0 584 - * otherwise we can't disable multiqueue support on the switch. 585 - */ 586 - ret = ksz_port_get_default_prio(ds, KSZ_PORT_1); 587 - if (ret < 0) { 588 - return ret; 589 - } else if (ret) { 590 - dev_err(dev->dev, "Not possible to disable PCP on Port 2 if non zero default priority is set on Port 1\n"); 591 - return -EINVAL; 592 - } 593 - 594 - /* Port 1 has no apptrust or default priority set and we got request to 595 - * disable PCP on Port 2. We can disable multiqueue support to disable 596 - * PCP on Port 2. 597 - */ 598 - return ksz8_all_queues_split(dev, 1); 599 - } 600 - 601 - /** 602 - * ksz88x3_port_apptrust_quirk - Quirk for apptrust configuration on KSZ88x3 603 - * devices 604 - * @dev: Pointer to the KSZ switch device structure 605 - * @port: Port number for which to set the apptrust selectors 606 - * @reg: Register address for the apptrust configuration 607 - * @data: Data to set for the apptrust configuration 608 - * 609 - * This function implements a quirk for apptrust configuration on KSZ88x3 610 - * devices. It ensures that apptrust configuration on Port 1 and 611 - * Port 2 is done in agreement with each other. 612 - * 613 - * Return: 0 on success, or a negative error code on failure 614 - */ 615 - static int ksz88x3_port_apptrust_quirk(struct ksz_device *dev, int port, 616 - int reg, u8 data) 617 - { 618 - if (port == KSZ_PORT_1) 619 - return ksz88x3_port1_apptrust_quirk(dev, port, reg, data); 620 - else if (port == KSZ_PORT_2) 621 - return ksz88x3_port2_apptrust_quirk(dev, port, reg, data); 622 - 623 - return 0; 624 - } 625 - 626 - /** 627 522 * ksz_port_set_apptrust - Sets the apptrust selectors for a port on a KSZ 628 523 * switch 629 524 * @ds: Pointer to the DSA switch structure ··· 512 705 data |= map[j].bit; 513 706 break; 514 707 } 515 - } 516 - 517 - if (ksz_is_ksz88x3(dev)) { 518 - ret = ksz88x3_port_apptrust_quirk(dev, port, reg, data); 519 - if (ret) 520 - return ret; 521 708 } 522 709 523 710 return ksz_prmw8(dev, port, reg, mask, data); ··· 600 799 */ 601 800 int ksz_dcb_init(struct ksz_device *dev) 602 801 { 603 - int ret; 604 - 605 - ret = ksz_init_global_dscp_map(dev); 606 - if (ret) 607 - return ret; 608 - 609 - /* Enable 802.1p priority control on Port 2 during switch initialization. 610 - * This setup is critical for the apptrust functionality on Port 1, which 611 - * relies on the priority settings of Port 2. Note: Port 1 is naturally 612 - * configured before Port 2, necessitating this configuration order. 613 - */ 614 - if (ksz_is_ksz88x3(dev)) 615 - return ksz_prmw8(dev, KSZ_PORT_2, KSZ8_REG_PORT_1_CTRL_0, 616 - KSZ8_PORT_802_1P_ENABLE, 617 - KSZ8_PORT_802_1P_ENABLE); 618 - 619 - return 0; 802 + return ksz_init_global_dscp_map(dev); 620 803 }
+36 -8
drivers/net/dsa/mv88e6xxx/chip.c
··· 3674 3674 return mv88e6xxx_g1_stats_clear(chip); 3675 3675 } 3676 3676 3677 + static int mv88e6320_setup_errata(struct mv88e6xxx_chip *chip) 3678 + { 3679 + u16 dummy; 3680 + int err; 3681 + 3682 + /* Workaround for erratum 3683 + * 3.3 RGMII timing may be out of spec when transmit delay is enabled 3684 + */ 3685 + err = mv88e6xxx_port_hidden_write(chip, 0, 0xf, 0x7, 0xe000); 3686 + if (err) 3687 + return err; 3688 + 3689 + return mv88e6xxx_port_hidden_read(chip, 0, 0xf, 0x7, &dummy); 3690 + } 3691 + 3677 3692 /* Check if the errata has already been applied. */ 3678 3693 static bool mv88e6390_setup_errata_applied(struct mv88e6xxx_chip *chip) 3679 3694 { ··· 5145 5130 5146 5131 static const struct mv88e6xxx_ops mv88e6320_ops = { 5147 5132 /* MV88E6XXX_FAMILY_6320 */ 5133 + .setup_errata = mv88e6320_setup_errata, 5148 5134 .ieee_pri_map = mv88e6085_g1_ieee_pri_map, 5149 5135 .ip_pri_map = mv88e6085_g1_ip_pri_map, 5150 5136 .irl_init_all = mv88e6352_g2_irl_init_all, ··· 5161 5145 .port_set_rgmii_delay = mv88e6320_port_set_rgmii_delay, 5162 5146 .port_set_speed_duplex = mv88e6185_port_set_speed_duplex, 5163 5147 .port_tag_remap = mv88e6095_port_tag_remap, 5148 + .port_set_policy = mv88e6352_port_set_policy, 5164 5149 .port_set_frame_mode = mv88e6351_port_set_frame_mode, 5165 5150 .port_set_ucast_flood = mv88e6352_port_set_ucast_flood, 5166 5151 .port_set_mcast_flood = mv88e6352_port_set_mcast_flood, ··· 5186 5169 .hardware_reset_pre = mv88e6xxx_g2_eeprom_wait, 5187 5170 .hardware_reset_post = mv88e6xxx_g2_eeprom_wait, 5188 5171 .reset = mv88e6352_g1_reset, 5189 - .vtu_getnext = mv88e6185_g1_vtu_getnext, 5190 - .vtu_loadpurge = mv88e6185_g1_vtu_loadpurge, 5172 + .vtu_getnext = mv88e6352_g1_vtu_getnext, 5173 + .vtu_loadpurge = mv88e6352_g1_vtu_loadpurge, 5174 + .stu_getnext = mv88e6352_g1_stu_getnext, 5175 + .stu_loadpurge = mv88e6352_g1_stu_loadpurge, 5191 5176 .gpio_ops = &mv88e6352_gpio_ops, 5192 5177 .avb_ops = &mv88e6352_avb_ops, 5193 5178 .ptp_ops = &mv88e6352_ptp_ops, ··· 5198 5179 5199 5180 static const struct mv88e6xxx_ops mv88e6321_ops = { 5200 5181 /* MV88E6XXX_FAMILY_6320 */ 5182 + .setup_errata = mv88e6320_setup_errata, 5201 5183 .ieee_pri_map = mv88e6085_g1_ieee_pri_map, 5202 5184 .ip_pri_map = mv88e6085_g1_ip_pri_map, 5203 5185 .irl_init_all = mv88e6352_g2_irl_init_all, ··· 5214 5194 .port_set_rgmii_delay = mv88e6320_port_set_rgmii_delay, 5215 5195 .port_set_speed_duplex = mv88e6185_port_set_speed_duplex, 5216 5196 .port_tag_remap = mv88e6095_port_tag_remap, 5197 + .port_set_policy = mv88e6352_port_set_policy, 5217 5198 .port_set_frame_mode = mv88e6351_port_set_frame_mode, 5218 5199 .port_set_ucast_flood = mv88e6352_port_set_ucast_flood, 5219 5200 .port_set_mcast_flood = mv88e6352_port_set_mcast_flood, ··· 5238 5217 .hardware_reset_pre = mv88e6xxx_g2_eeprom_wait, 5239 5218 .hardware_reset_post = mv88e6xxx_g2_eeprom_wait, 5240 5219 .reset = mv88e6352_g1_reset, 5241 - .vtu_getnext = mv88e6185_g1_vtu_getnext, 5242 - .vtu_loadpurge = mv88e6185_g1_vtu_loadpurge, 5220 + .vtu_getnext = mv88e6352_g1_vtu_getnext, 5221 + .vtu_loadpurge = mv88e6352_g1_vtu_loadpurge, 5222 + .stu_getnext = mv88e6352_g1_stu_getnext, 5223 + .stu_loadpurge = mv88e6352_g1_stu_loadpurge, 5243 5224 .gpio_ops = &mv88e6352_gpio_ops, 5244 5225 .avb_ops = &mv88e6352_avb_ops, 5245 5226 .ptp_ops = &mv88e6352_ptp_ops, ··· 5841 5818 .global1_addr = 0x1b, 5842 5819 .global2_addr = 0x1c, 5843 5820 .age_time_coeff = 3750, 5844 - .atu_move_port_mask = 0x1f, 5821 + .atu_move_port_mask = 0xf, 5845 5822 .g1_irqs = 9, 5846 5823 .g2_irqs = 10, 5847 5824 .stats_type = STATS_TYPE_BANK0 | STATS_TYPE_BANK1, ··· 6259 6236 .num_databases = 4096, 6260 6237 .num_macs = 8192, 6261 6238 .num_ports = 7, 6262 - .num_internal_phys = 5, 6239 + .num_internal_phys = 2, 6240 + .internal_phys_offset = 3, 6263 6241 .num_gpio = 15, 6264 6242 .max_vid = 4095, 6243 + .max_sid = 63, 6265 6244 .port_base_addr = 0x10, 6266 6245 .phy_base_addr = 0x0, 6267 6246 .global1_addr = 0x1b, ··· 6287 6262 .num_databases = 4096, 6288 6263 .num_macs = 8192, 6289 6264 .num_ports = 7, 6290 - .num_internal_phys = 5, 6265 + .num_internal_phys = 2, 6266 + .internal_phys_offset = 3, 6291 6267 .num_gpio = 15, 6292 6268 .max_vid = 4095, 6269 + .max_sid = 63, 6293 6270 .port_base_addr = 0x10, 6294 6271 .phy_base_addr = 0x0, 6295 6272 .global1_addr = 0x1b, ··· 6301 6274 .g2_irqs = 10, 6302 6275 .stats_type = STATS_TYPE_BANK0 | STATS_TYPE_BANK1, 6303 6276 .atu_move_port_mask = 0xf, 6277 + .pvt = true, 6304 6278 .multi_chip = true, 6305 6279 .edsa_support = MV88E6XXX_EDSA_SUPPORTED, 6306 6280 .ptp_support = true, ··· 6324 6296 .global1_addr = 0x1b, 6325 6297 .global2_addr = 0x1c, 6326 6298 .age_time_coeff = 3750, 6327 - .atu_move_port_mask = 0x1f, 6299 + .atu_move_port_mask = 0xf, 6328 6300 .g1_irqs = 9, 6329 6301 .g2_irqs = 10, 6330 6302 .stats_type = STATS_TYPE_BANK0 | STATS_TYPE_BANK1,
+8 -1
drivers/net/dsa/sja1105/sja1105_ethtool.c
··· 571 571 max_ctr = __MAX_SJA1105PQRS_PORT_COUNTER; 572 572 573 573 for (i = 0; i < max_ctr; i++) { 574 + if (!strlen(sja1105_port_counters[i].name)) 575 + continue; 576 + 574 577 rc = sja1105_port_counter_read(priv, port, i, &data[k++]); 575 578 if (rc) { 576 579 dev_err(ds->dev, ··· 599 596 else 600 597 max_ctr = __MAX_SJA1105PQRS_PORT_COUNTER; 601 598 602 - for (i = 0; i < max_ctr; i++) 599 + for (i = 0; i < max_ctr; i++) { 600 + if (!strlen(sja1105_port_counters[i].name)) 601 + continue; 602 + 603 603 ethtool_puts(&data, sja1105_port_counters[i].name); 604 + } 604 605 } 605 606 606 607 int sja1105_get_sset_count(struct dsa_switch *ds, int port, int sset)
+15 -5
drivers/net/dsa/sja1105/sja1105_ptp.c
··· 61 61 int sja1105_hwtstamp_set(struct dsa_switch *ds, int port, struct ifreq *ifr) 62 62 { 63 63 struct sja1105_private *priv = ds->priv; 64 + unsigned long hwts_tx_en, hwts_rx_en; 64 65 struct hwtstamp_config config; 65 66 66 67 if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) 67 68 return -EFAULT; 68 69 70 + hwts_tx_en = priv->hwts_tx_en; 71 + hwts_rx_en = priv->hwts_rx_en; 72 + 69 73 switch (config.tx_type) { 70 74 case HWTSTAMP_TX_OFF: 71 - priv->hwts_tx_en &= ~BIT(port); 75 + hwts_tx_en &= ~BIT(port); 72 76 break; 73 77 case HWTSTAMP_TX_ON: 74 - priv->hwts_tx_en |= BIT(port); 78 + hwts_tx_en |= BIT(port); 75 79 break; 76 80 default: 77 81 return -ERANGE; ··· 83 79 84 80 switch (config.rx_filter) { 85 81 case HWTSTAMP_FILTER_NONE: 86 - priv->hwts_rx_en &= ~BIT(port); 82 + hwts_rx_en &= ~BIT(port); 83 + break; 84 + case HWTSTAMP_FILTER_PTP_V2_L2_EVENT: 85 + hwts_rx_en |= BIT(port); 87 86 break; 88 87 default: 89 - priv->hwts_rx_en |= BIT(port); 90 - break; 88 + return -ERANGE; 91 89 } 92 90 93 91 if (copy_to_user(ifr->ifr_data, &config, sizeof(config))) 94 92 return -EFAULT; 93 + 94 + priv->hwts_tx_en = hwts_tx_en; 95 + priv->hwts_rx_en = hwts_rx_en; 96 + 95 97 return 0; 96 98 } 97 99
+4 -2
drivers/net/dsa/sja1105/sja1105_static_config.c
··· 1917 1917 if (i > table->entry_count) 1918 1918 return -ERANGE; 1919 1919 1920 - memmove(entries + i * entry_size, entries + (i + 1) * entry_size, 1921 - (table->entry_count - i) * entry_size); 1920 + if (i + 1 < table->entry_count) { 1921 + memmove(entries + i * entry_size, entries + (i + 1) * entry_size, 1922 + (table->entry_count - i - 1) * entry_size); 1923 + } 1922 1924 1923 1925 table->entry_count--; 1924 1926
+15 -4
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 489 489 txr = &bp->tx_ring[bp->tx_ring_map[i]]; 490 490 prod = txr->tx_prod; 491 491 492 + #if (MAX_SKB_FRAGS > TX_MAX_FRAGS) 493 + if (skb_shinfo(skb)->nr_frags > TX_MAX_FRAGS) { 494 + netdev_warn_once(dev, "SKB has too many (%d) fragments, max supported is %d. SKB will be linearized.\n", 495 + skb_shinfo(skb)->nr_frags, TX_MAX_FRAGS); 496 + if (skb_linearize(skb)) { 497 + dev_kfree_skb_any(skb); 498 + dev_core_stats_tx_dropped_inc(dev); 499 + return NETDEV_TX_OK; 500 + } 501 + } 502 + #endif 492 503 free_size = bnxt_tx_avail(bp, txr); 493 504 if (unlikely(free_size < skb_shinfo(skb)->nr_frags + 2)) { 494 505 /* We must have raced with NAPI cleanup */ ··· 579 568 TX_BD_FLAGS_LHINT_512_AND_SMALLER | 580 569 TX_BD_FLAGS_COAL_NOW | 581 570 TX_BD_FLAGS_PACKET_END | 582 - (2 << TX_BD_FLAGS_BD_CNT_SHIFT)); 571 + TX_BD_CNT(2)); 583 572 584 573 if (skb->ip_summed == CHECKSUM_PARTIAL) 585 574 tx_push1->tx_bd_hsize_lflags = ··· 654 643 655 644 dma_unmap_addr_set(tx_buf, mapping, mapping); 656 645 flags = (len << TX_BD_LEN_SHIFT) | TX_BD_TYPE_LONG_TX_BD | 657 - ((last_frag + 2) << TX_BD_FLAGS_BD_CNT_SHIFT); 646 + TX_BD_CNT(last_frag + 2); 658 647 659 648 txbd->tx_bd_haddr = cpu_to_le64(mapping); 660 649 txbd->tx_bd_opaque = SET_TX_OPAQUE(bp, txr, prod, 2 + last_frag); ··· 15912 15901 napi_enable(&bnapi->napi); 15913 15902 bnxt_db_nq_arm(bp, &cpr->cp_db, cpr->cp_raw_cons); 15914 15903 15915 - for (i = 0; i <= bp->nr_vnics; i++) { 15904 + for (i = 0; i < bp->nr_vnics; i++) { 15916 15905 vnic = &bp->vnic_info[i]; 15917 15906 15918 15907 rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic, true); ··· 15946 15935 struct bnxt_napi *bnapi; 15947 15936 int i; 15948 15937 15949 - for (i = 0; i <= bp->nr_vnics; i++) { 15938 + for (i = 0; i < bp->nr_vnics; i++) { 15950 15939 vnic = &bp->vnic_info[i]; 15951 15940 vnic->mru = 0; 15952 15941 bnxt_hwrm_vnic_update(bp, vnic,
+6
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 82 82 #define TX_OPAQUE_PROD(bp, opq) ((TX_OPAQUE_IDX(opq) + TX_OPAQUE_BDS(opq)) &\ 83 83 (bp)->tx_ring_mask) 84 84 85 + #define TX_BD_CNT(n) (((n) << TX_BD_FLAGS_BD_CNT_SHIFT) & TX_BD_FLAGS_BD_CNT) 86 + 87 + #define TX_MAX_BD_CNT 32 88 + 89 + #define TX_MAX_FRAGS (TX_MAX_BD_CNT - 2) 90 + 85 91 struct tx_bd_ext { 86 92 __le32 tx_bd_hsize_lflags; 87 93 #define TX_BD_FLAGS_TCP_UDP_CHKSUM (1 << 0)
+1 -2
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
··· 49 49 tx_buf->page = virt_to_head_page(xdp->data); 50 50 51 51 txbd = &txr->tx_desc_ring[TX_RING(bp, prod)][TX_IDX(prod)]; 52 - flags = (len << TX_BD_LEN_SHIFT) | 53 - ((num_frags + 1) << TX_BD_FLAGS_BD_CNT_SHIFT) | 52 + flags = (len << TX_BD_LEN_SHIFT) | TX_BD_CNT(num_frags + 1) | 54 53 bnxt_lhint_arr[len >> 9]; 55 54 txbd->tx_bd_len_flags_type = cpu_to_le32(flags); 56 55 txbd->tx_bd_opaque = SET_TX_OPAQUE(bp, txr, prod, 1 + num_frags);
+2 -1
drivers/net/ethernet/google/gve/gve_rx_dqo.c
··· 114 114 if (!gve_rx_was_added_to_block(priv, idx)) 115 115 return; 116 116 117 - page_pool_disable_direct_recycling(rx->dqo.page_pool); 117 + if (rx->dqo.page_pool) 118 + page_pool_disable_direct_recycling(rx->dqo.page_pool); 118 119 gve_remove_napi(priv, ntfy_idx); 119 120 gve_rx_remove_from_block(priv, idx); 120 121 gve_rx_reset_ring_dqo(priv, idx);
+18 -12
drivers/net/ethernet/ibm/ibmvnic.c
··· 4829 4829 strscpy(vlcd->name, adapter->netdev->name, len); 4830 4830 } 4831 4831 4832 + static void ibmvnic_print_hex_dump(struct net_device *dev, void *buf, 4833 + size_t len) 4834 + { 4835 + unsigned char hex_str[16 * 3]; 4836 + 4837 + for (size_t i = 0; i < len; i += 16) { 4838 + hex_dump_to_buffer((unsigned char *)buf + i, len - i, 16, 8, 4839 + hex_str, sizeof(hex_str), false); 4840 + netdev_dbg(dev, "%s\n", hex_str); 4841 + } 4842 + } 4843 + 4832 4844 static int send_login(struct ibmvnic_adapter *adapter) 4833 4845 { 4834 4846 struct ibmvnic_login_rsp_buffer *login_rsp_buffer; ··· 4951 4939 vnic_add_client_data(adapter, vlcd); 4952 4940 4953 4941 netdev_dbg(adapter->netdev, "Login Buffer:\n"); 4954 - for (i = 0; i < (adapter->login_buf_sz - 1) / 8 + 1; i++) { 4955 - netdev_dbg(adapter->netdev, "%016lx\n", 4956 - ((unsigned long *)(adapter->login_buf))[i]); 4957 - } 4942 + ibmvnic_print_hex_dump(adapter->netdev, adapter->login_buf, 4943 + adapter->login_buf_sz); 4958 4944 4959 4945 memset(&crq, 0, sizeof(crq)); 4960 4946 crq.login.first = IBMVNIC_CRQ_CMD; ··· 5329 5319 { 5330 5320 struct device *dev = &adapter->vdev->dev; 5331 5321 struct ibmvnic_query_ip_offload_buffer *buf = &adapter->ip_offload_buf; 5332 - int i; 5333 5322 5334 5323 dma_unmap_single(dev, adapter->ip_offload_tok, 5335 5324 sizeof(adapter->ip_offload_buf), DMA_FROM_DEVICE); 5336 5325 5337 5326 netdev_dbg(adapter->netdev, "Query IP Offload Buffer:\n"); 5338 - for (i = 0; i < (sizeof(adapter->ip_offload_buf) - 1) / 8 + 1; i++) 5339 - netdev_dbg(adapter->netdev, "%016lx\n", 5340 - ((unsigned long *)(buf))[i]); 5327 + ibmvnic_print_hex_dump(adapter->netdev, buf, 5328 + sizeof(adapter->ip_offload_buf)); 5341 5329 5342 5330 netdev_dbg(adapter->netdev, "ipv4_chksum = %d\n", buf->ipv4_chksum); 5343 5331 netdev_dbg(adapter->netdev, "ipv6_chksum = %d\n", buf->ipv6_chksum); ··· 5566 5558 netdev->mtu = adapter->req_mtu - ETH_HLEN; 5567 5559 5568 5560 netdev_dbg(adapter->netdev, "Login Response Buffer:\n"); 5569 - for (i = 0; i < (adapter->login_rsp_buf_sz - 1) / 8 + 1; i++) { 5570 - netdev_dbg(adapter->netdev, "%016lx\n", 5571 - ((unsigned long *)(adapter->login_rsp_buf))[i]); 5572 - } 5561 + ibmvnic_print_hex_dump(netdev, adapter->login_rsp_buf, 5562 + adapter->login_rsp_buf_sz); 5573 5563 5574 5564 /* Sanity checks */ 5575 5565 if (login->num_txcomp_subcrqs != login_rsp->num_txsubm_subcrqs ||
+3 -3
drivers/net/ethernet/intel/ice/devlink/health.c
··· 25 25 * The below lookup requires to be sorted by code. 26 26 */ 27 27 28 - static const char *const ice_common_port_solutions = 28 + static const char ice_common_port_solutions[] = 29 29 "Check your cable connection. Change or replace the module or cable. Manually set speed and duplex."; 30 - static const char *const ice_port_number_label = "Port Number"; 31 - static const char *const ice_update_nvm_solution = "Update to the latest NVM image."; 30 + static const char ice_port_number_label[] = "Port Number"; 31 + static const char ice_update_nvm_solution[] = "Update to the latest NVM image."; 32 32 33 33 static const struct ice_health_status ice_health_status_lookup[] = { 34 34 {ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_STRICT, "An unsupported module was detected.",
+2 -1
drivers/net/ethernet/intel/ice/ice_common.c
··· 2157 2157 caps->nvm_unified_update); 2158 2158 break; 2159 2159 case ICE_AQC_CAPS_RDMA: 2160 - caps->rdma = (number == 1); 2160 + if (IS_ENABLED(CONFIG_INFINIBAND_IRDMA)) 2161 + caps->rdma = (number == 1); 2161 2162 ice_debug(hw, ICE_DBG_INIT, "%s: rdma = %d\n", prefix, caps->rdma); 2162 2163 break; 2163 2164 case ICE_AQC_CAPS_MAX_MTU:
+4 -2
drivers/net/ethernet/intel/ice/ice_ptp.c
··· 1778 1778 8 + chan + (tmr_idx * 4)); 1779 1779 1780 1780 wr32(hw, GLGEN_GPIO_CTL(gpio_pin), val); 1781 + ice_flush(hw); 1781 1782 1782 1783 return 0; 1783 1784 } ··· 1839 1838 div64_u64_rem(start, period, &phase); 1840 1839 1841 1840 /* If we have only phase or start time is in the past, start the timer 1842 - * at the next multiple of period, maintaining phase. 1841 + * at the next multiple of period, maintaining phase at least 0.5 second 1842 + * from now, so we have time to write it to HW. 1843 1843 */ 1844 - clk = ice_ptp_read_src_clk_reg(pf, NULL); 1844 + clk = ice_ptp_read_src_clk_reg(pf, NULL) + NSEC_PER_MSEC * 500; 1845 1845 if (rq->flags & PTP_PEROUT_PHASE || start <= clk - prop_delay_ns) 1846 1846 start = div64_u64(clk + period - 1, period) * period + phase; 1847 1847
+31 -8
drivers/net/ethernet/intel/ice/ice_virtchnl.c
··· 565 565 * 566 566 * check for the valid queue ID 567 567 */ 568 - static bool ice_vc_isvalid_q_id(struct ice_vsi *vsi, u8 qid) 568 + static bool ice_vc_isvalid_q_id(struct ice_vsi *vsi, u16 qid) 569 569 { 570 570 /* allocated Tx and Rx queues should be always equal for VF VSI */ 571 571 return qid < vsi->alloc_txq; ··· 1865 1865 1866 1866 for (i = 0; i < qbw->num_queues; i++) { 1867 1867 if (qbw->cfg[i].shaper.peak != 0 && vf->max_tx_rate != 0 && 1868 - qbw->cfg[i].shaper.peak > vf->max_tx_rate) 1868 + qbw->cfg[i].shaper.peak > vf->max_tx_rate) { 1869 1869 dev_warn(ice_pf_to_dev(vf->pf), "The maximum queue %d rate limit configuration may not take effect because the maximum TX rate for VF-%d is %d\n", 1870 1870 qbw->cfg[i].queue_id, vf->vf_id, 1871 1871 vf->max_tx_rate); 1872 + v_ret = VIRTCHNL_STATUS_ERR_PARAM; 1873 + goto err; 1874 + } 1872 1875 if (qbw->cfg[i].shaper.committed != 0 && vf->min_tx_rate != 0 && 1873 - qbw->cfg[i].shaper.committed < vf->min_tx_rate) 1876 + qbw->cfg[i].shaper.committed < vf->min_tx_rate) { 1874 1877 dev_warn(ice_pf_to_dev(vf->pf), "The minimum queue %d rate limit configuration may not take effect because the minimum TX rate for VF-%d is %d\n", 1875 1878 qbw->cfg[i].queue_id, vf->vf_id, 1876 - vf->max_tx_rate); 1879 + vf->min_tx_rate); 1880 + v_ret = VIRTCHNL_STATUS_ERR_PARAM; 1881 + goto err; 1882 + } 1883 + if (qbw->cfg[i].queue_id > vf->num_vf_qs) { 1884 + dev_warn(ice_pf_to_dev(vf->pf), "VF-%d trying to configure invalid queue_id\n", 1885 + vf->vf_id); 1886 + v_ret = VIRTCHNL_STATUS_ERR_PARAM; 1887 + goto err; 1888 + } 1889 + if (qbw->cfg[i].tc >= ICE_MAX_TRAFFIC_CLASS) { 1890 + dev_warn(ice_pf_to_dev(vf->pf), "VF-%d trying to configure a traffic class higher than allowed\n", 1891 + vf->vf_id); 1892 + v_ret = VIRTCHNL_STATUS_ERR_PARAM; 1893 + goto err; 1894 + } 1877 1895 } 1878 1896 1879 1897 for (i = 0; i < qbw->num_queues; i++) { ··· 1921 1903 */ 1922 1904 static int ice_vc_cfg_q_quanta(struct ice_vf *vf, u8 *msg) 1923 1905 { 1906 + u16 quanta_prof_id, quanta_size, start_qid, num_queues, end_qid, i; 1924 1907 enum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS; 1925 - u16 quanta_prof_id, quanta_size, start_qid, end_qid, i; 1926 1908 struct virtchnl_quanta_cfg *qquanta = 1927 1909 (struct virtchnl_quanta_cfg *)msg; 1928 1910 struct ice_vsi *vsi; 1929 1911 int ret; 1912 + 1913 + start_qid = qquanta->queue_select.start_queue_id; 1914 + num_queues = qquanta->queue_select.num_queues; 1915 + 1916 + if (check_add_overflow(start_qid, num_queues, &end_qid)) { 1917 + v_ret = VIRTCHNL_STATUS_ERR_PARAM; 1918 + goto err; 1919 + } 1930 1920 1931 1921 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { 1932 1922 v_ret = VIRTCHNL_STATUS_ERR_PARAM; ··· 1947 1921 goto err; 1948 1922 } 1949 1923 1950 - end_qid = qquanta->queue_select.start_queue_id + 1951 - qquanta->queue_select.num_queues; 1952 1924 if (end_qid > ICE_MAX_RSS_QS_PER_VF || 1953 1925 end_qid > min_t(u16, vsi->alloc_txq, vsi->alloc_rxq)) { 1954 1926 dev_err(ice_pf_to_dev(vf->pf), "VF-%d trying to configure more than allocated number of queues: %d\n", ··· 1975 1951 goto err; 1976 1952 } 1977 1953 1978 - start_qid = qquanta->queue_select.start_queue_id; 1979 1954 for (i = start_qid; i < end_qid; i++) 1980 1955 vsi->tx_rings[i]->quanta_prof_id = quanta_prof_id; 1981 1956
+15 -9
drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
··· 832 832 struct virtchnl_proto_hdrs *proto, 833 833 struct virtchnl_fdir_fltr_conf *conf) 834 834 { 835 - u8 *pkt_buf, *msk_buf __free(kfree); 835 + u8 *pkt_buf, *msk_buf __free(kfree) = NULL; 836 836 struct ice_parser_result rslt; 837 837 struct ice_pf *pf = vf->pf; 838 + u16 pkt_len, udp_port = 0; 838 839 struct ice_parser *psr; 839 840 int status = -ENOMEM; 840 841 struct ice_hw *hw; 841 - u16 udp_port = 0; 842 842 843 - pkt_buf = kzalloc(proto->raw.pkt_len, GFP_KERNEL); 844 - msk_buf = kzalloc(proto->raw.pkt_len, GFP_KERNEL); 843 + pkt_len = proto->raw.pkt_len; 844 + 845 + if (!pkt_len || pkt_len > VIRTCHNL_MAX_SIZE_RAW_PACKET) 846 + return -EINVAL; 847 + 848 + pkt_buf = kzalloc(pkt_len, GFP_KERNEL); 849 + msk_buf = kzalloc(pkt_len, GFP_KERNEL); 850 + 845 851 if (!pkt_buf || !msk_buf) 846 852 goto err_mem_alloc; 847 853 848 - memcpy(pkt_buf, proto->raw.spec, proto->raw.pkt_len); 849 - memcpy(msk_buf, proto->raw.mask, proto->raw.pkt_len); 854 + memcpy(pkt_buf, proto->raw.spec, pkt_len); 855 + memcpy(msk_buf, proto->raw.mask, pkt_len); 850 856 851 857 hw = &pf->hw; 852 858 ··· 868 862 if (ice_get_open_tunnel_port(hw, &udp_port, TNL_VXLAN)) 869 863 ice_parser_vxlan_tunnel_set(psr, udp_port, true); 870 864 871 - status = ice_parser_run(psr, pkt_buf, proto->raw.pkt_len, &rslt); 865 + status = ice_parser_run(psr, pkt_buf, pkt_len, &rslt); 872 866 if (status) 873 867 goto err_parser_destroy; 874 868 ··· 882 876 } 883 877 884 878 status = ice_parser_profile_init(&rslt, pkt_buf, msk_buf, 885 - proto->raw.pkt_len, ICE_BLK_FD, 879 + pkt_len, ICE_BLK_FD, 886 880 conf->prof); 887 881 if (status) 888 882 goto err_parser_profile_init; ··· 891 885 ice_parser_profile_dump(hw, conf->prof); 892 886 893 887 /* Store raw flow info into @conf */ 894 - conf->pkt_len = proto->raw.pkt_len; 888 + conf->pkt_len = pkt_len; 895 889 conf->pkt_buf = pkt_buf; 896 890 conf->parser_ena = true; 897 891
+22 -9
drivers/net/ethernet/intel/idpf/idpf_lib.c
··· 928 928 static void idpf_decfg_netdev(struct idpf_vport *vport) 929 929 { 930 930 struct idpf_adapter *adapter = vport->adapter; 931 + u16 idx = vport->idx; 931 932 932 933 kfree(vport->rx_ptype_lkup); 933 934 vport->rx_ptype_lkup = NULL; 934 935 935 - unregister_netdev(vport->netdev); 936 - free_netdev(vport->netdev); 936 + if (test_and_clear_bit(IDPF_VPORT_REG_NETDEV, 937 + adapter->vport_config[idx]->flags)) { 938 + unregister_netdev(vport->netdev); 939 + free_netdev(vport->netdev); 940 + } 937 941 vport->netdev = NULL; 938 942 939 - adapter->netdevs[vport->idx] = NULL; 943 + adapter->netdevs[idx] = NULL; 940 944 } 941 945 942 946 /** ··· 1541 1537 } 1542 1538 1543 1539 for (index = 0; index < adapter->max_vports; index++) { 1544 - if (adapter->netdevs[index] && 1545 - !test_bit(IDPF_VPORT_REG_NETDEV, 1546 - adapter->vport_config[index]->flags)) { 1547 - register_netdev(adapter->netdevs[index]); 1548 - set_bit(IDPF_VPORT_REG_NETDEV, 1549 - adapter->vport_config[index]->flags); 1540 + struct net_device *netdev = adapter->netdevs[index]; 1541 + struct idpf_vport_config *vport_config; 1542 + 1543 + vport_config = adapter->vport_config[index]; 1544 + 1545 + if (!netdev || 1546 + test_bit(IDPF_VPORT_REG_NETDEV, vport_config->flags)) 1547 + continue; 1548 + 1549 + err = register_netdev(netdev); 1550 + if (err) { 1551 + dev_err(&pdev->dev, "failed to register netdev for vport %d: %pe\n", 1552 + index, ERR_PTR(err)); 1553 + continue; 1550 1554 } 1555 + set_bit(IDPF_VPORT_REG_NETDEV, vport_config->flags); 1551 1556 } 1552 1557 1553 1558 /* As all the required vports are created, clear the reset flag
+2
drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
··· 884 884 case ESP_V6_FLOW: 885 885 return MLX5_TT_IPV6_IPSEC_ESP; 886 886 case IPV4_FLOW: 887 + case IP_USER_FLOW: 887 888 return MLX5_TT_IPV4; 888 889 case IPV6_FLOW: 890 + case IPV6_USER_FLOW: 889 891 return MLX5_TT_IPV6; 890 892 default: 891 893 return -EINVAL;
+4
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
··· 1031 1031 if (err) { 1032 1032 if (shared_fdb || roce_lag) 1033 1033 mlx5_lag_add_devices(ldev); 1034 + if (shared_fdb) { 1035 + mlx5_ldev_for_each(i, 0, ldev) 1036 + mlx5_eswitch_reload_ib_reps(ldev->pf[i].dev->priv.eswitch); 1037 + } 1034 1038 1035 1039 return; 1036 1040 } else if (roce_lag) {
+7 -8
drivers/net/ethernet/mellanox/mlx5/core/main.c
··· 1210 1210 dev->caps.embedded_cpu = mlx5_read_embedded_cpu(dev); 1211 1211 mlx5_cmd_set_state(dev, MLX5_CMDIF_STATE_UP); 1212 1212 1213 - mlx5_start_health_poll(dev); 1214 - 1215 1213 err = mlx5_core_enable_hca(dev, 0); 1216 1214 if (err) { 1217 1215 mlx5_core_err(dev, "enable hca failed\n"); 1218 - goto stop_health_poll; 1216 + goto err_cmd_cleanup; 1219 1217 } 1218 + 1219 + mlx5_start_health_poll(dev); 1220 1220 1221 1221 err = mlx5_core_set_issi(dev); 1222 1222 if (err) { 1223 1223 mlx5_core_err(dev, "failed to set issi\n"); 1224 - goto err_disable_hca; 1224 + goto stop_health_poll; 1225 1225 } 1226 1226 1227 1227 err = mlx5_satisfy_startup_pages(dev, 1); 1228 1228 if (err) { 1229 1229 mlx5_core_err(dev, "failed to allocate boot pages\n"); 1230 - goto err_disable_hca; 1230 + goto stop_health_poll; 1231 1231 } 1232 1232 1233 1233 err = mlx5_tout_query_dtor(dev); ··· 1240 1240 1241 1241 reclaim_boot_pages: 1242 1242 mlx5_reclaim_startup_pages(dev); 1243 - err_disable_hca: 1244 - mlx5_core_disable_hca(dev, 0); 1245 1243 stop_health_poll: 1246 1244 mlx5_stop_health_poll(dev, boot); 1245 + mlx5_core_disable_hca(dev, 0); 1247 1246 err_cmd_cleanup: 1248 1247 mlx5_cmd_set_state(dev, MLX5_CMDIF_STATE_DOWN); 1249 1248 mlx5_cmd_disable(dev); ··· 1253 1254 static void mlx5_function_disable(struct mlx5_core_dev *dev, bool boot) 1254 1255 { 1255 1256 mlx5_reclaim_startup_pages(dev); 1256 - mlx5_core_disable_hca(dev, 0); 1257 1257 mlx5_stop_health_poll(dev, boot); 1258 + mlx5_core_disable_hca(dev, 0); 1258 1259 mlx5_cmd_set_state(dev, MLX5_CMDIF_STATE_DOWN); 1259 1260 mlx5_cmd_disable(dev); 1260 1261 }
+22 -5
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c
··· 212 212 * This array defines key offsets for easy access when copying key blocks from 213 213 * entry key to Bloom filter chunk. 214 214 */ 215 - static const u8 chunk_key_offsets[MLXSW_BLOOM_KEY_CHUNKS] = {2, 20, 38}; 215 + static char * 216 + mlxsw_sp_acl_bf_enc_key_get(struct mlxsw_sp_acl_atcam_entry *aentry, 217 + u8 chunk_index) 218 + { 219 + switch (chunk_index) { 220 + case 0: 221 + return &aentry->ht_key.enc_key[2]; 222 + case 1: 223 + return &aentry->ht_key.enc_key[20]; 224 + case 2: 225 + return &aentry->ht_key.enc_key[38]; 226 + default: 227 + WARN_ON_ONCE(1); 228 + return &aentry->ht_key.enc_key[0]; 229 + } 230 + } 216 231 217 232 static u16 mlxsw_sp2_acl_bf_crc16_byte(u16 crc, u8 c) 218 233 { ··· 250 235 u8 key_offset, u8 chunk_key_len, u8 chunk_len) 251 236 { 252 237 struct mlxsw_afk_key_info *key_info = aregion->region->key_info; 253 - u8 chunk_index, chunk_count, block_count; 238 + u8 chunk_index, chunk_count; 254 239 char *chunk = output; 255 240 __be16 erp_region_id; 241 + u32 block_count; 256 242 257 243 block_count = mlxsw_afk_key_info_blocks_count_get(key_info); 258 244 chunk_count = 1 + ((block_count - 1) >> 2); ··· 261 245 (aregion->region->id << 4)); 262 246 for (chunk_index = max_chunks - chunk_count; chunk_index < max_chunks; 263 247 chunk_index++) { 248 + char *enc_key; 249 + 264 250 memset(chunk, 0, pad_bytes); 265 251 memcpy(chunk + pad_bytes, &erp_region_id, 266 252 sizeof(erp_region_id)); 267 - memcpy(chunk + key_offset, 268 - &aentry->ht_key.enc_key[chunk_key_offsets[chunk_index]], 269 - chunk_key_len); 253 + enc_key = mlxsw_sp_acl_bf_enc_key_get(aentry, chunk_index); 254 + memcpy(chunk + key_offset, enc_key, chunk_key_len); 270 255 chunk += chunk_len; 271 256 } 272 257 *len = chunk_count * chunk_len;
+4 -7
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 3688 3688 { 3689 3689 struct stmmac_priv *priv = netdev_priv(dev); 3690 3690 enum request_irq_err irq_err; 3691 - cpumask_t cpu_mask; 3692 3691 int irq_idx = 0; 3693 3692 char *int_name; 3694 3693 int ret; ··· 3816 3817 irq_idx = i; 3817 3818 goto irq_error; 3818 3819 } 3819 - cpumask_clear(&cpu_mask); 3820 - cpumask_set_cpu(i % num_online_cpus(), &cpu_mask); 3821 - irq_set_affinity_hint(priv->rx_irq[i], &cpu_mask); 3820 + irq_set_affinity_hint(priv->rx_irq[i], 3821 + cpumask_of(i % num_online_cpus())); 3822 3822 } 3823 3823 3824 3824 /* Request Tx MSI irq */ ··· 3840 3842 irq_idx = i; 3841 3843 goto irq_error; 3842 3844 } 3843 - cpumask_clear(&cpu_mask); 3844 - cpumask_set_cpu(i % num_online_cpus(), &cpu_mask); 3845 - irq_set_affinity_hint(priv->tx_irq[i], &cpu_mask); 3845 + irq_set_affinity_hint(priv->tx_irq[i], 3846 + cpumask_of(i % num_online_cpus())); 3846 3847 } 3847 3848 3848 3849 return 0;
+40 -25
drivers/net/ethernet/wangxun/libwx/wx_lib.c
··· 1102 1102 context_desc->mss_l4len_idx = cpu_to_le32(mss_l4len_idx); 1103 1103 } 1104 1104 1105 - static void wx_get_ipv6_proto(struct sk_buff *skb, int offset, u8 *nexthdr) 1106 - { 1107 - struct ipv6hdr *hdr = (struct ipv6hdr *)(skb->data + offset); 1108 - 1109 - *nexthdr = hdr->nexthdr; 1110 - offset += sizeof(struct ipv6hdr); 1111 - while (ipv6_ext_hdr(*nexthdr)) { 1112 - struct ipv6_opt_hdr _hdr, *hp; 1113 - 1114 - if (*nexthdr == NEXTHDR_NONE) 1115 - return; 1116 - hp = skb_header_pointer(skb, offset, sizeof(_hdr), &_hdr); 1117 - if (!hp) 1118 - return; 1119 - if (*nexthdr == NEXTHDR_FRAGMENT) 1120 - break; 1121 - *nexthdr = hp->nexthdr; 1122 - } 1123 - } 1124 - 1125 1105 union network_header { 1126 1106 struct iphdr *ipv4; 1127 1107 struct ipv6hdr *ipv6; ··· 1112 1132 { 1113 1133 u8 tun_prot = 0, l4_prot = 0, ptype = 0; 1114 1134 struct sk_buff *skb = first->skb; 1135 + unsigned char *exthdr, *l4_hdr; 1136 + __be16 frag_off; 1115 1137 1116 1138 if (skb->encapsulation) { 1117 1139 union network_header hdr; ··· 1124 1142 ptype = WX_PTYPE_TUN_IPV4; 1125 1143 break; 1126 1144 case htons(ETH_P_IPV6): 1127 - wx_get_ipv6_proto(skb, skb_network_offset(skb), &tun_prot); 1145 + l4_hdr = skb_transport_header(skb); 1146 + exthdr = skb_network_header(skb) + sizeof(struct ipv6hdr); 1147 + tun_prot = ipv6_hdr(skb)->nexthdr; 1148 + if (l4_hdr != exthdr) 1149 + ipv6_skip_exthdr(skb, exthdr - skb->data, &tun_prot, &frag_off); 1128 1150 ptype = WX_PTYPE_TUN_IPV6; 1129 1151 break; 1130 1152 default: 1131 1153 return ptype; 1132 1154 } 1133 1155 1134 - if (tun_prot == IPPROTO_IPIP) { 1156 + if (tun_prot == IPPROTO_IPIP || tun_prot == IPPROTO_IPV6) { 1135 1157 hdr.raw = (void *)inner_ip_hdr(skb); 1136 1158 ptype |= WX_PTYPE_PKT_IPIP; 1137 1159 } else if (tun_prot == IPPROTO_UDP) { ··· 1172 1186 l4_prot = hdr.ipv4->protocol; 1173 1187 break; 1174 1188 case 6: 1175 - wx_get_ipv6_proto(skb, skb_inner_network_offset(skb), &l4_prot); 1189 + l4_hdr = skb_inner_transport_header(skb); 1190 + exthdr = skb_inner_network_header(skb) + sizeof(struct ipv6hdr); 1191 + l4_prot = inner_ipv6_hdr(skb)->nexthdr; 1192 + if (l4_hdr != exthdr) 1193 + ipv6_skip_exthdr(skb, exthdr - skb->data, &l4_prot, &frag_off); 1176 1194 ptype |= WX_PTYPE_PKT_IPV6; 1177 1195 break; 1178 1196 default: ··· 1189 1199 ptype = WX_PTYPE_PKT_IP; 1190 1200 break; 1191 1201 case htons(ETH_P_IPV6): 1192 - wx_get_ipv6_proto(skb, skb_network_offset(skb), &l4_prot); 1202 + l4_hdr = skb_transport_header(skb); 1203 + exthdr = skb_network_header(skb) + sizeof(struct ipv6hdr); 1204 + l4_prot = ipv6_hdr(skb)->nexthdr; 1205 + if (l4_hdr != exthdr) 1206 + ipv6_skip_exthdr(skb, exthdr - skb->data, &l4_prot, &frag_off); 1193 1207 ptype = WX_PTYPE_PKT_IP | WX_PTYPE_PKT_IPV6; 1194 1208 break; 1195 1209 default: ··· 1283 1289 1284 1290 /* vlan_macip_lens: HEADLEN, MACLEN, VLAN tag */ 1285 1291 if (enc) { 1292 + unsigned char *exthdr, *l4_hdr; 1293 + __be16 frag_off; 1294 + 1286 1295 switch (first->protocol) { 1287 1296 case htons(ETH_P_IP): 1288 1297 tun_prot = ip_hdr(skb)->protocol; 1289 1298 first->tx_flags |= WX_TX_FLAGS_OUTER_IPV4; 1290 1299 break; 1291 1300 case htons(ETH_P_IPV6): 1301 + l4_hdr = skb_transport_header(skb); 1302 + exthdr = skb_network_header(skb) + sizeof(struct ipv6hdr); 1292 1303 tun_prot = ipv6_hdr(skb)->nexthdr; 1304 + if (l4_hdr != exthdr) 1305 + ipv6_skip_exthdr(skb, exthdr - skb->data, &tun_prot, &frag_off); 1293 1306 break; 1294 1307 default: 1295 1308 break; ··· 1319 1318 WX_TXD_TUNNEL_LEN_SHIFT); 1320 1319 break; 1321 1320 case IPPROTO_IPIP: 1321 + case IPPROTO_IPV6: 1322 1322 tunhdr_eiplen_tunlen = (((char *)inner_ip_hdr(skb) - 1323 1323 (char *)ip_hdr(skb)) >> 2) << 1324 1324 WX_TXD_OUTER_IPLEN_SHIFT; ··· 1357 1355 u8 tun_prot = 0; 1358 1356 1359 1357 if (skb->ip_summed != CHECKSUM_PARTIAL) { 1358 + csum_failed: 1360 1359 if (!(first->tx_flags & WX_TX_FLAGS_HW_VLAN) && 1361 1360 !(first->tx_flags & WX_TX_FLAGS_CC)) 1362 1361 return; 1363 1362 vlan_macip_lens = skb_network_offset(skb) << 1364 1363 WX_TXD_MACLEN_SHIFT; 1365 1364 } else { 1365 + unsigned char *exthdr, *l4_hdr; 1366 + __be16 frag_off; 1366 1367 u8 l4_prot = 0; 1367 1368 union { 1368 1369 struct iphdr *ipv4; ··· 1387 1382 tun_prot = ip_hdr(skb)->protocol; 1388 1383 break; 1389 1384 case htons(ETH_P_IPV6): 1385 + l4_hdr = skb_transport_header(skb); 1386 + exthdr = skb_network_header(skb) + sizeof(struct ipv6hdr); 1390 1387 tun_prot = ipv6_hdr(skb)->nexthdr; 1388 + if (l4_hdr != exthdr) 1389 + ipv6_skip_exthdr(skb, exthdr - skb->data, 1390 + &tun_prot, &frag_off); 1391 1391 break; 1392 1392 default: 1393 1393 return; ··· 1416 1406 WX_TXD_TUNNEL_LEN_SHIFT); 1417 1407 break; 1418 1408 case IPPROTO_IPIP: 1409 + case IPPROTO_IPV6: 1419 1410 tunhdr_eiplen_tunlen = (((char *)inner_ip_hdr(skb) - 1420 1411 (char *)ip_hdr(skb)) >> 2) << 1421 1412 WX_TXD_OUTER_IPLEN_SHIFT; ··· 1439 1428 break; 1440 1429 case 6: 1441 1430 vlan_macip_lens |= (transport_hdr.raw - network_hdr.raw) >> 1; 1431 + exthdr = network_hdr.raw + sizeof(struct ipv6hdr); 1442 1432 l4_prot = network_hdr.ipv6->nexthdr; 1433 + if (transport_hdr.raw != exthdr) 1434 + ipv6_skip_exthdr(skb, exthdr - skb->data, &l4_prot, &frag_off); 1443 1435 break; 1444 1436 default: 1445 1437 break; ··· 1462 1448 WX_TXD_L4LEN_SHIFT; 1463 1449 break; 1464 1450 default: 1465 - break; 1451 + skb_checksum_help(skb); 1452 + goto csum_failed; 1466 1453 } 1467 1454 1468 1455 /* update TX checksum flag */
-1
drivers/net/ipvlan/ipvlan_l3s.c
··· 226 226 227 227 dev->priv_flags &= ~IFF_L3MDEV_RX_HANDLER; 228 228 ipvlan_unregister_nf_hook(read_pnet(&port->pnet)); 229 - dev->l3mdev_ops = NULL; 230 229 }
+1 -1
drivers/net/mctp/mctp-i2c.c
··· 537 537 rc = __i2c_transfer(midev->adapter, &msg, 1); 538 538 539 539 /* on tx errors, the flow can no longer be considered valid */ 540 - if (rc) 540 + if (rc < 0) 541 541 mctp_i2c_invalidate_tx_flow(midev, skb); 542 542 543 543 break;
+5 -5
drivers/net/vmxnet3/vmxnet3_drv.c
··· 2033 2033 2034 2034 rq->comp_ring.gen = VMXNET3_INIT_GEN; 2035 2035 rq->comp_ring.next2proc = 0; 2036 + 2037 + if (xdp_rxq_info_is_reg(&rq->xdp_rxq)) 2038 + xdp_rxq_info_unreg(&rq->xdp_rxq); 2039 + page_pool_destroy(rq->page_pool); 2040 + rq->page_pool = NULL; 2036 2041 } 2037 2042 2038 2043 ··· 2077 2072 rq->rx_ring[i].base = NULL; 2078 2073 } 2079 2074 } 2080 - 2081 - if (xdp_rxq_info_is_reg(&rq->xdp_rxq)) 2082 - xdp_rxq_info_unreg(&rq->xdp_rxq); 2083 - page_pool_destroy(rq->page_pool); 2084 - rq->page_pool = NULL; 2085 2075 2086 2076 if (rq->data_ring.base) { 2087 2077 dma_free_coherent(&adapter->pdev->dev,
+2 -2
include/linux/avf/virtchnl.h
··· 1343 1343 * 2 - from the second inner layer 1344 1344 * .... 1345 1345 **/ 1346 - int count; /* the proto layers must < VIRTCHNL_MAX_NUM_PROTO_HDRS */ 1346 + u32 count; /* the proto layers must < VIRTCHNL_MAX_NUM_PROTO_HDRS */ 1347 1347 union { 1348 1348 struct virtchnl_proto_hdr 1349 1349 proto_hdr[VIRTCHNL_MAX_NUM_PROTO_HDRS]; ··· 1395 1395 1396 1396 struct virtchnl_filter_action_set { 1397 1397 /* action number must be less then VIRTCHNL_MAX_NUM_ACTIONS */ 1398 - int count; 1398 + u32 count; 1399 1399 struct virtchnl_filter_action actions[VIRTCHNL_MAX_NUM_ACTIONS]; 1400 1400 }; 1401 1401
+2 -4
include/linux/if_bridge.h
··· 65 65 #define BR_DEFAULT_AGEING_TIME (300 * HZ) 66 66 67 67 struct net_bridge; 68 - void brioctl_set(int (*hook)(struct net *net, struct net_bridge *br, 69 - unsigned int cmd, struct ifreq *ifr, 68 + void brioctl_set(int (*hook)(struct net *net, unsigned int cmd, 70 69 void __user *uarg)); 71 - int br_ioctl_call(struct net *net, struct net_bridge *br, unsigned int cmd, 72 - struct ifreq *ifr, void __user *uarg); 70 + int br_ioctl_call(struct net *net, unsigned int cmd, void __user *uarg); 73 71 74 72 #if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) 75 73 int br_multicast_list_adjacent(struct net_device *dev,
-1
include/net/ax25.h
··· 418 418 int ax25_rt_ioctl(unsigned int, void __user *); 419 419 extern const struct seq_operations ax25_rt_seqops; 420 420 ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev); 421 - int ax25_rt_autobind(ax25_cb *, ax25_address *); 422 421 struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, 423 422 ax25_address *, ax25_digi *); 424 423 void ax25_rt_free(void);
+1
include/net/bonding.h
··· 695 695 void bond_debug_unregister(struct bonding *bond); 696 696 void bond_debug_reregister(struct bonding *bond); 697 697 const char *bond_mode_name(int mode); 698 + bool bond_xdp_check(struct bonding *bond, int mode); 698 699 void bond_setup(struct net_device *bond_dev); 699 700 unsigned int bond_get_num_tx_queues(void); 700 701 int bond_netlink_init(void);
+2
net/atm/mpc.c
··· 1314 1314 holding_time = msg->content.eg_info.holding_time; 1315 1315 dprintk("(%s) entry = %p, holding_time = %u\n", 1316 1316 mpc->dev->name, entry, holding_time); 1317 + if (entry == NULL && !holding_time) 1318 + return; 1317 1319 if (entry == NULL && holding_time) { 1318 1320 entry = mpc->eg_ops->add_entry(msg, mpc); 1319 1321 mpc->eg_ops->put(entry);
+10 -20
net/ax25/af_ax25.c
··· 1270 1270 } 1271 1271 } 1272 1272 1273 - /* 1274 - * Must bind first - autobinding in this may or may not work. If 1275 - * the socket is already bound, check to see if the device has 1276 - * been filled in, error if it hasn't. 1277 - */ 1273 + /* Must bind first - autobinding does not work. */ 1278 1274 if (sock_flag(sk, SOCK_ZAPPED)) { 1279 - /* check if we can remove this feature. It is broken. */ 1280 - printk(KERN_WARNING "ax25_connect(): %s uses autobind, please contact jreuter@yaina.de\n", 1281 - current->comm); 1282 - if ((err = ax25_rt_autobind(ax25, &fsa->fsa_ax25.sax25_call)) < 0) { 1283 - kfree(digi); 1284 - goto out_release; 1285 - } 1275 + kfree(digi); 1276 + err = -EINVAL; 1277 + goto out_release; 1278 + } 1286 1279 1287 - ax25_fillin_cb(ax25, ax25->ax25_dev); 1288 - ax25_cb_add(ax25); 1289 - } else { 1290 - if (ax25->ax25_dev == NULL) { 1291 - kfree(digi); 1292 - err = -EHOSTUNREACH; 1293 - goto out_release; 1294 - } 1280 + /* Check to see if the device has been filled in, error if it hasn't. */ 1281 + if (ax25->ax25_dev == NULL) { 1282 + kfree(digi); 1283 + err = -EHOSTUNREACH; 1284 + goto out_release; 1295 1285 } 1296 1286 1297 1287 if (sk->sk_type == SOCK_SEQPACKET &&
-74
net/ax25/ax25_route.c
··· 373 373 return ax25_rt; 374 374 } 375 375 376 - /* 377 - * Adjust path: If you specify a default route and want to connect 378 - * a target on the digipeater path but w/o having a special route 379 - * set before, the path has to be truncated from your target on. 380 - */ 381 - static inline void ax25_adjust_path(ax25_address *addr, ax25_digi *digipeat) 382 - { 383 - int k; 384 - 385 - for (k = 0; k < digipeat->ndigi; k++) { 386 - if (ax25cmp(addr, &digipeat->calls[k]) == 0) 387 - break; 388 - } 389 - 390 - digipeat->ndigi = k; 391 - } 392 - 393 - 394 - /* 395 - * Find which interface to use. 396 - */ 397 - int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr) 398 - { 399 - ax25_uid_assoc *user; 400 - ax25_route *ax25_rt; 401 - int err = 0; 402 - 403 - ax25_route_lock_use(); 404 - ax25_rt = ax25_get_route(addr, NULL); 405 - if (!ax25_rt) { 406 - ax25_route_lock_unuse(); 407 - return -EHOSTUNREACH; 408 - } 409 - rcu_read_lock(); 410 - if ((ax25->ax25_dev = ax25_dev_ax25dev(ax25_rt->dev)) == NULL) { 411 - err = -EHOSTUNREACH; 412 - goto put; 413 - } 414 - 415 - user = ax25_findbyuid(current_euid()); 416 - if (user) { 417 - ax25->source_addr = user->call; 418 - ax25_uid_put(user); 419 - } else { 420 - if (ax25_uid_policy && !capable(CAP_NET_BIND_SERVICE)) { 421 - err = -EPERM; 422 - goto put; 423 - } 424 - ax25->source_addr = *(ax25_address *)ax25->ax25_dev->dev->dev_addr; 425 - } 426 - 427 - if (ax25_rt->digipeat != NULL) { 428 - ax25->digipeat = kmemdup(ax25_rt->digipeat, sizeof(ax25_digi), 429 - GFP_ATOMIC); 430 - if (ax25->digipeat == NULL) { 431 - err = -ENOMEM; 432 - goto put; 433 - } 434 - ax25_adjust_path(addr, ax25->digipeat); 435 - } 436 - 437 - if (ax25->sk != NULL) { 438 - local_bh_disable(); 439 - bh_lock_sock(ax25->sk); 440 - sock_reset_flag(ax25->sk, SOCK_ZAPPED); 441 - bh_unlock_sock(ax25->sk); 442 - local_bh_enable(); 443 - } 444 - 445 - put: 446 - rcu_read_unlock(); 447 - ax25_route_lock_unuse(); 448 - return err; 449 - } 450 376 451 377 struct sk_buff *ax25_rt_build_path(struct sk_buff *skb, ax25_address *src, 452 378 ax25_address *dest, ax25_digi *digi)
+33 -3
net/bridge/br_ioctl.c
··· 394 394 return -EOPNOTSUPP; 395 395 } 396 396 397 - int br_ioctl_stub(struct net *net, struct net_bridge *br, unsigned int cmd, 398 - struct ifreq *ifr, void __user *uarg) 397 + int br_ioctl_stub(struct net *net, unsigned int cmd, void __user *uarg) 399 398 { 400 399 int ret = -EOPNOTSUPP; 400 + struct ifreq ifr; 401 + 402 + if (cmd == SIOCBRADDIF || cmd == SIOCBRDELIF) { 403 + void __user *data; 404 + char *colon; 405 + 406 + if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) 407 + return -EPERM; 408 + 409 + if (get_user_ifreq(&ifr, &data, uarg)) 410 + return -EFAULT; 411 + 412 + ifr.ifr_name[IFNAMSIZ - 1] = 0; 413 + colon = strchr(ifr.ifr_name, ':'); 414 + if (colon) 415 + *colon = 0; 416 + } 401 417 402 418 rtnl_lock(); 403 419 ··· 446 430 break; 447 431 case SIOCBRADDIF: 448 432 case SIOCBRDELIF: 449 - ret = add_del_if(br, ifr->ifr_ifindex, cmd == SIOCBRADDIF); 433 + { 434 + struct net_device *dev; 435 + 436 + dev = __dev_get_by_name(net, ifr.ifr_name); 437 + if (!dev || !netif_device_present(dev)) { 438 + ret = -ENODEV; 439 + break; 440 + } 441 + if (!netif_is_bridge_master(dev)) { 442 + ret = -EOPNOTSUPP; 443 + break; 444 + } 445 + 446 + ret = add_del_if(netdev_priv(dev), ifr.ifr_ifindex, cmd == SIOCBRADDIF); 447 + } 450 448 break; 451 449 } 452 450
+1 -2
net/bridge/br_private.h
··· 949 949 /* br_ioctl.c */ 950 950 int br_dev_siocdevprivate(struct net_device *dev, struct ifreq *rq, 951 951 void __user *data, int cmd); 952 - int br_ioctl_stub(struct net *net, struct net_bridge *br, unsigned int cmd, 953 - struct ifreq *ifr, void __user *uarg); 952 + int br_ioctl_stub(struct net *net, unsigned int cmd, void __user *uarg); 954 953 955 954 /* br_multicast.c */ 956 955 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
-19
net/core/dev_ioctl.c
··· 554 554 int err; 555 555 struct net_device *dev = __dev_get_by_name(net, ifr->ifr_name); 556 556 const struct net_device_ops *ops; 557 - netdevice_tracker dev_tracker; 558 557 559 558 if (!dev) 560 559 return -ENODEV; ··· 626 627 627 628 case SIOCWANDEV: 628 629 return dev_siocwandev(dev, &ifr->ifr_settings); 629 - 630 - case SIOCBRADDIF: 631 - case SIOCBRDELIF: 632 - if (!netif_device_present(dev)) 633 - return -ENODEV; 634 - if (!netif_is_bridge_master(dev)) 635 - return -EOPNOTSUPP; 636 - 637 - netdev_hold(dev, &dev_tracker, GFP_KERNEL); 638 - rtnl_net_unlock(net); 639 - 640 - err = br_ioctl_call(net, netdev_priv(dev), cmd, ifr, NULL); 641 - 642 - netdev_put(dev, &dev_tracker); 643 - rtnl_net_lock(net); 644 - return err; 645 630 646 631 case SIOCDEVPRIVATE ... SIOCDEVPRIVATE + 15: 647 632 return dev_siocdevprivate(dev, ifr, data, cmd); ··· 809 826 case SIOCBONDRELEASE: 810 827 case SIOCBONDSETHWADDR: 811 828 case SIOCBONDCHANGEACTIVE: 812 - case SIOCBRADDIF: 813 - case SIOCBRDELIF: 814 829 case SIOCSHWTSTAMP: 815 830 if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) 816 831 return -EPERM;
+9 -10
net/socket.c
··· 1139 1139 */ 1140 1140 1141 1141 static DEFINE_MUTEX(br_ioctl_mutex); 1142 - static int (*br_ioctl_hook)(struct net *net, struct net_bridge *br, 1143 - unsigned int cmd, struct ifreq *ifr, 1142 + static int (*br_ioctl_hook)(struct net *net, unsigned int cmd, 1144 1143 void __user *uarg); 1145 1144 1146 - void brioctl_set(int (*hook)(struct net *net, struct net_bridge *br, 1147 - unsigned int cmd, struct ifreq *ifr, 1145 + void brioctl_set(int (*hook)(struct net *net, unsigned int cmd, 1148 1146 void __user *uarg)) 1149 1147 { 1150 1148 mutex_lock(&br_ioctl_mutex); ··· 1151 1153 } 1152 1154 EXPORT_SYMBOL(brioctl_set); 1153 1155 1154 - int br_ioctl_call(struct net *net, struct net_bridge *br, unsigned int cmd, 1155 - struct ifreq *ifr, void __user *uarg) 1156 + int br_ioctl_call(struct net *net, unsigned int cmd, void __user *uarg) 1156 1157 { 1157 1158 int err = -ENOPKG; 1158 1159 ··· 1160 1163 1161 1164 mutex_lock(&br_ioctl_mutex); 1162 1165 if (br_ioctl_hook) 1163 - err = br_ioctl_hook(net, br, cmd, ifr, uarg); 1166 + err = br_ioctl_hook(net, cmd, uarg); 1164 1167 mutex_unlock(&br_ioctl_mutex); 1165 1168 1166 1169 return err; ··· 1260 1263 case SIOCSIFBR: 1261 1264 case SIOCBRADDBR: 1262 1265 case SIOCBRDELBR: 1263 - err = br_ioctl_call(net, NULL, cmd, NULL, argp); 1266 + case SIOCBRADDIF: 1267 + case SIOCBRDELIF: 1268 + err = br_ioctl_call(net, cmd, argp); 1264 1269 break; 1265 1270 case SIOCGIFVLAN: 1266 1271 case SIOCSIFVLAN: ··· 3422 3423 case SIOCGPGRP: 3423 3424 case SIOCBRADDBR: 3424 3425 case SIOCBRDELBR: 3426 + case SIOCBRADDIF: 3427 + case SIOCBRDELIF: 3425 3428 case SIOCGIFVLAN: 3426 3429 case SIOCSIFVLAN: 3427 3430 case SIOCGSKNS: ··· 3463 3462 case SIOCGIFPFLAGS: 3464 3463 case SIOCGIFTXQLEN: 3465 3464 case SIOCSIFTXQLEN: 3466 - case SIOCBRADDIF: 3467 - case SIOCBRDELIF: 3468 3465 case SIOCGIFNAME: 3469 3466 case SIOCSIFNAME: 3470 3467 case SIOCGMIIPHY: