[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240418184851.5cc11647@kernel.org>
Date: Thu, 18 Apr 2024 18:48:51 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Shailend Chand <shailend@...gle.com>
Cc: netdev@...r.kernel.org, almasrymina@...gle.com, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, willemb@...gle.com
Subject: Re: [RFC PATCH net-next 9/9] gve: Implement queue api
On Thu, 18 Apr 2024 19:51:59 +0000 Shailend Chand wrote:
> +static int gve_rx_queue_stop(struct net_device *dev, int idx,
> + void **out_per_q_mem)
> +{
> + struct gve_priv *priv = netdev_priv(dev);
> + struct gve_rx_ring *rx;
> + int err;
> +
> + if (!priv->rx)
> + return -EAGAIN;
> + if (idx < 0 || idx >= priv->rx_cfg.max_queues)
> + return -ERANGE;
A little too defensive? Core should not issue these > current real num
queues.
> + /* Destroying queue 0 while other queues exist is not supported in DQO */
> + if (!gve_is_gqi(priv) && idx == 0)
> + return -ERANGE;
> +
> + rx = kvzalloc(sizeof(*rx), GFP_KERNEL);
Why allocate in the driver rather than let the core allocate based on
the declared size ?
Powered by blists - more mailing lists