[dpdk-dev] [PATCH v1 2/2] pci: explain how empty strings are rejected in DBDF
Stojaczyk, Dariusz
dariusz.stojaczyk at intel.com
Thu May 14 10:53:22 CEST 2020
> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Gaetan Rivet
> Sent: Wednesday, May 13, 2020 12:48 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v1 2/2] pci: explain how empty strings are rejected
> in DBDF
>
> Empty strings are forbidden as input to rte_pci_addr_parse().
> It is explicitly enforced in BDF parsing as parsing the bus
> field will immediately fail. The related check is commented.
>
> It is implicitly enforced in DBDF parsing, as the domain would be
> parsed to 0 without error, but the check `end[0] != ':'` afterward
> will return -EINVAL.
>
> Enforcing consistency between parsers by reading the code is not helped
> by this property being implicit. Add a comment to explain.
>
> Signed-off-by: Gaetan Rivet <grive at u256.net>
> ---
Acked-by: Darek Stojaczyk <dariusz.stojaczyk at intel.com>
More information about the dev
mailing list