On Mon, 16 Nov 2026 11:55:08 +0530
Gagandeep Singh <[email protected]> wrote:
> V4-Changes:
> - Fixed ol_fd leak issue.
> - Fixed the FQID hold be kernel issue.
> - removed the not required locks.
> - fixed unwanted line and memcpy issue.
> - We want to have rte_pmd_dpaa_ol_* functions, the reason we sent over
> the email.
Still some findings from AI review
Subject: Re: [PATCH v4 0/4] DPAA offline port, shared MAC name, cgrid cleanup
Series applies to main and builds at every commit (bus/dpaa,
mempool/dpaa, net/dpaa, -Dwerror=true). Patches 1 and 3 have no
findings.
Patch 2/4 drivers: add offline (O/H) port device support
---------------------------------------------------------
Warning: FQ info set in dev_start but only reset in dev_close.
dpaa_ol_dev_start() sends ASK_CTRL_SET_DPDK_INFO on every start;
dpaa_ol_dev_stop() only swaps the Tx burst. After stop the kernel
keeps steering frames into the Rx FQ using buffers from the DPDK
pool, and a stop/start cycle issues a second SET with no RESET in
between. Pair them: reset in stop, set in start.
static int dpaa_ol_reset_fq_info(struct dpaa_if *dpaa_intf)
{
struct ask_ctrl_dpdk_fq_info_s fq_info = { 0 };
int ret;
if (!dpaa_intf->ol_fq_info_set)
return 0;
fq_info.tx_fq_id = dpaa_intf->tx_queues[0].fqid;
fq_info.rx_fq_id = dpaa_intf->rx_queues[0].fqid;
ret = ask_reset_fq_info(dpaa_intf, &fq_info);
if (ret == 0)
dpaa_intf->ol_fq_info_set = false;
return ret;
}
static int dpaa_ol_dev_stop(struct rte_eth_dev *dev)
{
dev->tx_pkt_burst = dpaa_eth_tx_drop_all;
return dpaa_ol_reset_fq_info(dev->data->dev_private);
}
dpaa_oldev_queues_release() can then call the same helper.
Warning: received mbufs carry the wrong port id.
dpaa_eth_fd_to_mbuf() sets mbuf->port = dpaa_intf->ifid. ifid is
never set for the offline port, so it stays 0 from rte_zmalloc().
The oldev sorts after all ETH devices on the bus, so port 0 is
always some other port. Set it in dpaa_oldev_init():
dpaa_intf->ifid = eth_dev->data->port_id;
Info: struct ask_ctrl_dpdk_fq_info_s is an ioctl ABI shared with an
out-of-tree module, but it uses bool members, implicit padding and
no version check. The public rte_pmd_dpaa_*_s structs are passed
straight to the same ioctls, so their layout is now frozen by the
CDX module rather than by DPDK. Consider fixed-width types and a
version query at probe so a mismatched cdx module fails cleanly.
Patch 4/4 drivers: add DPAA cgrid cleanup support
-------------------------------------------------
Warning: stale FQ scan runs at close, after the CGRs have been in
use for the whole run.
If a stale FQ from a previous run still references a CGRID handed
out at probe, it is a member of this port's CGR from the moment
qman_create_cgr() runs; its frames count against the tail-drop
thresholds for the life of the port. Removing it at close is too
late. Do the scan in dpaa_dev_init() right after
qman_alloc_cgrid_range(), before any CGR is created:
ret = qman_alloc_cgrid_range(&cgrid[0], num_rx_fqs, 1, 0);
...
if (!dpaa_cgr_stale_fq_cleanup(eth_dev, cgrid[0],
num_rx_fqs, "rx")) {
ret = -EBUSY;
goto free_rx;
}
and the same for cgrid_tx. Close then only needs to shut down the
port's own FQs.
Warning: dpaa_cgr_stale_fq_cleanup() returns true when max_loop is
exhausted.
The comment says true means the range was fully scanned. If the
loop runs out after cgrid_num * DPAA_CGR_STALE_FQ_MAX shutdowns,
more stale FQs may remain, yet cgrid_ok stays true and the CGRIDs
are released while still referenced. Fall out of the loop with
false:
start_fqid = fqid + 1;
}
DPAA_PMD_WARN("%s: stale %s FQ limit reached",
dev->data->name, dir);
return false;
Info: qman_pending_fq_by_cgrid_range() walks every implemented
FQID with up to two management commands each, and close runs it
twice per port (Rx and Tx). With several ports this is a
noticeable stall on shutdown. If the scan moves to probe as
suggested, one combined pass over all of the port's CGRIDs (Rx
and Tx are both known by then) would halve it.