projects/linux·commit 57f1f9dd

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

57f1f9dd · Linus Torvalds <[email protected]> · 2023-07-20 14:46:39 -07:00

Pull networking fixes from Jakub Kicinski:
 "Including fixes from BPF, netfilter, bluetooth and CAN.

  Current release - regressions:

   - eth: r8169: multiple fixes for PCIe ASPM-related problems

   - vrf: fix RCU lockdep splat in output path

  Previous releases - regressions:

   - gso: fall back to SW segmenting with GSO_UDP_L4 dodgy bit set

   - dsa: mv88e6xxx: do a final check before timing out when polling

   - nf_tables: fix sleep in atomic in nft_chain_validate

  Previous releases - always broken:

   - sched: fix undoing tcf_bind_filter() in multiple classifiers

   - bpf, arm64: fix BTI type used for freplace attached functions

   - can: gs_usb: fix time stamp counter initialization

   - nft_set_pipapo: fix improper element removal (leading to UAF)

  Misc:

   - net: support STP on bridge in non-root netns, STP prevents packet
     loops so not supporting it results in freezing systems of
     unsuspecting users, and in turn very upset noises being made

   - fix kdoc warnings

   - annotate various bits of TCP state to prevent data races"

* tag 'net-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (95 commits)
  net: phy: prevent stale pointer dereference in phy_init()
  tcp: annotate data-races around fastopenq.max_qlen
  tcp: annotate data-races around icsk->icsk_user_timeout
  tcp: annotate data-races around tp->notsent_lowat
  tcp: annotate data-races around rskq_defer_accept
  tcp: annotate data-races around tp->linger2
  tcp: annotate data-races around icsk->icsk_syn_retries
  tcp: annotate data-races around tp->keepalive_probes
  tcp: annotate data-races around tp->keepalive_intvl
  tcp: annotate data-races around tp->keepalive_time
  tcp: annotate data-races around tp->tsoffset
  tcp: annotate data-races around tp->tcp_tx_delay
  Bluetooth: MGMT: Use correct address for memcpy()
  Bluetooth: btusb: Fix bluetooth on Intel Macbook 2014
  Bluetooth: SCO: fix sco_conn related locking and validity issues
  Bluetooth: hci_conn: return ERR_PTR instead of NULL when there is no link
  Bluetooth: hci_sync: Avoid use-after-free in dbg for hci_remove_adv_monitor()
  Bluetooth: coredump: fix building with coredump disabled
  Bluetooth: ISO: fix iso_conn related locking and validity issues
  Bluetooth: hci_event: call disconnect callback before deleting conn
  ...
Commit
57f1f9dd3abea322173ea75a15887ccf14bbbe51
Parents
e599e16c · 75d42b35

Merge commit. Changes below are compared with the first parent: e599e16c.

Changes

84 files changed · +1152 −713

