DPDK patches and discussions
 help / color / mirror / Atom feed
* rte_devargs_parse
@ 2022-02-02 11:04 Dmitry Kozlyuk
  0 siblings, 0 replies; only message in thread
From: Dmitry Kozlyuk @ 2022-02-02 11:04 UTC (permalink / raw)
  To: dev

Hello,

/**
 * Parse a device string.
 *
 * Verify that a bus is capable of handling the device passed
 * in argument. Store which bus will handle the device, its name
 * and the eventual device parameters.
 *
 * [SNIP]
 *
 * @param da
 *   The devargs structure holding the device information.
 *
 * [SNIP]
 */
int rte_devargs_parse(struct rte_devargs *da, const char *dev);

It is unclear from this description that "da" is not only filled,
but also used as an input, and if it is not initialized
or at least zero-filled, the function will crash.
"Holding the device information" is not helpful,
because it doesn't say it's a pre- or post-condition,
or what must be filled on input (if everything, why parse at all?).
In test_devargs.c, test_valid_devargs_cases() zero-fills "da",
but test_invalid_devargs() does not, which is probably wrong.

Is the function intended to work this way?
What use case is covered by calling it with initialized "da"?


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-02 11:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 11:04 rte_devargs_parse Dmitry Kozlyuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).