1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Make compile without INET or without IP support in the kernel by hiding

variables and lro function calls behind approriate #ifdefs.

Also move the #includes for "opt_*" to the place where they should be.
This commit is contained in:
Bjoern A. Zeeb 2016-05-18 14:18:03 +00:00
parent e530e62312
commit aaeb188af3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=300147

View File

@ -28,6 +28,10 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_acpi.h"
#include <sys/param.h>
#include <sys/types.h>
#include <sys/bus.h>
@ -77,11 +81,6 @@ __FBSDID("$FreeBSD$");
#include <net/iflib.h>
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_acpi.h"
#include "ifdi_if.h"
#if defined(__i386__) || defined(__amd64__)
@ -2158,8 +2157,10 @@ iflib_rxeof(iflib_rxq_t rxq, int budget)
m->m_nextpkt = NULL;
rx_bytes += m->m_pkthdr.len;
rx_pkts++;
#if defined(INET6) || defined(INET)
if (lro_enabled && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0)
continue;
#endif
DBG_COUNTER_INC(rx_if_input);
ifp->if_input(ifp, m);
}
@ -2171,7 +2172,9 @@ iflib_rxeof(iflib_rxq_t rxq, int budget)
*/
while ((queued = LIST_FIRST(&rxq->ifr_lc.lro_active)) != NULL) {
LIST_REMOVE(queued, next);
#if defined(INET6) || defined(INET)
tcp_lro_flush(&rxq->ifr_lc, queued);
#endif
}
return (iflib_rxd_avail(ctx, rxq, *cidxp));
}
@ -2232,7 +2235,7 @@ static int
iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, struct mbuf **mp)
{
struct ether_vlan_header *eh;
struct mbuf *m, *n;
struct mbuf *m;
m = *mp;
/*
@ -2260,6 +2263,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, struct mbuf **mp)
{
struct ip *ip = NULL;
struct tcphdr *th = NULL;
struct mbuf *n;
int minthlen;
minthlen = min(m->m_pkthdr.len, pi->ipi_ehdrlen + sizeof(*ip) + sizeof(*th));
@ -4085,9 +4089,13 @@ static int
iflib_rx_structures_setup(if_ctx_t ctx)
{
iflib_rxq_t rxq = ctx->ifc_rxqs;
int i, q, err;
int q;
#if defined(INET6) || defined(INET)
int i, err;
#endif
for (q = 0; q < ctx->ifc_softc_ctx.isc_nrxqsets; q++, rxq++) {
#if defined(INET6) || defined(INET)
tcp_lro_free(&rxq->ifr_lc);
if ((err = tcp_lro_init(&rxq->ifr_lc)) != 0) {
device_printf(ctx->ifc_dev, "LRO Initialization failed!\n");
@ -4095,9 +4103,11 @@ iflib_rx_structures_setup(if_ctx_t ctx)
}
rxq->ifr_lro_enabled = TRUE;
rxq->ifr_lc.ifp = ctx->ifc_ifp;
#endif
IFDI_RXQ_SETUP(ctx, rxq->ifr_id);
}
return (0);
#if defined(INET6) || defined(INET)
fail:
/*
* Free RX software descriptors allocated so far, we will only handle
@ -4110,6 +4120,7 @@ iflib_rx_structures_setup(if_ctx_t ctx)
rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0;
}
return (err);
#endif
}
/*********************************************************************