FileStatusAddDelContent
.mailmapmodified+3−0View file
arch/arm64/net/bpf_jit_comp.cmodified+7−1View file
drivers/bluetooth/btusb.cmodified+1−0View file
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.cmodified+8−2View file
drivers/net/can/spi/mcp251xfd/mcp251xfd.hmodified+1−0View file
drivers/net/can/usb/gs_usb.cmodified+74−56View file
drivers/net/dsa/microchip/ksz8795.cmodified+7−1View file
drivers/net/dsa/microchip/ksz_common.cmodified+4−4View file
drivers/net/dsa/microchip/ksz_common.hmodified+7−0View file
drivers/net/dsa/mv88e6xxx/chip.cmodified+7−0View file
drivers/net/dsa/qca/ar9331.cmodified+2−2View file
drivers/net/ethernet/brocade/bna/bnad_debugfs.cmodified+0−5View file
drivers/net/ethernet/intel/iavf/iavf.hmodified+5−1View file
drivers/net/ethernet/intel/iavf/iavf_ethtool.cmodified+18−21View file
drivers/net/ethernet/intel/iavf/iavf_main.cmodified+150−87View file
drivers/net/ethernet/intel/iavf/iavf_virtchnl.cmodified+3−2View file
drivers/net/ethernet/intel/ice/ice_base.cmodified+2−0View file
drivers/net/ethernet/intel/ice/ice_ethtool.cmodified+11−2View file
drivers/net/ethernet/intel/ice/ice_lib.cmodified+0−27View file
drivers/net/ethernet/intel/ice/ice_main.cmodified+8−2View file
drivers/net/ethernet/intel/igc/igc_main.cmodified+2−2View file
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.cmodified+100−37View file
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.cmodified+3−2View file
drivers/net/ethernet/mediatek/mtk_eth_soc.cmodified+11−18View file
drivers/net/ethernet/mediatek/mtk_ppe_debugfs.cmodified+1−1View file
drivers/net/ethernet/mscc/ocelot_fdma.cmodified+2−1View file
drivers/net/ethernet/qualcomm/emac/emac-mac.cmodified+5−2View file
drivers/net/ethernet/realtek/r8169_main.cmodified+34−11View file
drivers/net/ethernet/ti/cpsw_ale.cmodified+19−5View file
drivers/net/ethernet/wangxun/libwx/wx_hw.cmodified+0−1View file
drivers/net/phy/phy_device.cmodified+14−7View file
drivers/net/usb/usbnet.cmodified+6−0View file
drivers/net/vrf.cmodified+6−6View file
include/linux/tcp.hmodified+1−1View file
include/net/bluetooth/hci_core.hmodified+5−2View file
include/net/bonding.hmodified+1−1View file
include/net/cfg802154.hmodified+2−1View file
include/net/codel.hmodified+2−2View file
include/net/devlink.hmodified+16−12View file
include/net/inet_frag.hmodified+1−1View file
include/net/llc_conn.hmodified+1−1View file
include/net/llc_pdu.hmodified+4−2View file
include/net/nsh.hmodified+1−1View file
include/net/pie.hmodified+1−1View file
include/net/rsi_91x.hmodified+1−1View file
include/net/tcp.hmodified+24−7View file
kernel/bpf/verifier.cmodified+25−7View file
net/bluetooth/hci_conn.cmodified+7−7View file
net/bluetooth/hci_core.cmodified+34−8View file
net/bluetooth/hci_event.cmodified+9−6View file
net/bluetooth/hci_sync.cmodified+106−11View file
net/bluetooth/iso.cmodified+31−22View file
net/bluetooth/mgmt.cmodified+12−16View file
net/bluetooth/sco.cmodified+12−11View file
net/can/bcm.cmodified+6−6View file
net/can/raw.cmodified+24−33View file
net/ipv4/esp4.cmodified+1−1View file
net/ipv4/inet_connection_sock.cmodified+1−1View file
net/ipv4/inet_hashtables.cmodified+2−15View file
net/ipv4/inet_timewait_sock.cmodified+4−4View file
net/ipv4/ip_gre.cmodified+4−2View file
net/ipv4/tcp.cmodified+30−27View file
net/ipv4/tcp_fastopen.cmodified+4−2View file
net/ipv4/tcp_ipv4.cmodified+6−4View file
net/ipv4/tcp_minisocks.cmodified+7−4View file
net/ipv4/tcp_output.cmodified+3−3View file
net/ipv4/udp_offload.cmodified+11−5View file
net/ipv6/ip6_gre.cmodified+2−1View file
net/ipv6/tcp_ipv6.cmodified+2−2View file
net/ipv6/udp_offload.cmodified+1−2View file
net/llc/af_llc.cmodified+1−1View file
net/llc/llc_conn.cmodified+30−19View file
net/llc/llc_if.cmodified+1−1View file
net/llc/llc_input.cmodified+0−3View file
net/llc/llc_sap.cmodified+11−7View file
net/netfilter/nf_tables_api.cmodified+10−2View file
net/netfilter/nft_set_pipapo.cmodified+5−1View file
net/sched/cls_bpf.cmodified+47−52View file
net/sched/cls_flower.cmodified+47−52View file
net/sched/cls_matchall.cmodified+12−23View file
net/sched/cls_u32.cmodified+37−11View file
tools/testing/selftests/bpf/progs/async_stack_depth.cmodified+23−2View file
tools/testing/selftests/tc-testing/configmodified+2−0View file
tools/testing/selftests/tc-testing/settingsadded+1−0View file

Only the first 600 diff lines are shown. Download the complete patch.

.mailmap

View file
diff --git a/.mailmap b/.mailmap
index 89b7f33..a33b9f5 100644
--- a/.mailmap
+++ b/.mailmap
@@ -241,6 +241,7 @@ Jisheng Zhang <[email protected]> <[email protected]>
John Paul Adrian Glaubitz <[email protected]>
John Stultz <[email protected]>
@@ -454,6 +455,8 @@ Sebastian Reichel <[email protected]> <[email protected]>

arch/arm64/net/bpf_jit_comp.c

