From nobody Fri Dec 19 15:48:16 2025 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (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 AC066350A11 for ; Thu, 6 Nov 2025 19:28:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762457298; cv=none; b=jBuePQrHWke/opCkc1IrF+mHeSgczLGdc6bCspjhPqiTu1A6VlRwZzFC3E0IYamJnQ9h9u8xUnwBwJvceBD+qzA2IsmhEYNV5TQT28ZCSfvijochVxlhBhD/qgd1eBU2+NVGsRprOIWyfQe4c/YaS+kao2nVZLVCivhojQA5cQY= 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.74 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-f74.google.com with SMTP id 98e67ed59e1d1-33da21394adso19555a91.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=WAFxY0OnlugzSrSeTGahOuE29h2gcwMGgE2Fy1crWUbwZ8oeP19i9r5LCMXhsvbODS 9xrjdhXVke731xOx6QVbJLjFA5aW/nWSSncxWrELtkrkNFgqV/GGkaky5XU3Xwyk4JG2 CydLTypi6fYbmPRt7Kjc5e+Fnzz9c5lRPkeaSW6/KQZGvgN013cqSy7/KtnvVDrTDY0t /UHLQrLD7PqeZG7n9vySiHHDIripvIQrlDWEFHOH4ItRbYdgeuiLN5UboEClxFQDwX9w xd2/zSqelNtCKQauh7zxFlMf25kKBpJYzHifmtmzEbxT4ZHWff2OjI7jyra9zeTIVcM0 3dLA== X-Forwarded-Encrypted: i=1; AJvYcCXwNX7Lepebb6zhYenhZ7o7763LbQYx/8i+A5ZCgYZSBOsm8P1euJg3wysPIoLwO6jbVh10PX3YCxc1t7Y=@vger.kernel.org X-Gm-Message-State: AOJu0YzMkEDrBufBRG9u4YpzgmMbnGnSQqFxYfFd8DKXeN8e65ypGBr5 mVe4/jA35Iv/ULE6UnKaqvZztdC9PLM82tIMlxC5z9l+3MXmHmKVwhNynUQYWVJd4/9K1i/lWO6 8cyKFJDKP1Hy3sQ== 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: linux-kernel@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-Transfer-Encoding: quoted-printable 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/ether= net/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, u= 32 queue_id, u32 flags) return 0; } =20 -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 =3D netdev_priv(dev); u16 max_xdp_mtu; =20 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; } =20 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; } =20 @@ -1727,17 +1730,20 @@ static int verify_xdp_configuration(struct net_devi= ce *dev) max_xdp_mtu -=3D GVE_RX_PAD; =20 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; } =20 if (priv->rx_cfg.num_queues !=3D 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 n= umber 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 e= qual 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 equa= l 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 que= ues"); return -EINVAL; } return 0; @@ -1748,7 +1754,7 @@ static int gve_xdp(struct net_device *dev, struct net= dev_bpf *xdp) struct gve_priv *priv =3D netdev_priv(dev); int err; =20 - err =3D verify_xdp_configuration(dev); + err =3D gve_verify_xdp_configuration(dev, xdp->extack); if (err) return err; switch (xdp->command) { --=20 2.51.2.997.g839fc31de9-goog