* [PATCH v1 0/1] allow MTU change when port is started @ 2026-09-28 8:36 Dimon Zhao 2026-09-28 8:36 ` [PATCH v1 1/1] net/nbl: " Dimon Zhao 0 siblings, 1 reply; 5+ messages in thread From: Dimon Zhao @ 2026-09-28 8:36 UTC (permalink / raw) To: dev; +Cc: Dimon Zhao Remove the dev_started check in nbl_mtu_set() to allow MTU configuration while the port is started. Dimon Zhao (1): net/nbl: allow MTU change when port is started drivers/net/nbl/nbl_dev/nbl_dev.c | 6 ------ 1 file changed, 6 deletions(-) -- 2.34.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 1/1] net/nbl: allow MTU change when port is started 2026-09-28 8:36 [PATCH v1 0/1] allow MTU change when port is started Dimon Zhao @ 2026-09-28 8:36 ` Dimon Zhao 2026-09-28 18:30 ` Stephen Hemminger 0 siblings, 1 reply; 5+ messages in thread From: Dimon Zhao @ 2026-09-28 8:36 UTC (permalink / raw) To: dev; +Cc: Dimon Zhao, stable, Leon Yu, Sam Chen Remove the dev_started check in nbl_mtu_set() to allow MTU configuration while the port is started. Fixes: 75cdda36a4c5 ("net/nbl: support MTU update") Cc: stable@dpdk.org Signed-off-by: Dimon Zhao <dimon.zhao@nebula-matrix.com> --- drivers/net/nbl/nbl_dev/nbl_dev.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/nbl/nbl_dev/nbl_dev.c b/drivers/net/nbl/nbl_dev/nbl_dev.c index 320f26619f..1c04fb8bfd 100644 --- a/drivers/net/nbl/nbl_dev/nbl_dev.c +++ b/drivers/net/nbl/nbl_dev/nbl_dev.c @@ -760,12 +760,6 @@ int nbl_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) uint32_t frame_size = mtu + NBL_ETH_OVERHEAD; int ret; - /* mtu setting is forbidden if port is start */ - if (dev_data->dev_started) { - NBL_LOG(ERR, "port %d must be stopped before configuration", dev_data->port_id); - return -EBUSY; - } - dev_data->dev_conf.rxmode.mtu = frame_size; ret = disp_ops->set_mtu(NBL_DEV_MGT_TO_DISP_PRIV(dev_mgt), dev_mgt->net_dev->vsi_id, mtu); if (ret) -- 2.34.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/1] net/nbl: allow MTU change when port is started 2026-09-28 8:36 ` [PATCH v1 1/1] net/nbl: " Dimon Zhao @ 2026-09-28 18:30 ` Stephen Hemminger 0 siblings, 0 replies; 5+ messages in thread From: Stephen Hemminger @ 2026-09-28 18:30 UTC (permalink / raw) To: Dimon Zhao; +Cc: dev, stable, Leon Yu, Sam Chen On Mon, 28 Sep 2026 01:36:16 -0700 Dimon Zhao <dimon.zhao@nebula-matrix.com> wrote: > Remove the dev_started check in nbl_mtu_set() to allow MTU > configuration while the port is started. > > Fixes: 75cdda36a4c5 ("net/nbl: support MTU update") > Cc: stable@dpdk.org > Signed-off-by: Dimon Zhao <dimon.zhao@nebula-matrix.com> > --- I don't think this is safe. AI explains in more wordy detail Review: [PATCH v1 1/1] net/nbl: allow MTU change when port is started The PMD Rx buffers survive a live MTU change. nbl_res_alloc_rx_bufs() and nbl_fill_rx_ring() post every descriptor with the full mbuf data room, not an MTU-derived length, and nbl_res_txrx_recv_pkts() always chains on num_buffers from the Rx extension header. In-flight descriptors cannot be overrun by a larger MTU; oversize frames get chained. What the patch drops without replacement is the scatter contract with the application, and nothing shows the hardware side of the MTU change is safe with queues running. Error ----- nbl_dev.c: nbl_mtu_set() With the dev_started check gone, a running port accepts an MTU whose frame no longer fits in one Rx buffer. scattered_rx is computed only in nbl_res_alloc_rx_bufs() at dev_start. An application started with MTU 1500, 2K mbufs and no RTE_ETH_RX_OFFLOAD_SCATTER can call rte_eth_dev_set_mtu(port, 9000); the call succeeds, scattered_rx stays 0, and the Rx burst starts returning multi-segment mbufs the application never agreed to handle. Replace the removed check with the one ixgbe_dev_mtu_set() uses: refuse, on a started port, a frame size that needs scatter when scatter is not already in use. NBL_ETH_OVERHEAD already covers two VLAN tags, but the Rx extension header occupies the start of the first buffer and must be counted, as nbl_res_alloc_rx_bufs() does: if (dev_data->dev_started && !dev_data->scattered_rx && frame_size + <rx exthdr len> > dev_data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) return -EINVAL; Warning ------- Commit message The PMD does not program MTU itself. nbl_disp_chan_set_mtu_req() sends NBL_CHAN_MSG_MTU_SET to the kernel driver over the mailbox, and the Rx queues are not quiesced around it. 75cdda36a4c5 blocked this on a started port deliberately. The message needs to state what MTU_SET changes in hardware (ingress length check only, or anything in queue context), that frames in DMA while the limit changes are handled, and that it was tested with the MTU raised and lowered under traffic. Fixes: / Cc: stable@dpdk.org Returning -EBUSY on a started port is documented behaviour of rte_eth_dev_set_mtu(), so the old code was not a bug. This adds a capability. Drop both tags; changing MTU semantics in the 25.11 LTS is not a backport. nbl_dev.c: nbl_mtu_set(), unchanged context dev_data->dev_conf.rxmode.mtu = frame_size; rxmode.mtu is an L3 MTU; this stores mtu + NBL_ETH_OVERHEAD. The value is returned by rte_eth_dev_conf_get(), so a conf_get then rte_eth_dev_configure() round trip grows the MTU by 26 bytes each cycle until max_mtu validation fails. It is also written before set_mtu and not restored on failure. ethdev updates data->mtu on success; delete the assignment. This one is a real bug: send it as a separate patch ahead of this one, with Fixes: 75cdda36a4c5 and Cc: stable@dpdk.org. Info ---- Configured MTU never reaches hardware (pre-existing) rte_eth_dev_configure() sets data->mtu from rxmode.mtu without calling mtu_set, and nbl_dev_port_start()/nbl_dev_txrx_start() never call disp_ops->set_mtu. An MTU requested at configure time takes effect only if the application also calls rte_eth_dev_set_mtu(). dev_start should push data->mtu to hardware. Separate patch. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 0/1] allow MTU change when port is started @ 2026-10-20 9:42 Dimon Zhao 2026-10-20 9:42 ` [PATCH v1 1/1] net/nbl: " Dimon Zhao 0 siblings, 1 reply; 5+ messages in thread From: Dimon Zhao @ 2026-10-20 9:42 UTC (permalink / raw) To: dev; +Cc: Dimon Zhao Remove the dev_started check in nbl_mtu_set() to allow MTU configuration while the port is started. Dimon Zhao (1): net/nbl: allow MTU change when port is started drivers/net/nbl/nbl_dev/nbl_dev.c | 7 ------- 1 file changed, 7 deletions(-) -- 2.34.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 1/1] net/nbl: allow MTU change when port is started 2026-10-20 9:42 [PATCH v1 0/1] " Dimon Zhao @ 2026-10-20 9:42 ` Dimon Zhao 2026-10-20 14:45 ` Stephen Hemminger 0 siblings, 1 reply; 5+ messages in thread From: Dimon Zhao @ 2026-10-20 9:42 UTC (permalink / raw) To: dev; +Cc: Dimon Zhao, Leon Yu, Sam Chen Remove the dev_started check in nbl_mtu_set() to allow MTU configuration while the port is started. Signed-off-by: Dimon Zhao <dimon.zhao@nebula-matrix.com> --- drivers/net/nbl/nbl_dev/nbl_dev.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/net/nbl/nbl_dev/nbl_dev.c b/drivers/net/nbl/nbl_dev/nbl_dev.c index e41732ccd3..2c1e39f559 100644 --- a/drivers/net/nbl/nbl_dev/nbl_dev.c +++ b/drivers/net/nbl/nbl_dev/nbl_dev.c @@ -753,18 +753,11 @@ int nbl_xstats_reset(struct rte_eth_dev *eth_dev) int nbl_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) { - struct rte_eth_dev_data *dev_data = eth_dev->data; struct nbl_adapter *adapter = ETH_DEV_TO_NBL_DEV_PF_PRIV(eth_dev); struct nbl_dev_mgt *dev_mgt = NBL_ADAPTER_TO_DEV_MGT(adapter); struct nbl_dispatch_ops *disp_ops = NBL_DEV_MGT_TO_DISP_OPS(dev_mgt); int ret; - /* mtu setting is forbidden if port is started */ - if (dev_data->dev_started) { - NBL_LOG(ERR, "port %d must be stopped before configuration", dev_data->port_id); - return -EBUSY; - } - ret = disp_ops->set_mtu(NBL_DEV_MGT_TO_DISP_PRIV(dev_mgt), dev_mgt->net_dev->vsi_id, mtu); if (ret) return ret; -- 2.34.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/1] net/nbl: allow MTU change when port is started 2026-10-20 9:42 ` [PATCH v1 1/1] net/nbl: " Dimon Zhao @ 2026-10-20 14:45 ` Stephen Hemminger 0 siblings, 0 replies; 5+ messages in thread From: Stephen Hemminger @ 2026-10-20 14:45 UTC (permalink / raw) To: Dimon Zhao; +Cc: dev, Leon Yu, Sam Chen On Tue, 20 Oct 2026 02:42:27 -0700 Dimon Zhao <dimon.zhao@nebula-matrix.com> wrote: > Remove the dev_started check in nbl_mtu_set() to allow MTU > configuration while the port is started. > > Signed-off-by: Dimon Zhao <dimon.zhao@nebula-matrix.com> > --- I was suspicious of this since changing MTU often requires driver to reset lots of receive state. And AI analysis confirmed it. [PATCH v1 1/1] net/nbl: allow MTU change when port is started Error The check being removed is what kept the Rx path consistent. Rx buffer layout and scattered_rx are decided once, at queue start, in nbl_res_alloc_rx_bufs(): u32 frame_size = rxq->eth_dev->data->mtu + NBL_ETH_OVERHEAD + rxq->exthdr_len; ... if (frame_size > rxq->buf_length) rxq->eth_dev->data->scattered_rx = 1; With the check gone, an application running with 2K mbufs and MTU 1500 can raise the MTU to 9000 on a started port. Nothing re-evaluates scattered_rx, and the application never enabled RTE_ETH_RX_OFFLOAD_SCATTER, but it will start receiving chained mbufs. Other PMDs that allow runtime MTU change (ixgbe, ice) reject the case where the new frame no longer fits a single Rx buffer and scatter is not already active. Do the same here, e.g.: struct rte_eth_dev_data *dev_data = eth_dev->data; uint32_t frame_size = mtu + NBL_ETH_OVERHEAD; if (dev_data->dev_started && !dev_data->scattered_rx && frame_size > dev_data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) { NBL_LOG(ERR, "port %u must be stopped to set MTU %u", dev_data->port_id, mtu); return -EBUSY; } The limit needs to account for the Rx extended header the same way nbl_res_alloc_rx_bufs() does (rxq->exthdr_len), so expose that value or a per-port max single-buffer frame size to the dev layer rather than open-coding it. Warning Commit message says what the patch does, not why it is now safe. The original comment said MTU setting is forbidden while started; something must have changed for that to no longer hold. Say what: does the PF/management side handling NBL_CHAN_MSG_MTU_SET now apply the new MTU to a running VSI without a queue restart, on both PF and VF? Which firmware/kernel driver version is required? State how this was tested (e.g. testpmd "port config mtu" with traffic running, both growing and shrinking the MTU). ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-20 14:46 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-09-28 8:36 [PATCH v1 0/1] allow MTU change when port is started Dimon Zhao 2026-09-28 8:36 ` [PATCH v1 1/1] net/nbl: " Dimon Zhao 2026-09-28 18:30 ` Stephen Hemminger -- strict thread matches above, loose matches on Subject: below -- 2026-10-20 9:42 [PATCH v1 0/1] " Dimon Zhao 2026-10-20 9:42 ` [PATCH v1 1/1] net/nbl: " Dimon Zhao 2026-10-20 14:45 ` Stephen Hemminger
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox