Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F101955648
D41200.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D41200.diff
View Options
Index: sys/net/iflib.c
===================================================================
--- sys/net/iflib.c
+++ sys/net/iflib.c
@@ -2483,7 +2483,6 @@
static void
iflib_init_locked(if_ctx_t ctx)
{
- if_softc_ctx_t sctx = &ctx->ifc_softc_ctx;
if_softc_ctx_t scctx = &ctx->ifc_softc_ctx;
if_t ifp = ctx->ifc_ifp;
iflib_fl_t fl;
@@ -2500,20 +2499,7 @@
*/
netmap_disable_all_rings(ifp);
- tx_ip_csum_flags = scctx->isc_tx_csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP);
- tx_ip6_csum_flags = scctx->isc_tx_csum_flags & (CSUM_IP6_TCP | CSUM_IP6_UDP | CSUM_IP6_SCTP);
- /* Set hardware offload abilities */
- if_clearhwassist(ifp);
- if (if_getcapenable(ifp) & IFCAP_TXCSUM)
- if_sethwassistbits(ifp, tx_ip_csum_flags, 0);
- if (if_getcapenable(ifp) & IFCAP_TXCSUM_IPV6)
- if_sethwassistbits(ifp, tx_ip6_csum_flags, 0);
- if (if_getcapenable(ifp) & IFCAP_TSO4)
- if_sethwassistbits(ifp, CSUM_IP_TSO, 0);
- if (if_getcapenable(ifp) & IFCAP_TSO6)
- if_sethwassistbits(ifp, CSUM_IP6_TSO, 0);
-
- for (i = 0, txq = ctx->ifc_txqs; i < sctx->isc_ntxqsets; i++, txq++) {
+ for (i = 0, txq = ctx->ifc_txqs; i < scctx->isc_ntxqsets; i++, txq++) {
CALLOUT_LOCK(txq);
callout_stop(&txq->ift_timer);
#ifdef DEV_NETMAP
@@ -2534,8 +2520,22 @@
i = if_getdrvflags(ifp);
#endif
IFDI_INIT(ctx);
+
+ tx_ip_csum_flags = scctx->isc_tx_csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP);
+ tx_ip6_csum_flags = scctx->isc_tx_csum_flags & (CSUM_IP6_TCP | CSUM_IP6_UDP | CSUM_IP6_SCTP);
+ /* Set hardware offload abilities */
+ if_clearhwassist(ifp);
+ if (if_getcapenable(ifp) & IFCAP_TXCSUM)
+ if_sethwassistbits(ifp, tx_ip_csum_flags, 0);
+ if (if_getcapenable(ifp) & IFCAP_TXCSUM_IPV6)
+ if_sethwassistbits(ifp, tx_ip6_csum_flags, 0);
+ if (if_getcapenable(ifp) & IFCAP_TSO4)
+ if_sethwassistbits(ifp, CSUM_IP_TSO, 0);
+ if (if_getcapenable(ifp) & IFCAP_TSO6)
+ if_sethwassistbits(ifp, CSUM_IP6_TSO, 0);
+
MPASS(if_getdrvflags(ifp) == i);
- for (i = 0, rxq = ctx->ifc_rxqs; i < sctx->isc_nrxqsets; i++, rxq++) {
+ for (i = 0, rxq = ctx->ifc_rxqs; i < scctx->isc_nrxqsets; i++, rxq++) {
if (iflib_netmap_rxq_init(ctx, rxq) > 0) {
/* This rxq is in netmap mode. Skip normal init. */
continue;
@@ -2553,7 +2553,7 @@
if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE);
IFDI_INTR_ENABLE(ctx);
txq = ctx->ifc_txqs;
- for (i = 0; i < sctx->isc_ntxqsets; i++, txq++)
+ for (i = 0; i < scctx->isc_ntxqsets; i++, txq++)
callout_reset_on(&txq->ift_timer, iflib_timer_default, iflib_timer, txq,
txq->ift_timer.c_cpu);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 6:57 PM (17 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14498459
Default Alt Text
D41200.diff (2 KB)
Attached To
Mode
D41200: iflib: Move network stack capabilities after device driver init
Attached
Detach File
Event Timeline
Log In to Comment