From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796444421; b=An4lAu83hRciFk1pzhYg5VOgJ1WRx9QMnZREk8i3bdw6APK2fdeXr8hGaDCPZGt/FPT+ xyPswtRg+GFuvTZdpJAC7tqN3UkOdk9Huun7jqk+/zRVn+XJwwZw5ke0HWOHm26Nyh8IU jbW21Ogx81O5PKPDO0mKqQuf4mnJ3YOoSt6GNm8KKOcXdyFWgF0cyHQ5bgcIFdZ1m9vWy rwPJLHKhSQj2nvtACiFya+AHOicl0B8IMfO7Ojx0ZTKYAjNYqQPQWfKWVcQRvWk3Quvse 2Exs259cktBaLDLpZykj1iYgEEME/+DCM1beV9UiFES7PpY40rcBDral6+Gunt59frw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796444421; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=8VzLtjRHVgnuHwDSNX6FUxD4z5MRdjhoWxomK9oTJNY=; b=FJQIpEIUFl2x7GYYDjs5B18my3gVgPXpoOmhrNLhSfh01oNG0ruZgaJ3JTa7x8QvcQLJ N/CzmyoqkhM1cgAI4BvL848zA5HgjkPWPVPeL0BFFWI6M7LZsuWQJbdnweYOUJ+CSCbuw 2MgC/QgIppomFWFEsoJMrcGTDU9XFzQHeMgY4XD9IzuMXnlxULEsx2Gwfqy5x/JslpYEs DQLrtyESkKuYZZ/nfB7MEs5wR96cjixybu1oZWplVDIlPqMeoD0KEsancsnLmuS2ZGLHA GotOkboPn786H9tTqyCqu5eJCnsvMaUWntBI7JDGYyD5m/XVcg4oDHDiouSvi8pO8+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TMT9jN8G; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3460C606A322 for ; Sat, 5 Dec 2026 04:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TMT9jN8G Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBF581F00A07; Sat, 5 Dec 2026 04:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796444421; bh=8VzLtjRHVgnuHwDSNX6FUxD4z5MRdjhoWxomK9oTJNY=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=TMT9jN8GUm5E51kjp9onXcHOV3bpzfTK2YXTT9nwDfWVZpQy03v8wy2wdFXCZmCe8 dxdnP0bumbIYLYQZxCtlTWlKOqgLRuyG7II7idR4CNA6FcHx6zh5bKeUhoQr27yl4P H8sFOw4B2+MnzDBTqq0VTNmUOx8B0CHH+a0sjyLmOZqId5zK+EFmLeeY96WYEnQEU0 YujwCVGyCxzIJngIp+2qqglqeqUUJKeIFGUIisJkyLBNoVEU+EpsLLNO5Xy0fifM/T EB3/RZ7C/lF0SXBnyxABQGGkNlWOfz3a3kNfvoqKu4obXJb1uzzmGpvoJuTSnH/xdw 65+xZGkqzRhiQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next v8 2/3] net: cortina: Add CS7542 CPU network datapath Reply-To: sashiko-reviews@lists.linux.dev To: "Fil Dunsky" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261204-b4-cs7542-ethernet-v8-2-4b625ce9fe82@gmail.com> References: <20261204-b4-cs7542-ethernet-v8-0-4b625ce9fe82@gmail.com> <20261204-b4-cs7542-ethernet-v8-2-4b625ce9fe82@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 04:20:20 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 13 potential issues to consider: - [High] net: cortina: netpoll/netconsole deadlocks on ne->txq.lock - [Medium] net: cortina: missing of_node_get()/of_node_put() for port OF nodes - [Medium] net: cortina: atomic dev_alloc_page() used for bulk RX probe refill - [Medium] net: cortina: host-endian writes to coherent TX DMA descriptors - [Medium] net: cortina: excessive hard-IRQ-disabling ne->rx_lock use in RX path - [Medium] net: cortina: TX ring data race and lock contention under ne->txq.lock - [Medium] net: cortina: order-2 atomic RX skb allocations for jumbo frames - [Medium] net: cortina: loop-invariant shaper bypass in cs752x_sch_init() - [Medium] net: cortina: cs_ne_rx_poll() discards refreshed RX write pointer - [Medium] net: cortina: missing IRQ status clear and recheck in cs_ne_rx_poll() - [Low] net: cortina: unpaired plain writes to txq->head, tail, and fault - [Low] net: cortina: duplicated TX descriptor, free-space, and txq init code - [Low] net: cortina: unmarked ndev->stats increments race with dev_get_tstats64() -- commit fd19fefeb519d024c28ee4b48974974a246e10bf Author: Fil Dunsky net: cortina: Add CS7542 CPU network datapath This commit adds the Cortina CS7542 Ethernet driver supporting three GMAC ports with phylink, per-port NAPI RX, a shared coherent TX ring, and forwarding engine, scheduler, and traffic manager initialization. > diff --git a/drivers/net/ethernet/cortina/cs752x_ne.c b/drivers/net/ether= net/cortina/cs752x_ne.c > new file mode 100644 > index 0000000000000..ad673449802c6 > --- /dev/null > +++ b/drivers/net/ethernet/cortina/cs752x_ne.c [ ... ] > +static int cs_ne_rx_refill(struct cs_ne_port *port, int count) > +{ > + struct cs_ne *ne =3D port->ne; > + struct cs_ne_rx_buf *buf; > + unsigned long flags; > + int ret, i; > + > + for (i =3D 0; i < count; i++) { > + buf =3D kzalloc_obj(*buf); > + if (!buf) > + break; > + buf->page =3D dev_alloc_page(); [Severity: Medium] Should cs_ne_rx_refill() use alloc_page(GFP_KERNEL) instead of dev_alloc_page()? cs_ne_rx_refill() is only called during sleepable probe from cs_ne_probe_port() and already uses GFP_KERNEL for kzalloc_obj() and xa_insert(). dev_alloc_page() allocates with GFP_ATOMIC, which can unnecessarily fail probe with -ENOMEM when filling up to 2304 RX pages (9 MiB) on a 512 MiB platform with 64 MiB reserved for QM. [ ... ] > +static bool cs_ne_rx_claim(struct cs_ne *ne, const dma_addr_t *dma, > + struct cs_ne_rx_buf **bufs, unsigned int count) > +{ > + struct cs_ne_rx_buf *buf; > + unsigned long flags; > + unsigned int i; > + bool valid =3D true; > + > + if (!count || count > CS_NE_RX_MAX_BUFS) > + return false; > + spin_lock_irqsave(&ne->rx_lock, flags); > + for (i =3D 0; i < count; i++) { > + bufs[i] =3D NULL; > + buf =3D xa_load(&ne->rx_buffers, dma[i] >> CS_NE_RX_DMA_SHIFT); > + if (!buf || buf->dma !=3D dma[i] || buf->state !=3D CS_NE_RX_HW) { > + valid =3D false; > + continue; > + } > + buf->state =3D CS_NE_RX_CPU; > + buf->sync_off =3D 0; > + buf->sync_len =3D 0; > + bufs[i] =3D buf; > + } > + spin_unlock_irqrestore(&ne->rx_lock, flags); > + return valid; > +} [ ... ] > +static void cs_ne_rx_recycle(struct cs_ne *ne, struct cs_ne_rx_buf *buf) > +{ > + unsigned long flags; > + > + if (!buf) > + return; > + /* A claimed mapping cannot be handed to another CPU while it is copied= . */ > + if (WARN_ON_ONCE(buf->state !=3D CS_NE_RX_CPU)) > + return; > + if (buf->sync_len) > + dma_sync_single_range_for_device(ne->dev, buf->dma, buf->sync_off, > + buf->sync_len, DMA_FROM_DEVICE); > + spin_lock_irqsave(&ne->rx_lock, flags); > + buf->sync_len =3D 0; > + buf->state =3D CS_NE_RX_PENDING; > + list_add_tail(&buf->pending, &ne->rx_pending); > + spin_unlock_irqrestore(&ne->rx_lock, flags); > +} [Severity: Medium] Does ne->rx_lock need to disable hard IRQs and be taken per packet and per fragment on the RX path? cs_ne_rx_irq() never acquires ne->rx_lock and zero-budget netpoll in cs_ne_rx_poll() returns before touching it, so every caller runs in softirq or process context. Acquiring spin_lock_irqsave(&ne->rx_lock) in cs_ne_rx_claim() across xa_load() lookups, again per fragment in cs_ne_rx_recycle(), and across the MMIO push loop in cs_ne_rx_kick() masks hard interrupts and serializes concurrent NAPI polls across all three ports. Using spin_lock_bh()/spin_lock(), doing the immutable xa_load() lookups outside the lock, and batching recycled buffers onto a local list spliced once per poll in cs_ne_rx_kick() would avoid this. [ ... ] > +static void cs_ne_tx_complete(struct cs_ne *ne) > +{ > + struct cs_ne_txq *txq =3D &ne->txq; > + struct cs_ne_tx_buf *buf; > + u32 rptr; > + int i; > + > + if (txq->fault) > + return; > + rptr =3D readl(ne->dma + DMA_LSO_TXQ_RPTR(0)) & DMA_PTR_MASK; > + /* Never consume unsubmitted descriptors or loop past the ring boundary= . */ > + if (rptr >=3D CS_NE_TX_DESC_NUM || > + ((rptr - txq->tail) & (CS_NE_TX_DESC_NUM - 1)) > > + ((txq->head - txq->tail) & (CS_NE_TX_DESC_NUM - 1))) { > + txq->fault =3D true; > + cs_ne_tx_stop_all(ne); > + dev_err_ratelimited(ne->dev, "invalid TX completion pointer %#x\n", rp= tr); > + return; > + } [Severity: High] Can netpoll or netconsole self-deadlock on ne->txq.lock here and across the TX paths? The driver does not set IFF_DISABLE_NETPOLL and supports zero-budget polling in cs_ne_rx_poll(). netconsole invokes netpoll_send_skb() from hardirq context with local IRQs disabled, reaching cs_ne_start_xmit() and cs_ne_rx_poll(..., 0) -> cs_ne_tx_reap(), while normal callers (cs_ne_tx_timer(), cs_ne_tx_reap(), cs_ne_start_xmit(), cs_ne_open(), cs_ne_stop()) acquire the shared ne->txq.lock with hardirqs enabled: cs_ne_tx_timer() spin_lock(&txq->lock) netconsole -> netpoll_send_skb(port0) cs_ne_start_xmit() spin_lock(&txq->lock) <-- spins forever In addition, calling dev_err_ratelimited() in cs_ne_tx_complete() while holding ne->txq.lock after cs_ne_tx_stop_all() synchronously re-enters netconsole -> netpoll_poll_dev() -> cs_ne_rx_poll(..., 0) -> cs_ne_tx_reap(), which self-deadlocks on ne->txq.lock even with spin_lock_irqsave(). Consider either setting IFF_DISABLE_NETPOLL, or converting all ne->txq.lock acquisitions to spin_lock_irqsave()/spin_unlock_irqrestore() and moving dev_err_ratelimited() outside ne->txq.lock. > + /* This engine retires through RPTR; completed descriptors keep OWN set= . */ > + while (txq->tail !=3D rptr) { > + buf =3D &txq->bufs[txq->tail]; > + if (buf->len) { > + if (buf->page) > + dma_unmap_page(ne->dev, buf->dma, buf->len, > + DMA_TO_DEVICE); > + else > + dma_unmap_single(ne->dev, buf->dma, buf->len, > + DMA_TO_DEVICE); > + buf->len =3D 0; > + } > + if (buf->skb) { > + dev_consume_skb_any(buf->skb); > + buf->skb =3D NULL; > + } > + txq->tail =3D (txq->tail + 1) & (CS_NE_TX_DESC_NUM - 1); > + } [Severity: Medium] Can holding the shared ne->txq.lock across DMA mapping, unmapping, and SKB freeing cause excessive multi-port contention and data races? cs_ne_tx_complete() holds ne->txq.lock while unmapping up to 1023 descriptors and calling dev_consume_skb_any(), while cs_ne_start_xmit() and cs_ne_xmit_sg() hold the same device-wide lock across dma_map_single() and skb_frag_dma_map(). In addition, cs_ne_xmit_sg() advances txq->head per fragment inside the mapping loop before writing DMA_LSO_TXQ_WPTR(0), exposing intermediate values to lockless READ_ONCE(txq->head) checks in cs_ne_tx_reap() and triggering spurious lock contention across all three ports. [ ... ] > +static void cs_ne_tx_reap(struct cs_ne *ne) > +{ > + struct cs_ne_txq *txq =3D &ne->txq; > + > + if (READ_ONCE(txq->tail) =3D=3D READ_ONCE(txq->head)) > + return; > + spin_lock(&txq->lock); > + cs_ne_tx_complete(ne); > + spin_unlock(&txq->lock); > +} [Severity: Low] Are the plain writes to txq->tail, txq->head, and txq->fault a data race with the lockless READ_ONCE() checks here and in cs_ne_open()? cs_ne_tx_complete(), cs_ne_xmit_sg(), and cs_ne_start_xmit() update txq->tail, txq->head, and txq->fault with plain assignments, which will trigger KCSAN data-race warnings against READ_ONCE(txq->tail), READ_ONCE(txq->head), and READ_ONCE(ne->txq.fault). Pairing those writes with WRITE_ONCE() (and publishing txq->head once an SG frame is fully mapped) would resolve this. [ ... ] > + if (!valid) { > + ndev->stats.rx_errors++; > + goto recycle; > + } [Severity: Low] Should these ndev->stats increments use DEV_STATS_INC()? cs_ne_probe_port() sets NETDEV_PCPU_STAT_TSTATS without ndo_get_stats64 or ndo_get_stats, so dev_get_stats() reads dev->stats locklessly via netdev_stats_to_stats64() using atomic_long_read(). Plain ++ updates to rx_errors, rx_dropped, rx_fifo_errors, and tx_dropped across cs_ne_rx_packet(), cs_ne_rx_poll(), cs_ne_xmit_sg(), and cs_ne_start_xmit() race with those readers under CONFIG_KCSAN_STRICT. > + skb =3D napi_alloc_skb(&port->napi, total); > + if (!skb) { > + ndev->stats.rx_dropped++; > + goto recycle; > + } > + remaining =3D total; > + for (i =3D 0; i < nbufs && remaining; i++) { > + seg =3D min_t(u32, remaining, CS_NE_BUF_DATA_MAX - (off & 0xff)); > + data =3D cs_ne_rx_buf_cpu(ne, bufs[i], off, seg); > + if (!data) > + break; > + skb_put_data(skb, data, seg); > + remaining -=3D seg; > + off =3D CS_NE_BUF_HDR_OFF; > + } [Severity: Medium] Will napi_alloc_skb(&port->napi, total) force order-2 atomic allocations for jumbo frames? cs_ne_probe_port() sets ndev->max_mtu up to 8988 bytes, allowing total up to CS_NE_MAX_PKT_LEN (9022 bytes). Lengths above SKB_WITH_OVERHEAD(PAGE_SIZE) bypass the NAPI page-frag cache and fall back to GFP_ATOMIC order-2 kmalloc-16k allocations, which can cause rx_dropped bursts under fragmentation on a 512 MiB system instead of attaching order-0 page fragments. [ ... ] > + next =3D FIELD_GET(XR_NEXT_LINK, w1); > + if (next =3D=3D wr && > + (ni_rd(ne, NI_CPUXRAM_CPU_STA_RX(port->id)) & NI_XRAM_PTR_MASK) = =3D=3D wr) { > + /* > + * The next link reaches the unchanged hardware write pointer: > + * this is the current tail packet. Retain the vendor's 16us > + * DDR-arrival guard before reading its header and payload. > + * NAPI softirq context cannot use a sleeping delay here. > + */ > + udelay(CS_NE_RX_TAIL_SETTLE_US); > + } > + rd =3D next; > + cs_ne_rx_packet(port, desc, w1); > + done++; [Severity: Medium] Should cs_ne_rx_poll() update wr from the refreshed NI_CPUXRAM_CPU_STA_RX(port->id) read when next =3D=3D wr? When hardware has already queued newer packets past wr, discarding the re-read value causes rd =3D next to equal the stale wr and exit the loop with done < budget. This flushes GRO early via napi_complete_done() and triggers an immediate hard interrupt and NAPI reschedule for packets already visible in XRAM. [ ... ] > + if (done < budget && napi_complete_done(napi, done)) { > + spin_lock_irqsave(&ne->rx_lock, flags); > + if (READ_ONCE(port->opened) && !ne->rx_stopping) { > + /* > + * Keep DMA-owned buffers untouched and the IRQ masked. > + * A delayed poll also handles completion without a new edge. > + */ > + if (defer) > + mod_delayed_work(system_wq, &port->rx_owned_retry, > + msecs_to_jiffies(1)); > + else > + ni_wr(ne, NI_CPUXRAM_RXPKT_INTENABLE(port->id), 1); > + } > + spin_unlock_irqrestore(&ne->rx_lock, flags); > + } [Severity: Medium] Can re-enabling NI_CPUXRAM_RXPKT_INTENABLE(port->id) without clearing NI_CPUXRAM_RXPKT_INTERRUPT fire a spurious level-triggered interrupt after every multi-packet burst? cs_ne_rx_irq() clears the W1C NI_CPUXRAM_RXPKT_INTERRUPT bit before NAPI runs, so any packet arriving before cs_ne_rx_poll() reads NI_CPUXRAM_CPU_STA_RX re-latches it while INTENABLE is masked. After draining those packets and calling napi_complete_done(), enabling INTENABLE with the stale latch still set immediately asserts the IRQ_TYPE_LEVEL_HIGH GIC SPI and schedules an empty 0-packet poll. Clearing NI_CPUXRAM_RXPKT_INTERRUPT after updating NI_CPUXRAM_CPU_CFG_RX and re-checking NI_CPUXRAM_CPU_STA_RX !=3D rd before re-enabling INTENABLE would avoid both spurious and missed interrupts. [ ... ] > +static void cs_ne_tx_desc(struct cs_ne_txq *txq, int port_id, dma_addr_t= dma, > + u32 len, u32 total, bool sof, bool eof) > +{ > + u32 *desc =3D txq->desc + txq->head * 8; > + u32 word0, word3; > + > + word3 =3D TX_LSO_SEGMENT_EN | CS_NE_MAX_PKT_LEN; > + if (eof && total < CS_NE_MIN_PKT_LEN) > + word3 |=3D TX_LSO_IP_LENFIX_EN; > + word0 =3D TX_DESC_OWN | FIELD_PREP(TX_DESC_LEN, len); > + if (sof) > + word0 |=3D TX_DESC_SOF; > + if (eof) > + word0 |=3D TX_DESC_EOF; > + > + desc[1] =3D dma; > + desc[2] =3D sof ? total << 16 : 0; > + desc[3] =3D word3; > + desc[4] =3D CS_NE_HDRA_CPU_PKT | FIELD_PREP(TX_HDRA_DVOQ, port_id * 8); > + desc[5] =3D 0; > + desc[6] =3D 0; > + desc[7] =3D 0; > + dma_wmb(); > + desc[0] =3D word0; > +} [Severity: Medium] Will writing host-endian u32 words directly to txq->desc break TX on big-endian kernels? CS7542_ETHERNET can be built on big-endian configurations such as ARM BE8, and cs_ne_dma_init() does not enable a big-endian descriptor mode. Both cs_ne_tx_desc() and cs_ne_start_xmit() write raw host-endian values into coherent DMA memory instead of typing txq->desc as __le32 * and converting descriptor words with cpu_to_le32(). [ ... ] > + word3 =3D TX_LSO_SEGMENT_EN | CS_NE_MAX_PKT_LEN; > + if (len < CS_NE_MIN_PKT_LEN) > + word3 |=3D TX_LSO_IP_LENFIX_EN; > + > + desc =3D txq->desc + txq->head * 8; > + desc[1] =3D dma; > + desc[2] =3D len << 16; > + desc[3] =3D word3; > + desc[4] =3D CS_NE_HDRA_CPU_PKT | FIELD_PREP(TX_HDRA_DVOQ, port->id * 8); > + desc[5] =3D 0; > + desc[6] =3D 0; > + desc[7] =3D 0; > + dma_wmb(); > + desc[0] =3D TX_DESC_OWN | TX_DESC_SOF | TX_DESC_EOF | > + FIELD_PREP(TX_DESC_LEN, len); [Severity: Low] Can this open-coded descriptor setup reuse cs_ne_tx_desc(txq, port->id, dma, len, len, true, true)? Similarly, cs_ne_tx_complete(), cs_ne_xmit_sg(), and cs_ne_start_xmit() open-code the ring free-space expression instead of calling cs_ne_tx_free(txq), and cs_ne_dma_init() redundantly re-initializes txq->ne, txq->stopping, and txq->lock after cs_ne_probe() already did. [ ... ] > + port =3D netdev_priv(ndev); > + port->ne =3D ne; > + port->ndev =3D ndev; > + port->np =3D np; > + port->id =3D id; [ ... ] > + ndev->dev.of_node =3D np; [Severity: Medium] Does storing np in port->np and ndev->dev.of_node need of_node_get(np) with a matching of_node_put(port->np) in cs_ne_port_cleanup()? cs_ne_probe() iterates child nodes with for_each_available_child_of_node(), which drops its reference to np when the loop advances or exits. port->np is later passed to phylink_of_phy_connect() in cs_ne_open(), so without taking a reference it risks a use-after-free under CONFIG_OF_DYNAMIC overlay removal. [ ... ] > diff --git a/drivers/net/ethernet/cortina/cs752x_sch_tm.c b/drivers/net/e= thernet/cortina/cs752x_sch_tm.c > new file mode 100644 > index 0000000000000..5886c1bc57a86 > --- /dev/null > +++ b/drivers/net/ethernet/cortina/cs752x_sch_tm.c [ ... ] > + for (port =3D 0; port < SCH_PORT_NO; port++) { > + cpu_port =3D port >=3D SCH_CPU_PORT0 ? port - SCH_CPU_PORT0 : 0; > + > + ret =3D cs752x_sch_enable_port(dev, sch, port); > + if (ret) > + return ret; > + ret =3D cs752x_sch_set_port_burst(dev, sch, port, 0); > + if (ret) > + return ret; > + ret =3D cs752x_sch_bypass_shaper(dev, sch, port + SCH_LT_BASE_ID, 0); > + if (ret) > + return ret; > + ret =3D cs752x_sch_bypass_shaper(dev, sch, port + SCH_ST_BASE_ID, 0); > + if (ret) > + return ret; > + > + for (q =3D 0; q < SCH_MAX_PORT_QUEUE; q++) { > + ret =3D cs752x_sch_enable_voq_drr(dev, sch, > + port * SCH_MAX_PORT_QUEUE + q, > + SCH_DEFAULT_QUANTA, cpu_port); > + if (ret) > + return ret; > + ret =3D cs752x_sch_bypass_shaper(dev, sch, > + port + SCH_DRR_BASE_ID, > + cpu_port); > + if (ret) > + return ret; > + } > + } [Severity: Medium] Is cs752x_sch_bypass_shaper() inside the queue loop supposed to bypass the per-VOQ shaper (port * SCH_MAX_PORT_QUEUE + q) rather than repeating port + SCH_DRR_BASE_ID eight times per port? Because port + SCH_DRR_BASE_ID does not depend on q, this sends 98 redundant atomic scheduler commands for the per-port DRR shapers while leaving all 112 per-VOQ shapers (IDs 0..111) unprogrammed. Also, the per-port LT and ST shaper bypass calls pass literal 0 instead of the computed cpu_port. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-b4-cs7542-= ethernet-v8-0-4b625ce9fe82@gmail.com?part=3D2