1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00
freebsd/sys/dev/cxgb
Marko Zec 21ca7b57bd Change the curvnet variable from a global const struct vnet *,
previously always pointing to the default vnet context, to a
dynamically changing thread-local one.  The currvnet context
should be set on entry to networking code via CURVNET_SET() macros,
and reverted to previous state via CURVNET_RESTORE().  Recursions
on curvnet are permitted, though strongly discuouraged.

This change should have no functional impact on nooptions VIMAGE
kernel builds, where CURVNET_* macros expand to whitespace.

The curthread->td_vnet (aka curvnet) variable's purpose is to be an
indicator of the vnet context in which the current network-related
operation takes place, in case we cannot deduce the current vnet
context from any other source, such as by looking at mbuf's
m->m_pkthdr.rcvif->if_vnet, sockets's so->so_vnet etc.  Moreover, so
far curvnet has turned out to be an invaluable consistency checking
aid: it helps to catch cases when sockets, ifnets or any other
vnet-aware structures may have leaked from one vnet to another.

The exact placement of the CURVNET_SET() / CURVNET_RESTORE() macros
was a result of an empirical iterative process, whith an aim to
reduce recursions on CURVNET_SET() to a minimum, while still reducing
the scope of CURVNET_SET() to networking only operations - the
alternative would be calling CURVNET_SET() on each system call entry.
In general, curvnet has to be set in three typicall cases: when
processing socket-related requests from userspace or from within the
kernel; when processing inbound traffic flowing from device drivers
to upper layers of the networking stack, and when executing
timer-driven networking functions.

This change also introduces a DDB subcommand to show the list of all
vnet instances.

Approved by:	julian (mentor)
2009-05-05 10:56:12 +00:00
..
common Update the Chelsio driver to the latest bits from Chelsio 2009-03-10 19:22:45 +00:00
sys The pkthdr field is flowid not rss_hash 2008-12-02 00:51:56 +00:00
ulp Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
bin2h.pl Update the Chelsio driver to the latest bits from Chelsio 2009-03-10 19:22:45 +00:00
cxgb_adapter.h Update the Chelsio driver to the latest bits from Chelsio 2009-03-10 19:22:45 +00:00
cxgb_config.h Add backward compatibility ifdefs for non-multiq kernels 2008-11-23 07:30:07 +00:00
cxgb_include.h - Remove default NIC dependency on ulp headers 2008-09-24 01:19:08 +00:00
cxgb_ioctl.h Update the Chelsio driver to the latest bits from Chelsio 2009-03-10 19:22:45 +00:00
cxgb_main.c Minor updates to the Chelsio driver, including removing an LOR. 2009-03-23 19:58:26 +00:00
cxgb_multiq.c simplify by removing dead code 2009-04-27 22:54:30 +00:00
cxgb_offload.c Minor updates to the Chelsio driver, including removing an LOR. 2009-03-23 19:58:26 +00:00
cxgb_offload.h - Remove default NIC dependency on ulp headers 2008-09-24 01:19:08 +00:00
cxgb_osdep.h Add backward compatibility ifdefs for non-multiq kernels 2008-11-23 07:30:07 +00:00
cxgb_sge.c Import "flowid" support for serializing flows across transmit queues 2009-04-10 06:16:14 +00:00
cxgb_t3fw.c Update the Chelsio driver to the latest bits from Chelsio 2009-03-10 19:22:45 +00:00
cxgb_t3fw.h Update the Chelsio driver to the latest bits from Chelsio 2009-03-10 19:22:45 +00:00
t3b_protocol_sram.h
t3b_tp_eeprom.h
t3c_protocol_sram.h Update the Chelsio driver to the latest bits from Chelsio 2009-03-10 19:22:45 +00:00
t3c_tp_eeprom.h Update the Chelsio driver to the latest bits from Chelsio 2009-03-10 19:22:45 +00:00
t3cdev.h MFSVN: 2008-05-05 01:41:53 +00:00