From: Stephen Hemminger <stephen@networkplumber.org>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v3 2/2] doc: add device hotplug documentation
Date: Wed, 25 Feb 2026 08:25:25 -0800 [thread overview]
Message-ID: <20260225082525.5fc3e0a2@phoenix.local> (raw)
In-Reply-To: <5906353fe6b1e388ce9bc44bf600bc94d2006e9d.1772020302.git.anatoly.burakov@intel.com>
On Wed, 25 Feb 2026 11:52:25 +0000
Anatoly Burakov <anatoly.burakov@intel.com> wrote:
> Currently, device hotplug is not documented except in API headers. Add
> documentation for device hotplug, both for user facing side of it, and a
> high level overview of its internal workings.
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>
> Notes:
> v2:
> - Removed "summary" section
>
> doc/guides/prog_guide/dev_args.rst | 3 +
> doc/guides/prog_guide/device_hotplug.rst | 286 +++++++++++++++++++++++
> doc/guides/prog_guide/index.rst | 1 +
> 3 files changed, 290 insertions(+)
> create mode 100644 doc/guides/prog_guide/device_hotplug.rst
This is great to see. It would be the flow from kernel to udev/systemd was explained.
If I remember right, mlx does this through another IB mechanism.
Also mention this is Linux only.
AI review is good at finding grammar and other things.
---
**Overall assessment:** This is a solid and welcome addition. Device hotplug has long needed proper documentation beyond the API headers. The structure is logical, the code examples are helpful, and the multi-process synchronization section is particularly well done. A few issues worth addressing:
**Technical issues:**
1. **`device_event_callback` return type mismatch (line 289):** The callback is declared as returning `int`, but `rte_dev_event_cb_fn` is typedef'd as returning `void`. This will cause a compiler warning/error if anyone copies this example verbatim. Should be `void` with no return statement.
2. **Missing error check on `rte_dev_probe()` (line 205):** The "Device Lifecycle Example" calls `rte_dev_probe(devargs)` without checking the return value, while the "Basic Usage" example above it correctly shows error handling. For a reference example demonstrating "proper device lifecycle management," this is inconsistent. Should check the return.
3. **`port_id` type (line 203):** `port_id` is declared as `unsigned` but `RTE_ETH_FOREACH_MATCHING_DEV` expects `uint16_t`. Should be `uint16_t port_id;`.
4. **`rte_eal_hotplug_add()`/`rte_eal_hotplug_remove()` deprecation status (line 179):** Are these functions deprecated or planned for deprecation in favor of `rte_dev_probe()`/`rte_dev_remove()`? If so, worth mentioning. If not, it might still be good to indicate which API is preferred for new code.
**Documentation nits:**
5. **Line 152:** "after the initial EAL initialization has completed" — consider noting that `rte_eal_init()` must have returned successfully, since that's the specific precondition.
6. **Line 224:** "to find newly attached port" → "to find the newly attached port"
7. **Line 232:** "In addition to providing generic hotplug infrastructure to be used in the above described manner" — a bit wordy. Consider: "In addition to the hotplug APIs described above, EAL also offers a device event infrastructure."
8. **Line 269:** "When ``RTE_DEV_EVENT_REMOVE`` event is delivered, the EAL has already released all internal resources associated with the device." — Is this accurate? My understanding is that the uevent notification tells the application the kernel removed the device, but it's still up to the application to call `rte_dev_remove()` to clean up EAL resources. If the EAL had already cleaned up, there'd be nothing for the application to do. Please double-check this claim.
9. **Line 412, nl_groups:** The doc says `nl_groups = 0xffffffff`. This is an implementation detail that could change and may be more confusing than helpful for users reading the prog guide. Consider dropping it or noting it's an implementation note.
**Structural:**
10. **Placement in index.rst:** The new page is added right after `dev_args` under "Device Libraries," which makes sense given the cross-references. Good.
11. **The "Implementation Details" section** (line 308 onward) switches from user-facing guidance to internal architecture. This is useful for contributors but might be better as a separate subsection with a note that it describes internals. Currently the document transitions from "here's how to use it" to "here's how it works internally" without much signaling.
**Minor:**
- Copyright says 2025 (line 142) — should be 2026 given the submission date.
next prev parent reply other threads:[~2026-02-25 16:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 12:13 [PATCH v1 1/2] doc: add devargs documentation Anatoly Burakov
2025-11-14 12:13 ` [PATCH v1 2/2] doc: add device hotplug documentation Anatoly Burakov
2025-11-30 15:44 ` [PATCH v1 1/2] doc: add devargs documentation Thomas Monjalon
2025-12-02 17:35 ` Burakov, Anatoly
2025-12-19 13:25 ` [PATCH v2 " Anatoly Burakov
2025-12-19 13:25 ` [PATCH v2 2/2] doc: add device hotplug documentation Anatoly Burakov
2025-12-19 14:01 ` Morten Brørup
2026-01-05 9:11 ` Burakov, Anatoly
2025-12-19 13:57 ` [PATCH v2 1/2] doc: add devargs documentation Bruce Richardson
2026-02-25 11:52 ` [PATCH v3 " Anatoly Burakov
2026-02-25 11:52 ` [PATCH v3 2/2] doc: add device hotplug documentation Anatoly Burakov
2026-02-25 16:25 ` Stephen Hemminger [this message]
2026-02-26 13:28 ` Burakov, Anatoly
2026-02-26 13:30 ` [PATCH v4 1/2] doc: add devargs documentation Anatoly Burakov
2026-02-26 13:30 ` [PATCH v4 2/2] doc: add device hotplug documentation Anatoly Burakov
2026-03-27 12:32 ` Mcnamara, John
2026-03-27 12:33 ` [PATCH v4 1/2] doc: add devargs documentation Mcnamara, John
2026-03-31 16:13 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260225082525.5fc3e0a2@phoenix.local \
--to=stephen@networkplumber.org \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.