All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] sock diag uAPI and MPTCP
@ 2020-06-19 10:54 ` Paolo Abeni
  0 siblings, 0 replies; 6+ messages in thread
From: Paolo Abeni @ 2020-06-19 10:54 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

Hi,

IPPROTO_MPTCP value (0x106) can't be represented using the current sock
diag uAPI, as the 'sdiag_protocol' field is 8 bits wide.

To implement diag support for MPTCP socket, we will likely need a
'inet_diag_req_v3' with a wider 'sdiag_protocol'
field. inet_diag_handler_cmd() could detect the version of
the inet_diag_req_v* provided by user-space checking nlmsg_len() and
convert _v2 reqs to _v3.

This change will be a bit invasive, as all in kernel diag users will
then operate only on 'inet_diag_req_v3' (many functions' signature
change required), but the code-related changes will be encapsulated
by inet_diag_handler_cmd().

Would the above be acceptable?

Thanks for any feedback!

Paolo

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

* sock diag uAPI and MPTCP
@ 2020-06-19 10:54 ` Paolo Abeni
  0 siblings, 0 replies; 6+ messages in thread
From: Paolo Abeni @ 2020-06-19 10:54 UTC (permalink / raw)
  To: Eric Dumazet, David Miller; +Cc: netdev, mptcp

Hi,

IPPROTO_MPTCP value (0x106) can't be represented using the current sock
diag uAPI, as the 'sdiag_protocol' field is 8 bits wide.

To implement diag support for MPTCP socket, we will likely need a
'inet_diag_req_v3' with a wider 'sdiag_protocol'
field. inet_diag_handler_cmd() could detect the version of
the inet_diag_req_v* provided by user-space checking nlmsg_len() and
convert _v2 reqs to _v3.

This change will be a bit invasive, as all in kernel diag users will
then operate only on 'inet_diag_req_v3' (many functions' signature
change required), but the code-related changes will be encapsulated
by inet_diag_handler_cmd().

Would the above be acceptable?

Thanks for any feedback!

Paolo


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

* [MPTCP] Re: sock diag uAPI and MPTCP
  2020-06-19 10:54 ` Paolo Abeni
@ 2020-06-21  0:44 ` David Miller
  -1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-06-21  0:44 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

From: Paolo Abeni <pabeni(a)redhat.com>
Date: Fri, 19 Jun 2020 12:54:40 +0200

> IPPROTO_MPTCP value (0x106) can't be represented using the current sock
> diag uAPI, as the 'sdiag_protocol' field is 8 bits wide.
> 
> To implement diag support for MPTCP socket, we will likely need a
> 'inet_diag_req_v3' with a wider 'sdiag_protocol'
> field. inet_diag_handler_cmd() could detect the version of
> the inet_diag_req_v* provided by user-space checking nlmsg_len() and
> convert _v2 reqs to _v3.
> 
> This change will be a bit invasive, as all in kernel diag users will
> then operate only on 'inet_diag_req_v3' (many functions' signature
> change required), but the code-related changes will be encapsulated
> by inet_diag_handler_cmd().

Another way to extend the size of a field is to add an attribute which
supercedes the header structure field when present.

We did this when we needed to make the fib rule table ID number larger,
see FRA_TABLE.

You'd only need to specify this when using protocol values larger than
8 bits in size.

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

* Re: sock diag uAPI and MPTCP
@ 2020-06-21  0:44 ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-06-21  0:44 UTC (permalink / raw)
  To: pabeni; +Cc: eric.dumazet, netdev, mptcp

From: Paolo Abeni <pabeni@redhat.com>
Date: Fri, 19 Jun 2020 12:54:40 +0200

> IPPROTO_MPTCP value (0x106) can't be represented using the current sock
> diag uAPI, as the 'sdiag_protocol' field is 8 bits wide.
> 
> To implement diag support for MPTCP socket, we will likely need a
> 'inet_diag_req_v3' with a wider 'sdiag_protocol'
> field. inet_diag_handler_cmd() could detect the version of
> the inet_diag_req_v* provided by user-space checking nlmsg_len() and
> convert _v2 reqs to _v3.
> 
> This change will be a bit invasive, as all in kernel diag users will
> then operate only on 'inet_diag_req_v3' (many functions' signature
> change required), but the code-related changes will be encapsulated
> by inet_diag_handler_cmd().

