linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vsock: Simplify '__vsock_release()'
@ 2019-10-31  6:47 Christophe JAILLET
  2019-10-31  9:07 ` Stefano Garzarella
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Christophe JAILLET @ 2019-10-31  6:47 UTC (permalink / raw)
  To: davem, sunilmut, willemb, sgarzare, stefanha, ytht.net, arnd,
	tglx, decui
  Cc: netdev, linux-kernel, kernel-janitors, Christophe JAILLET

Use '__skb_queue_purge()' instead of re-implementing it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 net/vmw_vsock/af_vsock.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 2ab43b2bba31..2983dc92ca63 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -641,7 +641,6 @@ EXPORT_SYMBOL_GPL(__vsock_create);
 static void __vsock_release(struct sock *sk, int level)
 {
 	if (sk) {
-		struct sk_buff *skb;
 		struct sock *pending;
 		struct vsock_sock *vsk;
 
@@ -662,8 +661,7 @@ static void __vsock_release(struct sock *sk, int level)
 		sock_orphan(sk);
 		sk->sk_shutdown = SHUTDOWN_MASK;
 
-		while ((skb = skb_dequeue(&sk->sk_receive_queue)))
-			kfree_skb(skb);
+		skb_queue_purge(&sk->sk_receive_queue);
 
 		/* Clean up any sockets that never were accepted. */
 		while ((pending = vsock_dequeue_accept(sk)) != NULL) {
-- 
2.20.1


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

* Re: [PATCH] vsock: Simplify '__vsock_release()'
  2019-10-31  6:47 [PATCH] vsock: Simplify '__vsock_release()' Christophe JAILLET
@ 2019-10-31  9:07 ` Stefano Garzarella
  2019-10-31  9:36 ` Sergei Shtylyov
  2019-11-01  8:08 ` Stefan Hajnoczi
  2 siblings, 0 replies; 6+ messages in thread
From: Stefano Garzarella @ 2019-10-31  9:07 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: davem, sunilmut, willemb, stefanha, ytht.net, arnd, tglx, decui,
	netdev, linux-kernel, kernel-janitors

