RE: [PATCH net-next v3 5/6] virtio_net: Add a lock for per queue RX coalesce

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Jakub Kicinski <kuba@xxxxxxxxxx>
> Sent: Friday, April 12, 2024 9:21 PM
> To: Dan Jurgens <danielj@xxxxxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx; mst@xxxxxxxxxx; jasowang@xxxxxxxxxx;
> xuanzhuo@xxxxxxxxxxxxxxxxx; virtualization@xxxxxxxxxxxxxxx;
> davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx; pabeni@xxxxxxxxxx; Jiri
> Pirko <jiri@xxxxxxxxxx>
> Subject: Re: [PATCH net-next v3 5/6] virtio_net: Add a lock for per queue RX
> coalesce
> 
> On Fri, 12 Apr 2024 14:53:08 -0500 Daniel Jurgens wrote:
> > Once the RTNL locking around the control buffer is removed there can
> > be contention on the per queue RX interrupt coalescing data. Use a
> > spin lock per queue.
> 
> Does not compile on Clang.

Which version? It compiles for me with:
$ clang -v
clang version 15.0.7 (Fedora 15.0.7-2.fc37)

> 
> > +			scoped_guard(spinlock, &vi->rq[i].intr_coal_lock) {
> > +				err = virtnet_send_rx_ctrl_coal_vq_cmd(vi, i,
> > +								       vi-
> >intr_coal_rx.max_usecs,
> > +								       vi-
> >intr_coal_rx.max_packets);
> > +				if (err)
> > +					return err;
> > +			}
> 
> Do you really think this needs a scoped guard and 4th indentation level,
> instead of just:
> 
> 			..lock(..);
> 			err = virtnet_send_rx_ctrl_coal_vq_cmd(vi, i,
> 							       vi-
> >intr_coal_rx.max_usecs,
> 							       vi-
> >intr_coal_rx.max_packets);
> 			..unlock(..);

I'll change it in the next version.

> 			if (err)
> 				return err;
> 
> > +		scoped_guard(spinlock, &vi->rq[i].intr_coal_lock) {
> > +			vi->rq[i].intr_coal.max_usecs = ec-
> >rx_coalesce_usecs;
> > +			vi->rq[i].intr_coal.max_packets = ec-
> >rx_max_coalesced_frames;
> > +		}
> 
> :-|
> --
> pw-bot: cr





[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux