Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143417339
D31485.id93470.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31485.id93470.diff
View Options
Index: sys/net/iflib.h
===================================================================
--- sys/net/iflib.h
+++ sys/net/iflib.h
@@ -187,6 +187,7 @@
void (*ift_rxd_refill) (void * , if_rxd_update_t iru);
void (*ift_rxd_flush) (void *, uint16_t qsidx, uint8_t flidx, qidx_t pidx);
int (*ift_legacy_intr) (void *);
+ qidx_t (*ift_txq_select) (void *, struct mbuf *);
} *if_txrx_t;
typedef struct if_softc_ctx {
@@ -396,6 +397,15 @@
*/
#define IFLIB_PSEUDO_ETHER 0x80000
+/* XXX: These are for driver modules to determine what features
+ * this version of iflib supports
+ */
+/*
+ * Driver can set its own TX queue selection function
+ * as ift_txq_select in struct if_txrx
+ */
+#define IFLIB_FEATURE_QUEUE_SELECT 1
+
/*
* These enum values are used in iflib_needs_restart to indicate to iflib
* functions whether or not the interface needs restarting when certain events
Index: sys/net/iflib.c
===================================================================
--- sys/net/iflib.c
+++ sys/net/iflib.c
@@ -207,6 +207,7 @@
#define isc_rxd_refill ifc_txrx.ift_rxd_refill
#define isc_rxd_flush ifc_txrx.ift_rxd_flush
#define isc_legacy_intr ifc_txrx.ift_legacy_intr
+#define isc_txq_select ifc_txrx.ift_txq_select
eventhandler_tag ifc_vlan_attach_event;
eventhandler_tag ifc_vlan_detach_event;
struct ether_addr ifc_mac;
@@ -4108,11 +4109,14 @@
MPASS(m->m_nextpkt == NULL);
/* ALTQ-enabled interfaces always use queue 0. */
qidx = 0;
- if ((NTXQSETS(ctx) > 1) && M_HASHTYPE_GET(m) && !ALTQ_IS_ENABLED(&ifp->if_snd))
+ /* Use driver-supplied queue selection method if it exists */
+ if (ctx->isc_txq_select)
+ qidx = ctx->isc_txq_select(ctx->ifc_softc, m);
+ /* If not, use iflib's standard method */
+ else if ((NTXQSETS(ctx) > 1) && M_HASHTYPE_GET(m) && !ALTQ_IS_ENABLED(&ifp->if_snd))
qidx = QIDX(ctx, m);
- /*
- * XXX calculate buf_ring based on flowid (divvy up bits?)
- */
+
+ /* Set TX queue */
txq = &ctx->ifc_txqs[qidx];
#ifdef DRIVER_BACKPRESSURE
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 31, 5:38 AM (1 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28108967
Default Alt Text
D31485.id93470.diff (1 KB)
Attached To
Mode
D31485: iflib: Allow drivers to determine which queue to TX on
Attached
Detach File
Event Timeline
Log In to Comment