lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231025015010-mutt-send-email-mst@kernel.org>
Date: Wed, 25 Oct 2023 01:50:38 -0400
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Jason Wang <jasowang@...hat.com>
Cc: Heng Qi <hengqi@...ux.alibaba.com>, netdev@...r.kernel.org,
	virtualization@...ts.linux-foundation.org,
	Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
	Eric Dumazet <edumazet@...gle.com>,
	"David S. Miller" <davem@...emloft.net>,
	Paolo Abeni <pabeni@...hat.com>,
	Jesper Dangaard Brouer <hawk@...nel.org>,
	John Fastabend <john.fastabend@...il.com>,
	Alexei Starovoitov <ast@...nel.org>,
	Jakub Kicinski <kuba@...nel.org>, Simon Horman <horms@...nel.org>,
	"Liu, Yujie" <yujie.liu@...el.com>
Subject: Re: [PATCH net-next 5/5] virtio-net: support tx netdim

On Wed, Oct 25, 2023 at 11:35:43AM +0800, Jason Wang wrote:
> On Thu, Oct 12, 2023 at 3:44 PM Heng Qi <hengqi@...ux.alibaba.com> wrote:
> >
> > Similar to rx netdim, this patch supports adaptive tx
> > coalescing moderation for the virtio-net.
> >
> > Signed-off-by: Heng Qi <hengqi@...ux.alibaba.com>
> > ---
> >  drivers/net/virtio_net.c | 143 ++++++++++++++++++++++++++++++++-------
> >  1 file changed, 119 insertions(+), 24 deletions(-)
> >
> > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index 6ad2890a7909..1c680cb09d48 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
> > @@ -154,6 +154,15 @@ struct send_queue {
> >
> >         struct virtnet_sq_stats stats;
> >
> > +       /* The number of tx notifications */
> > +       u16 calls;
> > +
> > +       /* Is dynamic interrupt moderation enabled? */
> > +       bool dim_enabled;
> > +
> > +       /* Dynamic Interrupt Moderation */
> > +       struct dim dim;
> > +
> >         struct virtnet_interrupt_coalesce intr_coal;
> >
> >         struct napi_struct napi;
> > @@ -317,8 +326,9 @@ struct virtnet_info {
> >         u8 duplex;
> >         u32 speed;
> >
> > -       /* Is rx dynamic interrupt moderation enabled? */
> > +       /* Is dynamic interrupt moderation enabled? */
> >         bool rx_dim_enabled;
> > +       bool tx_dim_enabled;
> >
> >         /* Interrupt coalescing settings */
> >         struct virtnet_interrupt_coalesce intr_coal_tx;
> > @@ -464,19 +474,40 @@ static bool virtqueue_napi_complete(struct napi_struct *napi,
> >         return false;
> >  }
> >
> > +static void virtnet_tx_dim_work(struct work_struct *work);
> > +
> > +static void virtnet_tx_dim_update(struct virtnet_info *vi, struct send_queue *sq)
> > +{
> > +       struct virtnet_sq_stats *stats = &sq->stats;
> > +       struct dim_sample cur_sample = {};
> > +
> > +       u64_stats_update_begin(&sq->stats.syncp);
> > +       dim_update_sample(sq->calls, stats->packets,
> > +                         stats->bytes, &cur_sample);
> > +       u64_stats_update_end(&sq->stats.syncp);
> > +
> > +       net_dim(&sq->dim, cur_sample);
> > +}
> > +
> >  static void skb_xmit_done(struct virtqueue *vq)
> >  {
> >         struct virtnet_info *vi = vq->vdev->priv;
> > -       struct napi_struct *napi = &vi->sq[vq2txq(vq)].napi;
> > +       struct send_queue *sq = &vi->sq[vq2txq(vq)];
> > +       struct napi_struct *napi = &sq->napi;
> > +
> > +       sq->calls++;
> 
> I wonder what's the impact of this counters for netdim. As we have a
> mode of orphan skb in xmit.
> 
> We need to test to see.
> 
> Thanks

Agreed, performance patches should come with performance results.

-- 
MST


Powered by blists - more mailing lists