Date: Thu, 31 Oct 2019 04:30:23 +0000 From: k simon <moremore2@outlook.com> To: =?gb2312?B?T2xpdmllciBDb2NoYXJkLUxhYmKopg==?= <olivier@freebsd.org> Cc: "Andrey V. Elsukov" <bu7cher@yandex.ru>, "freebsd-net@freebsd.org" <freebsd-net@freebsd.org> Subject: Re: How to disable tryforward ? Message-ID: <HK0PR03MB320210AA84AC67A6713452F0EE630@HK0PR03MB3202.apcprd03.prod.outlook.com> In-Reply-To: <CA%2Bq%2BTcpZ-uRJqWG-uiQmuM1VOBokt8tbix4ifrnMyWw9VdaqHg@mail.gmail.com> References: <HK0PR03MB32026778B9D469798DBF9326EE680@HK0PR03MB3202.apcprd03.prod.outlook.com> <aa7a2050-1635-d68e-fb6f-62663156be84@yandex.ru> <SG2PR03MB3212D9A495D60161DBA66C02EE640@SG2PR03MB3212.apcprd03.prod.outlook.com> <HK0PR03MB32028CD2E125294DB0A4F641EE600@HK0PR03MB3202.apcprd03.prod.outlook.com> <CA%2Bq%2BTcpZ-uRJqWG-uiQmuM1VOBokt8tbix4ifrnMyWw9VdaqHg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, Olivier,
This patch should fix ECMP forwarding as a workaround. I’ve added the “fastforwarding” sysctl knob back and set it’s default value to “1”. Value “0” would disable tryforward(). Maybe the right way is replaced fib4_lookup_nh_basic() with fib4_lookup_nh_ext() in ip_fastfwd.c, but I’m not familiar with it.
--- ip_input.c.orig 2019-10-26 20:33:21.468834000 +0800
+++ ip_input.c 2019-10-31 08:01:42.938504000 +0800
@@ -37,6 +37,7 @@
#include "opt_bootp.h"
#include "opt_ipstealth.h"
#include "opt_ipsec.h"
+#include "opt_mpath.h"
#include "opt_route.h"
#include "opt_rss.h"
@@ -64,6 +65,9 @@
#include <net/if_dl.h>
#include <net/route.h>
#include <net/netisr.h>
+#ifdef RADIX_MPATH
+#include <net/radix_mpath.h>
+#endif
#include <net/rss_config.h>
#include <net/vnet.h>
@@ -115,6 +119,11 @@
&VNET_NAME(ipsendredirects), 0,
"Enable sending IP redirects");
+VNET_DEFINE_STATIC(int, ipfastforward_active) = 1;
+#define V_ipfastforward_active VNET(ipfastforward_active)
+SYSCTL_INT(_net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_VNET | CTLFLAG_RW,
+ &VNET_NAME(ipfastforward_active), 0, "Enable fast IP forwarding");
+
/*
* XXX - Setting ip_checkinterface mostly implements the receive side of
* the Strong ES model described in RFC 1122, but since the routing table
@@ -566,7 +575,7 @@
* case skip another inbound firewall processing and update
* ip pointer.
*/
- if (V_ipforwarding != 0 && V_ipsendredirects == 0
+ if (V_ipforwarding != 0 && V_ipsendredirects == 0 && V_ipfastforward_active != 0
#if defined(IPSEC) || defined(IPSEC_SUPPORT)
&& (!IPSEC_ENABLED(ipv4) ||
IPSEC_CAPS(ipv4, m, IPSEC_CAP_OPERABLE) == 0)
Simon Ke
20191031
在 2019年10月31日,00:33,Olivier Cochard-Labbé <olivier@freebsd.org<mailto:olivier@freebsd.org>> 写道:
On Wed, Oct 30, 2019 at 9:44 AM k simon <moremore2@outlook.com<mailto:moremore2@outlook.com>> wrote:
Hi, Andrey,
OK, I’ve got it. Radix_mpath.h file is not included in input.c. Maybe someone can fix and commit it. Thanks for your reply!
But does including this header file enough to fix ECMP forwarding ?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?HK0PR03MB320210AA84AC67A6713452F0EE630>