View file
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index 145b540..ec21748 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -322,7 +322,13 @@ static int build_prologue(struct jit_ctx *ctx, bool ebpf_from_cbpf)
*
*/
- emit_bti(A64_BTI_C, ctx);
+ /* bpf function may be invoked by 3 instruction types:
+ * 1. bl, attached via freplace to bpf prog via short jump
+ * 2. br, attached via freplace to bpf prog via long jump
+ * 3. blr, working as a function pointer, used by emit_call.
+ * So BTI_JC should used here to support both br and blr.
+ */
+ emit_bti(A64_BTI_JC, ctx);
emit(A64_MOV(1, A64_R(9), A64_LR), ctx);
emit(A64_NOP, ctx);

drivers/bluetooth/btusb.c

View file
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 5ec4ad0..764d176 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -4104,6 +4104,7 @@ static int btusb_probe(struct usb_interface *intf,
BT_DBG("intf %p id %p", intf, id);
if ((id->driver_info & BTUSB_IFNUM_2) &&
+ (intf->cur_altsetting->desc.bInterfaceNumber != 0) &&
(intf->cur_altsetting->desc.bInterfaceNumber != 2))
return -ENODEV;

drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c

View file
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 68df6d4..eebf967 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -227,6 +227,8 @@ static int
__mcp251xfd_chip_set_mode(const struct mcp251xfd_priv *priv,
const u8 mode_req, bool nowait)
{
+ const struct can_bittiming *bt = &priv->can.bittiming;
+ unsigned long timeout_us = MCP251XFD_POLL_TIMEOUT_US;
u32 con = 0, con_reqop, osc = 0;
u8 mode;
int err;
@@ -246,12 +248,16 @@ __mcp251xfd_chip_set_mode(const struct mcp251xfd_priv *priv,
if (mode_req == MCP251XFD_REG_CON_MODE_SLEEP || nowait)
return 0;
+ if (bt->bitrate)
+ timeout_us = max_t(unsigned long, timeout_us,
+ MCP251XFD_FRAME_LEN_MAX_BITS * USEC_PER_SEC /
+ bt->bitrate);
+
err = regmap_read_poll_timeout(priv->map_reg, MCP251XFD_REG_CON, con,
!mcp251xfd_reg_invalid(con) &&
FIELD_GET(MCP251XFD_REG_CON_OPMOD_MASK,
con) == mode_req,
- MCP251XFD_POLL_SLEEP_US,
- MCP251XFD_POLL_TIMEOUT_US);
+ MCP251XFD_POLL_SLEEP_US, timeout_us);
if (err != -ETIMEDOUT && err != -EBADMSG)
return err;

drivers/net/can/spi/mcp251xfd/mcp251xfd.h

View file
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd.h b/drivers/net/can/spi/mcp251xfd/mcp251xfd.h
index 7024ff0..24510b3 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd.h
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd.h
@@ -387,6 +387,7 @@ static_assert(MCP251XFD_TIMESTAMP_WORK_DELAY_SEC <
#define MCP251XFD_OSC_STAB_TIMEOUT_US (10 * MCP251XFD_OSC_STAB_SLEEP_US)
#define MCP251XFD_POLL_SLEEP_US (10)
#define MCP251XFD_POLL_TIMEOUT_US (USEC_PER_MSEC)
+#define MCP251XFD_FRAME_LEN_MAX_BITS (736)
/* Misc */
#define MCP251XFD_NAPI_WEIGHT 32

drivers/net/can/usb/gs_usb.c

View file
diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index d476c28..f418066 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -303,12 +303,6 @@ struct gs_can {
struct can_bittiming_const bt_const, data_bt_const;
unsigned int channel; /* channel number */
- /* time counter for hardware timestamps */
- struct cyclecounter cc;
- struct timecounter tc;
- spinlock_t tc_lock; /* spinlock to guard access tc->cycle_last */
- struct delayed_work timestamp;
-
u32 feature;
unsigned int hf_size_tx;
@@ -325,6 +319,13 @@ struct gs_usb {
struct gs_can *canch[GS_MAX_INTF];
struct usb_anchor rx_submitted;
struct usb_device *udev;
+
+ /* time counter for hardware timestamps */
+ struct cyclecounter cc;
+ struct timecounter tc;
+ spinlock_t tc_lock; /* spinlock to guard access tc->cycle_last */
+ struct delayed_work timestamp;
+
unsigned int hf_size_rx;
u8 active_channels;
};
@@ -388,15 +389,15 @@ static int gs_cmd_reset(struct gs_can *dev)
GFP_KERNEL);
}
-static inline int gs_usb_get_timestamp(const struct gs_can *dev,
+static inline int gs_usb_get_timestamp(const struct gs_usb *parent,
u32 *timestamp_p)
{
__le32 timestamp;
int rc;
- rc = usb_control_msg_recv(dev->udev, 0, GS_USB_BREQ_TIMESTAMP,
+ rc = usb_control_msg_recv(parent->udev, 0, GS_USB_BREQ_TIMESTAMP,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
- dev->channel, 0,
+ 0, 0,
&timestamp, sizeof(timestamp),
USB_CTRL_GET_TIMEOUT,
GFP_KERNEL);
@@ -410,20 +411,20 @@ static inline int gs_usb_get_timestamp(const struct gs_can *dev,
static u64 gs_usb_timestamp_read(const struct cyclecounter *cc) __must_hold(&dev->tc_lock)
{
- struct gs_can *dev = container_of(cc, struct gs_can, cc);
+ struct gs_usb *parent = container_of(cc, struct gs_usb, cc);
u32 timestamp = 0;
int err;
- lockdep_assert_held(&dev->tc_lock);
+ lockdep_assert_held(&parent->tc_lock);
/* drop lock for synchronous USB transfer */
- spin_unlock_bh(&dev->tc_lock);
- err = gs_usb_get_timestamp(dev, &timestamp);
- spin_lock_bh(&dev->tc_lock);
+ spin_unlock_bh(&parent->tc_lock);
+ err = gs_usb_get_timestamp(parent, &timestamp);
+ spin_lock_bh(&parent->tc_lock);
if (err)
- netdev_err(dev->netdev,
- "Error %d while reading timestamp. HW timestamps may be inaccurate.",
- err);
+ dev_err(&parent->udev->dev,
+ "Error %d while reading timestamp. HW timestamps may be inaccurate.",
+ err);
return timestamp;
}
@@ -431,14 +432,14 @@ static u64 gs_usb_timestamp_read(const struct cyclecounter *cc) __must_hold(&dev
static void gs_usb_timestamp_work(struct work_struct *work)
{
struct delayed_work *delayed_work = to_delayed_work(work);
- struct gs_can *dev;
+ struct gs_usb *parent;
- dev = container_of(delayed_work, struct gs_can, timestamp);
- spin_lock_bh(&dev->tc_lock);
- timecounter_read(&dev->tc);
- spin_unlock_bh(&dev->tc_lock);
+ parent = container_of(delayed_work, struct gs_usb, timestamp);
+ spin_lock_bh(&parent->tc_lock);
+ timecounter_read(&parent->tc);
+ spin_unlock_bh(&parent->tc_lock);
- schedule_delayed_work(&dev->timestamp,
+ schedule_delayed_work(&parent->timestamp,
GS_USB_TIMESTAMP_WORK_DELAY_SEC * HZ);
}
@@ -446,37 +447,38 @@ static void gs_usb_skb_set_timestamp(struct gs_can *dev,
struct sk_buff *skb, u32 timestamp)
{
struct skb_shared_hwtstamps *hwtstamps = skb_hwtstamps(skb);
+ struct gs_usb *parent = dev->parent;
u64 ns;
- spin_lock_bh(&dev->tc_lock);
- ns = timecounter_cyc2time(&dev->tc, timestamp);
- spin_unlock_bh(&dev->tc_lock);
+ spin_lock_bh(&parent->tc_lock);
+ ns = timecounter_cyc2time(&parent->tc, timestamp);
+ spin_unlock_bh(&parent->tc_lock);
hwtstamps->hwtstamp = ns_to_ktime(ns);
}
-static void gs_usb_timestamp_init(struct gs_can *dev)
+static void gs_usb_timestamp_init(struct gs_usb *parent)
{
- struct cyclecounter *cc = &dev->cc;
+ struct cyclecounter *cc = &parent->cc;
cc->read = gs_usb_timestamp_read;
cc->mask = CYCLECOUNTER_MASK(32);
cc->shift = 32 - bits_per(NSEC_PER_SEC / GS_USB_TIMESTAMP_TIMER_HZ);
cc->mult = clocksource_hz2mult(GS_USB_TIMESTAMP_TIMER_HZ, cc->shift);
- spin_lock_init(&dev->tc_lock);
- spin_lock_bh(&dev->tc_lock);
- timecounter_init(&dev->tc, &dev->cc, ktime_get_real_ns());
- spin_unlock_bh(&dev->tc_lock);
+ spin_lock_init(&parent->tc_lock);
+ spin_lock_bh(&parent->tc_lock);
+ timecounter_init(&parent->tc, &parent->cc, ktime_get_real_ns());
+ spin_unlock_bh(&parent->tc_lock);
- INIT_DELAYED_WORK(&dev->timestamp, gs_usb_timestamp_work);
- schedule_delayed_work(&dev->timestamp,
+ INIT_DELAYED_WORK(&parent->timestamp, gs_usb_timestamp_work);
+ schedule_delayed_work(&parent->timestamp,
GS_USB_TIMESTAMP_WORK_DELAY_SEC * HZ);
}
-static void gs_usb_timestamp_stop(struct gs_can *dev)
+static void gs_usb_timestamp_stop(struct gs_usb *parent)
{
- cancel_delayed_work_sync(&dev->timestamp);
+ cancel_delayed_work_sync(&parent->timestamp);
}
static void gs_update_state(struct gs_can *dev, struct can_frame *cf)
@@ -560,6 +562,9 @@ static void gs_usb_receive_bulk_callback(struct urb *urb)
if (!netif_device_present(netdev))
return;
+ if (!netif_running(netdev))
+ goto resubmit_urb;
+
if (hf->echo_id == -1) { /* normal rx */
if (hf->flags & GS_CAN_FLAG_FD) {
skb = alloc_canfd_skb(dev->netdev, &cfd);
@@ -833,6 +838,7 @@ static int gs_can_open(struct net_device *netdev)
.mode = cpu_to_le32(GS_CAN_MODE_START),
};
struct gs_host_frame *hf;
+ struct urb *urb = NULL;
u32 ctrlmode;
u32 flags = 0;
int rc, i;
@@ -855,14 +861,18 @@ static int gs_can_open(struct net_device *netdev)
}
if (!parent->active_channels) {
+ if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
+ gs_usb_timestamp_init(parent);
+
for (i = 0; i < GS_MAX_RX_URBS; i++) {
- struct urb *urb;
u8 *buf;
/* alloc rx urb */
urb = usb_alloc_urb(0, GFP_KERNEL);
- if (!urb)
- return -ENOMEM;
+ if (!urb) {
+ rc = -ENOMEM;
+ goto out_usb_kill_anchored_urbs;
+ }
/* alloc rx buffer */
buf = kmalloc(dev->parent->hf_size_rx,
@@ -870,8 +880,8 @@ static int gs_can_open(struct net_device *netdev)
if (!buf) {
netdev_err(netdev,
"No memory left for USB buffer\n");
- usb_free_urb(urb);
- return -ENOMEM;
+ rc = -ENOMEM;
+ goto out_usb_free_urb;
}
/* fill, anchor, and submit rx urb */
@@ -894,9 +904,7 @@ static int gs_can_open(struct net_device *netdev)
netdev_err(netdev,
"usb_submit failed (err=%d)\n", rc);
- usb_unanchor_urb(urb);
- usb_free_urb(urb);
- break;
+ goto out_usb_unanchor_urb;
}
/* Drop reference,
@@ -926,13 +934,9 @@ static int gs_can_open(struct net_device *netdev)
flags |= GS_CAN_MODE_FD;
/* if hardware supports timestamps, enable it */
- if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP) {
+ if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
flags |= GS_CAN_MODE_HW_TIMESTAMP;
- /* start polling timestamp */
- gs_usb_timestamp_init(dev);
- }
-
/* finally start device */
dev->can.state = CAN_STATE_ERROR_ACTIVE;
dm.flags = cpu_to_le32(flags);
@@ -942,10 +946,9 @@ static int gs_can_open(struct net_device *netdev)
GFP_KERNEL);
if (rc) {
netdev_err(netdev, "Couldn't start device (err=%d)\n", rc);
- if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
- gs_usb_timestamp_stop(dev);
dev->can.state = CAN_STATE_STOPPED;
- return rc;
+
+ goto out_usb_kill_anchored_urbs;
}
parent->active_channels++;
@@ -953,6 +956,22 @@ static int gs_can_open(struct net_device *netdev)
netif_start_queue(netdev);
return 0;
+
+out_usb_unanchor_urb:
+ usb_unanchor_urb(urb);
+out_usb_free_urb:
+ usb_free_urb(urb);
+out_usb_kill_anchored_urbs:
+ if (!parent->active_channels) {
+ usb_kill_anchored_urbs(&dev->tx_submitted);
+
+ if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
+ gs_usb_timestamp_stop(parent);
+ }
+
+ close_candev(netdev);
+
+ return rc;
}
static int gs_usb_get_state(const struct net_device *netdev,
@@ -998,14 +1017,13 @@ static int gs_can_close(struct net_device *netdev)
netif_stop_queue(netdev);
- /* stop polling timestamp */
- if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
- gs_usb_timestamp_stop(dev);
-
/* Stop polling */
parent->active_channels--;
if (!parent->active_channels) {
usb_kill_anchored_urbs(&parent->rx_submitted);
+
+ if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
+ gs_usb_timestamp_stop(parent);
}
/* Stop sending URBs */

drivers/net/dsa/microchip/ksz8795.c

View file
diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
index 84d5025..91aba47 100644
--- a/drivers/net/dsa/microchip/ksz8795.c
+++ b/drivers/net/dsa/microchip/ksz8795.c
@@ -506,7 +506,13 @@ static int ksz8_r_sta_mac_table(struct ksz_device *dev, u16 addr,
(data_hi & masks[STATIC_MAC_TABLE_FWD_PORTS]) >>
shifts[STATIC_MAC_FWD_PORTS];
alu->is_override = (data_hi & masks[STATIC_MAC_TABLE_OVERRIDE]) ? 1 : 0;
- data_hi >>= 1;
+
+ /* KSZ8795 family switches have STATIC_MAC_TABLE_USE_FID and
+ * STATIC_MAC_TABLE_FID definitions off by 1 when doing read on the
+ * static MAC table compared to doing write.
+ */
+ if (ksz_is_ksz87xx(dev))
+ data_hi >>= 1;
alu->is_static = true;
alu->is_use_fid = (data_hi & masks[STATIC_MAC_TABLE_USE_FID]) ? 1 : 0;
alu->fid = (data_hi & masks[STATIC_MAC_TABLE_FID]) >>

drivers/net/dsa/microchip/ksz_common.c

View file
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 813b91a..b18cd17 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -331,13 +331,13 @@ static const u32 ksz8795_masks[] = {
[STATIC_MAC_TABLE_VALID] = BIT(21),
[STATIC_MAC_TABLE_USE_FID] = BIT(23),
[STATIC_MAC_TABLE_FID] = GENMASK(30, 24),
- [STATIC_MAC_TABLE_OVERRIDE] = BIT(26),
- [STATIC_MAC_TABLE_FWD_PORTS] = GENMASK(24, 20),
+ [STATIC_MAC_TABLE_OVERRIDE] = BIT(22),
+ [STATIC_MAC_TABLE_FWD_PORTS] = GENMASK(20, 16),
[DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(6, 0),
- [DYNAMIC_MAC_TABLE_MAC_EMPTY] = BIT(8),
+ [DYNAMIC_MAC_TABLE_MAC_EMPTY] = BIT(7),
[DYNAMIC_MAC_TABLE_NOT_READY] = BIT(7),
[DYNAMIC_MAC_TABLE_ENTRIES] = GENMASK(31, 29),
- [DYNAMIC_MAC_TABLE_FID] = GENMASK(26, 20),
+ [DYNAMIC_MAC_TABLE_FID] = GENMASK(22, 16),
[DYNAMIC_MAC_TABLE_SRC_PORT] = GENMASK(26, 24),
[DYNAMIC_MAC_TABLE_TIMESTAMP] = GENMASK(28, 27),
[P_MII_TX_FLOW_CTRL] = BIT(5),

drivers/net/dsa/microchip/ksz_common.h

View file
diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
index 28444e5..a4de588 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -601,6 +601,13 @@ static inline void ksz_regmap_unlock(void *__mtx)
mutex_unlock(mtx);
}
+static inline bool ksz_is_ksz87xx(struct ksz_device *dev)
+{
+ return dev->chip_id == KSZ8795_CHIP_ID ||
+ dev->chip_id == KSZ8794_CHIP_ID ||
+ dev->chip_id == KSZ8765_CHIP_ID;
+}
+
static inline bool ksz_is_ksz88x3(struct ksz_device *dev)
{
return dev->chip_id == KSZ8830_CHIP_ID;

drivers/net/dsa/mv88e6xxx/chip.c

View file
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 8b51756..c7d51a5 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -109,6 +109,13 @@ int mv88e6xxx_wait_mask(struct mv88e6xxx_chip *chip, int addr, int reg,
usleep_range(1000, 2000);
}
+ err = mv88e6xxx_read(chip, addr, reg, &data);
+ if (err)
+ return err;
+
+ if ((data & mask) == val)
+ return 0;
+
dev_err(chip->dev, "Timeout while waiting for switch\n");
return -ETIMEDOUT;
}

drivers/net/dsa/qca/ar9331.c

View file
diff --git a/drivers/net/dsa/qca/ar9331.c b/drivers/net/dsa/qca/ar9331.c
index b2bf78a..3b09370 100644
--- a/drivers/net/dsa/qca/ar9331.c
+++ b/drivers/net/dsa/qca/ar9331.c
@@ -1002,6 +1002,8 @@ static const struct regmap_config ar9331_mdio_regmap_config = {
.val_bits = 32,
.reg_stride = 4,
.max_register = AR9331_SW_REG_PAGE,
+ .use_single_read = true,
+ .use_single_write = true,
.ranges = ar9331_regmap_range,
.num_ranges = ARRAY_SIZE(ar9331_regmap_range),
@@ -1018,8 +1020,6 @@ static struct regmap_bus ar9331_sw_bus = {
.val_format_endian_default = REGMAP_ENDIAN_NATIVE,
.read = ar9331_mdio_read,
.write = ar9331_sw_bus_write,
- .max_raw_read = 4,
- .max_raw_write = 4,
};
static int ar9331_sw_probe(struct mdio_device *mdiodev)

drivers/net/ethernet/brocade/bna/bnad_debugfs.c

View file
diff --git a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
index 04ad0f2..7246e13 100644
--- a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
+++ b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
@@ -512,11 +512,6 @@ bnad_debugfs_init(struct bnad *bnad)
if (!bnad->port_debugfs_root) {
bnad->port_debugfs_root =
debugfs_create_dir(name, bna_debugfs_root);
- if (!bnad->port_debugfs_root) {
- netdev_warn(bnad->netdev,
- "debugfs root dir creation failed\n");
- return;
- }
atomic_inc(&bna_debugfs_port_count);

drivers/net/ethernet/intel/iavf/iavf.h

View file
diff --git a/drivers/net/ethernet/intel/iavf/iavf.h b/drivers/net/ethernet/intel/iavf/iavf.h
index f80f273..8cbdebc 100644
--- a/drivers/net/ethernet/intel/iavf/iavf.h
+++ b/drivers/net/ethernet/intel/iavf/iavf.h
@@ -255,8 +255,10 @@ struct iavf_adapter {
struct workqueue_struct *wq;
struct work_struct reset_task;
struct work_struct adminq_task;
+ struct work_struct finish_config;
struct delayed_work client_task;
wait_queue_head_t down_waitqueue;
+ wait_queue_head_t reset_waitqueue;
wait_queue_head_t vc_waitqueue;
struct iavf_q_vector *q_vectors;
struct list_head vlan_filter_list;
@@ -518,8 +520,9 @@ int iavf_up(struct iavf_adapter *adapter);
void iavf_down(struct iavf_adapter *adapter);
int iavf_process_config(struct iavf_adapter *adapter);
int iavf_parse_vf_resource_msg(struct iavf_adapter *adapter);
-void iavf_schedule_reset(struct iavf_adapter *adapter);
+void iavf_schedule_reset(struct iavf_adapter *adapter, u64 flags);
void iavf_schedule_request_stats(struct iavf_adapter *adapter);
+void iavf_schedule_finish_config(struct iavf_adapter *adapter);
void iavf_reset(struct iavf_adapter *adapter);
void iavf_set_ethtool_ops(struct net_device *netdev);
void iavf_update_stats(struct iavf_adapter *adapter);
@@ -582,4 +585,5 @@ void iavf_add_adv_rss_cfg(struct iavf_adapter *adapter);
void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter);
struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
const u8 *macaddr);
+int iavf_wait_for_reset(struct iavf_adapter *adapter);
#endif /* _IAVF_H_ */

drivers/net/ethernet/intel/iavf/iavf_ethtool.c

View file
diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
index 6f171d1..2f47cfa 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
@@ -484,6 +484,7 @@ static int iavf_set_priv_flags(struct net_device *netdev, u32 flags)
{
struct iavf_adapter *adapter = netdev_priv(netdev);
u32 orig_flags, new_flags, changed_flags;
+ int ret = 0;
u32 i;
orig_flags = READ_ONCE(adapter->flags);
@@ -531,12 +532,14 @@ static int iavf_set_priv_flags(struct net_device *netdev, u32 flags)
/* issue a reset to force legacy-rx change to take effect */
if (changed_flags & IAVF_FLAG_LEGACY_RX) {
if (netif_running(netdev)) {
- adapter->flags |= IAVF_FLAG_RESET_NEEDED;
- queue_work(adapter->wq, &adapter->reset_task);
+ iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
+ ret = iavf_wait_for_reset(adapter);
+ if (ret)
+ netdev_warn(netdev, "Changing private flags timeout or interrupted waiting for reset");
}
}
- return 0;
+ return ret;
}
/**
@@ -627,6 +630,7 @@ static int iavf_set_ringparam(struct net_device *netdev,
{
struct iavf_adapter *adapter = netdev_priv(netdev);
u32 new_rx_count, new_tx_count;
+ int ret = 0;
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
return -EINVAL;
@@ -671,11 +675,13 @@ static int iavf_set_ringparam(struct net_device *netdev,
}
if (netif_running(netdev)) {
- adapter->flags |= IAVF_FLAG_RESET_NEEDED;
- queue_work(adapter->wq, &adapter->reset_task);
+ iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
+ ret = iavf_wait_for_reset(adapter);
+ if (ret)
+ netdev_warn(netdev, "Changing ring parameters timeout or interrupted waiting for reset");
}
- return 0;
+ return ret;
}
/**
@@ -1830,7 +1836,7 @@ static int iavf_set_channels(struct net_device *netdev,
{
struct iavf_adapter *adapter = netdev_priv(netdev);
u32 num_req = ch->combined_count;
- int i;
+ int ret = 0;
if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&
adapter->num_tc) {
@@ -1852,22 +1858,13 @@ static int iavf_set_channels(struct net_device *netdev,
adapter->num_req_queues = num_req;
adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
- iavf_schedule_reset(adapter);
+ iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
- /* wait for the reset is done */
- for (i = 0; i < IAVF_RESET_WAIT_COMPLETE_COUNT; i++) {
- msleep(IAVF_RESET_WAIT_MS);

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/iavf/iavf_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/ice/ice_base.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/ice/ice_ethtool.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/ice/ice_lib.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/ice/ice_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/igc/igc_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mediatek/mtk_eth_soc.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mscc/ocelot_fdma.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/qualcomm/emac/emac-mac.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/realtek/r8169_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/ti/cpsw_ale.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/wangxun/libwx/wx_hw.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/phy/phy_device.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/usbnet.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/vrf.c

View file

This diff is incomplete. Download the complete patch.

include/linux/tcp.h

View file

This diff is incomplete. Download the complete patch.

include/net/bluetooth/hci_core.h

View file

This diff is incomplete. Download the complete patch.

include/net/bonding.h

View file

This diff is incomplete. Download the complete patch.

include/net/cfg802154.h

View file

This diff is incomplete. Download the complete patch.

include/net/codel.h

View file

This diff is incomplete. Download the complete patch.

include/net/devlink.h

View file

This diff is incomplete. Download the complete patch.

include/net/inet_frag.h

View file

This diff is incomplete. Download the complete patch.

include/net/llc_conn.h

View file

This diff is incomplete. Download the complete patch.

include/net/llc_pdu.h

View file

This diff is incomplete. Download the complete patch.

include/net/nsh.h

View file

This diff is incomplete. Download the complete patch.

include/net/pie.h

View file

This diff is incomplete. Download the complete patch.

include/net/rsi_91x.h

View file

This diff is incomplete. Download the complete patch.

include/net/tcp.h

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/verifier.c

View file

This diff is incomplete. Download the complete patch.

net/bluetooth/hci_conn.c

View file

This diff is incomplete. Download the complete patch.

net/bluetooth/hci_core.c

View file

This diff is incomplete. Download the complete patch.

net/bluetooth/hci_event.c

View file

This diff is incomplete. Download the complete patch.

net/bluetooth/hci_sync.c

View file

This diff is incomplete. Download the complete patch.

net/bluetooth/iso.c

View file

This diff is incomplete. Download the complete patch.

net/bluetooth/mgmt.c

View file

This diff is incomplete. Download the complete patch.

net/bluetooth/sco.c

View file

This diff is incomplete. Download the complete patch.

net/can/bcm.c

View file

This diff is incomplete. Download the complete patch.

net/can/raw.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/esp4.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/inet_connection_sock.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/inet_hashtables.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/inet_timewait_sock.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/ip_gre.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_fastopen.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_ipv4.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_minisocks.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_output.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/udp_offload.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/ip6_gre.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/tcp_ipv6.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/udp_offload.c

View file

This diff is incomplete. Download the complete patch.

net/llc/af_llc.c

View file

This diff is incomplete. Download the complete patch.

net/llc/llc_conn.c

View file

This diff is incomplete. Download the complete patch.

net/llc/llc_if.c

View file

This diff is incomplete. Download the complete patch.

net/llc/llc_input.c

View file

This diff is incomplete. Download the complete patch.

net/llc/llc_sap.c

View file

This diff is incomplete. Download the complete patch.

net/netfilter/nf_tables_api.c

View file

This diff is incomplete. Download the complete patch.

net/netfilter/nft_set_pipapo.c

View file

This diff is incomplete. Download the complete patch.

net/sched/cls_bpf.c

View file

This diff is incomplete. Download the complete patch.

net/sched/cls_flower.c

View file

This diff is incomplete. Download the complete patch.

net/sched/cls_matchall.c

View file

This diff is incomplete. Download the complete patch.

net/sched/cls_u32.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/async_stack_depth.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/tc-testing/config

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/tc-testing/settings

View file

This diff is incomplete. Download the complete patch.