|WARNING| [v1,1/1] net/nbl: allow MTU change when port is started
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Tue Oct 20 16:20:17 CEST 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/171744
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-10-20
# DPDK Patch Review
## ERRORS
### 1. Missing scatter Rx reselection after MTU change (Error)
**Location:** `drivers/net/nbl/nbl_dev/nbl_dev.c:760-763`
```c
ret = disp_ops->set_mtu(NBL_DEV_MGT_TO_DISP_PRIV(dev_mgt), dev_mgt->net_dev->vsi_id, mtu);
if (ret)
return ret;
```
**Issue:** After changing the MTU, the driver must verify whether the new frame length exceeds the single mbuf data size, and if so, either enable scattered Rx or reject the MTU. The patch removes the dev_started check but does not add the required frame-size vs mbuf-size validation or Rx function reselection.
When a port is started and the MTU is increased such that the maximum frame length (MTU + Ethernet overhead) exceeds the mbuf data buffer size, the current Rx burst function may be unable to receive the larger frames. The driver must either:
1. Check if scatter Rx is enabled and can handle the new size, or
2. Reconfigure the Rx queues and select the appropriate Rx burst function
Without this check, the driver will silently drop or truncate packets that exceed the mbuf size after an MTU increase on a started port.
**Required fix pattern:**
```c
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);
uint32_t frame_size;
uint32_t mbuf_data_size;
int ret;
/* Calculate max frame size with device-specific overhead */
frame_size = mtu + nbl_eth_overhead(eth_dev);
/* If port is started, verify new MTU is compatible */
if (dev_data->dev_started && dev_data->nb_rx_queues > 0) {
struct rte_eth_rxq_info rxq_info;
ret = rte_eth_rx_queue_info_get(eth_dev, 0, &rxq_info);
if (ret == 0) {
mbuf_data_size = rte_pktmbuf_data_room_size(rxq_info.mp) -
RTE_PKTMBUF_HEADROOM;
if (frame_size > mbuf_data_size) {
if (!dev_data->scattered_rx) {
NBL_LOG(ERR, "MTU %u requires scatter Rx "
"(frame %u > mbuf %u)",
mtu, frame_size, mbuf_data_size);
return -EINVAL;
}
/* Ensure scattered Rx function is selected */
nbl_select_rx_function(eth_dev);
}
}
}
ret = disp_ops->set_mtu(NBL_DEV_MGT_TO_DISP_PRIV(dev_mgt),
dev_mgt->net_dev->vsi_id, mtu);
if (ret)
return ret;
dev_data->mtu = mtu;
return 0;
}
```
Note: The exact implementation depends on how the nbl driver manages Rx queue info and Rx function selection. The key requirements are:
- Verify frame size fits in mbuf or scatter is enabled
- Reselect Rx burst function if needed when port is started
---
Review-Result: ERROR
More information about the test-report
mailing list