Re: [PATCH net-next 7/8] vhost_net: try batch dequing from skb array

2017-03-29 Thread Michael S. Tsirkin
On Wed, Mar 29, 2017 at 06:53:27PM +0800, Jason Wang wrote: > > > On 2017年03月29日 18:46, Pankaj Gupta wrote: > > Hi Jason, > > > > > On 2017年03月23日 13:34, Jason Wang wrote: > > > > > > > > > > +{ > > > > > > +if (rvq->rh != rvq->rt) > > > > > > +goto out; > > > > > > + > > > > > > +

Re: [PATCH net-next 7/8] vhost_net: try batch dequing from skb array

2017-03-29 Thread Jason Wang
On 2017年03月29日 18:46, Pankaj Gupta wrote: Hi Jason, On 2017年03月23日 13:34, Jason Wang wrote: +{ +if (rvq->rh != rvq->rt) +goto out; + +rvq->rh = rvq->rt = 0; +rvq->rt = skb_array_consume_batched_bh(rvq->rx_array, rvq->rxq, +VHOST_RX_BATCH); A com

Re: [PATCH net-next 7/8] vhost_net: try batch dequing from skb array

2017-03-29 Thread Pankaj Gupta
Hi Jason, > > On 2017年03月23日 13:34, Jason Wang wrote: > > > > > >> > >>> +{ > >>> +if (rvq->rh != rvq->rt) > >>> +goto out; > >>> + > >>> +rvq->rh = rvq->rt = 0; > >>> +rvq->rt = skb_array_consume_batched_bh(rvq->rx_array, rvq->rxq, > >>> +VHOST_RX_BATC

Re: [PATCH net-next 7/8] vhost_net: try batch dequing from skb array

2017-03-29 Thread Jason Wang
On 2017年03月23日 13:34, Jason Wang wrote: +{ +if (rvq->rh != rvq->rt) +goto out; + +rvq->rh = rvq->rt = 0; +rvq->rt = skb_array_consume_batched_bh(rvq->rx_array, rvq->rxq, +VHOST_RX_BATCH); A comment explaining why is is -bh would be helpful. Ok

Re: [PATCH net-next 7/8] vhost_net: try batch dequing from skb array

2017-03-23 Thread Jason Wang
On 2017年03月22日 22:16, Michael S. Tsirkin wrote: On Tue, Mar 21, 2017 at 12:04:46PM +0800, Jason Wang wrote: We used to dequeue one skb during recvmsg() from skb_array, this could be inefficient because of the bad cache utilization and spinlock touching for each packet. This patch tries to batc

Re: [PATCH net-next 7/8] vhost_net: try batch dequing from skb array

2017-03-22 Thread Michael S. Tsirkin
On Tue, Mar 21, 2017 at 12:04:46PM +0800, Jason Wang wrote: > We used to dequeue one skb during recvmsg() from skb_array, this could > be inefficient because of the bad cache utilization and spinlock > touching for each packet. This patch tries to batch them by calling > batch dequeuing helpers exp

[PATCH net-next 7/8] vhost_net: try batch dequing from skb array

2017-03-20 Thread Jason Wang
We used to dequeue one skb during recvmsg() from skb_array, this could be inefficient because of the bad cache utilization and spinlock touching for each packet. This patch tries to batch them by calling batch dequeuing helpers explicitly on the exported skb array and pass the skb back through msg_