Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Browse files Browse the repository at this point in the history
Merge in late fixes to prepare for the 6.15 net-next PR.

No conflicts, adjacent changes:

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

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Mar 26, 2025
2 parents 705094f + 70facbf commit 023b1e9
Show file tree
Hide file tree
Showing 42 changed files with 356 additions and 498 deletions.
4 changes: 4 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,10 @@ N: Rui Prior
E: rprior@inescn.pt
D: ATM device driver for NICStAR based cards

N: Roopa Prabhu
E: roopa@nvidia.com
D: Bridge co-maintainer, vxlan and networking contributor

N: Stefan Probst
E: sp@caldera.de
D: The Linux Support Team Erlangen, 1993-97
Expand Down
4 changes: 3 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -8593,12 +8593,14 @@ F: Documentation/networking/devlink/etas_es58x.rst
F: drivers/net/can/usb/etas_es58x/

ETHERNET BRIDGE
M: Roopa Prabhu <roopa@nvidia.com>
M: Nikolay Aleksandrov <razor@blackwall.org>
M: Ido Schimmel <idosch@nvidia.com>
L: bridge@lists.linux.dev
L: netdev@vger.kernel.org
S: Maintained
W: http://www.linuxfoundation.org/en/Net:Bridge
F: include/linux/if_bridge.h
F: include/uapi/linux/if_bridge.h
F: include/linux/netfilter_bridge/
F: net/bridge/

Expand Down
12 changes: 6 additions & 6 deletions arch/parisc/include/uapi/asm/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@
#define SO_PASSPIDFD 0x404A
#define SO_PEERPIDFD 0x404B

#define SO_DEVMEM_LINEAR 78
#define SCM_DEVMEM_LINEAR SO_DEVMEM_LINEAR
#define SO_DEVMEM_DMABUF 79
#define SCM_DEVMEM_DMABUF SO_DEVMEM_DMABUF
#define SO_DEVMEM_DONTNEED 80

#define SCM_TS_OPT_ID 0x404C

#define SO_RCVPRIORITY 0x404D

#define SO_DEVMEM_LINEAR 0x404E
#define SCM_DEVMEM_LINEAR SO_DEVMEM_LINEAR
#define SO_DEVMEM_DMABUF 0x404F
#define SCM_DEVMEM_DMABUF SO_DEVMEM_DMABUF
#define SO_DEVMEM_DONTNEED 0x4050

#if !defined(__KERNEL__)

#if __BITS_PER_LONG == 64
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ static bool bond_sk_check(struct bonding *bond)
}
}

