From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D282F355041 for ; Thu, 6 Nov 2025 19:28:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762457298; cv=none; b=IAP4LZKcrhcADH6oCC1CwQrhDVzxYT9VjHJA/L7H0nBYG1L/PfkeqQ4Wq4L2IZa6ZTuitffx7g6EPOTvzKLcYVNNgRjhtAV19RWXVVjB+AoYpANu7CBgtAUoVdQXV+KUxDmryArD+xXcdW2N2pDf25+0xMDjO/kbvANI6eAy88k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762457298; c=relaxed/simple; bh=pcL4mwaNz826zqpYk9r6miFynK/UjPiuyy50810qFLw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=f3XYrYF1VtZSDwu+ptAZVI6EeFioryi5JfTdx3HOPJ49NcpbK07KDtTZEeder6ufnSlg9T2joctmGjnfDtF9SPAKMK+MwK4ge/Wdp8qzGStsvQiu2H8oOL148O7KJWvilXbdqQdYMVwSKkunkjbn2d2cel9ht2WwVKzy1zUfZ6A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joshwash.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=GCvW05bH; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--joshwash.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="GCvW05bH" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-33da21394adso19557a91.1 for ; Thu, 06 Nov 2025 11:28:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1762457296; x=1763062096; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=iKgJEyI/mY8AR1xsdJxGBP2wYE2Ojj7dC3lzuPfMB5Q=; b=GCvW05bHps3K0Tca2deUNoeHJJwg8ATqXCoLyOvJwtuv8zprmc+4h+s8vDkd/VQFyN TYPmIcBe60XRr9HFkyHkk2tBzRkncUtOjTsSvqE2BMpI9qvc3YLPHzhX2BxkxQArnWQd h0FV/uGvLHshQjDgWepPOUCwPslGvYvzljLL1E8eqwdqB763ePZmZMBXrUYPRVKoGh2k MLl5b47ahBBCiWprCCuOlWeA2ULHSrreUOxXOpwDfBxI2ajlxRjgnml4W1dqPaIBLhgv /jM7A1U7MKpda699DPzr5RykL9NpTyKeuE5uSZnFQimIOOlUX0gnz8+1IrbAzYjdkeVf lhkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762457296; x=1763062096; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iKgJEyI/mY8AR1xsdJxGBP2wYE2Ojj7dC3lzuPfMB5Q=; b=U+7hQRE0q/z3ajFFbgzhxwxq5dCKhOuryMFlMY4ja831oU+8oJWUWqYP9jSHLQ9VpO iJwiGvWVzmnvuQcjBebdNwtYKsODhKkspIjy0YWBuYatw/HIwPBSMjtwLKheYHHNXR9e H/WJLkG7wjHFwBdiQY1BgUSjfQFbL5/9IIp/ETG/bDfsRWdtM3C0KRyp5Q/4NQLhFG5J Bzdjfgdq3GzxYgnwlQ+1+vrcpdZGSF5aZORwOqPtfnoAgqYOveB80SecBgEjRNWFhQCy +Po3AF+TUHoe+1O4A/4I4LtxJkEqlUB908JESZIc0WKd4SE71nnFkYn4ZEXpH3mMA/Hd Z88Q== X-Gm-Message-State: AOJu0Yx6yLoklXIziTdHBijk0TrTQYnfCjFypJSXbPyMi0Yeju0Xtysa 2sBXX9xNZ7OZnZ+L88BbxtUBIEhjqYS1X4QLGLhUIiB8DvmpeyrFJR3A9gExPS5NzSx67IN3uiP VOX3iCKyyRAFo5C88890JLYQmSNiOneM571UcQxdKrkN0PmFZ6VRN5BrGbxAXqPFgqmMdrLFdDi 4MPKptBbP1mrYB4Io4a3IefN5Ju71uKto1DAaFdQtRTEIYXXQ= X-Google-Smtp-Source: AGHT+IHuoC9uSzkGJMnKST7Musb48MfIxk+yGYWyESYp6VWPanJk3sFt8EEnKt8WNeVDhpt7ClFHwkP8aV18dQ== X-Received: from pjvp5.prod.google.com ([2002:a17:90a:df85:b0:340:e523:10dd]) (user=joshwash job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3885:b0:340:bb64:c5e with SMTP id 98e67ed59e1d1-3434c4fa855mr370595a91.14.1762457295919; Thu, 06 Nov 2025 11:28:15 -0800 (PST) Date: Thu, 6 Nov 2025 11:27:44 -0800 In-Reply-To: <20251106192746.243525-1-joshwash@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251106192746.243525-1-joshwash@google.com> X-Mailer: git-send-email 2.51.2.1041.gc1ab5b90ca-goog Message-ID: <20251106192746.243525-3-joshwash@google.com> Subject: [PATCH net-next v3 2/4] gve: Use extack to log xdp config verification errors From: joshwash@google.com To: netdev@vger.kernel.org Cc: Joshua Washington , Harshitha Ramamurthy , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Willem de Bruijn , Praveen Kaligineedi , Ziwei Xiao , John Fraker , "Dr. David Alan Gilbert" , Ankit Garg , linux-kernel@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" From: Ankit Garg Plumb extack as it allows us to send more detailed error messages back and append 'gve' suffix to method name per convention. NL_SET_ERR_MSG_FMT_MOD doesn't support format string longer than 80 chars so keeping netdev warning with actual queue count details. Signed-off-by: Ankit Garg Reviewed-by: Harshitha Ramamurthy Reviewed-by: Willem de Bruijn Signed-off-by: Joshua Washington --- Changes in v3: * Removed newline from extack messages (Jakub Kicinski) Changes in v2: * Add this patch to the series for RX buffer length management (Jakub Kicinski) --- drivers/net/ethernet/google/gve/gve_main.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c index 453e40a..c1d9916 100644 --- a/drivers/net/ethernet/google/gve/gve_main.c +++ b/drivers/net/ethernet/google/gve/gve_main.c @@ -1707,18 +1707,21 @@ static int gve_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags) return 0; } -static int verify_xdp_configuration(struct net_device *dev) +static int gve_verify_xdp_configuration(struct net_device *dev, + struct netlink_ext_ack *extack) { struct gve_priv *priv = netdev_priv(dev); u16 max_xdp_mtu; if (dev->features & NETIF_F_LRO) { - netdev_warn(dev, "XDP is not supported when LRO is on.\n"); + NL_SET_ERR_MSG_MOD(extack, + "XDP is not supported when LRO is on."); return -EOPNOTSUPP; } if (priv->header_split_enabled) { - netdev_warn(dev, "XDP is not supported when header-data split is enabled.\n"); + NL_SET_ERR_MSG_MOD(extack, + "XDP is not supported when header-data split is enabled."); return -EOPNOTSUPP; } @@ -1727,17 +1730,20 @@ static int verify_xdp_configuration(struct net_device *dev) max_xdp_mtu -= GVE_RX_PAD; if (dev->mtu > max_xdp_mtu) { - netdev_warn(dev, "XDP is not supported for mtu %d.\n", - dev->mtu); + NL_SET_ERR_MSG_FMT_MOD(extack, + "XDP is not supported for mtu %d.", + dev->mtu); return -EOPNOTSUPP; } if (priv->rx_cfg.num_queues != priv->tx_cfg.num_queues || (2 * priv->tx_cfg.num_queues > priv->tx_cfg.max_queues)) { - netdev_warn(dev, "XDP load failed: The number of configured RX queues %d should be equal to the number of configured TX queues %d and the number of configured RX/TX queues should be less than or equal to half the maximum number of RX/TX queues %d", - priv->rx_cfg.num_queues, - priv->tx_cfg.num_queues, + netdev_warn(dev, + "XDP load failed: The number of configured RX queues %d should be equal to the number of configured TX queues %d and the number of configured RX/TX queues should be less than or equal to half the maximum number of RX/TX queues %d.", + priv->rx_cfg.num_queues, priv->tx_cfg.num_queues, priv->tx_cfg.max_queues); + NL_SET_ERR_MSG_MOD(extack, + "XDP load failed: The number of configured RX queues should be equal to the number of configured TX queues and the number of configured RX/TX queues should be less than or equal to half the maximum number of RX/TX queues"); return -EINVAL; } return 0; @@ -1748,7 +1754,7 @@ static int gve_xdp(struct net_device *dev, struct netdev_bpf *xdp) struct gve_priv *priv = netdev_priv(dev); int err; - err = verify_xdp_configuration(dev); + err = gve_verify_xdp_configuration(dev, xdp->extack); if (err) return err; switch (xdp->command) { -- 2.51.2.997.g839fc31de9-goog