All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] udp: Switch the order of arguments to copy_linear_skb
@ 2021-05-11 11:34 Matthew Wilcox (Oracle)
  2021-05-11 13:11 ` David Laight
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox (Oracle) @ 2021-05-11 11:34 UTC (permalink / raw)
  To: davem, kuba, yoshfuji, dsahern
  Cc: Matthew Wilcox (Oracle), netdev, linux-kernel, Paolo Abeni, Eric Dumazet

All other skb functions use (off, len); this is the only one which
uses (len, off).  Make it consistent.

Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/net/udp.h | 2 +-
 net/ipv4/udp.c    | 2 +-
 net/ipv6/udp.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/net/udp.h b/include/net/udp.h
index 360df454356c..c4a7a4c56e75 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -392,7 +392,7 @@ static inline bool udp_skb_is_linear(struct sk_buff *skb)
 }
 #endif
 
-static inline int copy_linear_skb(struct sk_buff *skb, int len, int off,
+static inline int copy_linear_skb(struct sk_buff *skb, int off, int len,
 				  struct iov_iter *to)
 {
 	int n;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 15f5504adf5b..783c466e6071 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1859,7 +1859,7 @@ int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
 
 	if (checksum_valid || udp_skb_csum_unnecessary(skb)) {
 		if (udp_skb_is_linear(skb))
-			err = copy_linear_skb(skb, copied, off, &msg->msg_iter);
+			err = copy_linear_skb(skb, off, copied, &msg->msg_iter);
 		else
 			err = skb_copy_datagram_msg(skb, off, msg, copied);
 	} else {
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 199b080d418a..24b202dd370e 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -369,7 +369,7 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
 
 	if (checksum_valid || udp_skb_csum_unnecessary(skb)) {
 		if (udp_skb_is_linear(skb))
-			err = copy_linear_skb(skb, copied, off, &msg->msg_iter);
+			err = copy_linear_skb(skb, off, copied, &msg->msg_iter);
 		else
 			err = skb_copy_datagram_msg(skb, off, msg, copied);
 	} else {
-- 
2.30.2


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

* RE: [PATCH] udp: Switch the order of arguments to copy_linear_skb
  2021-05-11 11:34 [PATCH] udp: Switch the order of arguments to copy_linear_skb Matthew Wilcox (Oracle)
@ 2021-05-11 13:11 ` David Laight
  2021-05-11 13:38   ` Matthew Wilcox
  0 siblings, 1 reply; 5+ messages in thread
From: David Laight @ 2021-05-11 13:11 UTC (permalink / raw)
  To: 'Matthew Wilcox (Oracle)', davem, kuba, yoshfuji, dsahern
  Cc: netdev, linux-kernel, Paolo Abeni, Eric Dumazet

From: Matthew Wilcox
> Sent: 11 May 2021 12:34
> 
> All other skb functions use (off, len); this is the only one which
> uses (len, off).  Make it consistent.

I wouldn't change the order of the arguments without some other
change that ensures old code fails to compile.
(Like tweaking the function name.)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


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

* Re: [PATCH] udp: Switch the order of arguments to copy_linear_skb
  2021-05-11 13:11 ` David Laight
@ 2021-05-11 13:38   ` Matthew Wilcox
  2021-05-11 13:44     ` David Laight
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2021-05-11 13:38 UTC (permalink / raw)
  To: David Laight
  Cc: davem, kuba, yoshfuji, dsahern, netdev, linux-kernel,
	Paolo Abeni, Eric Dumazet

On Tue, May 11, 2021 at 01:11:42PM +0000, David Laight wrote:
> From: Matthew Wilcox
> > Sent: 11 May 2021 12:34
> > 
> > All other skb functions use (off, len); this is the only one which
> > uses (len, off).  Make it consistent.
> 
> I wouldn't change the order of the arguments without some other
> change that ensures old code fails to compile.
> (Like tweaking the function name.)

Yes, some random essentially internal function that has had no new
users since it was created in 2017 should get a new name *eyeroll*.

Please find more useful things to critique.  Or, you know, write some
damned code yourself instead of just having opinions.

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

* RE: [PATCH] udp: Switch the order of arguments to copy_linear_skb
  2021-05-11 13:38   ` Matthew Wilcox
@ 2021-05-11 13:44     ` David Laight
  2021-05-11 13:54       ` Matthew Wilcox
  0 siblings, 1 reply; 5+ messages in thread
From: David Laight @ 2021-05-11 13:44 UTC (permalink / raw)
  To: 'Matthew Wilcox'
  Cc: davem, kuba, yoshfuji, dsahern, netdev, linux-kernel,
	Paolo Abeni, Eric Dumazet

From: Matthew Wilcox
> Sent: 11 May 2021 14:39
> 
> On Tue, May 11, 2021 at 01:11:42PM +0000, David Laight wrote:
> > From: Matthew Wilcox
> > > Sent: 11 May 2021 12:34
> > >
> > > All other skb functions use (off, len); this is the only one which
> > > uses (len, off).  Make it consistent.
> >
> > I wouldn't change the order of the arguments without some other
> > change that ensures old code fails to compile.
> > (Like tweaking the function name.)
> 
> Yes, some random essentially internal function that has had no new
> users since it was created in 2017 should get a new name *eyeroll*.
> 
> Please find more useful things to critique.  Or, you know, write some
> damned code yourself instead of just having opinions.

You could easily completely screw up any code that isn't committed
to the kernel source tree.
It isn't the sort of bug I'd want to diagnose.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


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

* Re: [PATCH] udp: Switch the order of arguments to copy_linear_skb
  2021-05-11 13:44     ` David Laight
@ 2021-05-11 13:54       ` Matthew Wilcox
  0 siblings, 0 replies; 5+ messages in thread
From: Matthew Wilcox @ 2021-05-11 13:54 UTC (permalink / raw)
  To: David Laight
  Cc: davem, kuba, yoshfuji, dsahern, netdev, linux-kernel,
	Paolo Abeni, Eric Dumazet

On Tue, May 11, 2021 at 01:44:45PM +0000, David Laight wrote:
> From: Matthew Wilcox
> > Sent: 11 May 2021 14:39
> > 
> > On Tue, May 11, 2021 at 01:11:42PM +0000, David Laight wrote:
> > > From: Matthew Wilcox
> > > > Sent: 11 May 2021 12:34
> > > >
> > > > All other skb functions use (off, len); this is the only one which
> > > > uses (len, off).  Make it consistent.
> > >
> > > I wouldn't change the order of the arguments without some other
> > > change that ensures old code fails to compile.
> > > (Like tweaking the function name.)
> > 
> > Yes, some random essentially internal function that has had no new
> > users since it was created in 2017 should get a new name *eyeroll*.
> > 
> > Please find more useful things to critique.  Or, you know, write some
> > damned code yourself instead of just having opinions.
> 
> You could easily completely screw up any code that isn't committed
> to the kernel source tree.
> It isn't the sort of bug I'd want to diagnose.

Simple, get your kernel driver into the main kernel tree (remember we are
talking about drivers released under a GPL-compatible license here, if your
code doesn't fall under this category, good luck, you are on your own here,
you leech). -- GregKH

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

end of thread, other threads:[~2021-05-11 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 11:34 [PATCH] udp: Switch the order of arguments to copy_linear_skb Matthew Wilcox (Oracle)
2021-05-11 13:11 ` David Laight
2021-05-11 13:38   ` Matthew Wilcox
2021-05-11 13:44     ` David Laight
2021-05-11 13:54       ` Matthew Wilcox

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.