Date: Mon, 28 Feb 2022 15:12:58 +0800 From: Zhenlei Huang <zlei.huang@gmail.com> To: Santiago Martinez <sm@codenetworks.net> Cc: freebsd-net@freebsd.org Subject: Re: Current with RSS and EPAIR and without INET6. Message-ID: <0687A548-41D3-4D84-A83B-B2C0A87056BC@gmail.com> In-Reply-To: <5a7afbfc-586e-710d-f3af-c3ab92f1ae4e@codenetworks.net> References: <5a7afbfc-586e-710d-f3af-c3ab92f1ae4e@codenetworks.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
> On Feb 27, 2022, at 8:59 PM, Santiago Martinez <sm@codenetworks.net> wrote:
>
> Hi Everyone,
>
> While testing RSS and EPAIR I have find out that it is required to have kernel compiled with INET6 when enabling RSS+EPAIR.
>
> I usually remove everything that i do not use from the kernel, like SCTP and INET6, etc.
>
> After compiling with "option RSS" i noticed that iocage failed to start, checking the dmesg buffer clearly showed why.
>
> [321] link_elf_obj: symbol rss_soft_m2cpuid_v6 undefined
> [321] linker_load_file: /boot/kernel/if_epair.ko - unsupported file type
>
> I added two ifdef INET6 on the if_epair and solve the issue, still not sure if completely correct.
>
> Best regards.
>
> Santi
>
> diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c
> index 629de981d5b0..235e5098ebd8 100644
> --- a/sys/net/if_epair.c
> +++ b/sys/net/if_epair.c
> @@ -74,6 +74,8 @@ __FBSDID("$FreeBSD$");
> #ifdef RSS
> #include <net/rss_config.h>
> #include <netinet/in_rss.h>
> +#endif
> +#ifdef INET6
> #include <netinet6/in6_rss.h>
> #endif
>
The newly added ifdef should be wrapped around by RSS.
And also is "opt_inet6.h" header required?
And maybe ifdef INET is also required as someone need IPv4 only.
#ifdef RSS
#include <net/rss_config.h>
#include <netinet/in_rss.h>
+#ifdef INET6
#include <netinet6/in6_rss.h>
+#endif
#endif
> #include <net/vnet.h>
> @@ -220,9 +222,11 @@ epair_menq(struct mbuf *m, struct epair_softc *osc)
> case ETHERTYPE_IP:
> rss_soft_m2cpuid_v4(m, 0, &bucket);
> break;
> +#ifdef INET6
> case ETHERTYPE_IPV6:
> rss_soft_m2cpuid_v6(m, 0, &bucket);
> break;
> +#endif
> default:
> bucket = 0;
> break;
>
>
>
>
>
>
>
>
>
[-- Attachment #2 --]
<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 27, 2022, at 8:59 PM, Santiago Martinez <<a href="mailto:sm@codenetworks.net" class="">sm@codenetworks.net</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" class="">
<div class=""><p class="">Hi Everyone, <br class="">
</p><p class="">While testing RSS and EPAIR I have find out that it is required
to have kernel compiled with INET6 when enabling RSS+EPAIR.<br class="">
</p><p class="">I usually remove everything that i do not use from the kernel,
like SCTP and INET6, etc. <br class="">
</p><p class="">After compiling with "option RSS" i noticed that iocage failed to
start, checking the dmesg buffer clearly showed why.<br class="">
</p><p class=""><span style="font-family:monospace" class=""><span style="background-color: rgb(255, 255, 255);" class="">[321]
link_elf_obj: symbol rss_soft_m2cpuid_v6 undefined
</span><br class="">
[321] linker_load_file: /boot/kernel/if_epair.ko - unsupported
file type<br class="">
</span></p><p class=""><span style="font-family:monospace" class=""></span>I added two ifdef
INET6 on the if_epair and solve the issue, still not sure if
completely correct.<br class="">
</p><p class="">Best regards.</p><p class="">Santi</p><p class=""><span style="font-family:monospace" class=""><span style="font-weight: bold; background-color: rgb(255, 255, 255);" class="">diff
--git a/sys/net/if_epair.c b/sys/net/if_epair.c</span><span style="background-color: rgb(255, 255, 255);" class="">
</span><br class="">
<span style="font-weight: bold; background-color: rgb(255, 255, 255);" class="">index
629de981d5b0..235e5098ebd8 100644</span><span style="background-color: rgb(255, 255, 255);" class="">
</span><br class="">
<span style="font-weight: bold; background-color: rgb(255, 255, 255);" class="">---
a/sys/net/if_epair.c</span><span style="background-color: rgb(255, 255, 255);" class="">
</span><br class="">
<span style="font-weight: bold; background-color: rgb(255, 255, 255);" class="">+++
b/sys/net/if_epair.c</span><span style="background-color: rgb(255, 255, 255);" class="">
</span><br class="">
<span style="color:#18b2b2;background-color:#ffffff;" class="">@@ -74,6
+74,8 @@</span><span style="background-color: rgb(255, 255, 255);" class="">
__FBSDID("$FreeBSD$");
</span><br class="">
#ifdef RSS
<br class="">
#include <net/rss_config.h>
<br class="">
#include <netinet/in_rss.h>
<br class="">
<span style="color:#18b218;background-color:#ffffff;" class="">+#endif</span><span style="background-color: rgb(255, 255, 255);" class="">
</span><br class="">
<span style="color:#18b218;background-color:#ffffff;" class="">+#ifdef
INET6</span><span style="background-color: rgb(255, 255, 255);" class="">
</span><br class="">
#include <netinet6/in6_rss.h>
<br class="">
#endif
<br class=""></span></p></div></div></blockquote><div>The newly added ifdef should be wrapped around by RSS. </div><div>And also is "opt_inet6.h" header required?</div><div>And maybe <span class="">ifdef INET is also required as someone need IPv4 only.</span></div><span class=""><br class=""></span><div><font color="#a021df" face="Menlo" class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">#ifdef RSS<br class="">#include <net/rss_config.h><br class="">#include <netinet/in_rss.h></span></font><span style="font-family: monospace;" class=""> </span></div></div><div><div><span class="" style="font-family: monospace; color: rgb(24, 178, 24); background-color: rgb(255, 255, 255);">+#ifdef INET6</span><span class="" style="background-color: rgb(255, 255, 255);"><font face="monospace" class=""> </font><br class=""></span><font color="#a021df" face="Menlo" class="">#include <netinet6/in6_rss.h></font><font face="monospace" class=""> <br class=""></font><span class="" style="font-family: monospace; color: rgb(24, 178, 24); background-color: rgb(255, 255, 255);">+#endif</span><span class=""><font face="monospace" class=""><span style="background-color: rgb(255, 255, 255);" class=""> <br class=""></span></font></span><span class=""><font color="#a021df" face="Menlo" class="">#endif</font></span><span class="" style="font-family: monospace;"> </span></div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><p class=""><span style="font-family:monospace" class="">
#include <net/vnet.h>
<br class="">
<span style="color:#18b2b2;background-color:#ffffff;" class="">@@ -220,9
+222,11 @@</span><span style="background-color: rgb(255, 255, 255);" class="">
epair_menq(struct mbuf *m, struct epair_softc *osc)
</span><br class="">
case ETHERTYPE_IP:
<br class="">
rss_soft_m2cpuid_v4(m, 0, &bucket);
<br class="">
break;
<br class="">
<span style="color:#18b218;background-color:#ffffff;" class="">+#ifdef
INET6</span><span style="background-color: rgb(255, 255, 255);" class="">
</span><br class="">
case ETHERTYPE_IPV6:
<br class="">
rss_soft_m2cpuid_v6(m, 0, &bucket);
<br class="">
break;
<br class="">
<span style="color:#18b218;background-color:#ffffff;" class="">+#endif</span><span style="background-color: rgb(255, 255, 255);" class="">
</span><br class="">
default:
<br class="">
bucket = 0;
<br class="">
break;<br class="">
</span></p><p class=""><span style="font-family:monospace" class=""></span><br class="">
<span style="font-family:monospace" class=""></span></p><p class=""><br class="">
</p><p class=""><br class="">
</p>
<span style="font-family:monospace" class=""></span><p class=""><br class="">
<span style="font-family:monospace" class=""></span></p>
</div>
</div></blockquote></div><br class=""></body></html>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0687A548-41D3-4D84-A83B-B2C0A87056BC>