On Thu, Oct 31, 2019 at 07:47:41AM +0100, Christophe JAILLET wrote:
> Use '__skb_queue_purge()' instead of re-implementing it.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  net/vmw_vsock/af_vsock.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
> index 2ab43b2bba31..2983dc92ca63 100644
> --- a/net/vmw_vsock/af_vsock.c
> +++ b/net/vmw_vsock/af_vsock.c
> @@ -641,7 +641,6 @@ EXPORT_SYMBOL_GPL(__vsock_create);
>  static void __vsock_release(struct sock *sk, int level)
>  {
>  	if (sk) {
> -		struct sk_buff *skb;
>  		struct sock *pending;
>  		struct vsock_sock *vsk;
>  
> @@ -662,8 +661,7 @@ static void __vsock_release(struct sock *sk, int level)
>  		sock_orphan(sk);
>  		sk->sk_shutdown = SHUTDOWN_MASK;
>  
> -		while ((skb = skb_dequeue(&sk->sk_receive_queue)))
> -			kfree_skb(skb);
> +		skb_queue_purge(&sk->sk_receive_queue);
>  
>  		/* Clean up any sockets that never were accepted. */
>  		while ((pending = vsock_dequeue_accept(sk)) != NULL) {

Good clean-up!

This patch LGTM:
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

Thanks,
Stefano

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

* Re: [PATCH] vsock: Simplify '__vsock_release()'
  2019-10-31  6:47 [PATCH] vsock: Simplify '__vsock_release()' Christophe JAILLET
  2019-10-31  9:07 ` Stefano Garzarella
@ 2019-10-31  9:36 ` Sergei Shtylyov
  2019-10-31  9:48   ` Christophe JAILLET
  2019-11-01  8:08 ` Stefan Hajnoczi
  2 siblings, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2019-10-31  9:36 UTC (permalink / raw)
  To: Christophe JAILLET, davem, sunilmut, willemb, sgarzare, stefanha,
	ytht.net, arnd, tglx, decui
  Cc: netdev, linux-kernel, kernel-janitors

Hello!

On 31.10.2019 9:47, Christophe JAILLET wrote:

> Use '__skb_queue_purge()' instead of re-implementing it.

    In don't see that double underscore below...

> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   net/vmw_vsock/af_vsock.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
> index 2ab43b2bba31..2983dc92ca63 100644
> --- a/net/vmw_vsock/af_vsock.c
> +++ b/net/vmw_vsock/af_vsock.c
[...]
> @@ -662,8 +661,7 @@ static void __vsock_release(struct sock *sk, int level)
>   		sock_orphan(sk);
>   		sk->sk_shutdown = SHUTDOWN_MASK;
>   
> -		while ((skb = skb_dequeue(&sk->sk_receive_queue)))
> -			kfree_skb(skb);
> +		skb_queue_purge(&sk->sk_receive_queue);
>   
>   		/* Clean up any sockets that never were accepted. */
>   		while ((pending = vsock_dequeue_accept(sk)) != NULL) {

MBR, Sergei

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

* Re: [PATCH] vsock: Simplify '__vsock_release()'
  2019-10-31  9:36 ` Sergei Shtylyov
@ 2019-10-31  9:48   ` Christophe JAILLET
  2019-11-02 17:11     ` Stefano Garzarella
  0 siblings, 1 reply; 6+ messages in thread
From: Christophe JAILLET @ 2019-10-31  9:48 UTC (permalink / raw)
  To: Sergei Shtylyov, davem, sunilmut, willemb, sgarzare, stefanha,
	ytht.net, arnd, tglx, decui
  Cc: netdev, linux-kernel, kernel-janitors

Le 31/10/2019 à 10:36, Sergei Shtylyov a écrit :
> Hello!
>
> On 31.10.2019 9:47, Christophe JAILLET wrote:
>
>> Use '__skb_queue_purge()' instead of re-implementing it.
>
>    In don't see that double underscore below...
This is a typo in the commit message.

There is no need for __ because skb_dequeue was used.

Could you fix it directly in the commit message (preferred solution for 
me) or should I send a V2?

CJ

>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>>   net/vmw_vsock/af_vsock.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
>> index 2ab43b2bba31..2983dc92ca63 100644
>> --- a/net/vmw_vsock/af_vsock.c
>> +++ b/net/vmw_vsock/af_vsock.c
> [...]
>> @@ -662,8 +661,7 @@ static void __vsock_release(struct sock *sk, int 
>> level)
>>           sock_orphan(sk);
>>           sk->sk_shutdown = SHUTDOWN_MASK;
>>   -        while ((skb = skb_dequeue(&sk->sk_receive_queue)))
>> -            kfree_skb(skb);
>> +        skb_queue_purge(&sk->sk_receive_queue);
>>             /* Clean up any sockets that never were accepted. */
>>           while ((pending = vsock_dequeue_accept(sk)) != NULL) {
>
> MBR, Sergei
>


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

* Re: [PATCH] vsock: Simplify '__vsock_release()'
  2019-10-31  6:47 [PATCH] vsock: Simplify '__vsock_release()' Christophe JAILLET
  2019-10-31  9:07 ` Stefano Garzarella
  2019-10-31  9:36 ` Sergei Shtylyov
@ 2019-11-01  8:08 ` Stefan Hajnoczi
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2019-11-01  8:08 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: davem, sunilmut, willemb, sgarzare, ytht.net, arnd, tglx, decui,
	netdev, linux-kernel, kernel-janitors

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

On Thu, Oct 31, 2019 at 07:47:41AM +0100, Christophe JAILLET wrote:
> Use '__skb_queue_purge()' instead of re-implementing it.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  net/vmw_vsock/af_vsock.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Modulo the comment about double-underscore:

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] vsock: Simplify '__vsock_release()'
  2019-10-31  9:48   ` Christophe JAILLET
@ 2019-11-02 17:11     ` Stefano Garzarella
  0 siblings, 0 replies; 6+ messages in thread
From: Stefano Garzarella @ 2019-11-02 17:11 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Sergei Shtylyov, David S. Miller, sunilmut, Willem de Bruijn,
	Stefan Hajnoczi, ytht.net, Arnd Bergmann, tglx, Dexuan Cui,
	netdev, linux-kernel, kernel-janitors

On Thu, Oct 31, 2019 at 10:49 AM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> Le 31/10/2019 à 10:36, Sergei Shtylyov a écrit :
> > Hello!
> >
> > On 31.10.2019 9:47, Christophe JAILLET wrote:
> >
> >> Use '__skb_queue_purge()' instead of re-implementing it.
> >
> >    In don't see that double underscore below...
> This is a typo in the commit message.
>
> There is no need for __ because skb_dequeue was used.
>
> Could you fix it directly in the commit message (preferred solution for
> me) or should I send a V2?
>

I think is better if you send a v2 fixing this and including the R-b tags.
My R-b stays with that fixed :-)

Thanks,
Stefano

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

end of thread, other threads:[~2019-11-02 17:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31  6:47 [PATCH] vsock: Simplify '__vsock_release()' Christophe JAILLET
2019-10-31  9:07 ` Stefano Garzarella
2019-10-31  9:36 ` Sergei Shtylyov
2019-10-31  9:48   ` Christophe JAILLET
2019-11-02 17:11     ` Stefano Garzarella
2019-11-01  8:08 ` Stefan Hajnoczi

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).