1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-18 15:30:21 +00:00

Allow drivers, such as cxgb and mxge, which support LRO to bypass

the MTU check in ether_input() on LRO merged frames.

Discussed with: kmacy
This commit is contained in:
Andrew Gallatin 2007-06-11 14:59:56 +00:00
parent 276edd10ac
commit b6af0abdc4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170560
3 changed files with 5 additions and 2 deletions

View File

@ -99,6 +99,7 @@ mxge_lro_flush(mxge_softc_t *mgp, struct lro_entry *lro)
CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
lro->m_head->m_pkthdr.csum_data = 0xffff;
lro->m_head->m_pkthdr.len = lro->len;
lro->m_head->m_flags |= M_LRO;
/* incorporate the latest ack into the tcp header */
tcp = (struct tcphdr *) (ip + 1);

View File

@ -542,7 +542,8 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
}
eh = mtod(m, struct ether_header *);
etype = ntohs(eh->ether_type);
if (m->m_pkthdr.len >
if ((m->m_flags & M_LRO) == 0 &&
m->m_pkthdr.len >
ETHER_MAX_FRAME(ifp, etype, m->m_flags & M_HASFCS)) {
if_printf(ifp, "discard oversize frame "
"(ether type %x flags %x len %u > max %lu)\n",

View File

@ -192,6 +192,7 @@ struct mbuf {
#define M_LASTFRAG 0x2000 /* packet is last fragment */
#define M_VLANTAG 0x10000 /* ether_vtag is valid */
#define M_PROMISC 0x20000 /* packet was not for us */
#define M_LRO 0x40000 /* packet is LRO merged and may exceed mtu */
/*
* External buffer types: identify ext_buf type.
@ -214,7 +215,7 @@ struct mbuf {
#define M_COPYFLAGS (M_PKTHDR|M_EOR|M_RDONLY|M_PROTO1|M_PROTO1|M_PROTO2|\
M_PROTO3|M_PROTO4|M_PROTO5|M_SKIP_FIREWALL|\
M_BCAST|M_MCAST|M_FRAG|M_FIRSTFRAG|M_LASTFRAG|\
M_VLANTAG|M_PROMISC)
M_VLANTAG|M_PROMISC|M_LRO)
/*
* Flags to purge when crossing layers.