if_epair: fix build with RSS and INET or INET6 disabled

Reviewed by:	kp
MFC after:	1 week
This commit is contained in:
Santiago Martinez 2022-03-03 10:44:43 +01:00 committed by Kristof Provost
parent afb08a6d07
commit 52bcdc5b80
2 changed files with 11 additions and 1 deletions

View File

@ -3,6 +3,6 @@
.PATH: ${SRCTOP}/sys/net
KMOD= if_epair
SRCS= bus_if.h device_if.h if_epair.c
SRCS= bus_if.h device_if.h if_epair.c opt_rss.h opt_inet.h opt_inet6.h
.include <bsd.kmod.mk>

View File

@ -41,6 +41,8 @@
__FBSDID("$FreeBSD$");
#include "opt_rss.h"
#include "opt_inet.h"
#include "opt_inet6.h"
#include <sys/param.h>
#include <sys/hash.h>
@ -73,9 +75,13 @@ __FBSDID("$FreeBSD$");
#include <net/netisr.h>
#ifdef RSS
#include <net/rss_config.h>
#ifdef INET
#include <netinet/in_rss.h>
#endif
#ifdef INET6
#include <netinet6/in6_rss.h>
#endif
#endif
#include <net/vnet.h>
static int epair_clone_match(struct if_clone *, const char *);
@ -217,12 +223,16 @@ epair_menq(struct mbuf *m, struct epair_softc *osc)
eh = mtod(m, struct ether_header *);
switch (ntohs(eh->ether_type)) {
#ifdef INET
case ETHERTYPE_IP:
rss_soft_m2cpuid_v4(m, 0, &bucket);
break;
#endif
#ifdef INET6
case ETHERTYPE_IPV6:
rss_soft_m2cpuid_v6(m, 0, &bucket);
break;
#endif
default:
bucket = 0;
break;