Another way to extend the size of a field is to add an attribute which
supercedes the header structure field when present.

We did this when we needed to make the fib rule table ID number larger,
see FRA_TABLE.

You'd only need to specify this when using protocol values larger than
8 bits in size.


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

* [MPTCP] Re: sock diag uAPI and MPTCP
  2020-06-21  0:44 ` David Miller
@ 2020-06-22 10:18 ` Paolo Abeni
  -1 siblings, 0 replies; 6+ messages in thread
From: Paolo Abeni @ 2020-06-22 10:18 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1313 bytes --]

On Sat, 2020-06-20 at 17:44 -0700, David Miller wrote:
> From: Paolo Abeni <pabeni(a)redhat.com>
> Date: Fri, 19 Jun 2020 12:54:40 +0200
> 
> > IPPROTO_MPTCP value (0x106) can't be represented using the current sock
> > diag uAPI, as the 'sdiag_protocol' field is 8 bits wide.
> > 
> > To implement diag support for MPTCP socket, we will likely need a
> > 'inet_diag_req_v3' with a wider 'sdiag_protocol'
> > field. inet_diag_handler_cmd() could detect the version of
> > the inet_diag_req_v* provided by user-space checking nlmsg_len() and
> > convert _v2 reqs to _v3.
> > 
> > This change will be a bit invasive, as all in kernel diag users will
> > then operate only on 'inet_diag_req_v3' (many functions' signature
> > change required), but the code-related changes will be encapsulated
> > by inet_diag_handler_cmd().
> 
> Another way to extend the size of a field is to add an attribute which
> supercedes the header structure field when present.
> 
> We did this when we needed to make the fib rule table ID number larger,
> see FRA_TABLE.
> 
> You'd only need to specify this when using protocol values larger than
> 8 bits in size.

Thank you very much for the directions! This looks like a better, more
encapsulated solution. I'll try to give it a shot.

Thanks!

Paolo

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

* Re: sock diag uAPI and MPTCP
@ 2020-06-22 10:18 ` Paolo Abeni
  0 siblings, 0 replies; 6+ messages in thread
From: Paolo Abeni @ 2020-06-22 10:18 UTC (permalink / raw)
  To: David Miller; +Cc: eric.dumazet, netdev, mptcp

On Sat, 2020-06-20 at 17:44 -0700, David Miller wrote:
> From: Paolo Abeni <pabeni@redhat.com>
> Date: Fri, 19 Jun 2020 12:54:40 +0200
> 
> > IPPROTO_MPTCP value (0x106) can't be represented using the current sock
> > diag uAPI, as the 'sdiag_protocol' field is 8 bits wide.
> > 
> > To implement diag support for MPTCP socket, we will likely need a
> > 'inet_diag_req_v3' with a wider 'sdiag_protocol'
> > field. inet_diag_handler_cmd() could detect the version of
> > the inet_diag_req_v* provided by user-space checking nlmsg_len() and
> > convert _v2 reqs to _v3.
> > 
> > This change will be a bit invasive, as all in kernel diag users will
> > then operate only on 'inet_diag_req_v3' (many functions' signature
> > change required), but the code-related changes will be encapsulated
> > by inet_diag_handler_cmd().
> 
> Another way to extend the size of a field is to add an attribute which
> supercedes the header structure field when present.
> 
> We did this when we needed to make the fib rule table ID number larger,
> see FRA_TABLE.
> 
> You'd only need to specify this when using protocol values larger than
> 8 bits in size.

Thank you very much for the directions! This looks like a better, more
encapsulated solution. I'll try to give it a shot.

Thanks!

Paolo


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

end of thread, other threads:[~2020-06-22 10:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-21  0:44 [MPTCP] Re: sock diag uAPI and MPTCP David Miller
2020-06-21  0:44 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2020-06-22 10:18 [MPTCP] " Paolo Abeni
2020-06-22 10:18 ` Paolo Abeni
2020-06-19 10:54 [MPTCP] " Paolo Abeni
2020-06-19 10:54 ` Paolo Abeni

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.