From nobody Sat Feb 7 20:47:42 2026 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 EAB8D328612 for ; Thu, 13 Nov 2025 23:26:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763076377; cv=none; b=k2lsFWav9ip8PkXGFL4bl6/V/GW+NjIFz/5pv0m9olI+N3JyTUqylNuXUFgDRuDblY6UUSzB5ZdAwMVaFrPIZfGrUdfLQBwlujP/vQTkf/aqvcqemROiyH6lT5bXMufeQanXyD10MYiVGzy3Ft08DDKu3wV9JF847+yaiC8Iqgk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763076377; c=relaxed/simple; bh=s52FN6kZnvVR6k2YzgW8Df7RSitafE5fmZp21pzkkog=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YdBmZEW7jEk9Iyc50OtCybCpZmRcWm32sNrNClT0mGXsYiM+MLVCMgfdSAQq+cPCldIUO234ru3ZrwkGPpkgztlJqCrNecMuRM+P9pwfXvv+xehQo0gCwc7m+sMERUxIISvvM6AH6q59A0LFSQ/lf6gV3/b2VOQisHJQbNj+jmg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A61XuFFM; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A61XuFFM" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-477549b3082so11936545e9.0 for ; Thu, 13 Nov 2025 15:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763076374; x=1763681174; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=DRZeUmOPXFyDZUBPpLy6olifz91y1yIEQNkQRF4A6eM=; b=A61XuFFMko4Y/+ofYf1Z6bKwuKs3U29XbdlTihlOL6Ss42JtbNMn0dRkhA3GUCZ9JO nDJLkwg25u5+upXwYIP7V5ufLGMowUAp1Vle+E4JI1UIl2oaU4ZnRvhROqW9U7ouNL+y QYgOJAdoUSjGb7+ZtlOas3TLJhxTnfRTQpWewFODcOLxz+8fSDF2HHSGMAMql/G5aspv 2nbFbLmZETEbn55TwS+hqeAZPAOsuSy/vMynmv54yrurAbbb4vZTXu0HBjYKY2jBMKZr B5J1eBnxOidlFSjuIt5QdvHzyoNdyGJ2X/tmxqBy/V7fbtvi0KOuojE37VQKduN9VV6x majw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763076374; x=1763681174; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DRZeUmOPXFyDZUBPpLy6olifz91y1yIEQNkQRF4A6eM=; b=fxnZSHsVvZXtGxBf6CrTITaIo4/n3bkIX+ko02yn+xmgEJdHXv7v4S8veur+IINswv 9hM64WJ5PE4tgigKspuYgiyyS2Fi985X59tIVuwzU8DIi/HDv8ze80UmHE3mOAtu6DVY yG8VwvlrZRcRFkWmQlLyGpbPnLvne8moaBXb9Uq5SQmUu7XPuKnB4Exj2JS/h57VJxkR uhZWErh/hy7rpz/Uu08w8aVOjsOvOAQj2SZAthUBkD976ygosQP/1KFxFDQXG91vL9jf gICLD+OzSETw3vC4abwK4mSJrjSYMuZQUgVH2YDogleQ96iuCBVmXJ+V4loTVvRmJvBZ jsxg== X-Forwarded-Encrypted: i=1; AJvYcCUf1s93mn8YquKnaQW7AEQIXKujISkK4dlGkmmhI+32h42kFB2uZT0TF5hWeYR5iQm4FZxQRnV+ytj4ERI=@vger.kernel.org X-Gm-Message-State: AOJu0Ywk/JnI5KFPGmSudhQoS0fuzhb4/7jWmP4SwRwvOopIKbIpRDVL xpAHu8cJrB0NGA/RGkq79JsgIjTY0R2f/JhOidkPuIErwWv+70H2UfiC X-Gm-Gg: ASbGnct4FyfvBMebMxvOOpH9kRK9JRdMWBBzroJXqRr+EwFRfq2lRDHTgZ2B778fRRg RlQUjqH9OTQPBEB0JwFNNzwNvIMhziljN6y5NbkpDZqO2ONAkle6TtXNDvet7aGsqrxS/vNd+IU ffQTS7LLFgiPPdD5Fl79PziOpqMKBJ03VT6QBQW5n1qpn799sz65BjPXCHKbrE/sy0RG9P4D9jC RFe1uuYvTp6dmSCxzdlHkIWayFtUjNgmkNKdSVPO4erP3UucWanaMTk6MzBQqd0h4vAfIgrSB35 ROjI7G4Am9W+WPvKtP3+4V1wZjF52iaarftPRfiqadRjMOxr9kqQGZQez/YQT6V1LH7FNW9avnO qYvWy2Ge5Y0Azuev6kfTyGJZez274MczK37U/9pTAN3XcploZHLTv+9HburEY4Nh2+tvEIZ7W X-Google-Smtp-Source: AGHT+IFJ7mKysKsKOPwh7ai0stwsOyGRvHm+SxtTPB2Sd02mJGzCNzOAllBD3b8C4HAyiXZqFffnMQ== X-Received: by 2002:a05:600c:4695:b0:477:7b9a:bb1b with SMTP id 5b1f17b1804b1-4778fea681fmr11438215e9.32.1763076374096; Thu, 13 Nov 2025 15:26:14 -0800 (PST) Received: from localhost ([2a03:2880:31ff:6::]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b53e7b14bsm6254002f8f.9.2025.11.13.15.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Nov 2025 15:26:13 -0800 (PST) From: Mohsin Bashir To: netdev@vger.kernel.org Cc: alexanderduyck@fb.com, almasrymina@google.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, horms@kernel.org, kernel-team@meta.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, mohsin.bashr@gmail.com, pabeni@redhat.com, rmk+kernel@armlinux.org.uk Subject: [PATCH net-next V2] eth: fbnic: Configure RDE settings for pause frame Date: Thu, 13 Nov 2025 15:26:10 -0800 Message-ID: <20251113232610.1151712-1-mohsin.bashr@gmail.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" fbnic supports pause frames. When pause frames are enabled presumably user expects lossless operation from the NIC. Make sure we configure RDE (Rx DMA Engine) to DROP_NEVER mode to avoid discards due to delays in fetching Rx descriptors from the host. While at it enable DROP_NEVER when NIC only has a single queue configured. In this case the NIC acts as a FIFO so there's no risk of head-of-line blocking other queues by making RDE wait. If pause is disabled this just moves the packet loss from the DMA engine to the Rx buffer. Remove redundant call to fbnic_config_drop_mode_rcq(), introduced by commit 0cb4c0a13723 ("eth: fbnic: Implement Rx queue alloc/start/stop/free"). This call does not add value as fbnic_enable_rcq(), which is called immediately afterward, already handles this. Although we do not support autoneg at this time, preserve tx_pause in .mac_link_up instead of fbnic_phylink_get_pauseparam() Signed-off-by: Mohsin Bashir Reviewed-by: Andrew Lunn --- Changelog: - Move preserving tx_pause from fbnic_phylink_set_pauseparam() to .mac_link= _up V1: https://lore.kernel.org/netdev/20251112180427.2904990-1-mohsin.bashr@gm= ail.com/ --- .../net/ethernet/meta/fbnic/fbnic_netdev.h | 2 ++ .../net/ethernet/meta/fbnic/fbnic_phylink.c | 3 +++ drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 26 ++++++++++++++++--- drivers/net/ethernet/meta/fbnic/fbnic_txrx.h | 1 + 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_netdev.h b/drivers/net/e= thernet/meta/fbnic/fbnic_netdev.h index b0a87c57910f..e6ca23a9957d 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_netdev.h +++ b/drivers/net/ethernet/meta/fbnic/fbnic_netdev.h @@ -73,6 +73,8 @@ struct fbnic_net { =20 /* Time stamping filter config */ struct kernel_hwtstamp_config hwtstamp_config; + + bool tx_pause; }; =20 int __fbnic_open(struct fbnic_net *fbn); diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_phylink.c b/drivers/net/= ethernet/meta/fbnic/fbnic_phylink.c index 7ce3fdd25282..62701923cfe9 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_phylink.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_phylink.c @@ -208,6 +208,9 @@ fbnic_phylink_mac_link_up(struct phylink_config *config, struct fbnic_net *fbn =3D netdev_priv(netdev); struct fbnic_dev *fbd =3D fbn->fbd; =20 + fbn->tx_pause =3D tx_pause; + fbnic_config_drop_mode(fbn, tx_pause); + fbd->mac->link_up(fbd, tx_pause, rx_pause); } =20 diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/eth= ernet/meta/fbnic/fbnic_txrx.c index 57e18a68f5d2..c2d7b67fec28 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c @@ -2574,11 +2574,15 @@ static void fbnic_enable_bdq(struct fbnic_ring *hpq= , struct fbnic_ring *ppq) } =20 static void fbnic_config_drop_mode_rcq(struct fbnic_napi_vector *nv, - struct fbnic_ring *rcq) + struct fbnic_ring *rcq, bool tx_pause) { + struct fbnic_net *fbn =3D netdev_priv(nv->napi.dev); u32 drop_mode, rcq_ctl; =20 - drop_mode =3D FBNIC_QUEUE_RDE_CTL0_DROP_IMMEDIATE; + if (!tx_pause && fbn->num_rx_queues > 1) + drop_mode =3D FBNIC_QUEUE_RDE_CTL0_DROP_IMMEDIATE; + else + drop_mode =3D FBNIC_QUEUE_RDE_CTL0_DROP_NEVER; =20 /* Specify packet layout */ rcq_ctl =3D FIELD_PREP(FBNIC_QUEUE_RDE_CTL0_DROP_MODE_MASK, drop_mode) | @@ -2588,6 +2592,21 @@ static void fbnic_config_drop_mode_rcq(struct fbnic_= napi_vector *nv, fbnic_ring_wr32(rcq, FBNIC_QUEUE_RDE_CTL0, rcq_ctl); } =20 +void fbnic_config_drop_mode(struct fbnic_net *fbn, bool tx_pause) +{ + int i, t; + + for (i =3D 0; i < fbn->num_napi; i++) { + struct fbnic_napi_vector *nv =3D fbn->napi[i]; + + for (t =3D 0; t < nv->rxt_count; t++) { + struct fbnic_q_triad *qt =3D &nv->qt[nv->txt_count + t]; + + fbnic_config_drop_mode_rcq(nv, &qt->cmpl, tx_pause); + } + } +} + static void fbnic_config_rim_threshold(struct fbnic_ring *rcq, u16 nv_idx,= u32 rx_desc) { u32 threshold; @@ -2637,7 +2656,7 @@ static void fbnic_enable_rcq(struct fbnic_napi_vector= *nv, u32 hds_thresh =3D fbn->hds_thresh; u32 rcq_ctl =3D 0; =20 - fbnic_config_drop_mode_rcq(nv, rcq); + fbnic_config_drop_mode_rcq(nv, rcq, fbn->tx_pause); =20 /* Force lower bound on MAX_HEADER_BYTES. Below this, all frames should * be split at L4. It would also result in the frames being split at @@ -2700,7 +2719,6 @@ static void __fbnic_nv_enable(struct fbnic_napi_vecto= r *nv) &nv->napi); =20 fbnic_enable_bdq(&qt->sub0, &qt->sub1); - fbnic_config_drop_mode_rcq(nv, &qt->cmpl); fbnic_enable_rcq(nv, &qt->cmpl); } } diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h b/drivers/net/eth= ernet/meta/fbnic/fbnic_txrx.h index ca37da5a0b17..27776e844e29 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h @@ -184,6 +184,7 @@ void fbnic_reset_netif_queues(struct fbnic_net *fbn); irqreturn_t fbnic_msix_clean_rings(int irq, void *data); void fbnic_napi_enable(struct fbnic_net *fbn); void fbnic_napi_disable(struct fbnic_net *fbn); +void fbnic_config_drop_mode(struct fbnic_net *fbn, bool tx_pause); void fbnic_enable(struct fbnic_net *fbn); void fbnic_disable(struct fbnic_net *fbn); void fbnic_flush(struct fbnic_net *fbn); --=20 2.47.3