Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2013 22:24:30 +0100
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        net@freebsd.org
Cc:        jfv@freebsd.org
Subject:   IFF_DRV_OACTIVE handling in *_stop() for intel nic drivers ?
Message-ID:  <20131213212430.GA80282@onelab2.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
I am trying to make sense of what is the intended handling of
if_drv_flags in the *_stop() and *_init() routines for the
intel nic drivers and i see three different patterns (below).
I think the correct one is ixgbe.c which leaves IFF_DRV_OACTIVE alone,
although one could argue that IFF_DRV_OACTIVE should be cleaned
up just in case (as done in if_lem.c).
What really seems wrong is setting the flag in the _stop()
function as it is done in if_em.c and if_igb.c .

So which one should we pick ?

cheers
luigi

if_lem.c
    lem_stop()
	...
	/* Tell the stack that the interface is no longer active */
	ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);

    lem_init_locked()
	... (near the end)
	ifp->if_drv_flags |= IFF_DRV_RUNNING;
        ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;


if_em.c
    em_stop()
	...
	/* Tell the stack that the interface is no longer active */
        ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
        ifp->if_drv_flags |= IFF_DRV_OACTIVE;

    em_init_locked()
	... (near the end)
	/* Set the interface as ACTIVE */
        ifp->if_drv_flags |= IFF_DRV_RUNNING;
        ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;

if_igb.c
    igb_stop()
	...
	/* Tell the stack that the interface is no longer active */
        ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
        ifp->if_drv_flags |= IFF_DRV_OACTIVE;

    igb_init_locked()
	... (near the end)
	ifp->if_drv_flags |= IFF_DRV_RUNNING;
	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;

ixgbe.c
    ixgbe_stop()
	...
	/* Let the stack know...*/
        ifp->if_drv_flags &= ~IFF_DRV_RUNNING;

    ixgbe_init_locked()
	... (at the very end)
	/* Now inform the stack we're ready */
        ifp->if_drv_flags |= IFF_DRV_RUNNING;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131213212430.GA80282>