[dpdk-dev] [PATCH v5 5/5] devargs: parse global device syntax
Xueming(Steven) Li
xuemingl at nvidia.com
Sun Oct 3 12:51:45 CEST 2021
On Tue, 2021-09-28 at 11:04 +0200, Thomas Monjalon wrote:
> 28/09/2021 10:29, David Marchand:
> > On Tue, Apr 13, 2021 at 5:15 AM Xueming Li <xuemingl at nvidia.com> wrote:
> > >
> > > When parsing a devargs, try to parse using the global device syntax
> > > first. Fallback on legacy syntax on error.
> > >
> > > Example of new global device syntax:
> > > -a bus=pci,addr=82:00.0/class=eth/driver=mlx5,dv_flow_en=1
> > >
> > > Signed-off-by: Xueming Li <xuemingl at nvidia.com>
> > > Reviewed-by: Gaetan Rivet <grive at u256.net>
> >
> > Starting with a virtio user port, I get a warning:
> >
> > # dpdk-testpmd --vdev
> > net_virtio_user0,iface=test,path=/dev/vhost-net,queues=1
> > --log-level=pmd.net.virtio.*:debug -- -i
> > ...
> > EAL: Unrecognized layer dev/vhost-net,queues=1
> > ...
> >
> > Am I doing something wrong?
> > If not, could you have a look?
>
> The new global syntax is using the slash / as separator.
> We should detect legit use of slash in a path.
> Here, the value starts with a slash so it should be easy to ignore.
> Another way is to consider slash only if followed by "class=" or "driver="
There is an assumption in the function rte_devargs_layers_parse():
* The last layer is free-form.
* The "driver" key is not required (but accepted).
For some case like "bus=x,k1=v1/class=y,k2=/some/path/k3=v3", "k3"
belongs to driver layer, this will confuse parser.
More information about the dev
mailing list