static bool bond_xdp_check(struct bonding *bond)
bool bond_xdp_check(struct bonding *bond, int mode)
{
switch (BOND_MODE(bond)) {
switch (mode) {
case BOND_MODE_ROUNDROBIN:
case BOND_MODE_ACTIVEBACKUP:
return true;
Expand Down Expand Up @@ -1928,7 +1928,7 @@ void bond_xdp_set_features(struct net_device *bond_dev)

ASSERT_RTNL();

if (!bond_xdp_check(bond) || !bond_has_slaves(bond)) {
if (!bond_xdp_check(bond, BOND_MODE(bond)) || !bond_has_slaves(bond)) {
xdp_clear_features_flag(bond_dev);
return;
}
Expand Down Expand Up @@ -5693,7 +5693,7 @@ static int bond_xdp_set(struct net_device *dev, struct bpf_prog *prog,

ASSERT_RTNL();

if (!bond_xdp_check(bond)) {
if (!bond_xdp_check(bond, BOND_MODE(bond))) {
BOND_NL_ERR(dev, extack,
"No native XDP support for the current bonding mode");
return -EOPNOTSUPP;
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/bonding/bond_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,9 @@ static bool bond_set_xfrm_features(struct bonding *bond)
static int bond_option_mode_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
if (bond->xdp_prog && !bond_xdp_check(bond, newval->value))
return -EOPNOTSUPP;

if (!bond_mode_uses_arp(newval->value)) {
if (bond->params.arp_interval) {
netdev_dbg(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n",
Expand Down
11 changes: 1 addition & 10 deletions drivers/net/dsa/microchip/ksz8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1625,23 +1625,14 @@ void ksz8_port_setup(struct ksz_device *dev, int port, bool cpu_port)
const u16 *regs = dev->info->regs;
struct dsa_switch *ds = dev->ds;
const u32 *masks;
int queues;
u8 member;

masks = dev->info->masks;

/* enable broadcast storm limit */
ksz_port_cfg(dev, port, P_BCAST_STORM_CTRL, PORT_BROADCAST_STORM, true);

/* For KSZ88x3 enable only one queue by default, otherwise we won't
* be able to get rid of PCP prios on Port 2.
*/
if (ksz_is_ksz88x3(dev))
queues = 1;
else
queues = dev->info->num_tx_queues;

ksz8_port_queue_split(dev, port, queues);
ksz8_port_queue_split(dev, port, dev->info->num_tx_queues);

/* replace priority */
ksz_port_cfg(dev, port, P_802_1P_CTRL,
Expand Down
231 changes: 8 additions & 223 deletions drivers/net/dsa/microchip/ksz_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
#include "ksz_dcb.h"
#include "ksz8.h"

#define KSZ8_REG_PORT_1_CTRL_0 0x10
/* Port X Control 0 register.
* The datasheet specifies: Port 1 - 0x10, Port 2 - 0x20, Port 3 - 0x30.
* However, the driver uses get_port_addr(), which maps Port 1 to offset 0.
* Therefore, we define the base offset as 0x00 here to align with that logic.
*/
#define KSZ8_REG_PORT_1_CTRL_0 0x00
#define KSZ8_PORT_DIFFSERV_ENABLE BIT(6)
#define KSZ8_PORT_802_1P_ENABLE BIT(5)
#define KSZ8_PORT_BASED_PRIO_M GENMASK(4, 3)
Expand Down Expand Up @@ -181,49 +186,6 @@ int ksz_port_get_default_prio(struct dsa_switch *ds, int port)
return (data & mask) >> shift;
}

/**
* ksz88x3_port_set_default_prio_quirks - Quirks for default priority
* @dev: Pointer to the KSZ switch device structure
* @port: Port number for which to set the default priority
* @prio: Priority value to set
*
* This function implements quirks for setting the default priority on KSZ88x3
* devices. On Port 2, no other priority providers are working
* except of PCP. So, configuring default priority on Port 2 is not possible.
* On Port 1, it is not possible to configure port priority if PCP
* apptrust on Port 2 is disabled. Since we disable multiple queues on the
* switch to disable PCP on Port 2, we need to ensure that the default priority
* configuration on Port 1 is in agreement with the configuration on Port 2.
*
* Return: 0 on success, or a negative error code on failure
*/
static int ksz88x3_port_set_default_prio_quirks(struct ksz_device *dev, int port,
u8 prio)
{
if (!prio)
return 0;

if (port == KSZ_PORT_2) {
dev_err(dev->dev, "Port priority configuration is not working on Port 2\n");
return -EINVAL;
} else if (port == KSZ_PORT_1) {
u8 port2_data;
int ret;

ret = ksz_pread8(dev, KSZ_PORT_2, KSZ8_REG_PORT_1_CTRL_0,
&port2_data);
if (ret)
return ret;

if (!(port2_data & KSZ8_PORT_802_1P_ENABLE)) {
dev_err(dev->dev, "Not possible to configure port priority on Port 1 if PCP apptrust on Port 2 is disabled\n");
return -EINVAL;
}
}

return 0;
}

/**
* ksz_port_set_default_prio - Sets the default priority for a port on a KSZ
* switch
Expand All @@ -239,18 +201,12 @@ static int ksz88x3_port_set_default_prio_quirks(struct ksz_device *dev, int port
int ksz_port_set_default_prio(struct dsa_switch *ds, int port, u8 prio)
{
struct ksz_device *dev = ds->priv;
int reg, shift, ret;
int reg, shift;
u8 mask;

if (prio >= dev->info->num_ipms)
return -EINVAL;

if (ksz_is_ksz88x3(dev)) {
ret = ksz88x3_port_set_default_prio_quirks(dev, port, prio);
if (ret)
return ret;
}

ksz_get_default_port_prio_reg(dev, &reg, &mask, &shift);

return ksz_prmw8(dev, port, reg, mask, (prio << shift) & mask);
Expand Down Expand Up @@ -518,155 +474,6 @@ static int ksz_port_set_apptrust_validate(struct ksz_device *dev, int port,
return -EINVAL;
}

/**
* ksz88x3_port1_apptrust_quirk - Quirk for apptrust configuration on Port 1
* of KSZ88x3 devices
* @dev: Pointer to the KSZ switch device structure
* @port: Port number for which to set the apptrust selectors
* @reg: Register address for the apptrust configuration
* @port1_data: Data to set for the apptrust configuration
*
* This function implements a quirk for apptrust configuration on Port 1 of
* KSZ88x3 devices. It ensures that apptrust configuration on Port 1 is not
* possible if PCP apptrust on Port 2 is disabled. This is because the Port 2
* seems to be permanently hardwired to PCP classification, so we need to
* do Port 1 configuration always in agreement with Port 2 configuration.
*
* Return: 0 on success, or a negative error code on failure
*/
static int ksz88x3_port1_apptrust_quirk(struct ksz_device *dev, int port,
int reg, u8 port1_data)
{
u8 port2_data;
int ret;

/* If no apptrust is requested for Port 1, no need to care about Port 2
* configuration.
*/
if (!(port1_data & (KSZ8_PORT_802_1P_ENABLE | KSZ8_PORT_DIFFSERV_ENABLE)))
return 0;

/* We got request to enable any apptrust on Port 1. To make it possible,
* we need to enable multiple queues on the switch. If we enable
* multiqueue support, PCP classification on Port 2 will be
* automatically activated by HW.
*/
ret = ksz_pread8(dev, KSZ_PORT_2, reg, &port2_data);
if (ret)
return ret;

/* If KSZ8_PORT_802_1P_ENABLE bit is set on Port 2, the driver showed
* the interest in PCP classification on Port 2. In this case,
* multiqueue support is enabled and we can enable any apptrust on
* Port 1.
* If KSZ8_PORT_802_1P_ENABLE bit is not set on Port 2, the PCP
* classification on Port 2 is still active, but the driver disabled
* multiqueue support and made frame prioritization inactive for
* all ports. In this case, we can't enable any apptrust on Port 1.
*/
if (!(port2_data & KSZ8_PORT_802_1P_ENABLE)) {
dev_err(dev->dev, "Not possible to enable any apptrust on Port 1 if PCP apptrust on Port 2 is disabled\n");
return -EINVAL;
}

return 0;
}

/**
* ksz88x3_port2_apptrust_quirk - Quirk for apptrust configuration on Port 2
* of KSZ88x3 devices
* @dev: Pointer to the KSZ switch device structure
* @port: Port number for which to set the apptrust selectors
* @reg: Register address for the apptrust configuration
* @port2_data: Data to set for the apptrust configuration
*
* This function implements a quirk for apptrust configuration on Port 2 of
* KSZ88x3 devices. It ensures that DSCP apptrust is not working on Port 2 and
* that it is not possible to disable PCP on Port 2. The only way to disable PCP
* on Port 2 is to disable multiple queues on the switch.
*
* Return: 0 on success, or a negative error code on failure
*/
static int ksz88x3_port2_apptrust_quirk(struct ksz_device *dev, int port,
int reg, u8 port2_data)
{
struct dsa_switch *ds = dev->ds;
u8 port1_data;
int ret;

/* First validate Port 2 configuration. DiffServ/DSCP is not working
* on this port.
*/
if (port2_data & KSZ8_PORT_DIFFSERV_ENABLE) {
dev_err(dev->dev, "DSCP apptrust is not working on Port 2\n");
return -EINVAL;
}

/* If PCP support is requested, we need to enable all queues on the
* switch to make PCP priority working on Port 2.
*/
if (port2_data & KSZ8_PORT_802_1P_ENABLE)
return ksz8_all_queues_split(dev, dev->info->num_tx_queues);

/* We got request to disable PCP priority on Port 2.
* Now, we need to compare Port 2 configuration with Port 1
* configuration.
*/
ret = ksz_pread8(dev, KSZ_PORT_1, reg, &port1_data);
if (ret)
return ret;

/* If Port 1 has any apptrust enabled, we can't disable multiple queues
* on the switch, so we can't disable PCP on Port 2.
*/
if (port1_data & (KSZ8_PORT_802_1P_ENABLE | KSZ8_PORT_DIFFSERV_ENABLE)) {
dev_err(dev->dev, "Not possible to disable PCP on Port 2 if any apptrust is enabled on Port 1\n");
return -EINVAL;
}

/* Now we need to ensure that default priority on Port 1 is set to 0
* otherwise we can't disable multiqueue support on the switch.
*/
ret = ksz_port_get_default_prio(ds, KSZ_PORT_1);
if (ret < 0) {
return ret;
} else if (ret) {
dev_err(dev->dev, "Not possible to disable PCP on Port 2 if non zero default priority is set on Port 1\n");
return -EINVAL;
}

/* Port 1 has no apptrust or default priority set and we got request to
* disable PCP on Port 2. We can disable multiqueue support to disable
* PCP on Port 2.
*/
return ksz8_all_queues_split(dev, 1);
}

/**
* ksz88x3_port_apptrust_quirk - Quirk for apptrust configuration on KSZ88x3
* devices
* @dev: Pointer to the KSZ switch device structure
* @port: Port number for which to set the apptrust selectors
* @reg: Register address for the apptrust configuration
* @data: Data to set for the apptrust configuration
*
* This function implements a quirk for apptrust configuration on KSZ88x3
* devices. It ensures that apptrust configuration on Port 1 and
* Port 2 is done in agreement with each other.
*
* Return: 0 on success, or a negative error code on failure
*/
static int ksz88x3_port_apptrust_quirk(struct ksz_device *dev, int port,
int reg, u8 data)
{
if (port == KSZ_PORT_1)
return ksz88x3_port1_apptrust_quirk(dev, port, reg, data);
else if (port == KSZ_PORT_2)
return ksz88x3_port2_apptrust_quirk(dev, port, reg, data);

return 0;
}

/**
* ksz_port_set_apptrust - Sets the apptrust selectors for a port on a KSZ
* switch
Expand Down Expand Up @@ -707,12 +514,6 @@ int ksz_port_set_apptrust(struct dsa_switch *ds, int port,
}
}

if (ksz_is_ksz88x3(dev)) {
ret = ksz88x3_port_apptrust_quirk(dev, port, reg, data);
if (ret)
return ret;
}

return ksz_prmw8(dev, port, reg, mask, data);
}

Expand Down Expand Up @@ -799,21 +600,5 @@ int ksz_dcb_init_port(struct ksz_device *dev, int port)
*/
int ksz_dcb_init(struct ksz_device *dev)
{
int ret;

ret = ksz_init_global_dscp_map(dev);
if (ret)
return ret;

/* Enable 802.1p priority control on Port 2 during switch initialization.
* This setup is critical for the apptrust functionality on Port 1, which
* relies on the priority settings of Port 2. Note: Port 1 is naturally
* configured before Port 2, necessitating this configuration order.
*/
if (ksz_is_ksz88x3(dev))
return ksz_prmw8(dev, KSZ_PORT_2, KSZ8_REG_PORT_1_CTRL_0,
KSZ8_PORT_802_1P_ENABLE,
KSZ8_PORT_802_1P_ENABLE);

return 0;
return ksz_init_global_dscp_map(dev);
}
Loading

0 comments on commit 023b1e9

Please sign in to comment.