mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-20 08:44:33 +00:00
Implement minimal set of changes suggested by bz to make
mxge no longer depend on INET.
This commit is contained in:
parent
5880b860f8
commit
eb6219e337
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=194743
|
@ -1207,12 +1207,12 @@ mwlboot.fw optional mwlfw \
|
|||
compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu" \
|
||||
no-obj no-implicit-rule \
|
||||
clean "mwlboot.fw"
|
||||
dev/mxge/if_mxge.c optional mxge pci inet
|
||||
dev/mxge/mxge_lro.c optional mxge pci inet
|
||||
dev/mxge/mxge_eth_z8e.c optional mxge pci inet
|
||||
dev/mxge/mxge_ethp_z8e.c optional mxge pci inet
|
||||
dev/mxge/mxge_rss_eth_z8e.c optional mxge pci inet
|
||||
dev/mxge/mxge_rss_ethp_z8e.c optional mxge pci inet
|
||||
dev/mxge/if_mxge.c optional mxge pci
|
||||
dev/mxge/mxge_lro.c optional mxge pci
|
||||
dev/mxge/mxge_eth_z8e.c optional mxge pci
|
||||
dev/mxge/mxge_ethp_z8e.c optional mxge pci
|
||||
dev/mxge/mxge_rss_eth_z8e.c optional mxge pci
|
||||
dev/mxge/mxge_rss_ethp_z8e.c optional mxge pci
|
||||
dev/my/if_my.c optional my
|
||||
dev/ncv/ncr53c500.c optional ncv
|
||||
dev/ncv/ncr53c500_pccard.c optional ncv pccard
|
||||
|
|
|
@ -89,6 +89,8 @@ __FBSDID("$FreeBSD$");
|
|||
#include <sys/buf_ring.h>
|
||||
#endif
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
/* tunable params */
|
||||
static int mxge_nvidia_ecrc_enable = 1;
|
||||
static int mxge_force_firmware = 0;
|
||||
|
@ -2408,10 +2410,13 @@ mxge_rx_csum(struct mbuf *m, int csum)
|
|||
if (__predict_false(ip->ip_p != IPPROTO_TCP &&
|
||||
ip->ip_p != IPPROTO_UDP))
|
||||
return 1;
|
||||
|
||||
#ifdef INET
|
||||
c = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
|
||||
htonl(ntohs(csum) + ntohs(ip->ip_len) +
|
||||
- (ip->ip_hl << 2) + ip->ip_p));
|
||||
#else
|
||||
c = 1;
|
||||
#endif
|
||||
c ^= 0xffff;
|
||||
return (c);
|
||||
}
|
||||
|
@ -2607,7 +2612,6 @@ static inline void
|
|||
mxge_clean_rx_done(struct mxge_slice_state *ss)
|
||||
{
|
||||
mxge_rx_done_t *rx_done = &ss->rx_done;
|
||||
struct lro_entry *lro;
|
||||
int limit = 0;
|
||||
uint16_t length;
|
||||
uint16_t checksum;
|
||||
|
@ -2628,11 +2632,13 @@ mxge_clean_rx_done(struct mxge_slice_state *ss)
|
|||
if (__predict_false(++limit > rx_done->mask / 2))
|
||||
break;
|
||||
}
|
||||
#ifdef INET
|
||||
while (!SLIST_EMPTY(&ss->lro_active)) {
|
||||
lro = SLIST_FIRST(&ss->lro_active);
|
||||
struct lro_entry *lro = SLIST_FIRST(&ss->lro_active);
|
||||
SLIST_REMOVE_HEAD(&ss->lro_active, next);
|
||||
mxge_lro_flush(ss, lro);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -4529,7 +4535,10 @@ mxge_attach(device_t dev)
|
|||
|
||||
ifp->if_baudrate = IF_Gbps(10UL);
|
||||
ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO4 |
|
||||
IFCAP_VLAN_MTU | IFCAP_LRO;
|
||||
IFCAP_VLAN_MTU;
|
||||
#ifdef INET
|
||||
ifp->if_capabilities |= IFCAP_LRO;
|
||||
#endif
|
||||
|
||||
#ifdef MXGE_NEW_VLAN_API
|
||||
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM;
|
||||
|
|
|
@ -54,6 +54,9 @@ __FBSDID("$FreeBSD$");
|
|||
#include <dev/mxge/mxge_mcp.h>
|
||||
#include <dev/mxge/if_mxge_var.h>
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
#ifdef INET
|
||||
|
||||
/* Assume len is a multiple of 4 */
|
||||
static uint16_t
|
||||
|
@ -340,6 +343,8 @@ mxge_lro_rx(struct mxge_slice_state *ss, struct mbuf *m_head, uint32_t csum)
|
|||
lro->m_tail = m_tail;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* INET */
|
||||
/*
|
||||
This file uses Myri10GE driver indentation.
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
.PATH: ${.CURDIR}/../../../dev/mxge
|
||||
|
||||
KMOD= if_mxge
|
||||
SRCS= if_mxge.c mxge_lro.c device_if.h bus_if.h pci_if.h
|
||||
SRCS= if_mxge.c mxge_lro.c device_if.h bus_if.h pci_if.h opt_inet.h
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
|
Loading…
Reference in a new issue