Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Aug 2013 10:23:07 +0200
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        net@freebsd.org
Cc:        current@freebsd.org
Subject:   [net] protecting interfaces from races between control and data ?
Message-ID:  <20130805082307.GA35162@onelab2.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
i am slightly unclear of what mechanisms we use to prevent races
between interface being reconfigured (up/down/multicast setting, etc,
all causing reinitialization of the rx and tx rings) and

i) packets from the host stack being sent out;
ii) interrupts from the network card being processed.

I think in the old times IFF_DRV_RUNNING was used for this purpose,
but now it is not enough.
Acquiring the "core lock" in the NIC does not seem enough, either,
because newer drivers, especially multiqueue ones, have per-queue
rx and tx locks.

Does anyone know if there is a generic mechanism, or each driver
reimplements its own way ?

thanks
luigi



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