* Re: [RFC PATCH v5 2/2] virtio/vsock: check argument to avoid no effect call
[not found] ` <50bb0210-1ed7-42fb-b5f6-8d97247209b5@sberdevices.ru>
@ 2023-03-23 9:29 ` Stefano Garzarella
0 siblings, 0 replies; 3+ messages in thread
From: Stefano Garzarella @ 2023-03-23 9:29 UTC (permalink / raw)
To: Arseniy Krasnov
Cc: Bobby Eshleman, kvm, netdev, linux-kernel, virtualization,
oxffffaa, Eric Dumazet, Stefan Hajnoczi, kernel, Jakub Kicinski,
Paolo Abeni, David S. Miller
On Wed, Mar 22, 2023 at 09:36:24PM +0300, Arseniy Krasnov wrote:
>Both of these functions have no effect when input argument is 0, so to
>avoid useless spinlock access, check argument before it.
>
>Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
>---
> net/vmw_vsock/virtio_transport_common.c | 6 ++++++
> 1 file changed, 6 insertions(+)
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>
>diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
>index 9e87c7d4d7cf..312658c176bd 100644
>--- a/net/vmw_vsock/virtio_transport_common.c
>+++ b/net/vmw_vsock/virtio_transport_common.c
>@@ -302,6 +302,9 @@ u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 credit)
> {
> u32 ret;
>
>+ if (!credit)
>+ return 0;
>+
> spin_lock_bh(&vvs->tx_lock);
> ret = vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt);
> if (ret > credit)
>@@ -315,6 +318,9 @@ EXPORT_SYMBOL_GPL(virtio_transport_get_credit);
>
> void virtio_transport_put_credit(struct virtio_vsock_sock *vvs, u32 credit)
> {
>+ if (!credit)
>+ return;
>+
> spin_lock_bh(&vvs->tx_lock);
> vvs->tx_cnt -= credit;
> spin_unlock_bh(&vvs->tx_lock);
>--
>2.25.1
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH v5 0/2] allocate multiple skbuffs on tx
[not found] ` <2e06387d-036b-dde2-5ddc-734c65a2f50d@sberdevices.ru>
@ 2023-03-23 10:48 ` Stefano Garzarella
[not found] ` <15e9ac56-bedc-b444-6d9a-8a1355e32eaf@sberdevices.ru>
0 siblings, 1 reply; 3+ messages in thread
From: Stefano Garzarella @ 2023-03-23 10:48 UTC (permalink / raw)
To: Arseniy Krasnov
Cc: Bobby Eshleman, kvm, netdev, linux-kernel, virtualization,
oxffffaa, Eric Dumazet, Stefan Hajnoczi, kernel, Jakub Kicinski,
Paolo Abeni, David S. Miller
On Thu, Mar 23, 2023 at 01:01:40PM +0300, Arseniy Krasnov wrote:
>Hello Stefano,
>
>thanks for review!
You're welcome!
>
>Since both patches are R-b, i can wait for a few days, then send this
>as 'net-next'?
Yep, maybe even this series could have been directly without RFC ;-)
Thanks,
Stefano
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH v5 0/2] allocate multiple skbuffs on tx
[not found] ` <15e9ac56-bedc-b444-6d9a-8a1355e32eaf@sberdevices.ru>
@ 2023-03-23 11:11 ` Stefano Garzarella
0 siblings, 0 replies; 3+ messages in thread
From: Stefano Garzarella @ 2023-03-23 11:11 UTC (permalink / raw)
To: Arseniy Krasnov
Cc: Bobby Eshleman, kvm, netdev, linux-kernel, virtualization,
oxffffaa, Eric Dumazet, Stefan Hajnoczi, kernel, Jakub Kicinski,
Paolo Abeni, David S. Miller
On Thu, Mar 23, 2023 at 01:53:40PM +0300, Arseniy Krasnov wrote:
>
>
>On 23.03.2023 13:48, Stefano Garzarella wrote:
>> On Thu, Mar 23, 2023 at 01:01:40PM +0300, Arseniy Krasnov wrote:
>>> Hello Stefano,
>>>
>>> thanks for review!
>>
>> You're welcome!
>>
>>>
>>> Since both patches are R-b, i can wait for a few days, then send this
>>> as 'net-next'?
>>
>> Yep, maybe even this series could have been directly without RFC ;-)
>
>"directly", You mean 'net' tag? Of just without RFC, like [PATCH v5]. In this case
>it will be merged to 'net' right?
Sorry for the confusion. I meant without RFC but with net-next.
Being enhancements and not fixes this is definitely net-next material,
so even in RFCs you can already use the net-next tag, so the reviewer
knows which branch to apply them to. (It's not super important since
being RFCs it's expected that it's not complete, but it's definitely an
help for the reviewer).
Speaking of the RFC, we usually use it for patches that we don't think
are ready to be merged. But when they reach a good state (like this
series for example), we can start publishing them already without the
RFC tag.
Anyway, if you are not sure, use RFC and then when a maintainer has
reviewed them all, surely you can remove the RFC tag.
Hope this helps, at least that's what I usually do, so don't take that
as a strict rule ;-)
Thanks,
Stefano
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-23 11:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <f0b283a1-cc63-dc3d-cc0c-0da7f684d4d2@sberdevices.ru>
[not found] ` <50bb0210-1ed7-42fb-b5f6-8d97247209b5@sberdevices.ru>
2023-03-23 9:29 ` [RFC PATCH v5 2/2] virtio/vsock: check argument to avoid no effect call Stefano Garzarella
[not found] ` <2e06387d-036b-dde2-5ddc-734c65a2f50d@sberdevices.ru>
2023-03-23 10:48 ` [RFC PATCH v5 0/2] allocate multiple skbuffs on tx Stefano Garzarella
[not found] ` <15e9ac56-bedc-b444-6d9a-8a1355e32eaf@sberdevices.ru>
2023-03-23 11:11 ` Stefano Garzarella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox