]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
eth: fbnic: set FBNIC_QUEUE_RDE_CTL0_EN_HDR_SPLIT on RDE_CTL0
authorBobby Eshleman <bobbyeshleman@meta.com>
Thu, 12 Feb 2026 01:00:41 +0000 (17:00 -0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 17 Feb 2026 09:40:14 +0000 (10:40 +0100)
Fix EN_HDR_SPLIT configuration by writing the field to RDE_CTL0 instead
of RDE_CTL1.

Because drop mode configuration and header splitting enablement both use
RDE_CTL0, we consolidate these configurations into the single function
fbnic_config_drop_mode.

Fixes: 2b30fc01a6c7 ("eth: fbnic: Add support for HDS configuration")
Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Acked-by: Mohsin Bashir <mohsin.bashr@gmail.com>
Link: https://patch.msgid.link/20260211-fbnic-tcp-hds-fixes-v1-1-55d050e6f606@meta.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c

index e29959241ff3b444da393fa1c2aa1239fe528b73..4aaa928bf8ab39d248c6852296f85bb94a999e3c 100644 (file)
@@ -2591,7 +2591,8 @@ write_ctl:
 }
 
 static void fbnic_config_drop_mode_rcq(struct fbnic_napi_vector *nv,
-                                      struct fbnic_ring *rcq, bool tx_pause)
+                                      struct fbnic_ring *rcq, bool tx_pause,
+                                      bool hdr_split)
 {
        struct fbnic_net *fbn = netdev_priv(nv->napi.dev);
        u32 drop_mode, rcq_ctl;
@@ -2604,22 +2605,26 @@ static void fbnic_config_drop_mode_rcq(struct fbnic_napi_vector *nv,
        /* Specify packet layout */
        rcq_ctl = FIELD_PREP(FBNIC_QUEUE_RDE_CTL0_DROP_MODE_MASK, drop_mode) |
            FIELD_PREP(FBNIC_QUEUE_RDE_CTL0_MIN_HROOM_MASK, FBNIC_RX_HROOM) |
-           FIELD_PREP(FBNIC_QUEUE_RDE_CTL0_MIN_TROOM_MASK, FBNIC_RX_TROOM);
+           FIELD_PREP(FBNIC_QUEUE_RDE_CTL0_MIN_TROOM_MASK, FBNIC_RX_TROOM) |
+           FIELD_PREP(FBNIC_QUEUE_RDE_CTL0_EN_HDR_SPLIT, hdr_split);
 
        fbnic_ring_wr32(rcq, FBNIC_QUEUE_RDE_CTL0, rcq_ctl);
 }
 
-void fbnic_config_drop_mode(struct fbnic_net *fbn, bool tx_pause)
+void fbnic_config_drop_mode(struct fbnic_net *fbn, bool txp)
 {
+       bool hds;
        int i, t;
 
+       hds = fbn->hds_thresh < FBNIC_HDR_BYTES_MIN;
+
        for (i = 0; i < fbn->num_napi; i++) {
                struct fbnic_napi_vector *nv = fbn->napi[i];
 
                for (t = 0; t < nv->rxt_count; t++) {
                        struct fbnic_q_triad *qt = &nv->qt[nv->txt_count + t];
 
-                       fbnic_config_drop_mode_rcq(nv, &qt->cmpl, tx_pause);
+                       fbnic_config_drop_mode_rcq(nv, &qt->cmpl, txp, hds);
                }
        }
 }
@@ -2670,20 +2675,18 @@ static void fbnic_enable_rcq(struct fbnic_napi_vector *nv,
 {
        struct fbnic_net *fbn = netdev_priv(nv->napi.dev);
        u32 log_size = fls(rcq->size_mask);
-       u32 hds_thresh = fbn->hds_thresh;
        u32 rcq_ctl = 0;
-
-       fbnic_config_drop_mode_rcq(nv, rcq, fbn->tx_pause);
+       bool hdr_split;
+       u32 hds_thresh;
 
        /* 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
         * L2/L3 depending on the frame size.
         */
-       if (fbn->hds_thresh < FBNIC_HDR_BYTES_MIN) {
-               rcq_ctl = FBNIC_QUEUE_RDE_CTL0_EN_HDR_SPLIT;
-               hds_thresh = FBNIC_HDR_BYTES_MIN;
-       }
+       hdr_split = fbn->hds_thresh < FBNIC_HDR_BYTES_MIN;
+       fbnic_config_drop_mode_rcq(nv, rcq, fbn->tx_pause, hdr_split);
 
+       hds_thresh = max(fbn->hds_thresh, FBNIC_HDR_BYTES_MIN);
        rcq_ctl |= FIELD_PREP(FBNIC_QUEUE_RDE_CTL1_PADLEN_MASK, FBNIC_RX_PAD) |
                   FIELD_PREP(FBNIC_QUEUE_RDE_CTL1_MAX_HDR_MASK, hds_thresh) |
                   FIELD_PREP(FBNIC_QUEUE_RDE_CTL1_PAYLD_OFF_MASK,