Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_output.c
Show All 27 Lines | |||||
* | * | ||||
* @(#)ip_output.c 8.3 (Berkeley) 1/21/94 | * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include "opt_inet.h" | #include "opt_inet.h" | ||||
#include "opt_ratelimit.h" | |||||
#include "opt_ipsec.h" | #include "opt_ipsec.h" | ||||
#include "opt_mbuf_stress_test.h" | #include "opt_mbuf_stress_test.h" | ||||
#include "opt_mpath.h" | #include "opt_mpath.h" | ||||
#include "opt_route.h" | #include "opt_route.h" | ||||
#include "opt_sctp.h" | #include "opt_sctp.h" | ||||
#include "opt_rss.h" | #include "opt_rss.h" | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
▲ Show 20 Lines • Show All 598 Lines • ▼ Show 20 Lines | if (ip_len <= mtu || | ||||
if (!(flags & IP_FORWARDING) && ia) { | if (!(flags & IP_FORWARDING) && ia) { | ||||
if (m->m_pkthdr.csum_flags & CSUM_TSO) | if (m->m_pkthdr.csum_flags & CSUM_TSO) | ||||
counter_u64_add(ia->ia_ifa.ifa_opackets, | counter_u64_add(ia->ia_ifa.ifa_opackets, | ||||
m->m_pkthdr.len / m->m_pkthdr.tso_segsz); | m->m_pkthdr.len / m->m_pkthdr.tso_segsz); | ||||
else | else | ||||
counter_u64_add(ia->ia_ifa.ifa_opackets, 1); | counter_u64_add(ia->ia_ifa.ifa_opackets, 1); | ||||
counter_u64_add(ia->ia_ifa.ifa_obytes, m->m_pkthdr.len); | counter_u64_add(ia->ia_ifa.ifa_obytes, m->m_pkthdr.len); | ||||
} | } | ||||
jtl: I'm not convinced this is a good idea. Imagine you have a flow that is flopping between cards. | |||||
Done Inline ActionsWill be fixed. Please wait for updated patch. hselasky: Will be fixed. Please wait for updated patch. | |||||
#ifdef MBUF_STRESS_TEST | #ifdef MBUF_STRESS_TEST | ||||
if (mbuf_frag_size && m->m_pkthdr.len > mbuf_frag_size) | if (mbuf_frag_size && m->m_pkthdr.len > mbuf_frag_size) | ||||
m = m_fragment(m, M_NOWAIT, mbuf_frag_size); | m = m_fragment(m, M_NOWAIT, mbuf_frag_size); | ||||
#endif | #endif | ||||
/* | /* | ||||
* Reset layer specific mbuf flags | * Reset layer specific mbuf flags | ||||
* to avoid confusing lower layers. | * to avoid confusing lower layers. | ||||
*/ | */ | ||||
m_clrprotoflags(m); | m_clrprotoflags(m); | ||||
IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); | IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); | ||||
#ifdef RATELIMIT | |||||
if (ifp->if_capabilities & IFCAP_TXRTLMT) | |||||
in_pcboutput_txrtlmt(inp, ifp, m); | |||||
#endif | |||||
error = (*ifp->if_output)(ifp, m, | error = (*ifp->if_output)(ifp, m, | ||||
(const struct sockaddr *)gw, ro); | (const struct sockaddr *)gw, ro); | ||||
goto done; | goto done; | ||||
} | } | ||||
/* Balk when DF bit is set or the interface didn't support TSO. */ | /* Balk when DF bit is set or the interface didn't support TSO. */ | ||||
if ((ip_off & IP_DF) || (m->m_pkthdr.csum_flags & CSUM_TSO)) { | if ((ip_off & IP_DF) || (m->m_pkthdr.csum_flags & CSUM_TSO)) { | ||||
error = EMSGSIZE; | error = EMSGSIZE; | ||||
Show All 20 Lines | if (error == 0) { | ||||
} | } | ||||
/* | /* | ||||
* Reset layer specific mbuf flags | * Reset layer specific mbuf flags | ||||
* to avoid confusing upper layers. | * to avoid confusing upper layers. | ||||
*/ | */ | ||||
m_clrprotoflags(m); | m_clrprotoflags(m); | ||||
IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); | IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); | ||||
#ifdef RATELIMIT | |||||
if (ifp->if_capabilities & IFCAP_TXRTLMT) | |||||
in_pcboutput_txrtlmt(inp, ifp, m); | |||||
#endif | |||||
error = (*ifp->if_output)(ifp, m, | error = (*ifp->if_output)(ifp, m, | ||||
(const struct sockaddr *)gw, ro); | (const struct sockaddr *)gw, ro); | ||||
} else | } else | ||||
m_freem(m); | m_freem(m); | ||||
} | } | ||||
if (error == 0) | if (error == 0) | ||||
IPSTAT_INC(ips_fragmented); | IPSTAT_INC(ips_fragmented); | ||||
▲ Show 20 Lines • Show All 714 Lines • Show Last 20 Lines |
I'm not convinced this is a good idea. Imagine you have a flow that is flopping between cards. One card runs into a problem and won't allocate a ring ID. But, the flow then gets moved to a different card, which would allocate a ring ID... except, you don't ask because you just changed the pacing rate to 0.