All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
	davem@davemloft.net, eric.dumazet@gmail.com, brouer@redhat.com
Subject: Re: [PATCH net-next V2] tun: introduce tx skb ring
Date: Thu, 30 Jun 2016 09:50:36 +0800	[thread overview]
Message-ID: <57747AEC.8050307@redhat.com> (raw)
In-Reply-To: <20160628100907-mutt-send-email-mst@redhat.com>



On 2016年06月28日 15:09, Michael S. Tsirkin wrote:
> On Thu, Jun 23, 2016 at 01:14:07PM +0800, Jason Wang wrote:
>>
>> On 2016年06月23日 02:18, Michael S. Tsirkin wrote:
>>> On Fri, Jun 17, 2016 at 03:41:20AM +0300, Michael S. Tsirkin wrote:
>>>>> Would it help to have ptr_ring_resize that gets an array of
>>>>> rings and resizes them both to same length?
>>> OK, here it is. Untested so far, and no skb wrapper.
>>> Pls let me know whether this is what you had in mind.
>> Exactly what I want.
>>
>> Thanks
> Ok and this for skb_array
>
> -->
> skb_array: add wrappers for resizing
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> --
>
> diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h
> index c900708..7e01c1f 100644
> --- a/include/linux/skb_array.h
> +++ b/include/linux/skb_array.h
> @@ -151,16 +151,24 @@ static inline int skb_array_init(struct skb_array *a, int size, gfp_t gfp)
>   	return ptr_ring_init(&a->ring, size, 0, gfp);
>   }
>   
> -void __skb_array_destroy_skb(void *ptr)
> +static void __skb_array_destroy_skb(void *ptr)
>   {
>   	kfree_skb(ptr);
>   }
>   
> -int skb_array_resize(struct skb_array *a, int size, gfp_t gfp)
> +static inline int skb_array_resize(struct skb_array *a, int size, gfp_t gfp)
>   {
>   	return ptr_ring_resize(&a->ring, size, gfp, __skb_array_destroy_skb);
>   }

Will split up the above tweak into another patch when reposting.

>   
> +static inline int skb_raay_resize_multiple(struct skb_array **rings, int nrings,

I think you mean 'skb_array_resize' here.

> +					   int size, gfp_t gfp)
> +{
> +	BUILD_BUG_ON(offsetof(struct skb_array, ring));
> +	ptr_ring_resize_multiple((struct ptr_ring **)rings, nrings, size, gfp,
> +				 __skb_array_destroy_skb);

This should be return ptr_ring_resize_multiple(...

> +}
> +
>   static inline void skb_array_cleanup(struct skb_array *a)
>   {
>   	ptr_ring_cleanup(&a->ring, __skb_array_destroy_skb);

With this, looks like there's no need for a new flag. Will repost the 
series with those two patches.

Thanks

WARNING: multiple messages have this Message-ID (diff)
From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: kvm@vger.kernel.org, eric.dumazet@gmail.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, brouer@redhat.com,
	davem@davemloft.net
Subject: Re: [PATCH net-next V2] tun: introduce tx skb ring
Date: Thu, 30 Jun 2016 09:50:36 +0800	[thread overview]
Message-ID: <57747AEC.8050307@redhat.com> (raw)
In-Reply-To: <20160628100907-mutt-send-email-mst@redhat.com>



On 2016年06月28日 15:09, Michael S. Tsirkin wrote:
> On Thu, Jun 23, 2016 at 01:14:07PM +0800, Jason Wang wrote:
>>
>> On 2016年06月23日 02:18, Michael S. Tsirkin wrote:
>>> On Fri, Jun 17, 2016 at 03:41:20AM +0300, Michael S. Tsirkin wrote:
>>>>> Would it help to have ptr_ring_resize that gets an array of
>>>>> rings and resizes them both to same length?
>>> OK, here it is. Untested so far, and no skb wrapper.
>>> Pls let me know whether this is what you had in mind.
>> Exactly what I want.
>>
>> Thanks
> Ok and this for skb_array
>
> -->
> skb_array: add wrappers for resizing
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> --
>
> diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h
> index c900708..7e01c1f 100644
> --- a/include/linux/skb_array.h
> +++ b/include/linux/skb_array.h
> @@ -151,16 +151,24 @@ static inline int skb_array_init(struct skb_array *a, int size, gfp_t gfp)
>   	return ptr_ring_init(&a->ring, size, 0, gfp);
>   }
>   
> -void __skb_array_destroy_skb(void *ptr)
> +static void __skb_array_destroy_skb(void *ptr)
>   {
>   	kfree_skb(ptr);
>   }
>   
> -int skb_array_resize(struct skb_array *a, int size, gfp_t gfp)
> +static inline int skb_array_resize(struct skb_array *a, int size, gfp_t gfp)
>   {
>   	return ptr_ring_resize(&a->ring, size, gfp, __skb_array_destroy_skb);
>   }

Will split up the above tweak into another patch when reposting.

>   
> +static inline int skb_raay_resize_multiple(struct skb_array **rings, int nrings,

I think you mean 'skb_array_resize' here.

> +					   int size, gfp_t gfp)
> +{
> +	BUILD_BUG_ON(offsetof(struct skb_array, ring));
> +	ptr_ring_resize_multiple((struct ptr_ring **)rings, nrings, size, gfp,
> +				 __skb_array_destroy_skb);

This should be return ptr_ring_resize_multiple(...

> +}
> +
>   static inline void skb_array_cleanup(struct skb_array *a)
>   {
>   	ptr_ring_cleanup(&a->ring, __skb_array_destroy_skb);

With this, looks like there's no need for a new flag. Will repost the 
series with those two patches.

Thanks
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2016-06-30  1:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15  8:38 [PATCH net-next V2] tun: introduce tx skb ring Jason Wang
2016-06-15 10:34 ` kbuild test robot
2016-06-15 10:34 ` kbuild test robot
2016-06-15 11:52 ` Jamal Hadi Salim
2016-06-15 11:55   ` Jamal Hadi Salim
2016-06-16  7:08     ` Jason Wang
2016-06-15 11:55   ` Jamal Hadi Salim
2016-06-15 11:52 ` Jamal Hadi Salim
2016-06-17  0:01 ` David Miller
2016-06-17  0:01   ` David Miller
2016-06-17  0:41 ` Michael S. Tsirkin
2016-06-17  0:41 ` Michael S. Tsirkin
2016-06-17  7:22   ` Jason Wang
2016-06-17  7:22   ` Jason Wang
2016-06-22 18:18   ` Michael S. Tsirkin
2016-06-22 18:18     ` Michael S. Tsirkin
2016-06-23  5:14     ` Jason Wang
2016-06-23  5:14       ` Jason Wang
2016-06-28  7:09       ` Michael S. Tsirkin
2016-06-28  7:09         ` Michael S. Tsirkin
2016-06-30  1:50         ` Jason Wang [this message]
2016-06-30  1:50           ` Jason Wang
2016-06-15  8:38 Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57747AEC.8050307@redhat.com \
    --to=jasowang@redhat.com \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.