* [PATCH net-next 0/2] Update R8152 module to version 2
@ 2022-11-04 13:25 Albert Zhou
2022-11-04 13:25 ` [PATCH net-next 1/2] Reverse 744d49daf8bd3b17b345c836f2e6f97d49fa6ae8 so that the v2 r8152 driver can use netif_set_gso_max_* Albert Zhou
[not found] ` <20221104132526.64530-3-albert.zhou.50@gmail.com>
0 siblings, 2 replies; 6+ messages in thread
From: Albert Zhou @ 2022-11-04 13:25 UTC (permalink / raw)
To: linux-usb; +Cc: gregkh, nic_swsd, Albert Zhou
As per my discussion with Greg K H, here is a patch for the updated
R8152 module, version 2, obtained from Realtek website. This is my
first ever patch, I hope it's useful.
Albert Zhou (2):
Reverse 744d49daf8bd3b17b345c836f2e6f97d49fa6ae8 so that the v2 r8152
driver can use netif_set_gso_max_*
Update R8152 module to v2 obtained from the Realtek website, included
in a comment in r8152.c. The only other modification to r8152.c is
amending netif_napi_add, see comment for explanation.
drivers/net/usb/r8152.c | 17938 +++++++++++++++++++-----
drivers/net/usb/r8152_compatibility.h | 658 +
include/linux/netdevice.h | 21 +
net/core/dev.h | 21 -
4 files changed, 15151 insertions(+), 3487 deletions(-)
create mode 100644 drivers/net/usb/r8152_compatibility.h
base-commit: ee6050c8af96bba2f81e8b0793a1fc2f998fcd20
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 1/2] Reverse 744d49daf8bd3b17b345c836f2e6f97d49fa6ae8 so that the v2 r8152 driver can use netif_set_gso_max_*
2022-11-04 13:25 [PATCH net-next 0/2] Update R8152 module to version 2 Albert Zhou
@ 2022-11-04 13:25 ` Albert Zhou
2022-11-04 14:39 ` Greg KH
[not found] ` <20221104132526.64530-3-albert.zhou.50@gmail.com>
1 sibling, 1 reply; 6+ messages in thread
From: Albert Zhou @ 2022-11-04 13:25 UTC (permalink / raw)
To: linux-usb; +Cc: gregkh, nic_swsd, Albert Zhou
---
include/linux/netdevice.h | 21 +++++++++++++++++++++
net/core/dev.h | 21 ---------------------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index eddf8ee270e7..8fa98c67a466 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -4952,6 +4952,27 @@ static inline bool netif_needs_gso(struct sk_buff *skb,
(skb->ip_summed != CHECKSUM_UNNECESSARY)));
}
+static inline void netif_set_gso_max_size(struct net_device *dev,
+ unsigned int size)
+{
+ /* dev->gso_max_size is read locklessly from sk_setup_caps() */
+ WRITE_ONCE(dev->gso_max_size, size);
+}
+
+static inline void netif_set_gso_max_segs(struct net_device *dev,
+ unsigned int segs)
+{
+ /* dev->gso_max_segs is read locklessly from sk_setup_caps() */
+ WRITE_ONCE(dev->gso_max_segs, segs);
+}
+
+static inline void netif_set_gro_max_size(struct net_device *dev,
+ unsigned int size)
+{
+ /* This pairs with the READ_ONCE() in skb_gro_receive() */
+ WRITE_ONCE(dev->gro_max_size, size);
+}
+
void netif_set_tso_max_size(struct net_device *dev, unsigned int size);
void netif_set_tso_max_segs(struct net_device *dev, unsigned int segs);
void netif_inherit_tso_max(struct net_device *to,
diff --git a/net/core/dev.h b/net/core/dev.h
index cbb8a925175a..c3a4dc66e4b3 100644
--- a/net/core/dev.h
+++ b/net/core/dev.h
@@ -88,25 +88,4 @@ int dev_change_carrier(struct net_device *dev, bool new_carrier);
void __dev_set_rx_mode(struct net_device *dev);
-static inline void netif_set_gso_max_size(struct net_device *dev,
- unsigned int size)
-{
- /* dev->gso_max_size is read locklessly from sk_setup_caps() */
- WRITE_ONCE(dev->gso_max_size, size);
-}
-
-static inline void netif_set_gso_max_segs(struct net_device *dev,
- unsigned int segs)
-{
- /* dev->gso_max_segs is read locklessly from sk_setup_caps() */
- WRITE_ONCE(dev->gso_max_segs, segs);
-}
-
-static inline void netif_set_gro_max_size(struct net_device *dev,
- unsigned int size)
-{
- /* This pairs with the READ_ONCE() in skb_gro_receive() */
- WRITE_ONCE(dev->gro_max_size, size);
-}
-
#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 1/2] Reverse 744d49daf8bd3b17b345c836f2e6f97d49fa6ae8 so that the v2 r8152 driver can use netif_set_gso_max_*
2022-11-04 13:25 ` [PATCH net-next 1/2] Reverse 744d49daf8bd3b17b345c836f2e6f97d49fa6ae8 so that the v2 r8152 driver can use netif_set_gso_max_* Albert Zhou
@ 2022-11-04 14:39 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2022-11-04 14:39 UTC (permalink / raw)
To: Albert Zhou; +Cc: linux-usb, nic_swsd
On Sat, Nov 05, 2022 at 12:25:25AM +1100, Albert Zhou wrote:
> ---
> include/linux/netdevice.h | 21 +++++++++++++++++++++
> net/core/dev.h | 21 ---------------------
> 2 files changed, 21 insertions(+), 21 deletions(-)
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- Your patch does not have a Signed-off-by: line. Please read the
kernel file, Documentation/SubmittingPatches and resend it after
adding that line. Note, the line needs to be in the body of the
email, before the patch, not at the bottom of the patch or in the
email signature.
- Your patch did many different things all at once, making it difficult
to review. All Linux kernel patches need to only do one thing at a
time. If you need to do multiple things (such as clean up all coding
style issues in a file/driver), do it in a sequence of patches, each
one doing only one thing. This will make it easier to review the
patches to ensure that they are correct, and to help alleviate any
merge issues that larger patches can cause.
- You did not specify a description of why the patch is needed, or
possibly, any description at all, in the email body. Please read the
section entitled "The canonical patch format" in the kernel file,
Documentation/SubmittingPatches for what is needed in order to
properly describe the change.
- You did not write a descriptive Subject: for the patch, allowing Greg,
and everyone else, to know what this patch is all about. Please read
the section entitled "The canonical patch format" in the kernel file,
Documentation/SubmittingPatches for what a proper Subject: line should
look like.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 2/2] Update R8152 module to v2 obtained from the Realtek website, included in a comment in r8152.c. The only other modification to r8152.c is amending netif_napi_add, see comment for explanation.
[not found] ` <20221104132526.64530-3-albert.zhou.50@gmail.com>
@ 2022-11-04 14:40 ` Greg KH
2022-11-05 9:46 ` Albert Zhou
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2022-11-04 14:40 UTC (permalink / raw)
To: Albert Zhou; +Cc: linux-usb, nic_swsd
On Sat, Nov 05, 2022 at 12:25:26AM +1100, Albert Zhou wrote:
> ---
> drivers/net/usb/r8152.c | 17938 +++++++++++++++++++-----
> drivers/net/usb/r8152_compatibility.h | 658 +
> 2 files changed, 15130 insertions(+), 3466 deletions(-)
> create mode 100644 drivers/net/usb/r8152_compatibility.h
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- Your patch contains warnings and/or errors noticed by the
scripts/checkpatch.pl tool.
- Your patch does not have a Signed-off-by: line. Please read the
kernel file, Documentation/SubmittingPatches and resend it after
adding that line. Note, the line needs to be in the body of the
email, before the patch, not at the bottom of the patch or in the
email signature.
- Your patch did many different things all at once, making it difficult
to review. All Linux kernel patches need to only do one thing at a
time. If you need to do multiple things (such as clean up all coding
style issues in a file/driver), do it in a sequence of patches, each
one doing only one thing. This will make it easier to review the
patches to ensure that they are correct, and to help alleviate any
merge issues that larger patches can cause.
- You did not specify a description of why the patch is needed, or
possibly, any description at all, in the email body. Please read the
section entitled "The canonical patch format" in the kernel file,
Documentation/SubmittingPatches for what is needed in order to
properly describe the change.
- You did not write a descriptive Subject: for the patch, allowing Greg,
and everyone else, to know what this patch is all about. Please read
the section entitled "The canonical patch format" in the kernel file,
Documentation/SubmittingPatches for what a proper Subject: line should
look like.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 2/2] Update R8152 module to v2 obtained from the Realtek website, included in a comment in r8152.c. The only other modification to r8152.c is amending netif_napi_add, see comment for explanation.
2022-11-04 14:40 ` [PATCH net-next 2/2] Update R8152 module to v2 obtained from the Realtek website, included in a comment in r8152.c. The only other modification to r8152.c is amending netif_napi_add, see comment for explanation Greg KH
@ 2022-11-05 9:46 ` Albert Zhou
2022-11-05 10:28 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Albert Zhou @ 2022-11-05 9:46 UTC (permalink / raw)
To: Greg KH; +Cc: linux-usb
[-- Attachment #1.1.1: Type: text/plain, Size: 4170 bytes --]
Hi Greg,
I realised several things. Firstly, when I initially contacted you, it was simply based on looking up who maintained drivers/net/usb in the MAINTAINERS file, however when running scripts/get_maintainer.pl, I realise that there are many other people who maintain drivers/net/usb/r8152.c. Should I include them in future submissions? Or should I just stick to you for now?
Secondly, running scripts/checkpatch.pl on Realtek's code gives many warnings and errors. E.g. the code is written to be compatible
for old versions of the kernel, whereas checkpatch.pl insists that each kernel version should have dedicated code for itself.
I am hesitant to edit the original code more than I already have, but if necessary, I can make another patch when I resubmit to iron out all the trivial style issues. However I may need some guidance, e.g. on the use of the volatile keyword; since I am not the original developer, it will be difficult for met to judge whether its usage is critical for the code.
Thirdly, if I do remove all of the macros for backwards compatibility, (# if LINUX_VERSION_CODE >= KERNEL_VERSION(a,b,c)), it will be difficult for distros like Ubuntu to incorporate the updated module into their older kernels. How can the version-two module also be included in the other stable/longerm kernels?
Best,
From Albert Zhou
On 5/11/22 01:40, Greg KH wrote:
> On Sat, Nov 05, 2022 at 12:25:26AM +1100, Albert Zhou wrote:
>> ---
>> drivers/net/usb/r8152.c | 17938 +++++++++++++++++++-----
>> drivers/net/usb/r8152_compatibility.h | 658 +
>> 2 files changed, 15130 insertions(+), 3466 deletions(-)
>> create mode 100644 drivers/net/usb/r8152_compatibility.h
>>
>
> Hi,
>
> This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
> a patch that has triggered this response. He used to manually respond
> to these common problems, but in order to save his sanity (he kept
> writing the same thing over and over, yet to different people), I was
> created. Hopefully you will not take offence and will fix the problem
> in your patch and resubmit it so that it can be accepted into the Linux
> kernel tree.
>
> You are receiving this message because of the following common error(s)
> as indicated below:
>
> - Your patch contains warnings and/or errors noticed by the
> scripts/checkpatch.pl tool.
>
> - Your patch does not have a Signed-off-by: line. Please read the
> kernel file, Documentation/SubmittingPatches and resend it after
> adding that line. Note, the line needs to be in the body of the
> email, before the patch, not at the bottom of the patch or in the
> email signature.
>
> - Your patch did many different things all at once, making it difficult
> to review. All Linux kernel patches need to only do one thing at a
> time. If you need to do multiple things (such as clean up all coding
> style issues in a file/driver), do it in a sequence of patches, each
> one doing only one thing. This will make it easier to review the
> patches to ensure that they are correct, and to help alleviate any
> merge issues that larger patches can cause.
>
> - You did not specify a description of why the patch is needed, or
> possibly, any description at all, in the email body. Please read the
> section entitled "The canonical patch format" in the kernel file,
> Documentation/SubmittingPatches for what is needed in order to
> properly describe the change.
>
> - You did not write a descriptive Subject: for the patch, allowing Greg,
> and everyone else, to know what this patch is all about. Please read
> the section entitled "The canonical patch format" in the kernel file,
> Documentation/SubmittingPatches for what a proper Subject: line should
> look like.
>
> If you wish to discuss this problem further, or you have questions about
> how to resolve this issue, please feel free to respond to this email and
> Greg will reply once he has dug out from the pending patches received
> from other developers.
>
> thanks,
>
> greg k-h's patch email bot
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 653 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 2/2] Update R8152 module to v2 obtained from the Realtek website, included in a comment in r8152.c. The only other modification to r8152.c is amending netif_napi_add, see comment for explanation.
2022-11-05 9:46 ` Albert Zhou
@ 2022-11-05 10:28 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2022-11-05 10:28 UTC (permalink / raw)
To: Albert Zhou; +Cc: linux-usb
On Sat, Nov 05, 2022 at 08:46:25PM +1100, Albert Zhou wrote:
> Hi Greg,
Hi!
Some meta-comments, please don't top-post and try line-wrapping your
emails at 72 columns to make it easier to respond properly. See the
mailing list archives for examples.
> I realised several things. Firstly, when I initially contacted you, it was simply based on looking up who maintained drivers/net/usb in the MAINTAINERS file, however when running scripts/get_maintainer.pl, I realise that there are many other people who maintain drivers/net/usb/r8152.c. Should I include them in future submissions? Or should I just stick to you for now?
Yes, include everyone that get_maintainer.pl tells you to, that's what
it is there for.
> Secondly, running scripts/checkpatch.pl on Realtek's code gives many warnings and errors. E.g. the code is written to be compatible
> for old versions of the kernel, whereas checkpatch.pl insists that each kernel version should have dedicated code for itself.
And that's not needed for in-kernel drivers at all, which is why it is
complaining. You should remove all of that compatibility cruft as it
just clutters up the code and is not needed for obvious reasons.
> I am hesitant to edit the original code more than I already have, but if necessary, I can make another patch when I resubmit to iron out all the trivial style issues. However I may need some guidance, e.g. on the use of the volatile keyword; since I am not the original developer, it will be difficult for met to judge whether its usage is critical for the code.
Look at how it is being used and see if it is required. For a USB
driver, volitile should never be used as it makes no sense at all,
right?
> Thirdly, if I do remove all of the macros for backwards compatibility, (# if LINUX_VERSION_CODE >= KERNEL_VERSION(a,b,c)), it will be difficult for distros like Ubuntu to incorporate the updated module into their older kernels. How can the version-two module also be included in the other stable/longerm kernels?
We do kernel development for the latest release only. If distros want
to backport things, that's up to them to do on their own. For
stable/long term kernels, see the stable documentation for what is a
valid acceptable change (hint, bug fixes and quirks and device ids only,
not new features or new drivers.)
So all of that code for old kernels needs to be removed. Do that and
you will end up with a much smaller and actually maintable codebase, so
that's a good thing to do.
hope this helps,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-11-05 10:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-04 13:25 [PATCH net-next 0/2] Update R8152 module to version 2 Albert Zhou
2022-11-04 13:25 ` [PATCH net-next 1/2] Reverse 744d49daf8bd3b17b345c836f2e6f97d49fa6ae8 so that the v2 r8152 driver can use netif_set_gso_max_* Albert Zhou
2022-11-04 14:39 ` Greg KH
[not found] ` <20221104132526.64530-3-albert.zhou.50@gmail.com>
2022-11-04 14:40 ` [PATCH net-next 2/2] Update R8152 module to v2 obtained from the Realtek website, included in a comment in r8152.c. The only other modification to r8152.c is amending netif_napi_add, see comment for explanation Greg KH
2022-11-05 9:46 ` Albert Zhou
2022-11-05 10:28 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).