Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/netmap/netmap_generic.c
Show First 20 Lines • Show All 831 Lines • ▼ Show 20 Lines | generic_rx_handler(struct ifnet *ifp, struct mbuf *m) | ||||
/* limit the size of the queue */ | /* limit the size of the queue */ | ||||
if (unlikely(!gna->rxsg && MBUF_LEN(m) > NETMAP_BUF_SIZE(na))) { | if (unlikely(!gna->rxsg && MBUF_LEN(m) > NETMAP_BUF_SIZE(na))) { | ||||
/* This may happen when GRO/LRO features are enabled for | /* This may happen when GRO/LRO features are enabled for | ||||
* the NIC driver when the generic adapter does not | * the NIC driver when the generic adapter does not | ||||
* support RX scatter-gather. */ | * support RX scatter-gather. */ | ||||
nm_prlim(2, "Warning: driver pushed up big packet " | nm_prlim(2, "Warning: driver pushed up big packet " | ||||
"(size=%d)", (int)MBUF_LEN(m)); | "(size=%d)", (int)MBUF_LEN(m)); | ||||
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); | |||||
m_freem(m); | m_freem(m); | ||||
} else if (unlikely(mbq_len(&kring->rx_queue) > na->num_rx_desc)) { | } else if (unlikely(mbq_len(&kring->rx_queue) > na->num_rx_desc)) { | ||||
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); | |||||
m_freem(m); | m_freem(m); | ||||
} else { | } else { | ||||
mbq_safe_enqueue(&kring->rx_queue, m); | mbq_safe_enqueue(&kring->rx_queue, m); | ||||
} | } | ||||
if (netmap_generic_mit < 32768) { | if (netmap_generic_mit < 32768) { | ||||
/* no rx mitigation, pass notification up */ | /* no rx mitigation, pass notification up */ | ||||
netmap_generic_irq(na, r, &work_done); | netmap_generic_irq(na, r, &work_done); | ||||
▲ Show 20 Lines • Show All 289 Lines • Show Last 20 Lines |