mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 12:48:33 -10:00
hn: Invoke the owned VF's transmit queue flush callback
The generic if_qflush() only clears if_snd. Calling it directly for a transparent VF bypasses the driver's callback and its private software transmit queues. Add if_getqflushfn(), matching the existing callback accessors, and invoke the registered callback while hn_vf_lock protects the VF pointer. Flush an attached VF whenever transparent mode owns it, not only while the VF datapath is enabled. Disabling transmit during handoff does not discard packets already queued to the VF. This also covers the inactive interval after fallback. Non-transparent VFs remain independently owned and are not flushed by hn. Synthetic queue flushing is unchanged. MFC after: 2 weeks Sponsored by: BBOX.io
This commit is contained in:
1 parent
6b3b1d6d4f
commit
8e816fc2e9
3 files changed
+10
-2
No files matched your search
@@ -6240,8 +6240,9 @@ hn_xmit_qflush(if_t ifp)
|
||||
if_qflush(ifp);
|
||||
|
||||
rm_rlock(&sc->hn_vf_lock, &pt);
|
||||
if (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED)
|
||||
if_qflush(sc->hn_vf_ifp);
|
||||
/* Transparent mode owns the VF's queues even while switching paths. */
|
||||
if (hn_xpnt_vf && sc->hn_vf_ifp != NULL)
|
||||
if_getqflushfn(sc->hn_vf_ifp)(sc->hn_vf_ifp);
|
||||
rm_runlock(&sc->hn_vf_lock, &pt);
|
||||
}
|
||||
|
||||
|
||||
@@ -5087,6 +5087,12 @@ if_setqflushfn(if_t ifp, if_qflush_fn_t flush_fn)
|
||||
ifp->if_qflush = flush_fn;
|
||||
}
|
||||
|
||||
if_qflush_fn_t
|
||||
if_getqflushfn(if_t ifp)
|
||||
{
|
||||
return (ifp->if_qflush);
|
||||
}
|
||||
|
||||
void
|
||||
if_setsndtagallocfn(if_t ifp, if_snd_tag_alloc_t alloc_fn)
|
||||
{
|
||||
|
||||
@@ -738,6 +738,7 @@ if_start_fn_t if_getstartfn(if_t ifp);
|
||||
void if_settransmitfn(if_t ifp, if_transmit_fn_t);
|
||||
if_transmit_fn_t if_gettransmitfn(if_t ifp);
|
||||
void if_setqflushfn(if_t ifp, if_qflush_fn_t);
|
||||
if_qflush_fn_t if_getqflushfn(if_t ifp);
|
||||
void if_setgetcounterfn(if_t ifp, if_get_counter_t);
|
||||
void if_setsndtagallocfn(if_t ifp, if_snd_tag_alloc_t);
|
||||
void if_setdebugnet_methods(if_t, struct debugnet_methods *);
|
||||
|
||||
Reference in new issue
Block a user