From: Li RongQing <hidden> Date: 2021-08-26 08:31:05
smp_processor_id()/raw* will be called once each when not
more queues in virtnet_xdp_get_sq() which is called in
non-preemptible context, so it's safe to call the function
smp_processor_id() once.
Signed-off-by: Li RongQing <redacted>
---
drivers/net/virtio_net.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2021-08-30 21:10:25
On Thu, Aug 26, 2021 at 04:21:35PM +0800, Li RongQing wrote:
smp_processor_id()/raw* will be called once each when not
more queues in virtnet_xdp_get_sq() which is called in
non-preemptible context, so it's safe to call the function
smp_processor_id() once.
Signed-off-by: Li RongQing <redacted>
commit log should probably explain why it's a good idea
to replace raw_smp_processor_id with smp_processor_id
in the case of curr_queue_pairs <= nr_cpu_ids.
-----邮件原件-----
发件人: Michael S. Tsirkin [off-list ref]
发送时间: 2021年8月31日 5:10
收件人: Li,Rongqing [off-list ref]
抄送: netdev@vger.kernel.org; bpf@vger.kernel.org;
virtualization@lists.linux-foundation.org
主题: Re: [PATCH] virtio_net: reduce raw_smp_processor_id() calling in
virtnet_xdp_get_sq
On Thu, Aug 26, 2021 at 04:21:35PM +0800, Li RongQing wrote:
quoted
smp_processor_id()/raw* will be called once each when not more queues
in virtnet_xdp_get_sq() which is called in non-preemptible context, so
it's safe to call the function
smp_processor_id() once.
Signed-off-by: Li RongQing <redacted>
commit log should probably explain why it's a good idea to replace
raw_smp_processor_id with smp_processor_id in the case of curr_queue_pairs
<= nr_cpu_ids.
I change it as below, is it ok?
virtio_net: reduce raw_smp_processor_id() calling in virtnet_xdp_get_sq
smp_processor_id() and raw_smp_processor_id() are called once
each in virtnet_xdp_get_sq(), when curr_queue_pairs <= nr_cpu_ids,
should be merged
virtnet_xdp_get_sq() is called in non-preemptible context, so
it's safe to call the function smp_processor_id(), and keep
smp_processor_id(), and remove the calling of raw_smp_processor_id(),
avoid the wrong use virtnet_xdp_get_sq to preemptible context
in the future
-Li
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2021-08-31 14:34:13
On Tue, Aug 31, 2021 at 02:09:36AM +0000, Li,Rongqing wrote:
quoted
-----邮件原件-----
发件人: Michael S. Tsirkin [off-list ref]
发送时间: 2021年8月31日 5:10
收件人: Li,Rongqing [off-list ref]
抄送: netdev@vger.kernel.org; bpf@vger.kernel.org;
virtualization@lists.linux-foundation.org
主题: Re: [PATCH] virtio_net: reduce raw_smp_processor_id() calling in
virtnet_xdp_get_sq
On Thu, Aug 26, 2021 at 04:21:35PM +0800, Li RongQing wrote:
quoted
smp_processor_id()/raw* will be called once each when not more queues
in virtnet_xdp_get_sq() which is called in non-preemptible context, so
it's safe to call the function
smp_processor_id() once.
Signed-off-by: Li RongQing <redacted>
commit log should probably explain why it's a good idea to replace
raw_smp_processor_id with smp_processor_id in the case of curr_queue_pairs
<= nr_cpu_ids.
I change it as below, is it ok?
virtio_net: reduce raw_smp_processor_id() calling in virtnet_xdp_get_sq
shorter:
virtio_net: s/raw_smp_processor_id/smp_processor_id/ in virtnet_xdp_get_sq
smp_processor_id() and raw_smp_processor_id() are called once
each in virtnet_xdp_get_sq(), when curr_queue_pairs <= nr_cpu_ids,
should be merged
I'd just drop this part.
virtnet_xdp_get_sq() is called in non-preemptible context, so
it's safe to call the function smp_processor_id(), and keep
smp_processor_id(), and remove the calling of raw_smp_processor_id(),
avoid the wrong use virtnet_xdp_get_sq to preemptible context
in the future
s/avoid.*/this way we'll get a warning if this is ever called in a preemptible context/
-----邮件原件-----
发件人: Michael S. Tsirkin [off-list ref]
发送时间: 2021年8月31日 22:34
收件人: Li,Rongqing [off-list ref]
抄送: netdev@vger.kernel.org; bpf@vger.kernel.org;
virtualization@lists.linux-foundation.org
主题: Re: 答复: [PATCH] virtio_net: reduce raw_smp_processor_id() calling in
virtnet_xdp_get_sq
On Tue, Aug 31, 2021 at 02:09:36AM +0000, Li,Rongqing wrote:
quoted
quoted
-----邮件原件-----
发件人: Michael S. Tsirkin [off-list ref]
发送时间: 2021年8月31日 5:10
收件人: Li,Rongqing [off-list ref]
抄送: netdev@vger.kernel.org; bpf@vger.kernel.org;
virtualization@lists.linux-foundation.org
主题: Re: [PATCH] virtio_net: reduce raw_smp_processor_id() calling in
virtnet_xdp_get_sq
On Thu, Aug 26, 2021 at 04:21:35PM +0800, Li RongQing wrote:
quoted
smp_processor_id()/raw* will be called once each when not more
queues in virtnet_xdp_get_sq() which is called in non-preemptible
context, so it's safe to call the function
smp_processor_id() once.
Signed-off-by: Li RongQing <redacted>
commit log should probably explain why it's a good idea to replace
raw_smp_processor_id with smp_processor_id in the case of
curr_queue_pairs <= nr_cpu_ids.
I change it as below, is it ok?
virtio_net: reduce raw_smp_processor_id() calling in
virtnet_xdp_get_sq
shorter:
virtio_net: s/raw_smp_processor_id/smp_processor_id/ in virtnet_xdp_get_sq
quoted
smp_processor_id() and raw_smp_processor_id() are called once
each in virtnet_xdp_get_sq(), when curr_queue_pairs <= nr_cpu_ids,
should be merged
I'd just drop this part.
quoted
virtnet_xdp_get_sq() is called in non-preemptible context, so
it's safe to call the function smp_processor_id(), and keep
smp_processor_id(), and remove the calling of raw_smp_processor_id(),
avoid the wrong use virtnet_xdp_get_sq to preemptible context
in the future
s/avoid.*/this way we'll get a warning if this is ever called in a preemptible
context/