Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_epair.c
Show First 20 Lines • Show All 435 Lines • ▼ Show 20 Lines | for (;;) { | ||||
DPRINTF("packet %s -> %s\n", ifp->if_xname, oifp->if_xname); | DPRINTF("packet %s -> %s\n", ifp->if_xname, oifp->if_xname); | ||||
/* | /* | ||||
* Add a reference so the interface cannot go while the | * Add a reference so the interface cannot go while the | ||||
* packet is in transit as we rely on rcvif to stay valid. | * packet is in transit as we rely on rcvif to stay valid. | ||||
*/ | */ | ||||
EPAIR_REFCOUNT_AQUIRE(&sc->refcount); | EPAIR_REFCOUNT_AQUIRE(&sc->refcount); | ||||
m->m_pkthdr.rcvif = oifp; | m->m_pkthdr.rcvif = oifp; | ||||
m_tag_delete_nonpersistent(m); | |||||
bz: Not sure if the other review we were discussion already has this but in my working branch I… | |||||
CURVNET_SET_QUIET(oifp->if_vnet); | CURVNET_SET_QUIET(oifp->if_vnet); | ||||
error = netisr_queue(NETISR_EPAIR, m); | error = netisr_queue(NETISR_EPAIR, m); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
if (!error) { | if (!error) { | ||||
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); | if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); | ||||
/* Someone else received the packet. */ | /* Someone else received the packet. */ | ||||
if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); | if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | if (!error) { | ||||
epair_start_locked(ifp); | epair_start_locked(ifp); | ||||
else | else | ||||
(void)epair_add_ifp_for_draining(ifp); | (void)epair_add_ifp_for_draining(ifp); | ||||
} | } | ||||
return (error); | return (error); | ||||
} | } | ||||
IF_UNLOCK(&ifp->if_snd); | IF_UNLOCK(&ifp->if_snd); | ||||
#endif | #endif | ||||
m_tag_delete_nonpersistent(m); | |||||
Not Done Inline ActionsGiven you do the same in epair_start_locked() can we move the call down after the if() block below to save us a tiny little work in an already pressing situation? bz: Given you do the same in epair_start_locked() can we move the call down after the if() block… | |||||
if ((epair_dpcpu->epair_drv_flags & IFF_DRV_OACTIVE) != 0) { | if ((epair_dpcpu->epair_drv_flags & IFF_DRV_OACTIVE) != 0) { | ||||
/* | /* | ||||
* Our hardware queue is full, try to fall back | * Our hardware queue is full, try to fall back | ||||
* queuing to the ifq but do not call ifp->if_start. | * queuing to the ifq but do not call ifp->if_start. | ||||
* Either we are lucky or the packet is gone. | * Either we are lucky or the packet is gone. | ||||
*/ | */ | ||||
IFQ_ENQUEUE(&ifp->if_snd, m, error); | IFQ_ENQUEUE(&ifp->if_snd, m, error); | ||||
▲ Show 20 Lines • Show All 500 Lines • Show Last 20 Lines |
Not sure if the other review we were discussion already has this but in my working branch I also have (note: the code looks different so the surroundings are different):
I don't think m_tag_delete_nonpersistent() takes send tags into account?