From 1dce924d2528107dd2c49bf68434bca3135b2fbf Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Thu, 17 Jan 2013 22:14:58 +0000 Subject: add some definition and driver changes in preparation for two upcoming features: semi-transparent mode: when a device is opened in this mode, the user program will be able to mark slots that must be forwarded to the "other" side (i.e. from NIC to host stack, or viceversa), and the forwarding will occur automatically at the next netmap syscall. This saves the need to open another file descriptor and do the forwarding manually. direct-forwarding mode: when operating with a VALE port, the user can specify in the slot the actual destination port, overriding the forwarding decision made by a lookup of the destination MAC. This can be useful to implement packet dispatchers. No API changes will be introduced. No new functionality in this patch yet. --- sys/dev/netmap/netmap_kern.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/dev/netmap/netmap_kern.h') diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index bb0d3faae7061..6b3e7ac93ce93 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -119,6 +119,10 @@ struct netmap_adapter; * RX rings: the next empty buffer (hwcur + hwavail + hwofs) coincides with * the next empty buffer as known by the hardware (next_to_check or so). * TX rings: hwcur + hwofs coincides with next_to_send + * + * For received packets, slot->flags is set to nkr_slot_flags + * so we can provide a proper initial value (e.g. set NS_FORWARD + * when operating in 'transparent' mode). */ struct netmap_kring { struct netmap_ring *ring; @@ -128,6 +132,7 @@ struct netmap_kring { #define NKR_PENDINTR 0x1 // Pending interrupt. u_int nkr_num_slots; + uint16_t nkr_slot_flags; /* initial value for flags */ int nkr_hwofs; /* offset between NIC and netmap ring */ struct netmap_adapter *na; NM_SELINFO_T si; /* poll/select wait queue */ -- cgit v1.3