Changeset View
Changeset View
Standalone View
Standalone View
sys/netgraph/ng_one2many.c
Show First 20 Lines • Show All 445 Lines • ▼ Show 20 Lines | if (linkNum == NG_ONE2MANY_ONE_LINKNUM) { | ||||
case NG_ONE2MANY_XMIT_ROUNDROBIN: | case NG_ONE2MANY_XMIT_ROUNDROBIN: | ||||
dst = &priv->many[priv->activeMany[priv->nextMany]]; | dst = &priv->many[priv->activeMany[priv->nextMany]]; | ||||
priv->nextMany = (priv->nextMany + 1) % priv->numActiveMany; | priv->nextMany = (priv->nextMany + 1) % priv->numActiveMany; | ||||
break; | break; | ||||
case NG_ONE2MANY_XMIT_ALL: | case NG_ONE2MANY_XMIT_ALL: | ||||
/* no need to copy data for the 1st one */ | /* no need to copy data for the 1st one */ | ||||
dst = &priv->many[priv->activeMany[0]]; | dst = &priv->many[priv->activeMany[0]]; | ||||
/* make copies of data and send for all links | /* make modifiable copies of data and send for all | ||||
* except the first one, which we'll do last | * links except the first one, which we'll do last | ||||
*/ | */ | ||||
for (i = 1; i < priv->numActiveMany; i++) { | for (i = 1; i < priv->numActiveMany; i++) { | ||||
struct mbuf *m2; | struct mbuf *m2; | ||||
struct ng_one2many_link *mdst; | struct ng_one2many_link *mdst; | ||||
mdst = &priv->many[priv->activeMany[i]]; | mdst = &priv->many[priv->activeMany[i]]; | ||||
m2 = m_dup(m, M_NOWAIT); /* XXX m_copypacket() */ | m2 = m_dup(m, M_NOWAIT); | ||||
if (m2 == NULL) { | if (m2 == NULL) { | ||||
mdst->stats.memoryFailures++; | mdst->stats.memoryFailures++; | ||||
NG_FREE_ITEM(item); | NG_FREE_ITEM(item); | ||||
NG_FREE_M(m); | NG_FREE_M(m); | ||||
return (ENOBUFS); | return (ENOBUFS); | ||||
} | } | ||||
/* Update transmit stats */ | /* Update transmit stats */ | ||||
mdst->stats.xmitPackets++; | mdst->stats.xmitPackets++; | ||||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |