Re: [PATCH net-next v3 06/15] gve: introduce ctrl ops to set vectors and Qs

Harshitha Ramamurthy <[email protected]>
Newsgroups gmane.linux.kernel.bpf,gmane.linux.network,gmane.linux.kernel
Message-ID <CAEAWyHdh3+mO=+b9Zmt1dLO5-x3bhF1ZcC26wsbcnf787MyY2w@mail.gmail.com>
On Thu, Aug 6, 2026 at 12:33 AM Przemek Kitszel
<[email protected]> wrote:
>
> On 8/3/26 20:46, Harshitha Ramamurthy wrote:
> > Introduce following ctrl ops for Adminq mode. This change does
> > not introduce any functional change, just movement of code into
> > ops.
> >
> > - set_num_queues to set maximum and default TX/RX queues in the
> >    alloc structures used in the initialization flow.
> > - set_num_ntfy_blks op to set number of vectors(ntfy_blks) in the
> >    initialization flow.
> >
> > Reviewed-by: Willem de Bruijn <[email protected]>
> > Reviewed-by: Jordan Rhee <[email protected]>
> > Signed-off-by: Harshitha Ramamurthy <[email protected]>
> > ---
> >   drivers/net/ethernet/google/gve/gve.h        |  6 ++
> >   drivers/net/ethernet/google/gve/gve_adminq.c | 45 ++++++++++++++
> >   drivers/net/ethernet/google/gve/gve_adminq.h |  2 +
> >   drivers/net/ethernet/google/gve/gve_main.c   | 64 +++-----------------
> >   4 files changed, 63 insertions(+), 54 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/google/gve/gve.h b/drivers/net/ethernet/google/gve/gve.h
> > index 56148ea3cfbf..1bc5e32b6618 100644
> > --- a/drivers/net/ethernet/google/gve/gve.h
> > +++ b/drivers/net/ethernet/google/gve/gve.h
> > @@ -829,10 +829,16 @@ struct gve_device_info {
> >    * struct gve_ctrl_ops - Control plane operations structure
> >    * @map_db_bar: Maps the doorbell BAR for the device and store in @priv.
> >    * @unmap_db_bar: Unmaps the doorbell BAR previously mapped by @map_db_bar.
> > + * @set_num_queues: Sets default and max TX/RX queues into allocation
> > + *                  structures stored in @priv to be used during initialization.
> > + * @set_num_ntfy_blks: Sets no. of vectors into @priv to be used during
> > + *                     initialization.
> >    */
> >   struct gve_ctrl_ops {
> >       int (*map_db_bar)(struct gve_priv *priv);
> >       void (*unmap_db_bar)(struct gve_priv *priv);
> > +     void (*set_num_queues)(struct gve_priv *priv);
> > +     int (*set_num_ntfy_blks)(struct gve_priv *priv);
> >   };
> >
> >   struct gve_priv {
> > diff --git a/drivers/net/ethernet/google/gve/gve_adminq.c b/drivers/net/ethernet/google/gve/gve_adminq.c
> > index 9c3ebdb547cf..1d9ae601cdeb 100644
> > --- a/drivers/net/ethernet/google/gve/gve_adminq.c
> > +++ b/drivers/net/ethernet/google/gve/gve_adminq.c
> > @@ -1612,3 +1612,48 @@ void gve_adminq_unmap_db_bar(struct gve_priv *priv)
> >
> >       pci_iounmap(pdev, priv->db_bar2);
> >   }
> > +
> > +int gve_adminq_set_num_ntfy_blks(struct gve_priv *priv)
>
> Would be best to change patch 2 to introduce this in the gve_adminq.c,
> to avoid trashing. Same for the other callbacks.

That’s a good suggestion, thanks. I will move these functions into
gve_adminq.c in the patch they’re introduced to reduce the churn.
>
>
> [..]
>
> >
> >   static const struct gve_ctrl_ops gve_adminq_ops = {
> > -     .map_db_bar      = gve_adminq_map_db_bar,
> > -     .unmap_db_bar    = gve_adminq_unmap_db_bar,
> > +     .map_db_bar             = gve_adminq_map_db_bar,
> > +     .unmap_db_bar           = gve_adminq_unmap_db_bar,
>
> pleaase instead use final spacing in the previous patch

Ack. Will fix in v4.
>
> > +     .set_num_queues         = gve_adminq_set_num_queues,
> > +     .set_num_ntfy_blks      = gve_adminq_set_num_ntfy_blks,
> >   };
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.