From: Guillaume Nault <gnault@redhat.com>
To: "Drewek, Wojciech" <wojciech.drewek@intel.com>
Cc: Andrea Righi <andrea.righi@canonical.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Shuah Khan <shuah@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: selftests: net: l2tp.sh regression starting with 6.1-rc1
Date: Wed, 29 Mar 2023 17:26:28 +0200 [thread overview]
Message-ID: <ZCRYpDehyDxsrnfi@debian> (raw)
In-Reply-To: <MW4PR11MB57763144FE1BE9756FD3176BFD899@MW4PR11MB5776.namprd11.prod.outlook.com>
On Wed, Mar 29, 2023 at 02:16:37PM +0000, Drewek, Wojciech wrote:
> Hi,
>
> Modifying UAPI was not a good idea although the patch should not break userspace (related discussion [1]).
> We could revert this patch with one additional change (include l2tp.h in net/sched/cls_flower.c) but then again,
> modifying UAPI. This patch was mostly cosmetic anyway.
> Second option is to try to fix the automatic load. I'm not an expert but I think
> MODULE_ALIAS_NET_PF_PROTO macro is somehow responsible for that. I noticed some comments saying that
> "__stringify doesn't like enums" (this macro is using _stringify) and my patch defined IPPROTO_L2TP in enum.
> We can just replace IPPROTO_L2TP with 115 (where this macro is used) in order to fix this.
> I'm going to give it a try and will let you know.
Yes, the modules aliases now have symbolic names:
$ modinfo l2tp_ip l2tp_ip6 | grep alias
alias: net-pf-2-proto-IPPROTO_L2TP
alias: net-pf-2-proto-2-type-IPPROTO_L2TP
alias: net-pf-10-proto-IPPROTO_L2TP
alias: net-pf-10-proto-2-type-IPPROTO_L2TP
Therefore, 'request_module("net-pf-%d-proto-%d-type-%d")' can't find
them.
My personal preference is for the second option: fix module loading by
using plain numbers in MODULE_ALIAS_*. We can always keep the symbolic
names in comments.
---- >8 ----
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index 4db5a554bdbd..afe94a390ef0 100644
--- a/net/l2tp/l2tp_ip.c
+++ b/net/l2tp/l2tp_ip.c
@@ -680,5 +680,5 @@ MODULE_VERSION("1.0");
/* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
* enums
*/
-MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP);
-MODULE_ALIAS_NET_PF_PROTO(PF_INET, IPPROTO_L2TP);
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, 115 /* IPPROTO_L2TP */);
+MODULE_ALIAS_NET_PF_PROTO(PF_INET, 115 /* IPPROTO_L2TP */);
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c
index 2478aa60145f..65d106b41951 100644
--- a/net/l2tp/l2tp_ip6.c
+++ b/net/l2tp/l2tp_ip6.c
@@ -809,5 +809,5 @@ MODULE_VERSION("1.0");
/* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
* enums
*/
-MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
-MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, 115 /* IPPROTO_L2TP */);
+MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115 /* IPPROTO_L2TP */);
next prev parent reply other threads:[~2023-03-29 15:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-29 12:24 selftests: net: l2tp.sh regression starting with 6.1-rc1 Andrea Righi
2023-03-29 14:16 ` Drewek, Wojciech
2023-03-29 15:26 ` Guillaume Nault [this message]
2023-03-29 15:39 ` Drewek, Wojciech
2023-03-29 16:52 ` Guillaume Nault
2023-03-30 6:45 ` Andrea Righi
2023-03-30 9:26 ` Drewek, Wojciech
2023-03-30 9:56 ` Andrea Righi
2023-03-30 10:12 ` Drewek, Wojciech
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZCRYpDehyDxsrnfi@debian \
--to=gnault@redhat.com \
--cc=andrea.righi@canonical.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=wojciech.drewek@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox