diff mbox series

[net,v1,2/2] virtio_net: Close queue pairs using helper function

Message ID 20230428224346.68211-1-feliu@nvidia.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net,v1,1/2] virtio_net: Fix error unwinding of XDP initialization | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers warning 8 maintainers not CCed: kuba@kernel.org hawk@kernel.org daniel@iogearbox.net john.fastabend@gmail.com davem@davemloft.net pabeni@redhat.com ast@kernel.org edumazet@google.com
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Feng Liu April 28, 2023, 10:43 p.m. UTC
Use newly introduced helper function that exactly does the same of
closing the queue pairs.

Signed-off-by: Feng Liu <feliu@nvidia.com>
Reviewed-by: William Tu <witu@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
---
 drivers/net/virtio_net.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Simon Horman May 1, 2023, 12:44 p.m. UTC | #1
On Fri, Apr 28, 2023 at 06:43:46PM -0400, Feng Liu wrote:
> Use newly introduced helper function that exactly does the same of
> closing the queue pairs.
> 
> Signed-off-by: Feng Liu <feliu@nvidia.com>
> Reviewed-by: William Tu <witu@nvidia.com>
> Reviewed-by: Parav Pandit <parav@nvidia.com>

I guess this was put in a separate patch to 1/2, as it's more
net-next material, as opposed to 1/2 which seems to be net material.
FWIIW, I'd lean to putting 1/2 in net. And holding this one for net-next.

That aside, this looks good to me.

Reviewed-by: Simon Horman <simon.horman@corigine.com>
Feng Liu May 1, 2023, 1:58 p.m. UTC | #2
On 2023-05-01 a.m.8:44, Simon Horman wrote:
> External email: Use caution opening links or attachments
> 
> 
> On Fri, Apr 28, 2023 at 06:43:46PM -0400, Feng Liu wrote:
>> Use newly introduced helper function that exactly does the same of
>> closing the queue pairs.
>>
>> Signed-off-by: Feng Liu <feliu@nvidia.com>
>> Reviewed-by: William Tu <witu@nvidia.com>
>> Reviewed-by: Parav Pandit <parav@nvidia.com>
> 
> I guess this was put in a separate patch to 1/2, as it's more
> net-next material, as opposed to 1/2 which seems to be net material.
> FWIIW, I'd lean to putting 1/2 in net. And holding this one for net-next.
> 
> That aside, this looks good to me.
> 
> Reviewed-by: Simon Horman <simon.horman@corigine.com>

Will do, thanks Simon
Michael S. Tsirkin May 1, 2023, 2:14 p.m. UTC | #3
On Mon, May 01, 2023 at 09:58:18AM -0400, Feng Liu wrote:
> 
> 
> On 2023-05-01 a.m.8:44, Simon Horman wrote:
> > External email: Use caution opening links or attachments
> > 
> > 
> > On Fri, Apr 28, 2023 at 06:43:46PM -0400, Feng Liu wrote:
> > > Use newly introduced helper function that exactly does the same of
> > > closing the queue pairs.
> > > 
> > > Signed-off-by: Feng Liu <feliu@nvidia.com>
> > > Reviewed-by: William Tu <witu@nvidia.com>
> > > Reviewed-by: Parav Pandit <parav@nvidia.com>
> > 
> > I guess this was put in a separate patch to 1/2, as it's more
> > net-next material, as opposed to 1/2 which seems to be net material.
> > FWIIW, I'd lean to putting 1/2 in net. And holding this one for net-next.
> > 
> > That aside, this looks good to me.
> > 
> > Reviewed-by: Simon Horman <simon.horman@corigine.com>
> 
> Will do, thanks Simon

Nah, I think you should just squash these two patches together.
It's early in the merge window.
Michael S. Tsirkin May 1, 2023, 2:14 p.m. UTC | #4
On Fri, Apr 28, 2023 at 06:43:46PM -0400, Feng Liu wrote:
> Use newly introduced helper function that exactly does the same of
> closing the queue pairs.
> 
> Signed-off-by: Feng Liu <feliu@nvidia.com>
> Reviewed-by: William Tu <witu@nvidia.com>
> Reviewed-by: Parav Pandit <parav@nvidia.com>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  drivers/net/virtio_net.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index fc6ee833a09f..5cd78e154d14 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -2319,11 +2319,8 @@ static int virtnet_close(struct net_device *dev)
>  	/* Make sure refill_work doesn't re-enable napi! */
>  	cancel_delayed_work_sync(&vi->refill);
>  
> -	for (i = 0; i < vi->max_queue_pairs; i++) {
> -		virtnet_napi_tx_disable(&vi->sq[i].napi);
> -		napi_disable(&vi->rq[i].napi);
> -		xdp_rxq_info_unreg(&vi->rq[i].xdp_rxq);
> -	}
> +	for (i = 0; i < vi->max_queue_pairs; i++)
> +		virtnet_disable_qp(vi, i);
>  
>  	return 0;
>  }
> -- 
> 2.37.1 (Apple Git-137.1)
Feng Liu May 1, 2023, 4:53 p.m. UTC | #5
On 2023-05-01 a.m.10:14, Michael S. Tsirkin wrote:
> External email: Use caution opening links or attachments
> 
> 
> On Mon, May 01, 2023 at 09:58:18AM -0400, Feng Liu wrote:
>>
>>
>> On 2023-05-01 a.m.8:44, Simon Horman wrote:
>>> External email: Use caution opening links or attachments
>>>
>>>
>>> On Fri, Apr 28, 2023 at 06:43:46PM -0400, Feng Liu wrote:
>>>> Use newly introduced helper function that exactly does the same of
>>>> closing the queue pairs.
>>>>
>>>> Signed-off-by: Feng Liu <feliu@nvidia.com>
>>>> Reviewed-by: William Tu <witu@nvidia.com>
>>>> Reviewed-by: Parav Pandit <parav@nvidia.com>
>>>
>>> I guess this was put in a separate patch to 1/2, as it's more
>>> net-next material, as opposed to 1/2 which seems to be net material.
>>> FWIIW, I'd lean to putting 1/2 in net. And holding this one for net-next.
>>>
>>> That aside, this looks good to me.
>>>
>>> Reviewed-by: Simon Horman <simon.horman@corigine.com>
>>
>> Will do, thanks Simon
> 
> Nah, I think you should just squash these two patches together.
> It's early in the merge window.
> 
> --
> MST
> 
OK, will do , thx
Simon Horman May 2, 2023, 6 a.m. UTC | #6
On Mon, May 01, 2023 at 10:14:00AM -0400, Michael S. Tsirkin wrote:
> On Mon, May 01, 2023 at 09:58:18AM -0400, Feng Liu wrote:
> > 
> > 
> > On 2023-05-01 a.m.8:44, Simon Horman wrote:
> > > External email: Use caution opening links or attachments
> > > 
> > > 
> > > On Fri, Apr 28, 2023 at 06:43:46PM -0400, Feng Liu wrote:
> > > > Use newly introduced helper function that exactly does the same of
> > > > closing the queue pairs.
> > > > 
> > > > Signed-off-by: Feng Liu <feliu@nvidia.com>
> > > > Reviewed-by: William Tu <witu@nvidia.com>
> > > > Reviewed-by: Parav Pandit <parav@nvidia.com>
> > > 
> > > I guess this was put in a separate patch to 1/2, as it's more
> > > net-next material, as opposed to 1/2 which seems to be net material.
> > > FWIIW, I'd lean to putting 1/2 in net. And holding this one for net-next.
> > > 
> > > That aside, this looks good to me.
> > > 
> > > Reviewed-by: Simon Horman <simon.horman@corigine.com>
> > 
> > Will do, thanks Simon
> 
> Nah, I think you should just squash these two patches together.
> It's early in the merge window.

Ack, sorry for the noise.
diff mbox series

Patch

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index fc6ee833a09f..5cd78e154d14 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2319,11 +2319,8 @@  static int virtnet_close(struct net_device *dev)
 	/* Make sure refill_work doesn't re-enable napi! */
 	cancel_delayed_work_sync(&vi->refill);
 
-	for (i = 0; i < vi->max_queue_pairs; i++) {
-		virtnet_napi_tx_disable(&vi->sq[i].napi);
-		napi_disable(&vi->rq[i].napi);
-		xdp_rxq_info_unreg(&vi->rq[i].xdp_rxq);
-	}
+	for (i = 0; i < vi->max_queue_pairs; i++)
+		virtnet_disable_qp(vi, i);
 
 	return 0;
 }