On Tue, Jun 12, 2018 at 02:44:12PM +0000, Xueming(Steven) Li wrote:
<snip>
> > +   if (dpdk_dev->devargs) {
> > +           ret = rte_eth_devargs_parse(dpdk_dev->devargs->args, &eth_da);
> > +           if (ret)
> > +                   goto error;
> > +   } else {
> > +           memset(&eth_da, 0, sizeof(eth_da));
> > +   }
> >  next:
> > +   if (j) {
> > +           unsigned int k;
> > +
> > +           for (k = 0; k < eth_da.nb_representor_ports; ++k)
> > +                   if (eth_da.representor_ports[k] == j - 1)
> > +                           break;
> > +           if (k == eth_da.nb_representor_ports)
> > +                   goto skip;
> > +   }
> >     errno = 0;
> >     ctx = mlx5_glue->open_device(ibv_dev[j]);
> >     if (!ctx) {
> > @@ -1187,6 +1211,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
> >                     goto error;
> >             ++n;
> >     }
> > +skip:
> >     if (ibv_dev[++j])
> >             goto next;
> 
> int rte_eth_dev_attach(const char *devargs, uint16_t *port_id);
> The rte_eth_dev_attach api attach one device a time as only one *port_id 
> parameter.
> Dev argument "82:0.0,representer[a-b] will register multiple devices in one 
> call,
> is this correct behavior?

Yes, this is how the representor argument is documented and supposed to be
used. This probing approach is obviously not compatible with representors
hot-plugging, for which something will have to be devised if needed.

> I ask this because this caused testpmd CLI "port attach" 
> crash due to only the last registered port id returned.

I reproduced this crash and determined it is caused by a bug in
testpmd. I'll submit a separate fix for it.

-- 
Adrien Mazarguil
6WIND

Reply via email to