From: Leon Romanovsky <leon@kernel.org>
To: Jeroen de Borst <jeroendb@google.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org
Subject: Re: [PATCH net-next] gve: Introduce a way to disable queue formats
Date: Mon, 30 Jan 2023 10:54:38 +0200 [thread overview]
Message-ID: <Y9eFznRPUJ2QnJXc@unreal> (raw)
In-Reply-To: <20230127190744.3721063-1-jeroendb@google.com>
On Fri, Jan 27, 2023 at 11:07:44AM -0800, Jeroen de Borst wrote:
> The device is capable of simultaneously supporting multiple
> queue formats. With this change the driver can deliberately
> pick a queue format.
>
> Signed-off-by: Jeroen de Borst <jeroendb@google.com>
> ---
> drivers/net/ethernet/google/gve/gve.h | 30 +++++++++-
> drivers/net/ethernet/google/gve/gve_adminq.c | 35 +++++++-----
> drivers/net/ethernet/google/gve/gve_ethtool.c | 57 ++++++++++++-------
> drivers/net/ethernet/google/gve/gve_main.c | 26 ++++++++-
> 4 files changed, 110 insertions(+), 38 deletions(-)
<...>
> /* Interrupt coalescing settings */
> u32 tx_coalesce_usecs;
> @@ -609,7 +613,7 @@ enum gve_service_task_flags_bit {
> GVE_PRIV_FLAGS_DO_RESET = 1,
> GVE_PRIV_FLAGS_RESET_IN_PROGRESS = 2,
> GVE_PRIV_FLAGS_PROBE_IN_PROGRESS = 3,
> - GVE_PRIV_FLAGS_DO_REPORT_STATS = 4,
> + GVE_PRIV_FLAGS_DO_REPORT_STATS = 4,
Not relevant change.
> };
<...>
> static u32 gve_get_priv_flags(struct net_device *netdev)
> {
> struct gve_priv *priv = netdev_priv(netdev);
> - u32 ret_flags = 0;
> -
> - /* Only 1 flag exists currently: report-stats (BIT(O)), so set that flag. */
> - if (priv->ethtool_flags & BIT(0))
> - ret_flags |= BIT(0);
> - return ret_flags;
> + return priv->ethtool_flags & GVE_PRIV_FLAGS_MASK;
It it possible to get ethtool_flags which has enabled bits other than
GVE_PRIV_FLAGS_MASK?
I would expect that gve_set_priv_flags() won't allow setting of such bits.
> }
>
> static int gve_set_priv_flags(struct net_device *netdev, u32 flags)
> {
> struct gve_priv *priv = netdev_priv(netdev);
> - u64 ori_flags, new_flags;
> + u32 ori_flags;
> + enum gve_queue_format new_format;
Reversed Xmas tree, please.
> +
> + /* Make sure there is a queue format to use */
> + if ((priv->ethtool_formats & flags) == 0) {
> + dev_err(&priv->pdev->dev,
> + "All available queue formats disabled\n");
> + return -EINVAL;
> + }
Thanks
next prev parent reply other threads:[~2023-01-30 8:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-27 19:07 [PATCH net-next] gve: Introduce a way to disable queue formats Jeroen de Borst
2023-01-30 8:54 ` Leon Romanovsky [this message]
2023-01-31 0:39 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y9eFznRPUJ2QnJXc@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=jeroendb@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox