2021-03-25 19:58:21

by Norman Maurer

[permalink] [raw]
Subject: [PATCH] udp: Add support for getsockopt(..., ..., UDP_GRO, ..., ...);

From: Norman Maurer <[email protected]>

Support for UDP_GRO was added in the past but the implementation for
getsockopt was missed which did lead to an error when we tried to
retrieve the setting for UDP_GRO. This patch adds the missing switch
case for UDP_GRO

Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.")
Signed-off-by: Norman Maurer <[email protected]>
---
net/ipv4/udp.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 4a0478b17243..99d743eb9dc4 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2754,6 +2754,10 @@ int udp_lib_getsockopt(struct sock *sk, int level, int optname,
val = up->gso_size;
break;

+ case UDP_GRO:
+ val = up->gro_enabled;
+ break;
+
/* The following two cannot be changed on UDP sockets, the return is
* always 0 (which corresponds to the full checksum coverage of UDP). */
case UDPLITE_SEND_CSCOV:
--
2.30.2


2021-03-26 09:39:47

by Paolo Abeni

[permalink] [raw]
Subject: Re: [PATCH] udp: Add support for getsockopt(..., ..., UDP_GRO, ..., ...)

Hello,

On Thu, 2021-03-25 at 20:56 +0100, Norman Maurer wrote:
> From: Norman Maurer <[email protected]>
>
> Support for UDP_GRO was added in the past but the implementation for
> getsockopt was missed which did lead to an error when we tried to
> retrieve the setting for UDP_GRO. This patch adds the missing switch
> case for UDP_GRO
>
> Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.")
> Signed-off-by: Norman Maurer <[email protected]>

The patch LGTM, but please cc the blamed commit author in when you add
a 'Fixes' tag (me in this case ;)

Also please specify a target tree, either 'net' or 'net-next', in the
patch subj. Being declared as a fix, this should target 'net'.

One thing you can do to simplifies the maintainer's life, would be post
a v2 with the correct tag (and ev. obsolete this patch in patchwork).

Side note: I personally think this is more a new feature (is adds
getsockopt support for UDP_GRO) than a fix, so I would not have added
the 'Fixes' tag and I would have targeted net-next, but it's just my
opinion.

Cheers,

Paolo

2021-03-26 10:42:21

by Norman Maurer

[permalink] [raw]
Subject: Re: [PATCH] udp: Add support for getsockopt(..., ..., UDP_GRO, ..., ...)

Hi,

> On 26. Mar 2021, at 10:36, Paolo Abeni <[email protected]> wrote:
>
> Hello,
>
> On Thu, 2021-03-25 at 20:56 +0100, Norman Maurer wrote:
>> From: Norman Maurer <[email protected]>
>>
>> Support for UDP_GRO was added in the past but the implementation for
>> getsockopt was missed which did lead to an error when we tried to
>> retrieve the setting for UDP_GRO. This patch adds the missing switch
>> case for UDP_GRO
>>
>> Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.")
>> Signed-off-by: Norman Maurer <[email protected]>
>
> The patch LGTM, but please cc the blamed commit author in when you add
> a 'Fixes' tag (me in this case ;)

Noted for the next time…

>
> Also please specify a target tree, either 'net' or 'net-next', in the
> patch subj. Being declared as a fix, this should target 'net'.
>

Ok noted

> One thing you can do to simplifies the maintainer's life, would be post
> a v2 with the correct tag (and ev. obsolete this patch in patchwork).

I am quite new to contribute patches to the kernel so I am not sure how I would “obsolete” this patch and make a v2. If you can give me some pointers I am happy to do so.


>
> Side note: I personally think this is more a new feature (is adds
> getsockopt support for UDP_GRO) than a fix, so I would not have added
> the 'Fixes' tag and I would have targeted net-next, but it's just my
> opinion.

I see… For me it seemed more like a bug as I can’t think of a reason why only setsockopt should be supported for an option but not getsockopt. But it may be just my opinion :)

>
> Cheers,
>
> Paolo
>

Thanks
Norman

2021-03-26 14:42:13

by Norman Maurer

[permalink] [raw]
Subject: Re: [PATCH] udp: Add support for getsockopt(..., ..., UDP_GRO, ..., ...)

Hi,

> On 26. Mar 2021, at 10:36, Paolo Abeni <[email protected]> wrote:
>
> Hello,
>
> On Thu, 2021-03-25 at 20:56 +0100, Norman Maurer wrote:
>> From: Norman Maurer <[email protected]>
>>
>> Support for UDP_GRO was added in the past but the implementation for
>> getsockopt was missed which did lead to an error when we tried to
>> retrieve the setting for UDP_GRO. This patch adds the missing switch
>> case for UDP_GRO
>>
>> Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.")
>> Signed-off-by: Norman Maurer <[email protected]>
>
> The patch LGTM, but please cc the blamed commit author in when you add
> a 'Fixes' tag (me in this case ;)

Noted for the next time…

>
> Also please specify a target tree, either 'net' or 'net-next', in the
> patch subj. Being declared as a fix, this should target 'net'.
>

Ok noted

> One thing you can do to simplifies the maintainer's life, would be post
> a v2 with the correct tag (and ev. obsolete this patch in patchwork).

I am quite new to contribute patches to the kernel so I am not sure how I would “obsolete” this patch and make a v2. If you can give me some pointers I am happy to do so.


>
> Side note: I personally think this is more a new feature (is adds
> getsockopt support for UDP_GRO) than a fix, so I would not have added
> the 'Fixes' tag and I would have targeted net-next, but it's just my
> opinion.

I see… For me it seemed more like a bug as I can’t think of a reason why only setsockopt should be supported for an option but not getsockopt. But it may be just my opinion :)

>
> Cheers,
>
> Paolo
>

Thanks
Norman

2021-03-26 16:57:22

by Norman Maurer

[permalink] [raw]
Subject: Re: [PATCH] udp: Add support for getsockopt(..., ..., UDP_GRO, ..., ...)

Hi,

> On 26. Mar 2021, at 10:36, Paolo Abeni <[email protected]> wrote:
>
> Hello,
>
> On Thu, 2021-03-25 at 20:56 +0100, Norman Maurer wrote:
>> From: Norman Maurer <[email protected]>
>>
>> Support for UDP_GRO was added in the past but the implementation for
>> getsockopt was missed which did lead to an error when we tried to
>> retrieve the setting for UDP_GRO. This patch adds the missing switch
>> case for UDP_GRO
>>
>> Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.")
>> Signed-off-by: Norman Maurer <[email protected]>
>
> The patch LGTM, but please cc the blamed commit author in when you add
> a 'Fixes' tag (me in this case ;)

Noted for the next time…

>
> Also please specify a target tree, either 'net' or 'net-next', in the
> patch subj. Being declared as a fix, this should target 'net'.
>

Ok noted

> One thing you can do to simplifies the maintainer's life, would be post
> a v2 with the correct tag (and ev. obsolete this patch in patchwork).

I am quite new to contribute patches to the kernel so I am not sure how I would “obsolete” this patch and make a v2. If you can give me some pointers I am happy to do so.


>
> Side note: I personally think this is more a new feature (is adds
> getsockopt support for UDP_GRO) than a fix, so I would not have added
> the 'Fixes' tag and I would have targeted net-next, but it's just my
> opinion.

I see… For me it seemed more like a bug as I can’t think of a reason why only setsockopt should be supported for an option but not getsockopt. But it may be just my opinion :)

>
> Cheers,
>
> Paolo
>

Thanks
Norman