Page MenuHomeFreeBSD

D13368.id36250.diff
No OneTemporary

D13368.id36250.diff

Index: sys/net/iflib.c
===================================================================
--- sys/net/iflib.c
+++ sys/net/iflib.c
@@ -2467,13 +2467,26 @@
}
#if defined(INET6) || defined(INET)
+static void
+iflib_get_ip_forwarding(struct lro_ctrl *lc, bool *v4, bool *v6)
+{
+ CURVNET_SET(lc->ifp->if_vnet);
+#if defined(INET6)
+ *v6 = VNET(ip6_forwarding);
+#endif
+#if defined(INET)
+ *v4 = VNET(ipforwarding);
+#endif
+ CURVNET_RESTORE();
+}
+
/*
* Returns true if it's possible this packet could be LROed.
* if it returns false, it is guaranteed that tcp_lro_rx()
* would not return zero.
*/
static bool
-iflib_check_lro_possible(struct lro_ctrl *lc, struct mbuf *m)
+iflib_check_lro_possible(struct mbuf *m, bool v4_forwarding, bool v6_forwarding)
{
struct ether_header *eh;
uint16_t eh_type;
@@ -2483,32 +2496,21 @@
switch (eh_type) {
#if defined(INET6)
case ETHERTYPE_IPV6:
- {
- CURVNET_SET(lc->ifp->if_vnet);
- if (VNET(ip6_forwarding) == 0) {
- CURVNET_RESTORE();
- return true;
- }
- CURVNET_RESTORE();
- break;
- }
+ return !v6_forwarding;
#endif
#if defined (INET)
case ETHERTYPE_IP:
- {
- CURVNET_SET(lc->ifp->if_vnet);
- if (VNET(ipforwarding) == 0) {
- CURVNET_RESTORE();
- return true;
- }
- CURVNET_RESTORE();
- break;
- }
+ return !v4_forwarding;
#endif
}
return false;
}
+#else
+static void
+iflib_get_ip_forwarding(struct lro_ctrl *lc __unused, bool *v4 __unused, bool *v6 __unused)
+{
+}
#endif
static bool
@@ -2525,6 +2527,7 @@
struct ifnet *ifp;
int lro_enabled;
bool lro_possible = false;
+ bool v4_forwarding, v6_forwarding;
/*
* XXX early demux data packets so that if_input processing only handles
@@ -2601,6 +2604,8 @@
__iflib_fl_refill_lt(ctx, fl, budget + 8);
lro_enabled = (if_getcapenable(ifp) & IFCAP_LRO);
+ if (lro_enabled)
+ iflib_get_ip_forwarding(&rxq->ifr_lc, &v4_forwarding, &v6_forwarding);
mt = mf = NULL;
while (mh != NULL) {
m = mh;
@@ -2615,7 +2620,7 @@
#if defined(INET6) || defined(INET)
if (lro_enabled) {
if (!lro_possible) {
- lro_possible = iflib_check_lro_possible(&rxq->ifr_lc, m);
+ lro_possible = iflib_check_lro_possible(m, v4_forwarding, v6_forwarding);
if (lro_possible && mf != NULL) {
ifp->if_input(ifp, mf);
DBG_COUNTER_INC(rx_if_input);

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 22, 2:48 AM (4 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31939533
Default Alt Text
D13368.id36250.diff (2 KB)

Event Timeline