On 02/16/17 02:25, Giuseppe Lettieri wrote: > Hi all, > > the "Operation not permitted" is coming from iflib_netmap_register: > > ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); > ... > IFDI_INIT(ctx); // for igb it calls em_if_init() > ... > return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1); > > the last line is meant to check that the initialization was successful, > but em_if_init() is not setting IFF_DRV_RUNNING. > > Note that the iflib_netmap_register code, and the other netmap register > functions which it mimicks, have other issues: > > - in case of failure on NIOCREGIF, they leaves the NETMAP_ON flag set > even if the netmap data structures are deleted; > - the 1 was intended as a generic indication of failure, but it > translates to the rather confusing EPERM; > - they check IFF_DRV_RUNNING flag outside of the lock; I don't know it > this is safe or not. > > I can prepare a patch fixing these issues, but I don't know wether > em_if_init() is supposed to set the IFF_DRV_RUNNING flag or not. > > Cheers, > Giuseppe >
With IFLIB, em_if_init() should *not* set IFF_DRV_RUNNING, this should be done in sys/net/iflib.c Do you have an idea where you want to put this? sean
signature.asc
Description: OpenPGP digital signature