Changeset View
Changeset View
Standalone View
Standalone View
sys/net/iflib.h
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | typedef struct if_txrx { | ||||
void (*ift_txd_flush) (void *, uint16_t, qidx_t pidx); | void (*ift_txd_flush) (void *, uint16_t, qidx_t pidx); | ||||
int (*ift_txd_credits_update) (void *, uint16_t qsidx, bool clear); | int (*ift_txd_credits_update) (void *, uint16_t qsidx, bool clear); | ||||
int (*ift_rxd_available) (void *, uint16_t qsidx, qidx_t pidx, qidx_t budget); | int (*ift_rxd_available) (void *, uint16_t qsidx, qidx_t pidx, qidx_t budget); | ||||
int (*ift_rxd_pkt_get) (void *, if_rxd_info_t ri); | int (*ift_rxd_pkt_get) (void *, if_rxd_info_t ri); | ||||
void (*ift_rxd_refill) (void * , if_rxd_update_t iru); | void (*ift_rxd_refill) (void * , if_rxd_update_t iru); | ||||
void (*ift_rxd_flush) (void *, uint16_t qsidx, uint8_t flidx, qidx_t pidx); | void (*ift_rxd_flush) (void *, uint16_t qsidx, uint8_t flidx, qidx_t pidx); | ||||
int (*ift_legacy_intr) (void *); | int (*ift_legacy_intr) (void *); | ||||
qidx_t (*ift_txq_select) (void *, struct mbuf *); | |||||
} *if_txrx_t; | } *if_txrx_t; | ||||
typedef struct if_softc_ctx { | typedef struct if_softc_ctx { | ||||
int isc_vectors; | int isc_vectors; | ||||
int isc_nrxqsets; | int isc_nrxqsets; | ||||
int isc_ntxqsets; | int isc_ntxqsets; | ||||
uint16_t __spare0__; | uint16_t __spare0__; | ||||
uint32_t __spare1__; | uint32_t __spare1__; | ||||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | |||||
* interrupts instead of doing combined RX/TX processing. | * interrupts instead of doing combined RX/TX processing. | ||||
*/ | */ | ||||
#define IFLIB_SINGLE_IRQ_RX_ONLY 0x40000 | #define IFLIB_SINGLE_IRQ_RX_ONLY 0x40000 | ||||
/* | /* | ||||
* Don't need/want most of the niceties of | * Don't need/want most of the niceties of | ||||
* emulating ethernet | * emulating ethernet | ||||
*/ | */ | ||||
#define IFLIB_PSEUDO_ETHER 0x80000 | #define IFLIB_PSEUDO_ETHER 0x80000 | ||||
/* | /* | ||||
* Interface has an admin completion queue | * Interface has an admin completion queue | ||||
*/ | */ | ||||
#define IFLIB_HAS_ADMINCQ 0x100000 | #define IFLIB_HAS_ADMINCQ 0x100000 | ||||
/* | /* | ||||
* Interface needs to preserve TX ring indices across restarts. | * Interface needs to preserve TX ring indices across restarts. | ||||
*/ | */ | ||||
#define IFLIB_PRESERVE_TX_INDICES 0x200000 | #define IFLIB_PRESERVE_TX_INDICES 0x200000 | ||||
/* The following IFLIB_FEATURE_* defines are for driver modules to determine | |||||
* what features this version of iflib supports. They shall be defined to the | |||||
* first __FreeBSD_version that introduced the feature. | |||||
*/ | |||||
/* | |||||
* Driver can set its own TX queue selection function | |||||
* as ift_txq_select in struct if_txrx | |||||
*/ | |||||
kbowling: I guess we could bump the build version instead (including in the stable branches), that seems… | |||||
Done Inline ActionsYou mean __FreeBSD_version? Yeah, I'd be inclined to go with that approach: the kernel ABI is changing here, so we'd want to bump it to ensure that modules compiled against the old iflib are rejected. iflib.h can define symbolic feature names in terms of __FreeBSD_version to make drivers a bit neater. markj: You mean `__FreeBSD_version`? Yeah, I'd be inclined to go with that approach: the kernel ABI is… | |||||
Done Inline ActionsSo, then, something like bumping the _FreeBSD_version along with replacing the line above like: #define IFLIB_FEATURE_QUEUE_SELECT <the new __FreeBSD_version above> ? erj: So, then, something like bumping the _FreeBSD_version along with replacing the line above like… | |||||
Not Done Inline ActionsSure, and drivers could write #if __FreeBSD_version >= IFLIB_FEATURE_QUEUE_SELECT <tx queue selection code> #endif It'd be nice to have another iflib.h macro to wrap the comparison, so you can write #if IFLIB_HAS_FEATURE(QUEUE_SELECT) <tx queue selection code> #endif but of course drivers can't rely on IFLIB_HAS_FEATURE being defined. markj: Sure, and drivers could write
```
#if __FreeBSD_version >= IFLIB_FEATURE_QUEUE_SELECT
<tx… | |||||
#define IFLIB_FEATURE_QUEUE_SELECT 1400050 | |||||
/* | /* | ||||
* These enum values are used in iflib_needs_restart to indicate to iflib | * These enum values are used in iflib_needs_restart to indicate to iflib | ||||
* functions whether or not the interface needs restarting when certain events | * functions whether or not the interface needs restarting when certain events | ||||
* happen. | * happen. | ||||
*/ | */ | ||||
enum iflib_restart_event { | enum iflib_restart_event { | ||||
IFLIB_RESTART_VLAN_CONFIG, | IFLIB_RESTART_VLAN_CONFIG, | ||||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |
I guess we could bump the build version instead (including in the stable branches), that seems to be how openzfs does checks. @markj any advice here?