[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANLc=autx-MmR+Sm40QaNsJ3sit2RuD=J8=cLHZK-PrtYVRxwg@mail.gmail.com>
Date: Wed, 1 May 2024 16:27:38 -0700
From: Shailend Chand <shailend@...gle.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: netdev@...r.kernel.org, almasrymina@...gle.com, davem@...emloft.net,
edumazet@...gle.com, hramamurthy@...gle.com, jeroendb@...gle.com,
kuba@...nel.org, pabeni@...hat.com, pkaligineedi@...gle.com,
willemb@...gle.com
Subject: Re: [PATCH net-next 03/10] gve: Add adminq funcs to add/remove a
single Rx queue
On Wed, May 1, 2024 at 6:50 AM Willem de Bruijn
<willemdebruijn.kernel@...il.com> wrote:
>
> Shailend Chand wrote:
> > This allows for implementing future ndo hooks that act on a single
> > queue.
> >
> > Tested-by: Mina Almasry <almasrymina@...gle.com>
> > Reviewed-by: Praveen Kaligineedi <pkaligineedi@...gle.com>
> > Reviewed-by: Harshitha Ramamurthy <hramamurthy@...gle.com>
> > Signed-off-by: Shailend Chand <shailend@...gle.com>
>
> > +static int gve_adminq_create_rx_queue(struct gve_priv *priv, u32 queue_index)
> > +{
> > + union gve_adminq_command cmd;
> > +
> > + gve_adminq_get_create_rx_queue_cmd(priv, &cmd, queue_index);
> > return gve_adminq_issue_cmd(priv, &cmd);
> > }
> >
> > +int gve_adminq_create_single_rx_queue(struct gve_priv *priv, u32 queue_index)
> > +{
> > + union gve_adminq_command cmd;
> > +
> > + gve_adminq_get_create_rx_queue_cmd(priv, &cmd, queue_index);
> > + return gve_adminq_execute_cmd(priv, &cmd);
> > +}
> > +
> > int gve_adminq_create_rx_queues(struct gve_priv *priv, u32 num_queues)
> > {
> > int err;
> > @@ -727,17 +742,22 @@ int gve_adminq_destroy_tx_queues(struct gve_priv *priv, u32 start_id, u32 num_qu
> > return gve_adminq_kick_and_wait(priv);
> > }
> >
> > +static void gve_adminq_make_destroy_rx_queue_cmd(union gve_adminq_command *cmd,
> > + u32 queue_index)
> > +{
> > + memset(cmd, 0, sizeof(*cmd));
> > + cmd->opcode = cpu_to_be32(GVE_ADMINQ_DESTROY_RX_QUEUE);
> > + cmd->destroy_rx_queue = (struct gve_adminq_destroy_rx_queue) {
> > + .queue_id = cpu_to_be32(queue_index),
> > + };
> > +}
> > +
> > static int gve_adminq_destroy_rx_queue(struct gve_priv *priv, u32 queue_index)
> > {
> > union gve_adminq_command cmd;
> > int err;
> >
> > - memset(&cmd, 0, sizeof(cmd));
> > - cmd.opcode = cpu_to_be32(GVE_ADMINQ_DESTROY_RX_QUEUE);
> > - cmd.destroy_rx_queue = (struct gve_adminq_destroy_rx_queue) {
> > - .queue_id = cpu_to_be32(queue_index),
> > - };
> > -
> > + gve_adminq_make_destroy_rx_queue_cmd(&cmd, queue_index);
> > err = gve_adminq_issue_cmd(priv, &cmd);
> > if (err)
> > return err;
> > @@ -745,6 +765,19 @@ static int gve_adminq_destroy_rx_queue(struct gve_priv *priv, u32 queue_index)
> > return 0;
> > }
> >
> > +int gve_adminq_destroy_single_rx_queue(struct gve_priv *priv, u32 queue_index)
> > +{
> > + union gve_adminq_command cmd;
> > + int err;
> > +
> > + gve_adminq_make_destroy_rx_queue_cmd(&cmd, queue_index);
> > + err = gve_adminq_execute_cmd(priv, &cmd);
> > + if (err)
> > + return err;
> > +
> > + return 0;
> > +}
>
> This is identical to gve_adminq_destroy_rx_queue, bar for removing the
> file scope?
>
> Same for gve_adminq_create_rx_queue.
One doesn't immediately ring the doorbell, added a comment in v2
clarifying this.
Powered by blists - more mailing lists