diff options
| author | Vincenzo Maffione <vmaffione@FreeBSD.org> | 2019-02-02 22:39:29 +0000 |
|---|---|---|
| committer | Vincenzo Maffione <vmaffione@FreeBSD.org> | 2019-02-02 22:39:29 +0000 |
| commit | 5faab7782202ab1e6815c5da956d8997f59aa105 (patch) | |
| tree | 5e2550d3df987aa498d1fe373d6d99bf2a2968cf /sys/net/netmap.h | |
| parent | 769d56eccf62ada5443e8225abb7000875e77821 (diff) | |
Notes
Diffstat (limited to 'sys/net/netmap.h')
| -rw-r--r-- | sys/net/netmap.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/net/netmap.h b/sys/net/netmap.h index 098d369b07d6..bb38c748f840 100644 --- a/sys/net/netmap.h +++ b/sys/net/netmap.h @@ -540,7 +540,8 @@ enum { enum { /* On NETMAP_REQ_REGISTER, ask netmap to use memory allocated - * from user-space allocated memory pools (e.g. hugepages). */ + * from user-space allocated memory pools (e.g. hugepages). + */ NETMAP_REQ_OPT_EXTMEM = 1, /* ON NETMAP_REQ_SYNC_KLOOP_START, ask netmap to use eventfd-based @@ -551,8 +552,15 @@ enum { /* On NETMAP_REQ_REGISTER, ask netmap to work in CSB mode, where * head, cur and tail pointers are not exchanged through the * struct netmap_ring header, but rather using an user-provided - * memory area (see struct nm_csb_atok and struct nm_csb_ktoa). */ + * memory area (see struct nm_csb_atok and struct nm_csb_ktoa). + */ NETMAP_REQ_OPT_CSB, + + /* An extension to NETMAP_REQ_OPT_SYNC_KLOOP_EVENTFDS, which specifies + * if the TX and/or RX rings are synced in the context of the VM exit. + * This requires the 'ioeventfd' fields to be valid (cannot be < 0). + */ + NETMAP_REQ_OPT_SYNC_KLOOP_MODE, }; /* @@ -877,6 +885,12 @@ struct nmreq_opt_sync_kloop_eventfds { * their order must agree with the CSB arrays passed in the * NETMAP_REQ_OPT_CSB option. Each entry contains a file descriptor * backed by an eventfd. + * + * If any of the 'ioeventfd' entries is < 0, the event loop uses + * the sleeping synchronization strategy (according to sleep_us), + * and keeps kern_need_kick always disabled. + * Each 'irqfd' can be < 0, and in that case the corresponding queue + * is never notified. */ struct { /* Notifier for the application --> kernel loop direction. */ @@ -886,6 +900,13 @@ struct nmreq_opt_sync_kloop_eventfds { } eventfds[0]; }; +struct nmreq_opt_sync_kloop_mode { + struct nmreq_option nro_opt; /* common header */ +#define NM_OPT_SYNC_KLOOP_DIRECT_TX (1 << 0) +#define NM_OPT_SYNC_KLOOP_DIRECT_RX (1 << 1) + uint32_t mode; +}; + struct nmreq_opt_extmem { struct nmreq_option nro_opt; /* common header */ uint64_t nro_usrptr; /* (in) ptr to usr memory */ |
