[PATCH] net/tap: Bug fix to populate fds in secondary process
Thomas Monjalon
thomas at monjalon.net
Mon Jan 17 19:33:43 CET 2022
17/01/2022 19:28, Ferruh Yigit:
> > + ret = rte_eth_dev_get_port_by_name(request_param->port_name, &port_id);
> > + if (ret) {
> > + TAP_LOG(ERR, "Failed to get port id for %s",
> > + request_param->port_name);
> > + return -1;
> > + }
> > + dev = &rte_eth_devices[port_id];
>
> Since this is not really related with your patch, I want to have a separate thread for it.
>
> It is not good to access the 'rte_eth_devices' global variable directly from a driver, that
> is error prone.
>
> Btw, what 'peer' supposed to contain?
>
> It can be solved by adding an internal API, only for drivers to get eth_dev from the name,
> like: 'rte_eth_dev_get_by_name()'.
> This way a few other usage can be converted to this API.
>
> @Thomas and @Andrew what do you think about the new API proposal?
It looks similar to rte_eth_dev_get_port_by_name() which returns a port_id.
It is a bit strange for an ethdev driver to not have access to its own ethdev struct.
Isn't there something broken in the logic?
More information about the dev
mailing list