if_sk and IFF_OACTIVE in general.

Peter Edwards peadar.edwards at gmail.com
Thu Nov 4 07:07:07 PST 2004


(Sorry for starting yet another if_sk thread, but this is a more
general issue with mpsafenet networking)

I have a general problem with the IF_OACTIVE flag handling that I
think might be related to some of the MP issues with if_sk.

ether_output_frame() queues an mbuf to the interface via
IFQ_HANDOFF->IFQ_HANDOFF_ADJ (in net/if_var.h)

This calls IF_ENQUEUE to actually queue the mbuf onto the if_snd
queue, and then calls "if_start()" if the interface is not IFF_OACTIVE.

I think the setting/clearing of the IFF_OACTIVE should probably be
protected: What's to stop the driver interrupt clearing this flag
between the test in IFQ_HANDOFF_ADJ and the call to if_start(),
leading to mbufs getting queued to the interface, but the interface
remaining idle.

Similar things can happen on a txeof interrupt: it probably needs to
protect the clearing of IFF_OACTIVE, and invoke the driver's start
routine if something gets queued to the driver when it isn't looking.


More information about the freebsd-current mailing list