All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] netlink: specs: mptcp: fix port endianness
@ 2024-09-11  9:10 Asbjørn Sloth Tønnesen
  2024-09-11 10:04 ` MPTCP CI
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Asbjørn Sloth Tønnesen @ 2024-09-11  9:10 UTC (permalink / raw)
  To: Matthieu Baerts, Mat Martineau
  Cc: Asbjørn Sloth Tønnesen, Geliang Tang, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Donald Hunter,
	Davide Caratti, netdev, mptcp, linux-kernel

The MPTCP port attribute is in host endianness, but was documented
as big-endian in the ynl specification.

Below are two examples from net/mptcp/pm_netlink.c showing that the
attribute is converted to/from host endianness for use with netlink.

Import from netlink:
  addr->port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]))

Export to netlink:
  nla_put_u16(skb, MPTCP_PM_ADDR_ATTR_PORT, ntohs(addr->port))

Where addr->port is defined as __be16.

No functional change intended.

Fixes: bc8aeb2045e2 ("Documentation: netlink: add a YAML spec for mptcp")
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
---
 Documentation/netlink/specs/mptcp_pm.yaml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Documentation/netlink/specs/mptcp_pm.yaml b/Documentation/netlink/specs/mptcp_pm.yaml
index af525ed29792..30d8342cacc8 100644
--- a/Documentation/netlink/specs/mptcp_pm.yaml
+++ b/Documentation/netlink/specs/mptcp_pm.yaml
@@ -109,7 +109,6 @@ attribute-sets:
       -
         name: port
         type: u16
-        byte-order: big-endian
       -
         name: flags
         type: u32
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net] netlink: specs: mptcp: fix port endianness
  2024-09-11  9:10 [PATCH net] netlink: specs: mptcp: fix port endianness Asbjørn Sloth Tønnesen
@ 2024-09-11 10:04 ` MPTCP CI
  2024-09-11 12:42 ` Davide Caratti
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: MPTCP CI @ 2024-09-11 10:04 UTC (permalink / raw)
  To: Asbjørn Sloth Tønnesen; +Cc: mptcp

Hi Asbjørn,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/10808837330

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/a918e18ee437
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=889241


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] netlink: specs: mptcp: fix port endianness
  2024-09-11  9:10 [PATCH net] netlink: specs: mptcp: fix port endianness Asbjørn Sloth Tønnesen
  2024-09-11 10:04 ` MPTCP CI
@ 2024-09-11 12:42 ` Davide Caratti
  2024-09-11 15:07 ` Matthieu Baerts
  2024-09-12  3:50 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Davide Caratti @ 2024-09-11 12:42 UTC (permalink / raw)
  To: Asbjørn Sloth Tønnesen
  Cc: Matthieu Baerts, Mat Martineau, Geliang Tang, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Donald Hunter, netdev,
	mptcp, linux-kernel

hello Asbjørn,

On Wed, Sep 11, 2024 at 09:10:02AM +0000, Asbjørn Sloth Tønnesen wrote:
> The MPTCP port attribute is in host endianness, but was documented
> as big-endian in the ynl specification.
> 
> Below are two examples from net/mptcp/pm_netlink.c showing that the
> attribute is converted to/from host endianness for use with netlink.
> 
> Import from netlink:
>   addr->port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]))
> 
> Export to netlink:
>   nla_put_u16(skb, MPTCP_PM_ADDR_ATTR_PORT, ntohs(addr->port))
> 
> Where addr->port is defined as __be16.
> 
> No functional change intended.
> 
> Fixes: bc8aeb2045e2 ("Documentation: netlink: add a YAML spec for mptcp")
> Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>

not sure why we are doing addresses in network byte order
and ports in host byte order for endpoints. But it's like this since the
very beginning, so this host ordering in spec is correct.

Reviewed-by: Davide Caratti <dcaratti@redhat.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] netlink: specs: mptcp: fix port endianness
  2024-09-11  9:10 [PATCH net] netlink: specs: mptcp: fix port endianness Asbjørn Sloth Tønnesen
  2024-09-11 10:04 ` MPTCP CI
  2024-09-11 12:42 ` Davide Caratti
@ 2024-09-11 15:07 ` Matthieu Baerts
  2024-09-12  3:50 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts @ 2024-09-11 15:07 UTC (permalink / raw)
  To: Asbjørn Sloth Tønnesen, Mat Martineau
  Cc: Geliang Tang, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Donald Hunter, Davide Caratti, netdev, mptcp,
	linux-kernel

Hi Asbjørn,

On 11/09/2024 11:10, Asbjørn Sloth Tønnesen wrote:
> The MPTCP port attribute is in host endianness, but was documented
> as big-endian in the ynl specification.
> 
> Below are two examples from net/mptcp/pm_netlink.c showing that the
> attribute is converted to/from host endianness for use with netlink.
> 
> Import from netlink:
>   addr->port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]))
> 
> Export to netlink:
>   nla_put_u16(skb, MPTCP_PM_ADDR_ATTR_PORT, ntohs(addr->port))
> 
> Where addr->port is defined as __be16.
> 
> No functional change intended.

Good catch. Indeed, this port attribute is supposed to be in host
endianness.

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

This patch can be applied in netdev directly.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] netlink: specs: mptcp: fix port endianness
  2024-09-11  9:10 [PATCH net] netlink: specs: mptcp: fix port endianness Asbjørn Sloth Tønnesen
                   ` (2 preceding siblings ...)
  2024-09-11 15:07 ` Matthieu Baerts
@ 2024-09-12  3:50 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-09-12  3:50 UTC (permalink / raw)
  To: =?utf-8?b?QXNiasO4cm4gU2xvdGggVMO4bm5lc2VuIDxhc3RAZmliZXJieS5uZXQ+?=
  Cc: matttbe, martineau, geliang, davem, edumazet, kuba, pabeni,
	donald.hunter, dcaratti, netdev, mptcp, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 11 Sep 2024 09:10:02 +0000 you wrote:
> The MPTCP port attribute is in host endianness, but was documented
> as big-endian in the ynl specification.
> 
> Below are two examples from net/mptcp/pm_netlink.c showing that the
> attribute is converted to/from host endianness for use with netlink.
> 
> Import from netlink:
>   addr->port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]))
> 
> [...]

Here is the summary with links:
  - [net] netlink: specs: mptcp: fix port endianness
    https://git.kernel.org/netdev/net/c/09a45a555379

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-09-12  3:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11  9:10 [PATCH net] netlink: specs: mptcp: fix port endianness Asbjørn Sloth Tønnesen
2024-09-11 10:04 ` MPTCP CI
2024-09-11 12:42 ` Davide Caratti
2024-09-11 15:07 ` Matthieu Baerts
2024-09-12  3:50 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.