From patchwork Mon Jan 13 06:39:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13936778 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 1E504230D32 for ; Mon, 13 Jan 2025 06:40:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750410; cv=none; b=AZ7w7jd8MIiKtmFTC4pH3F2M42Og5EFIabJ5ASfA1RySctS1E9LiI2EtnimoHnY4lOJXkNRsYorDWnlrZiUWxJZsgrOTxezaBBz1zITL7rrupsunM+RokSiYW0z9unSEoX6cCSoPHwvOwPscezcGcVfSP4u44k2D435d/J5n24Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750410; c=relaxed/simple; bh=mC+E9RwuFdjOgnkpmUfX9FY4jDWN/NFSd1zxwMrJIus=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pTNKYUIMaZmyuUhRUQya1FmzBSz3e9I5kMyttTi1xrOQVF0LW6GDavpBoyLZ5SlDPN/ZGY2SP3do+sbhCOjMgh9I+VSWxrOfQAaO6ujpVmnJ5mxIF2y6dJglCSbZkTz2Zx/5noy9Gjf1yBob2Y5wz6tdvzc25ooZu+Ja3IKnimw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=Om9sbzye; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Om9sbzye" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-216395e151bso46678085ad.0 for ; Sun, 12 Jan 2025 22:40:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1736750408; x=1737355208; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=y+1wX2t3VqddUuQuqxX59a5UXsvxBQwbhQtXzmJevDk=; b=Om9sbzyeu+jV8Y3eB/eBuuVmFMQuVqzN4pF5j7oFoHNbgW6M+WVCnhvTJsZTnn3MAw pNrmDYno5umuKoO8aK7G4fCyYFPVIJCTOxILQF/g+E7WVTX6yYphAMamlf4498KP2oBm S3ZPB4OHw/YaiZ7wljDUmfrq56qT37fsEvAe8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736750408; x=1737355208; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y+1wX2t3VqddUuQuqxX59a5UXsvxBQwbhQtXzmJevDk=; b=BbjitJUsHU45JEd+QNpt3SA/1ZGamiCDeFn/K9GyF4yRiOE60qlD96oAk+h4fPQn0P /fDm6+ON4NEwFYmkiz9zILCpta6cm2sC8OxQXYhrMYWJaxAmoC6i2CvWorkJsyL0QTlh FFzhPTmzKNKm5Ly6ZpBYzuVHf+7djtX5crkidYm2UBSMy08XDQnuoD69qPHCAkN5HqMy jdcs8kiGxDg1AhIODKseY1R4ZvDO9fttdZ+ZS68vpFU0bBQ/y2Hv85PrnbEMbxVlJrNF OpeGmJeO/1GmxUoVL7DRWmERHHd9rgy3pXE2KOvpZ/g8tY2Gk7Ko8KtMmdAl5jGzUHE4 KMMQ== X-Gm-Message-State: AOJu0YyAY/R2MhfvewsioLw7sHcwEDohZ2Fqwv4vmqlw52/UhXGjx2ha bwwN0q2OUYAmWaNBCdxB+2KhZoMe0b+n8q6ke8YpyKM7jh3H1144O8jBwnf4LQ== X-Gm-Gg: ASbGncs8m+syTjkY+3h+EdlAxt5ohsmQNrmyOllFMdAbaKLHntX+2nRX7SXjAjqEJlo cWvPddCCe4Z2Wm9ttLceF+cI/9QwOAJ5OhAeHDfleHWjspW45BVKJdkoL+ZYq626xlk19qTyVZZ 6bySkMaiIiAdspK5TuluEQTwP25rebIbH/iNeDppqeZyJ6mAbfFQd+q821WC6UIvi9m6wO1khef qyThzhxZkmlDFgOzUtwIDDYYwamOtJl0vbHN8SPjIpIRs3eV3st7AlJuDV4FchPwG9SpEkU8EPo Od7rPtjgAFWKLlWv8fcomp9Jo9pjKPHD X-Google-Smtp-Source: AGHT+IGEzCmK+JS8UEJHTWm8JX0EEL7tOIj6hQKgYAN5QIzO9zRukA8GlFMLbsziwcoyGYcjpdOIog== X-Received: by 2002:a17:902:dac9:b0:215:742e:5cff with SMTP id d9443c01a7336-21ad9f7ca15mr110659545ad.16.1736750408322; Sun, 12 Jan 2025 22:40:08 -0800 (PST) Received: from lvnvda3289.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f254264sm46488165ad.233.2025.01.12.22.40.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 22:40:07 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, somnath.kotur@broadcom.com Subject: [PATCH net-next 01/10] bnxt_en: Set NAPR 1.2 support when registering with firmware Date: Sun, 12 Jan 2025 22:39:18 -0800 Message-ID: <20250113063927.4017173-2-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20250113063927.4017173-1-michael.chan@broadcom.com> References: <20250113063927.4017173-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org NPAR 1.2 adds a transparent VLAN tag for all packets between the NIC and the switch. Because of that, RX VLAN acceleration cannot be supported for any additional host configured VLANs. The driver has to acknowledge that it can support no RX VLAN acceleration and set the NPAR 1.2 supported flag when registering with the FW. Otherwise, the FW call will fail and the driver will abort on these NPAR 1.2 NICs with this error: bnxt_en 0000:26:00.0 (unnamed net_device) (uninitialized): hwrm req_type 0x1d seq id 0xb error 0x2 Reviewed-by: Somnath Kotur Signed-off-by: Michael Chan Reviewed-by: Michal Swiatkowski --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +++++ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 884d42db5554..8527788bed91 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -5537,6 +5537,8 @@ int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp, unsigned long *bmap, int bmap_size, if (bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY) flags |= FUNC_DRV_RGTR_REQ_FLAGS_ERROR_RECOVERY_SUPPORT | FUNC_DRV_RGTR_REQ_FLAGS_MASTER_SUPPORT; + if (bp->fw_cap & BNXT_FW_CAP_NPAR_1_2) + flags |= FUNC_DRV_RGTR_REQ_FLAGS_NPAR_1_2_SUPPORT; req->flags = cpu_to_le32(flags); req->ver_maj_8b = DRV_VER_MAJ; req->ver_min_8b = DRV_VER_MIN; @@ -8338,6 +8340,7 @@ static int bnxt_hwrm_func_qcfg(struct bnxt *bp) switch (resp->port_partition_type) { case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_0: + case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_2: case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_5: case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR2_0: bp->port_partition_type = resp->port_partition_type; @@ -9502,6 +9505,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) bp->fw_cap |= BNXT_FW_CAP_HOT_RESET_IF; if (BNXT_PF(bp) && (flags_ext & FUNC_QCAPS_RESP_FLAGS_EXT_FW_LIVEPATCH_SUPPORTED)) bp->fw_cap |= BNXT_FW_CAP_LIVEPATCH; + if (flags_ext & FUNC_QCAPS_RESP_FLAGS_EXT_NPAR_1_2_SUPPORTED) + bp->fw_cap |= BNXT_FW_CAP_NPAR_1_2; if (BNXT_PF(bp) && (flags_ext & FUNC_QCAPS_RESP_FLAGS_EXT_DFLT_VLAN_TPID_PCP_SUPPORTED)) bp->fw_cap |= BNXT_FW_CAP_DFLT_VLAN_TPID_PCP; if (flags_ext & FUNC_QCAPS_RESP_FLAGS_EXT_BS_V2_SUPPORTED) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index 094c9e95b463..a634ad76177d 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -2488,6 +2488,7 @@ struct bnxt { #define BNXT_FW_CAP_CFA_RFS_RING_TBL_IDX_V3 BIT_ULL(39) #define BNXT_FW_CAP_VNIC_RE_FLUSH BIT_ULL(40) #define BNXT_FW_CAP_SW_MAX_RESOURCE_LIMITS BIT_ULL(41) + #define BNXT_FW_CAP_NPAR_1_2 BIT_ULL(42) u32 fw_dbg_cap; From patchwork Mon Jan 13 06:39:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13936779 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 5A133231A4A for ; Mon, 13 Jan 2025 06:40:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750411; cv=none; b=eSq8zLGnKa9/IYTZWsTyLjlKgNBHBvn/cZrozHc3zI3gYUZTIIiXKpAAjeAZ7qGbZ2NiCHHUVlUpKpuokixT1k4tFQ9GQcny/IAKl/BnirAzS6HFtfkIKqy5TV+bXt9ggcbcBGeVyKwx2Y9Be8f7+XK8+ovuzgwBtwZA5jKChhw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750411; c=relaxed/simple; bh=Dea4pR4cXk5qEykXZBDAOpCwQbiXY+FuOOAR5KVZaAg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WgEi5vLo7K4I47bA0MX7LpcNR+bxxt7zbq8hQ2eMA+/Wsx+1xDylsfxshBPD5cleESXgL4px8u/eiKwXg83t8z9lLIXDFOc0Yi/f41GjTXn4cSmeVLsT17Pufl2XUhhqjglGpyIHq7oesZrLPfn4z0zZaQJzVmpQ5ar65qvyNiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=KF6DYAd9; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="KF6DYAd9" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-21619108a6bso65444735ad.3 for ; Sun, 12 Jan 2025 22:40:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1736750409; x=1737355209; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hb9UUNYI4XDM0CINWyjo9QkwgzJgOZdvnwHvpE3CNYo=; b=KF6DYAd97faH/ir3HLRPkUoYa4CsdUVs5mLVU6BfU0N/ZKfvP9VNBxOEZIH+GruR75 UIEnwRAja8nV4OZUaN4siMDmWQ6ZcCHtmVg0BYQ5RXkt/FW0AKgM8lxtlFeVqNhTQMNS ysdsCzIYx53ZN6TnWLUX2tuKgxvRkHh3xXYas= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736750409; x=1737355209; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hb9UUNYI4XDM0CINWyjo9QkwgzJgOZdvnwHvpE3CNYo=; b=fy07dwr4/KKxx1/er8DGwpOvDVW8dosPzFvB9OEjemeMoZ/or34rZRgpv5KCnkXulU 8UzD6nxT+rFMBCWL3NRk+DQP43+Nz4CvURcKocGA9wS+Anb7NnlsFpWf3+4z2GQjuih4 x3Oc8uxUwndNcTB6ZuM4TS+oFnFFl7oAa41VfAM7MZ1Dlc6CcwOkDWffi6Qld5B3rKqQ Sa7ymOrw2YlAoPlXAwIQGQqCrYXlsnfIbPIqfUa/jQQMHAAhDgteeEL1tXi5lfnIieJz ujUNkh89bbREg8kxUvzgz1FpkOt8lpkX8CugfIszKwawSO3tB2prwIRHNExcIU20E1RG 6VMQ== X-Gm-Message-State: AOJu0YwMb9dzfMCywGRaTo6affAX53zny/cpH3nzVXXRoI9GyXbSPEbw vv2ibJjaz04E7j/gR04wdip6nY1zWQNJZfIE+Yu52THndQrxuD+FpJS/BV0SGQ== X-Gm-Gg: ASbGncvyeKmskORvS9bxhOlFnFW1Elr5a+lFPKyClxsma5+me1cG/joVk9xgZtWqBhW TE9h58w9O2NAzlZK7OW4Svhu5PqCWjbwjJAXqeV6iv3Hu3QU1s3ST4M8R6xQXxR9DVlMI6a7LYl 8ttVaHEdDq5YhGetrkYQTEcA1rS2k27FK5VjoioAAEi1v9Xuf1CaOBZ96ENZ/+XD3WcRvk8QEYj 8h/CTrqi1DBuyp699x1u91XFy1ukhk6Omlt7C42rQi/bsFMvmuy5PmnVoyS1eQIR8iq1R6j0AMa 4VLJ5IggKhEbxUq+Cz+MO5PtPtsLS+gM X-Google-Smtp-Source: AGHT+IEKDv32Lcu4FcodgUY3SJqGI/Vo8bgnCCXkggot/VSstFC5he5DHZULs/dSni5olplKBRPN3w== X-Received: by 2002:a17:902:ea09:b0:216:2a36:5b2e with SMTP id d9443c01a7336-21a83f76879mr287978995ad.32.1736750409652; Sun, 12 Jan 2025 22:40:09 -0800 (PST) Received: from lvnvda3289.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f254264sm46488165ad.233.2025.01.12.22.40.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 22:40:09 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, somnath.kotur@broadcom.com, Ajit Khaparde Subject: [PATCH net-next 02/10] bnxt_en Refactor completion ring allocation logic for P5_PLUS chips Date: Sun, 12 Jan 2025 22:39:19 -0800 Message-ID: <20250113063927.4017173-3-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20250113063927.4017173-1-michael.chan@broadcom.com> References: <20250113063927.4017173-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add a new bnxt_hwrm_cp_ring_alloc_p5() function to handle allocating one completion ring on P5_PLUS chips. This simplifies the existing code and will be useful later in the series. Reviewed-by: Ajit Khaparde Signed-off-by: Michael Chan Reviewed-by: Michal Swiatkowski --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 44 +++++++++++------------ 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 8527788bed91..d364a707664b 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -7172,6 +7172,25 @@ static int bnxt_hwrm_rx_agg_ring_alloc(struct bnxt *bp, return 0; } +static int bnxt_hwrm_cp_ring_alloc_p5(struct bnxt *bp, + struct bnxt_cp_ring_info *cpr) +{ + struct bnxt_napi *bnapi = cpr->bnapi; + u32 type = HWRM_RING_ALLOC_CMPL; + struct bnxt_ring_struct *ring; + u32 map_idx = bnapi->index; + int rc; + + ring = &cpr->cp_ring_struct; + ring->handle = BNXT_SET_NQ_HDL(cpr); + rc = hwrm_ring_alloc_send_msg(bp, ring, type, map_idx); + if (rc) + return rc; + bnxt_set_db(bp, &cpr->cp_db, type, map_idx, ring->fw_ring_id); + bnxt_db_cq(bp, &cpr->cp_db, cpr->cp_raw_cons); + return 0; +} + static int bnxt_hwrm_ring_alloc(struct bnxt *bp) { bool agg_rings = !!(bp->flags & BNXT_FLAG_AGG_RINGS); @@ -7215,19 +7234,9 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp) u32 map_idx; if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) { - struct bnxt_cp_ring_info *cpr2 = txr->tx_cpr; - struct bnxt_napi *bnapi = txr->bnapi; - u32 type2 = HWRM_RING_ALLOC_CMPL; - - ring = &cpr2->cp_ring_struct; - ring->handle = BNXT_SET_NQ_HDL(cpr2); - map_idx = bnapi->index; - rc = hwrm_ring_alloc_send_msg(bp, ring, type2, map_idx); + rc = bnxt_hwrm_cp_ring_alloc_p5(bp, txr->tx_cpr); if (rc) goto err_out; - bnxt_set_db(bp, &cpr2->cp_db, type2, map_idx, - ring->fw_ring_id); - bnxt_db_cq(bp, &cpr2->cp_db, cpr2->cp_raw_cons); } ring = &txr->tx_ring_struct; map_idx = i; @@ -7247,20 +7256,9 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp) if (!agg_rings) bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod); if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) { - struct bnxt_cp_ring_info *cpr2 = rxr->rx_cpr; - struct bnxt_napi *bnapi = rxr->bnapi; - u32 type2 = HWRM_RING_ALLOC_CMPL; - struct bnxt_ring_struct *ring; - u32 map_idx = bnapi->index; - - ring = &cpr2->cp_ring_struct; - ring->handle = BNXT_SET_NQ_HDL(cpr2); - rc = hwrm_ring_alloc_send_msg(bp, ring, type2, map_idx); + rc = bnxt_hwrm_cp_ring_alloc_p5(bp, rxr->rx_cpr); if (rc) goto err_out; - bnxt_set_db(bp, &cpr2->cp_db, type2, map_idx, - ring->fw_ring_id); - bnxt_db_cq(bp, &cpr2->cp_db, cpr2->cp_raw_cons); } } From patchwork Mon Jan 13 06:39:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13936780 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 7BDB7231C9D for ; Mon, 13 Jan 2025 06:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750413; cv=none; b=uPhuNFxljG3jsLJon4eV5g91QvJNk+vq5AbUrCsLdBQ4pNDvHTfXAin+E4RlKgPNuGQ8odUAMgLT/CgEzzKU5y6tKeYgcD8kXQWAqkxsM76nmCXs+ApRfK8yFqYob+QdLM9Ukou67NCeyr7d+p/J6+rEFimxw/KX8LGHzGALhNA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750413; c=relaxed/simple; bh=eUdmp/KPsiALefk+9mhYNve58+cZAnyd1eIrO/48gYM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mGcDwmdwj8QVJnuu2UGoEj5w84cGq2lVGHp6Nwq7wkZUn4Y+F6vSrQLi1aAvdA13ItWV/4+jvKZKF4hM5riZhBWGmruumU7WFwNNlT1KtPKxBl9KeHeszDR+Z/xLYWZe5h2nO7WXGXaSaewvadv0/mCSedTWRx/sFVS7fHhlUWc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=K9kjYbLF; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="K9kjYbLF" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2167141dfa1so67692275ad.1 for ; Sun, 12 Jan 2025 22:40:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1736750411; x=1737355211; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0Ms5zo6ZPdW4ymWmsGL4fzbsL1eE26sA6YU5s5fC1Lo=; b=K9kjYbLF0U/Fc2qxQnJRCW/zEb/zDByH36FiCVLXxYEUxKmRdZHoLdNArU7W1zCiJv QFxnVboirx8WoLT3QdYN/ikueMiimiJJd4oU+/j691XcoBjskcD0j70aXXwF91+LMpP1 LVcWF9NWWwantt2aI8PStPntK6IxzzOb1fdSE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736750411; x=1737355211; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0Ms5zo6ZPdW4ymWmsGL4fzbsL1eE26sA6YU5s5fC1Lo=; b=YxwkmS5HvNB9rMNObvXyCuUqhAQW9Ysvw3Cp44jAQmYKpyZD5DeatR2iW8CVo/cq/t QHbJPc/UlQlHkW3Ds+sFSlzn7W7U7T3mHu/iZ4S3EMPP6GzkK50daNZ29MtaXMb3gwNR +mNVt4HwR4lSCz+tKlyuO5ylZJMNs1eSkUXWsxqqVCLNcOe6sUGisPu6Oukm95M46STt Sojs4uxjaAnmhkMoxtiic07Rg36beZMPsi+RmwwpcAouBKRQaszlU5ixWO8S3UExfYgJ t9EjNgeyqBuI1oOlX8dWIhQgQe9MJMXmQ43t5UJyl7n7FTXGIu+I0ClDzsuQaLPBZ4qX dRvw== X-Gm-Message-State: AOJu0Yy1AzXokcykTb3T8QCBqezqUVgpdaXffzDEmQLpnIjILb7okS6t ZmUK68qWoGnxUNOa3mjfEq/ngBNPVURqfcuaacpPzx0fjWpvLe7jwHt5bFG/qA== X-Gm-Gg: ASbGnctRj82u1LBu29eL0ygXAG2z5rK7gqGA162q9V4b0aifVAO5TBCNbR3sA5fnD31 we0tDNogXR4pMUxm9bcKsahRfKSMKAomzlBxYWIIWE3+55OSt27h1Z0cIQhyAdlF+Y5g28DyQA6 kHnIg/T21EMqAoE6+nztC/dLuypr91qu+xB5ZpCTbqRsenle6hV3bHo995IPOEew08KzCgqHoyS 3NvbR32xju3w9aOkf4E3qVl3iP9kDIP+6UI/339A1xVORThhGBkpZvV5XIEf9pd6ZJExhrMtEiy jsiovzwmYqwPb5KyvyS+2x58COLbSgpp X-Google-Smtp-Source: AGHT+IHh694P97QPocB8y0Rcu+Ea1eTKhHRm9Px3euNWf8A93IS1uukmOlDjQ7BVclKkwlBbWTrg/A== X-Received: by 2002:a17:902:c407:b0:215:44fe:163d with SMTP id d9443c01a7336-21ad9f7ebe1mr94178415ad.17.1736750410831; Sun, 12 Jan 2025 22:40:10 -0800 (PST) Received: from lvnvda3289.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f254264sm46488165ad.233.2025.01.12.22.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 22:40:10 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, somnath.kotur@broadcom.com, Ajit Khaparde Subject: [PATCH net-next 03/10] bnxt_en: Refactor TX ring allocation logic Date: Sun, 12 Jan 2025 22:39:20 -0800 Message-ID: <20250113063927.4017173-4-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20250113063927.4017173-1-michael.chan@broadcom.com> References: <20250113063927.4017173-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add a new bnxt_hwrm_tx_ring_alloc() function to handle allocating a transmit ring. This will be useful later in the series. Reviewed-by: Ajit Khaparde Signed-off-by: Michael Chan Reviewed-by: Michal Swiatkowski --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index d364a707664b..e9a2e30c1537 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -7191,6 +7191,20 @@ static int bnxt_hwrm_cp_ring_alloc_p5(struct bnxt *bp, return 0; } +static int bnxt_hwrm_tx_ring_alloc(struct bnxt *bp, + struct bnxt_tx_ring_info *txr, u32 tx_idx) +{ + struct bnxt_ring_struct *ring = &txr->tx_ring_struct; + u32 type = HWRM_RING_ALLOC_TX; + int rc; + + rc = hwrm_ring_alloc_send_msg(bp, ring, type, tx_idx); + if (rc) + return rc; + bnxt_set_db(bp, &txr->tx_db, type, tx_idx, ring->fw_ring_id); + return 0; +} + static int bnxt_hwrm_ring_alloc(struct bnxt *bp) { bool agg_rings = !!(bp->flags & BNXT_FLAG_AGG_RINGS); @@ -7227,23 +7241,17 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp) } } - type = HWRM_RING_ALLOC_TX; for (i = 0; i < bp->tx_nr_rings; i++) { struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; - struct bnxt_ring_struct *ring; - u32 map_idx; if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) { rc = bnxt_hwrm_cp_ring_alloc_p5(bp, txr->tx_cpr); if (rc) goto err_out; } - ring = &txr->tx_ring_struct; - map_idx = i; - rc = hwrm_ring_alloc_send_msg(bp, ring, type, map_idx); + rc = bnxt_hwrm_tx_ring_alloc(bp, txr, i); if (rc) goto err_out; - bnxt_set_db(bp, &txr->tx_db, type, map_idx, ring->fw_ring_id); } for (i = 0; i < bp->rx_nr_rings; i++) { From patchwork Mon Jan 13 06:39:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13936781 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 B8E11232369 for ; Mon, 13 Jan 2025 06:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750415; cv=none; b=nVRdVIY29b7l/KrtdezO7yIcWeNY7rV/kTgSUm1SiaREEH2CLjgLEzXHFy7XkRe7iD+LZBLwRDNckoezHWqBKzB2zTUbMYf+v2TGRWq2Kyez4cvFhctM2cFr5rJGi5MttM4Uekd+DizsfmpIhkmJaAW5t3BkB6Z4mHACoZTgbW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750415; c=relaxed/simple; bh=7xGbNKfDlDXcmJ3zEHTqOX5f6MHoW+qO6bLiXgRv4t0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QXPnOoqEnAId2I2+f9WRI138M+pszf04tjnEYTClhTp5HGiYQMtOTEbHTrSln5D7JLD4Cxt5jbwCRjg4bEZpx+ePtt2EY98EuqDZ3jdGgR8OEY8L53E3WSHDnvqQZeKikaAVPdFIKEZcJU/iRJmoQAV6BBaA7BzxwtY3jEbZJeY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=P2O+tN5t; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="P2O+tN5t" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-21654fdd5daso63893765ad.1 for ; Sun, 12 Jan 2025 22:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1736750412; x=1737355212; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zbm+qmkEZ6i8uKzVe9Rp2TsXkqbq1pLB5M2HUO7zAlQ=; b=P2O+tN5tUWjNdYYcv+bWQl0W6NaV5Mcum0zYPFb91lmsh2a3026tmWt9Vg0Hk3EgFs GEapKOsh7hzkpTvHui6IWrzGp6QeIcTMZvg6NNszGD2pfD9+g+KpeOaPUu92cTla2Iwg jKF3W2aMQWjUxIA46g0Y3cf3SZXJgPDB6miYE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736750412; x=1737355212; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zbm+qmkEZ6i8uKzVe9Rp2TsXkqbq1pLB5M2HUO7zAlQ=; b=aOZRJd03ETrjRB3l6qSzVLrYn56c6/QqVFPgS/uyIuSHUPjAIeFpjv/y6/8n484cKX uZSy1JdL6gEF7zt71k4Wh1rOIL91/YpK8uncErzwfvsroBoRSyXo1iyYgzmMAKFSDs6z nVGYoFP/xpu2su/19TkMi0UMfuChEz7oXCZvDHJGPv8On1ygZs3iE1Da7+9Hvt4NTaWb o8HAxG8gT4nWKSwAcZWYNJJAS6GiUlpktvs9i9XfettsrLXjvvTMDgxSLsysJjBMTrFc rO8hFpA8LTRw9oyWkIFbI7392NBbwN1ILsUmHlja8UhOwt/pVm/1T9Lk/R7RFrl3kWlq imWQ== X-Gm-Message-State: AOJu0YxUht/eF8FsA7zWfwNMw8k2jA7vMtvO2kubcMRoOOXjS0LqMof2 3ggEC8sB35/AZ/LMfNYoYToacTxI0HbROMeipIdMy92C+qJbTL05cVGAGP1SuQ== X-Gm-Gg: ASbGncsW30nH/ZIykWmTktwQPG8HnISNC2rqpAPxb4CnUxi8+u/wnEk0a3YdIMi2H14 ei2atO/NkhPL+pfrK1C69UqMVxIDyRGEH1sqJ+onYwGJemDhl+lDhpNk5/O88QAqbGP4R2TDcTw /TKzXKBONbP3kKcfvaS2erKbLb0fUom2KYqNqsMZWnKKnjT5qHNZief4ndhhdP0luKrWhpn2lIG S/2zAdpR+UGg6FfZ2Ozi2V2sWZ6rk+CVb/4S+OdzWdKF+v7gwVu+3AEqZvHTHCoK+VTmgiRQl4K tFrszJFoY3ZxcxZHv4T/XPmo1aoqY0No X-Google-Smtp-Source: AGHT+IH9U2F4rqzrw1L3+8gxJ12nQn0NL/IcdTdsvtxItHBlDBSmW6AkaMo29skKcZOjmCoBGriqKg== X-Received: by 2002:a17:903:186:b0:216:282d:c69b with SMTP id d9443c01a7336-21a84002ac6mr288513375ad.50.1736750412019; Sun, 12 Jan 2025 22:40:12 -0800 (PST) Received: from lvnvda3289.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f254264sm46488165ad.233.2025.01.12.22.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 22:40:11 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, somnath.kotur@broadcom.com, Kalesh AP Subject: [PATCH net-next 04/10] bnxt_en: Refactor completion ring free routine Date: Sun, 12 Jan 2025 22:39:21 -0800 Message-ID: <20250113063927.4017173-5-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20250113063927.4017173-1-michael.chan@broadcom.com> References: <20250113063927.4017173-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Somnath Kotur Add a wrapper routine to free L2 completion rings. This will be useful later in the series. Reviewed-by: Kalesh AP Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan Reviewed-by: Michal Swiatkowski --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 26 ++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index e9a2e30c1537..4c5cb4dd7420 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -7378,6 +7378,20 @@ static void bnxt_hwrm_rx_agg_ring_free(struct bnxt *bp, bp->grp_info[grp_idx].agg_fw_ring_id = INVALID_HW_RING_ID; } +static void bnxt_hwrm_cp_ring_free(struct bnxt *bp, + struct bnxt_cp_ring_info *cpr) +{ + struct bnxt_ring_struct *ring; + + ring = &cpr->cp_ring_struct; + if (ring->fw_ring_id == INVALID_HW_RING_ID) + return; + + hwrm_ring_free_send_msg(bp, ring, RING_FREE_REQ_RING_TYPE_L2_CMPL, + INVALID_HW_RING_ID); + ring->fw_ring_id = INVALID_HW_RING_ID; +} + static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path) { u32 type; @@ -7423,17 +7437,9 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path) struct bnxt_ring_struct *ring; int j; - for (j = 0; j < cpr->cp_ring_count && cpr->cp_ring_arr; j++) { - struct bnxt_cp_ring_info *cpr2 = &cpr->cp_ring_arr[j]; + for (j = 0; j < cpr->cp_ring_count && cpr->cp_ring_arr; j++) + bnxt_hwrm_cp_ring_free(bp, &cpr->cp_ring_arr[j]); - ring = &cpr2->cp_ring_struct; - if (ring->fw_ring_id == INVALID_HW_RING_ID) - continue; - hwrm_ring_free_send_msg(bp, ring, - RING_FREE_REQ_RING_TYPE_L2_CMPL, - INVALID_HW_RING_ID); - ring->fw_ring_id = INVALID_HW_RING_ID; - } ring = &cpr->cp_ring_struct; if (ring->fw_ring_id != INVALID_HW_RING_ID) { hwrm_ring_free_send_msg(bp, ring, type, From patchwork Mon Jan 13 06:39:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13936782 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 DE9F3231C9D for ; Mon, 13 Jan 2025 06:40:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750416; cv=none; b=oyqCF3ylh1oaQqhIcq/Gez488qYx+5bNXv6Hm8Bc17mWFjiHcJYWAnJ/6sts8L2WDXceczB1o/hSEPFyvvM8mV7VprBBh73/17llQbC3xbP8uLsO479/BB8B4eXuEIOgBlkVrOm+L7bYTzl6KN6O8+yWwoapbF279/BNnzjVwEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750416; c=relaxed/simple; bh=olcQktziKlvqmLByWHEI11OxrxT9qSsm816NlJjYoOE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aBZv6K+X3OkB1MKOjhbygb/UVH0z4yFN5T6QIO0Zjehbi4/k9SpM9/LkRvP8iUWNLsvnf4nBRuubCym6bcho8aXVvytASu7z+m1QYQLPNdHHq16Dw6tfPFtuCsEIvyPg1BUVRqFXKlWsYfuWjSgiaEh1zNNcpEVrgnk4vm4Xo0U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=gni6Je6L; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="gni6Je6L" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-21670dce0a7so81542595ad.1 for ; Sun, 12 Jan 2025 22:40:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1736750413; x=1737355213; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s1FhP/ied+x0o5xjyb/8S/ytBNTYe0wNCM2agmPfadU=; b=gni6Je6LOH53+rMFJgIzSPON4yhSOQNMcc44al0bqQ9HY5tKW6CjFN/IesmPKceJZG lgSnGp5Au9bGnSwl/B1M38iYL3yjssOtBCqgJ3ZmID8N9YG74LP1ejKSy1fHixXwmedg nrEf/nzjG/YiY7i0AGGqRdX8R56r/HixDM/+Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736750413; x=1737355213; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s1FhP/ied+x0o5xjyb/8S/ytBNTYe0wNCM2agmPfadU=; b=upfzo8iCRfqFyDcy6MYbhvVyN+mdtVltJs3KvlhzojpZ0Dclry1MkD6kcz+Zi07u2o 0sTWAO5Kxy5bhVtYR13WTHDtijC5TsX8g8eKnU4/237/ilQZk20mAPDEjJyq/J2G7a0G /9bkmyznk/Ck375hoGU2M7chC0eJ8F3TbpayZJMb1dupB3WYg0H5EjI3AZFxM3qHuVOU Fi5EXrCZcaSNmZHGdCmhw7tcntQbTNNAT5Yftesb90rtC4mhJlhr3RI/40rOoHik97iT 3w2UVOc/SpHjwzpk33PMVVmP8w4alnOya/Wp9GnHKs6ii9XCHm7jASHAR8Y6vZ1N0jwF sHqg== X-Gm-Message-State: AOJu0YzhfrgizGq11MJhpKl3kloOTQmCyO2ZG8Bxv17S6aNRRkMGJ+it oZM0OmxSgmKgXjRnCFgZ0DRXeT1yJSwhdyJNNHhJ6FFqzKHOINwqSUmz8Wt18g== X-Gm-Gg: ASbGncuzuAJ2gE4sGfnev1MKp7CHlFPdmjl9cq8PWGlfv7JIKDqyXOR7mqjTNDw8auH Cu4snJc0U/tNurVEpo+ixBz+OZ0OGaLAh+gWDIHxiVT1HHG/O3yg0+7lJMjbzzmd7sLJwA1H2G3 DFJMxKhhboiGXc/lwV24CX4Ww0OFrXP5Kt6LDAyZT9Eq5a9Pe5NFnt+mPZ6d1qRe33NvZbKZ5J4 YIaXHwF2mhNCiyjKWca5c2CT0Hh0+lXwzxI1pkr1yvMB4PmyOxubvix6SjLgICwsQD2rZ81WI2r G+ykKacea2j32OOMc3gdSU71INMnDviP X-Google-Smtp-Source: AGHT+IENXV+F75c3K7kpShn33W7AxJx4zLq4geITEdYZyThtDRkADBEZqNNuqb19dR1hIXmVbDlW4A== X-Received: by 2002:a17:902:e544:b0:216:50c6:6b47 with SMTP id d9443c01a7336-21a8400038bmr311159545ad.46.1736750413172; Sun, 12 Jan 2025 22:40:13 -0800 (PST) Received: from lvnvda3289.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f254264sm46488165ad.233.2025.01.12.22.40.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 22:40:12 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, somnath.kotur@broadcom.com Subject: [PATCH net-next 05/10] bnxt_en: Refactor bnxt_free_tx_rings() to free per Tx ring Date: Sun, 12 Jan 2025 22:39:22 -0800 Message-ID: <20250113063927.4017173-6-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20250113063927.4017173-1-michael.chan@broadcom.com> References: <20250113063927.4017173-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Somnath Kotur Modify bnxt_free_tx_rings() to free the skbs per Tx ring. This will be useful later in the series. Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan Reviewed-by: Michal Swiatkowski --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 115 ++++++++++++---------- 1 file changed, 61 insertions(+), 54 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 4c5cb4dd7420..4336a5b54289 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -3314,74 +3314,81 @@ static int bnxt_poll_p5(struct napi_struct *napi, int budget) return work_done; } -static void bnxt_free_tx_skbs(struct bnxt *bp) +static void bnxt_free_one_tx_ring_skbs(struct bnxt *bp, + struct bnxt_tx_ring_info *txr, int idx) { int i, max_idx; struct pci_dev *pdev = bp->pdev; - if (!bp->tx_ring) - return; - max_idx = bp->tx_nr_pages * TX_DESC_CNT; - for (i = 0; i < bp->tx_nr_rings; i++) { - struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; - int j; - if (!txr->tx_buf_ring) + for (i = 0; i < max_idx;) { + struct bnxt_sw_tx_bd *tx_buf = &txr->tx_buf_ring[i]; + struct sk_buff *skb; + int j, last; + + if (idx < bp->tx_nr_rings_xdp && + tx_buf->action == XDP_REDIRECT) { + dma_unmap_single(&pdev->dev, + dma_unmap_addr(tx_buf, mapping), + dma_unmap_len(tx_buf, len), + DMA_TO_DEVICE); + xdp_return_frame(tx_buf->xdpf); + tx_buf->action = 0; + tx_buf->xdpf = NULL; + i++; continue; + } - for (j = 0; j < max_idx;) { - struct bnxt_sw_tx_bd *tx_buf = &txr->tx_buf_ring[j]; - struct sk_buff *skb; - int k, last; - - if (i < bp->tx_nr_rings_xdp && - tx_buf->action == XDP_REDIRECT) { - dma_unmap_single(&pdev->dev, - dma_unmap_addr(tx_buf, mapping), - dma_unmap_len(tx_buf, len), - DMA_TO_DEVICE); - xdp_return_frame(tx_buf->xdpf); - tx_buf->action = 0; - tx_buf->xdpf = NULL; - j++; - continue; - } + skb = tx_buf->skb; + if (!skb) { + i++; + continue; + } - skb = tx_buf->skb; - if (!skb) { - j++; - continue; - } + tx_buf->skb = NULL; - tx_buf->skb = NULL; + if (tx_buf->is_push) { + dev_kfree_skb(skb); + i += 2; + continue; + } - if (tx_buf->is_push) { - dev_kfree_skb(skb); - j += 2; - continue; - } + dma_unmap_single(&pdev->dev, + dma_unmap_addr(tx_buf, mapping), + skb_headlen(skb), + DMA_TO_DEVICE); - dma_unmap_single(&pdev->dev, - dma_unmap_addr(tx_buf, mapping), - skb_headlen(skb), - DMA_TO_DEVICE); + last = tx_buf->nr_frags; + i += 2; + for (j = 0; j < last; j++, i++) { + int ring_idx = i & bp->tx_ring_mask; + skb_frag_t *frag = &skb_shinfo(skb)->frags[j]; - last = tx_buf->nr_frags; - j += 2; - for (k = 0; k < last; k++, j++) { - int ring_idx = j & bp->tx_ring_mask; - skb_frag_t *frag = &skb_shinfo(skb)->frags[k]; - - tx_buf = &txr->tx_buf_ring[ring_idx]; - dma_unmap_page( - &pdev->dev, - dma_unmap_addr(tx_buf, mapping), - skb_frag_size(frag), DMA_TO_DEVICE); - } - dev_kfree_skb(skb); + tx_buf = &txr->tx_buf_ring[ring_idx]; + dma_unmap_page(&pdev->dev, + dma_unmap_addr(tx_buf, mapping), + skb_frag_size(frag), DMA_TO_DEVICE); } - netdev_tx_reset_queue(netdev_get_tx_queue(bp->dev, i)); + dev_kfree_skb(skb); + } + netdev_tx_reset_queue(netdev_get_tx_queue(bp->dev, idx)); +} + +static void bnxt_free_tx_skbs(struct bnxt *bp) +{ + int i; + + if (!bp->tx_ring) + return; + + for (i = 0; i < bp->tx_nr_rings; i++) { + struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; + + if (!txr->tx_buf_ring) + continue; + + bnxt_free_one_tx_ring_skbs(bp, txr, i); } } From patchwork Mon Jan 13 06:39:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13936783 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 3907C232373 for ; Mon, 13 Jan 2025 06:40:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750416; cv=none; b=okHGW171auPFsLc6LQL62BRrEvp2D5O/4pfk5KnuSw3T1x6Dv4TOEx3/EUaALvVKLLHpbYPNizSX55A3wBoIej3RMII/M+8u44MRHRJ++vFIirXsO4cvJrU3Yj11YoxMR/6ISPfpvTSLcJhy7rBJZw0CHyb3MtVKHPe/RK/AvgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750416; c=relaxed/simple; bh=Iw7QAxScAn+dBGHgREsYNYQ3Xgxp6sYPYPJBWqLTM9g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=so87z+/RuHpn1Jh3o+SZR6erYt8qi5yNnwpj8j1Yj+11zmcBlZ3LfqcN41rnfVurfQUCXDsvxpcyMGcRjn2nF2mriiTtsuvboNMB/AEyUZqpsnfSlCwazFyTTWqYwnPSiyUgVVYoJa4FCWCv9k2Lza1tkfHu78RUafywIOcY1B8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=TUvxHEl+; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="TUvxHEl+" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2167141dfa1so67693005ad.1 for ; Sun, 12 Jan 2025 22:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1736750414; x=1737355214; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Cz9kdjBWSmt76W8AEDgoAsCUHcapox2gX7zyXYohUmA=; b=TUvxHEl+Y0TByXcybpzWE8oVo/hzkkBO8h1CuyFj20+kETv7twJics92TTVRD/U7f6 ECT5EthBM7P/X3S1ulmBw/Q6Xdk1MmkK8hs4WMZ88FY+jrxM0AqlqksO87NHQMMdHriq mAdcQOH9KpsU3zxIIl+6La00ie4TI6aJrXm+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736750414; x=1737355214; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Cz9kdjBWSmt76W8AEDgoAsCUHcapox2gX7zyXYohUmA=; b=AZneWDi35DA8Rs61GgKdDUllKOthTarQmanq+Zu9uc9FwNGbve7/Iy7nVI9fzaaYM9 eVmKPuJrkiSt0kJvJykBTIqXrqhOVHG1VfzvIpgwJkc2jF+ZWGmwBn8Cm5yymomUTI4c GvMrPJCW8NIxe9nuEbWX+M/F+Abq+KJlDtDfvkfkkZXjAzvJzU9QTD7sUarRPAJqNk3W 6gNhXPUNsIULl/+espX7LWfwz6Xuuv0GjPwBXqAzLlH9f1eMbg9lJ9uD9VIGyBd4v/Q2 2zV9oei6tMqux1qH+FzqMmr0VYTYo7O8x0GJJUQFm/Si3VhFlhWyxU9vPVsWUk9+rM94 NauQ== X-Gm-Message-State: AOJu0Yz2aIlf5n7NkGurjXT8FTIzf+vsljkLeW9mZ8HaxDJS4d8hsAkm Ya7z3t/H4TXTFpz8NOHlrCMvYbKlJcwtcvw8SFZbdnYvH1ipNuAKDn+mMjh77Q== X-Gm-Gg: ASbGnctXDvr7Nfg07r30DTi24OWiMJua4xFlpBmHnXIoAHPHkDexTAn/I9I+Coh/xc4 EpeYP+h2mzuchnkEyei7Uh4q8dYkZNKoVO1A68fPY7Kzj233V1uEij517XjMLAhxdorW3vck7oj J4QxhuvfvfW4GX2AXb9EYcNXKyb3URw7s9CUP9lhpdykAYB/pjUOawXVPx1gMVgwUscBAcYtmOy KX8RWmfQG7URoGji2mUF/IQJhPpN7tsJKF+WTqADIhCw0rCiuW8Mb32UDWyKF9wGopguePV661C 7v4O520WzE6JG9pJsdLGOjAZOwhyutoC X-Google-Smtp-Source: AGHT+IHeSu+LpP+hgaRqPG+y7ed7EF5xxMkskA4/oEts9gg6KsIP4ajwa06rbrvERGeFWMaVHw73rg== X-Received: by 2002:a17:903:1249:b0:215:b1e3:c051 with SMTP id d9443c01a7336-21ad9f23c63mr115441095ad.11.1736750414426; Sun, 12 Jan 2025 22:40:14 -0800 (PST) Received: from lvnvda3289.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f254264sm46488165ad.233.2025.01.12.22.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 22:40:14 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, somnath.kotur@broadcom.com, Hongguang Gao , Ajit Khaparde Subject: [PATCH net-next 06/10] bnxt_en: Refactor RX/RX AGG ring parameters setup for P5_PLUS Date: Sun, 12 Jan 2025 22:39:23 -0800 Message-ID: <20250113063927.4017173-7-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20250113063927.4017173-1-michael.chan@broadcom.com> References: <20250113063927.4017173-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org There is some common code for setting up RX and RX AGG ring allocation parameters for P5_PLUS chips. Refactor the logic into a new function. Reviewed-by: Hongguang Gao Reviewed-by: Ajit Khaparde Signed-off-by: Michael Chan Reviewed-by: Michal Swiatkowski --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 58 +++++++++++------------ 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 4336a5b54289..c862250d3b77 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -6917,6 +6917,28 @@ static void bnxt_hwrm_ring_grp_free(struct bnxt *bp) hwrm_req_drop(bp, req); } +static void bnxt_set_rx_ring_params_p5(struct bnxt *bp, u32 ring_type, + struct hwrm_ring_alloc_input *req, + struct bnxt_ring_struct *ring) +{ + struct bnxt_ring_grp_info *grp_info = &bp->grp_info[ring->grp_idx]; + u32 enables = RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID; + + if (ring_type == HWRM_RING_ALLOC_AGG) { + req->ring_type = RING_ALLOC_REQ_RING_TYPE_RX_AGG; + req->rx_ring_id = cpu_to_le16(grp_info->rx_fw_ring_id); + req->rx_buf_size = cpu_to_le16(BNXT_RX_PAGE_SIZE); + enables |= RING_ALLOC_REQ_ENABLES_RX_RING_ID_VALID; + } else { + req->rx_buf_size = cpu_to_le16(bp->rx_buf_use_size); + if (NET_IP_ALIGN == 2) + req->flags = + cpu_to_le16(RING_ALLOC_REQ_FLAGS_RX_SOP_PAD); + } + req->stat_ctx_id = cpu_to_le32(grp_info->fw_stats_ctx); + req->enables |= cpu_to_le32(enables); +} + static int hwrm_ring_alloc_send_msg(struct bnxt *bp, struct bnxt_ring_struct *ring, u32 ring_type, u32 map_index) @@ -6968,37 +6990,13 @@ static int hwrm_ring_alloc_send_msg(struct bnxt *bp, break; } case HWRM_RING_ALLOC_RX: - req->ring_type = RING_ALLOC_REQ_RING_TYPE_RX; - req->length = cpu_to_le32(bp->rx_ring_mask + 1); - if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) { - u16 flags = 0; - - /* Association of rx ring with stats context */ - grp_info = &bp->grp_info[ring->grp_idx]; - req->rx_buf_size = cpu_to_le16(bp->rx_buf_use_size); - req->stat_ctx_id = cpu_to_le32(grp_info->fw_stats_ctx); - req->enables |= cpu_to_le32( - RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID); - if (NET_IP_ALIGN == 2) - flags = RING_ALLOC_REQ_FLAGS_RX_SOP_PAD; - req->flags = cpu_to_le16(flags); - } - break; case HWRM_RING_ALLOC_AGG: - if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) { - req->ring_type = RING_ALLOC_REQ_RING_TYPE_RX_AGG; - /* Association of agg ring with rx ring */ - grp_info = &bp->grp_info[ring->grp_idx]; - req->rx_ring_id = cpu_to_le16(grp_info->rx_fw_ring_id); - req->rx_buf_size = cpu_to_le16(BNXT_RX_PAGE_SIZE); - req->stat_ctx_id = cpu_to_le32(grp_info->fw_stats_ctx); - req->enables |= cpu_to_le32( - RING_ALLOC_REQ_ENABLES_RX_RING_ID_VALID | - RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID); - } else { - req->ring_type = RING_ALLOC_REQ_RING_TYPE_RX; - } - req->length = cpu_to_le32(bp->rx_agg_ring_mask + 1); + req->ring_type = RING_ALLOC_REQ_RING_TYPE_RX; + req->length = (ring_type == HWRM_RING_ALLOC_RX) ? + cpu_to_le32(bp->rx_ring_mask + 1) : + cpu_to_le32(bp->rx_agg_ring_mask + 1); + if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) + bnxt_set_rx_ring_params_p5(bp, ring_type, req, ring); break; case HWRM_RING_ALLOC_CMPL: req->ring_type = RING_ALLOC_REQ_RING_TYPE_L2_CMPL; From patchwork Mon Jan 13 06:39:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13936784 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 8D39D232780 for ; Mon, 13 Jan 2025 06:40:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750418; cv=none; b=l8A+PATxCkOmV0V/lwB7deFwFwIiXdkQCapOonuyd6xerl/3GhlN403TBjcYXQFsWhcwdMre6vU5Nzx4zZD2EjkCNPEqoipisftRZ3VV5P0IYi9IssA0HRbR12KCFStaiIhD3IAbrurDy246Yse/ZDOO0iPanD0hPqSq24z4Fek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750418; c=relaxed/simple; bh=LtGLFlZCuLB26h0C57Xbpxchpfd0yGdBnyNXqg4zol0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JbIYIJWJhfTbUL+u6+6kZqs94QeM2VWABljlgO/tsdDGKurmMksJ0VpgtIPPwzpTG5I3PmHuKW8z/GDe2PZC6WpA32vPfTdD5q+MkuAWvhZCfWSywvusJhAf13mfs02jC1VJ5ZsrsWPlEneUOWblhVU8wowC+1KpjscdJYQePN4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=RNJI4KQ0; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="RNJI4KQ0" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-216728b1836so66289335ad.0 for ; Sun, 12 Jan 2025 22:40:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1736750416; x=1737355216; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Do9Y7F8ta8tI4xzuwVHlG3rrw+vbCLlsnA7GtVLEL10=; b=RNJI4KQ0ty8HFZ206OvkgOjik8Vwt0ueAXJQ365SF5TSfMjOYtuSCDT9cSh+laRkyX CPSSgsMfU8jlaPSWiz+8usophPSGHlLzgqzpi7P8i1VnqgkXblzjFliZD20ayWOCMyVI 3AAwcq8DtANONilEn6qlWf0SzyQHi2h87tUYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736750416; x=1737355216; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Do9Y7F8ta8tI4xzuwVHlG3rrw+vbCLlsnA7GtVLEL10=; b=UeeFiF2/mE4Nko09avu8HTZh5QiO/uwy/KSO6duOdo21bb/IQaT8fmxD0kpfjW1jcs Y2u6WnynBDnX0tbOU1elw7rLIGKvyb+GRqROu+4vrPXCHeztjY4n3DY1r8plD6rJ/tMo 9M41mqjl/88zYQCXflMAfokC6e+3/wlC7+jCwhxVWImKSl1Lb9wIzU2k6N/RPhI7OMTh D8M43sYF9q5Bl3NVMo+hR85gr8r2qpOeNI3zUR2fkOlF9Qaum+wK7Z36twT8byiG0w5+ mPc91nviX4ZNh0amnE3xHtQGHTr5uJXRWAwysPumZDN/MJfOrQ4IJVhgLAPdCprXWsCP ykyg== X-Gm-Message-State: AOJu0YzdnXD0Fa41x4Y1w7KcWZcjAdp0af9AM2NVTn1b+G6DRa+oRNMP 0oiAtGEl+UeU5jGdVteH4VEUxQpmBk6ICLg7m7Rn8ueWTlY5ltEflK+NQsKvcQ== X-Gm-Gg: ASbGncuPUrO/wBCloBqUqqTOH2sWuz0zT7xnBkC6wIPO+7dl97g6A+zAddqOjeGcQMT sXTwtwMXdDsDVC5enI6aPTIzueNBseXqgIhohLxbhkEB/CdZV8Ex7zBvo24irwDUcwwxWHyzVVS XCEMZSEY7oyzm+1arTLlX4UIQ3YGgguaC8w1IOwC0OKY4ua+P7tCdvVKUI+iS+kgQhaUMxK+FeV 9Fu3L8OJgjRxsN/RBzw6HOIE5lr34+r0PCkWxbEVzWaztxJ+dc+bCaeF/bzkznteudpVHkrSaEY HDnWOzbuiZK1DKRJPgDq/YiY7RDzX7nu X-Google-Smtp-Source: AGHT+IE3To7RMKSvdFJ2fKWLq+sjEZMMshsBW6o8iiJJtXxBeh58DLdd5gTevfoz8VgtWMOgeIY3kA== X-Received: by 2002:a17:902:db0e:b0:216:725c:a11a with SMTP id d9443c01a7336-21a83f43b7amr330127465ad.10.1736750415882; Sun, 12 Jan 2025 22:40:15 -0800 (PST) Received: from lvnvda3289.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f254264sm46488165ad.233.2025.01.12.22.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 22:40:15 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, somnath.kotur@broadcom.com, Hongguang Gao , Ajit Khaparde Subject: [PATCH net-next 07/10] bnxt_en: Pass NQ ID to the FW when allocating RX/RX AGG rings Date: Sun, 12 Jan 2025 22:39:24 -0800 Message-ID: <20250113063927.4017173-8-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20250113063927.4017173-1-michael.chan@broadcom.com> References: <20250113063927.4017173-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Newer firmware can use the NQ ring ID associated with each RX/RX AGG ring to enable PCIe Steering Tags on P5_PLUS chips. When allocating RX/RX AGG rings, pass along NQ ring ID for the firmware to use. This information helps optimize DMA writes by directing them to the cache closer to the CPU consuming the data, potentially improving the processing speed. This change is backward-compatible with older firmware, which will simply disregard the information. Reviewed-by: Hongguang Gao Reviewed-by: Ajit Khaparde Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Reviewed-by: Michal Swiatkowski --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index c862250d3b77..30a57bbc407c 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -6922,7 +6922,8 @@ static void bnxt_set_rx_ring_params_p5(struct bnxt *bp, u32 ring_type, struct bnxt_ring_struct *ring) { struct bnxt_ring_grp_info *grp_info = &bp->grp_info[ring->grp_idx]; - u32 enables = RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID; + u32 enables = RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID | + RING_ALLOC_REQ_ENABLES_NQ_RING_ID_VALID; if (ring_type == HWRM_RING_ALLOC_AGG) { req->ring_type = RING_ALLOC_REQ_RING_TYPE_RX_AGG; @@ -6936,6 +6937,7 @@ static void bnxt_set_rx_ring_params_p5(struct bnxt *bp, u32 ring_type, cpu_to_le16(RING_ALLOC_REQ_FLAGS_RX_SOP_PAD); } req->stat_ctx_id = cpu_to_le32(grp_info->fw_stats_ctx); + req->nq_ring_id = cpu_to_le16(grp_info->cp_fw_ring_id); req->enables |= cpu_to_le32(enables); } From patchwork Mon Jan 13 06:39:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13936785 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 C152F231C85 for ; Mon, 13 Jan 2025 06:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750419; cv=none; b=SzQNELjz7yT5Rv5hfeWg6Ay/qE7jSQFVyaYr1TkPaZnw0Vg9iz+As3Jd92WzFQ0Jf1yvuUBPekxxJHSitHEnXOiK7Bcm3db5V65ztTInWkk70r3yboBEgJl3mIBTd8LcEuPDaxky5DtvilJF9fttrbtSIfrFBZlFIVh5o/MLZ74= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750419; c=relaxed/simple; bh=OW/EhcPAALkMHONpotvVdmf9I2szxk8QJccSlFm+e0g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pwOvUdRLpYkhmEpMNCqKFKDx3V/LK8GWRujLoqmRwXxER2xn5yz1/5OK8mSjE3pRYQcBMy9BoOY+JrQd/kGpCvYJh6Pz5aJPsY0u/nxDvoNJUgt87t4Q+awsZuhAxn+ZrZif/BI/GIJ4KSrE/GMNsb/kERbJfmq0iC2bEqihQNg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=U8KivjuI; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="U8KivjuI" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-21619108a6bso65446645ad.3 for ; Sun, 12 Jan 2025 22:40:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1736750417; x=1737355217; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SR5XWqzcjY8ThcvEtHL1qDDCuhjPAi88uUlx04yuMF8=; b=U8KivjuIkCMTIMWD8FrRy3FTCMeNx/6kloQF9ShNtWmEqWm8kwVUSv2YDGbL4kCO6v 59MnTwgeVbouo51oKQaji7itQxMRGy+ef5iqmRPZLuRTroUdIC8F8TmFM9lWGJB4vGtA Te/pwHlGNUt7B0P8E+eQHW1dK7R8t/johIct0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736750417; x=1737355217; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SR5XWqzcjY8ThcvEtHL1qDDCuhjPAi88uUlx04yuMF8=; b=vZ4rwUK5/FDH3gqKlEAi1+Pcl4apvFwXbcpU2otrKlsJxVHHAD00cTq8BXy6giR1mE SxW2edf/tkL/SZFSQXTNguKqP1ZH60mKaav2zMjan1CIt9o7hY4ipgPAD783KncrGiKv TCK7NtECWw15L7Y2O8hzu4NAEBrqsF2aK+RBNp2X/sAXzkqtvaoqTtarBFLnfdXkVZcS Um1oYFc0Vlo2amhT9nBaA64K5crx094i5LU+dVnEuJvQHc1l7FABdBRZw4rsa1Zj544B PfNxMF0IBWrOlFLHjeZwGkrdiQEXS/dz+/MFYFgt+hjTM7NbMU8CiNBXv+HRTQcAsk2a CtqA== X-Gm-Message-State: AOJu0YzfkPIf5ZZEauLVdMv0NpjJyZHfmvbEpBZz9ETJ3XhMj+SoBx7m FdIkWO/VrhOI7o0RZVax2eTEx56L0beO7Rsv1mZ3vSgCEB37408Rn5GwRi7N3A== X-Gm-Gg: ASbGncvwT7SXcRFKZ2pTgGlMkzU8pmTjjbv5V7Id06fmHmv93K8CY4e76EMLl0KreWg iKvKS0HfFDv2Ez+GaZ0ThMfOXiKhCWlz8ZVsIm7pUxMeY7R+K8dF7APt1eVe6x9+w+H0nVlsio3 ojVpNXwEPhO3N/zgtoaDoA7umUyyIUi0xEsDATFeFEUflncIjFWUWe46D+FH+Va1zVfZbnYW5lK oW8h3hlh6uDo7S4Me16sBYlORP65wLCkmvxJGJ7Jj7iFJkseOFRXWyzRKVwpEOlBTq8dq9SnFFm fVYrVM2xhMm981oerdny2ymQwtFVsrMj X-Google-Smtp-Source: AGHT+IE6YTmjpi6iZTgNPfCubCJBN2Hv9p/lNrM8qetcwJ2IDS1FUW+prG8VnIqGV1cDrtoxn/Jh+g== X-Received: by 2002:a17:902:f54e:b0:215:8809:b3b7 with SMTP id d9443c01a7336-21a83f36de7mr281085705ad.7.1736750417114; Sun, 12 Jan 2025 22:40:17 -0800 (PST) Received: from lvnvda3289.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f254264sm46488165ad.233.2025.01.12.22.40.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 22:40:16 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, somnath.kotur@broadcom.com, David Wei Subject: [PATCH net-next 08/10] bnxt_en: Reallocate Rx completion ring for TPH support Date: Sun, 12 Jan 2025 22:39:25 -0800 Message-ID: <20250113063927.4017173-9-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20250113063927.4017173-1-michael.chan@broadcom.com> References: <20250113063927.4017173-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Somnath Kotur In order to program the correct Steering Tag during an IRQ affinity change, we need to free/re-allocate the Rx completion ring during queue_restart. Call FW to free the Rx completion ring and clear the ring entries in queue_stop(). Re-allocate it in queue_start(). Signed-off-by: Somnath Kotur Reviewed-by: Michael Chan Reviewed-by: Michal Swiatkowski --- Cc: David Wei --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 26 +++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 30a57bbc407c..fe350d0ba99c 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -7399,6 +7399,19 @@ static void bnxt_hwrm_cp_ring_free(struct bnxt *bp, ring->fw_ring_id = INVALID_HW_RING_ID; } +static void bnxt_clear_one_cp_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr) +{ + struct bnxt_ring_struct *ring = &cpr->cp_ring_struct; + int i, size = ring->ring_mem.page_size; + + cpr->cp_raw_cons = 0; + cpr->toggle = 0; + + for (i = 0; i < bp->cp_nr_pages; i++) + if (cpr->cp_desc_ring[i]) + memset(cpr->cp_desc_ring[i], 0, size); +} + static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path) { u32 type; @@ -15618,10 +15631,15 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx) rc = bnxt_hwrm_rx_ring_alloc(bp, rxr); if (rc) return rc; - rc = bnxt_hwrm_rx_agg_ring_alloc(bp, rxr); + + rc = bnxt_hwrm_cp_ring_alloc_p5(bp, rxr->rx_cpr); if (rc) goto err_free_hwrm_rx_ring; + rc = bnxt_hwrm_rx_agg_ring_alloc(bp, rxr); + if (rc) + goto err_free_hwrm_cp_ring; + bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod); if (bp->flags & BNXT_FLAG_AGG_RINGS) bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod); @@ -15645,6 +15663,8 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx) return 0; +err_free_hwrm_cp_ring: + bnxt_hwrm_cp_ring_free(bp, rxr->rx_cpr); err_free_hwrm_rx_ring: bnxt_hwrm_rx_ring_free(bp, rxr, false); return rc; @@ -15669,11 +15689,13 @@ static int bnxt_queue_stop(struct net_device *dev, void *qmem, int idx) cancel_work_sync(&rxr->bnapi->cp_ring.dim.work); bnxt_hwrm_rx_ring_free(bp, rxr, false); bnxt_hwrm_rx_agg_ring_free(bp, rxr, false); - rxr->rx_next_cons = 0; page_pool_disable_direct_recycling(rxr->page_pool); if (bnxt_separate_head_pool()) page_pool_disable_direct_recycling(rxr->head_pool); + bnxt_hwrm_cp_ring_free(bp, rxr->rx_cpr); + bnxt_clear_one_cp_ring(bp, rxr->rx_cpr); + memcpy(qmem, rxr, sizeof(*rxr)); bnxt_init_rx_ring_struct(bp, qmem); From patchwork Mon Jan 13 06:39:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13936786 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 EC6D3231A2B for ; Mon, 13 Jan 2025 06:40:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750420; cv=none; b=I7Zls6EbMO0kVQWxAVHXAP+aG3tOi81hTBUVlB/cVQWiZqGS9O4lj6Qu0XWK0OykXYmBTIFa9gHFLDd8WaA/o24ag9Dv32JlqK2NgTUp2nYDfhgPtmDqgfaBIiQJnbgMBCZQMOI0L47g0rGYlVsKlE1SQV+8HUK759tzi0oyeNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750420; c=relaxed/simple; bh=qtM4+neR5uKJIfJVuviqqJmsdus8dBgLjhKWXjtgA3o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lj7UxPr++Rdr2fYkVoyDbLUm9PKHKaqYsPuoqI31L4nXrCg9dY8lli7/nLskrW+g/dyUD3kAgiOUt9quS5E+v2DFh3obC7qThYcPt+f0MI8wkpPhNOcscVxHMTuyVbmQAx+A33vEvg33TptuJ/KmVFtRtKcYm9OCCGRyqKrELAM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=NaBjXi0O; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="NaBjXi0O" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2163b0c09afso68258695ad.0 for ; Sun, 12 Jan 2025 22:40:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1736750418; x=1737355218; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UBdYDp1JAUZJh0QPIMS3gD47vLzzKNVdhhPpNOWc8To=; b=NaBjXi0OyH67JwCUMdD9knL/yPKq2aCTHf0RqgdwXr62Ctl9Zz4Du9bPk+MEoSnJaT U7Qu2Kl2GVxlXyKMhLEmtK0hNyF+Nm4DMB5CHU4rPObPC+xl4Lf6B3NPPVJwblX+IklP XJiRc67XHlOfEhP3n05Ft4KO1vaUFWpIrYA8o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736750418; x=1737355218; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UBdYDp1JAUZJh0QPIMS3gD47vLzzKNVdhhPpNOWc8To=; b=FiLOGOcYiP050fxRYWtH0P7p3E8POilTOnLf+yXAWHD0hOau3hxwkaJztng2evNTLF XaxwaB7MKq2yVtTAdGo19MdBcz/mjhGkf48aa8zSsnzpDNjSNggPfh3sj4MERVn6AFJY /xwGWCgD2wmz5yC/BaGRyk8BRwpBUrenLpgmQEVJafCjcU41l7M2n3hrSBNEVKWtXMEA kzOtT0Hcv/weZsP9A7LZuG6qfZkWZJveDqq3pKVMSAk3ihwo4I5/tbC1QKsDalz27fsO 28/fqXJh7aC87T6IzLGKhraqfwysB+gr+3OIxCIiDyZBzxMuvNfJxOjriqQg5xdxcEWx Eugw== X-Gm-Message-State: AOJu0Yykrz8LTOWPSYiL2WBp/q25pjkVh3FOrtJ0TOo/Lzf3fbTlT14H t0ftvQJOSxPwOnscQiPx078vhEsma6wHbemi2v2CzkMQGuP9NDGO0IPm4OkNXnExhMSUJWEwRvw = X-Gm-Gg: ASbGncs7xvT55Tv5HIjJeQ1LdjBth6yZGEXaHVGxPhyd8FTI7I7S9XqUqqQZ0FVZe4f 4BZWKEJbOjzsRZQpNtbvxASJKx0/bP+tN/Y/BpC8UwRjavEDrSgfR6oPg9uvfbK7dMNM1OBD8gE mMhyz3pAOmiXqLLe6J01SfW9nkn6IuNwvQcF1XffOWO2p15/j0uB4eRMisMXEvKt8eZZzxdARPJ cHhQYTiJC/ZUJab6LTlPEeVy94YJI6wbbMTmP+WXmANB8knX87eq2/ylPBMt14PyIi1E7e4G4M1 1RZqZR+etL76Vl8knTJPe84Wf00w3Gbb X-Google-Smtp-Source: AGHT+IELI5ZjyUM0oy+fb6Ac44tkvh2dvLKAawewN8YVf8mq9w+RjQ1xf9MBNUI8FSlAxhsiC7hPYw== X-Received: by 2002:a17:902:cecd:b0:215:6995:1ef3 with SMTP id d9443c01a7336-21a83f3469cmr267171935ad.3.1736750418327; Sun, 12 Jan 2025 22:40:18 -0800 (PST) Received: from lvnvda3289.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f254264sm46488165ad.233.2025.01.12.22.40.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 22:40:17 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, somnath.kotur@broadcom.com, Ajit Khaparde , David Wei Subject: [PATCH net-next 09/10] bnxt_en: Extend queue stop/start for Tx rings Date: Sun, 12 Jan 2025 22:39:26 -0800 Message-ID: <20250113063927.4017173-10-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20250113063927.4017173-1-michael.chan@broadcom.com> References: <20250113063927.4017173-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Somnath Kotur In order to use queue_stop/queue_start to support the new Steering Tags, we need to free the TX ring and TX completion ring if it is a combined channel with TX/RX sharing the same NAPI. Otherwise TX completions will not have the updated Steering Tag. With that we can now add napi_disable() and napi_enable() during queue_stop()/ queue_start(). This will guarantee that NAPI will stop processing the completion entries in case there are additional pending entries in the completion rings after queue_stop(). There could be some NQEs sitting unprocessed while NAPI is disabled thereby leaving the NQ unarmed. Explictily Re-arm the NQ after napi_enable() in queue start so that NAPI will resume properly. Reviewed-by: Ajit Khaparde Signed-off-by: Somnath Kotur Reviewed-by: Michael Chan --- Cc: David Wei Discussion about adding napi_disable()/napi_enable(): https://lore.kernel.org/netdev/5336d624-8d8b-40a6-b732-b020e4a119a2@davidwei.uk/#t --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 99 ++++++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index fe350d0ba99c..eddb4de959c6 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -7341,6 +7341,22 @@ static int hwrm_ring_free_send_msg(struct bnxt *bp, return 0; } +static void bnxt_hwrm_tx_ring_free(struct bnxt *bp, struct bnxt_tx_ring_info *txr, + bool close_path) +{ + struct bnxt_ring_struct *ring = &txr->tx_ring_struct; + u32 cmpl_ring_id; + + if (ring->fw_ring_id == INVALID_HW_RING_ID) + return; + + cmpl_ring_id = close_path ? bnxt_cp_ring_for_tx(bp, txr) : + INVALID_HW_RING_ID; + hwrm_ring_free_send_msg(bp, ring, RING_FREE_REQ_RING_TYPE_TX, + cmpl_ring_id); + ring->fw_ring_id = INVALID_HW_RING_ID; +} + static void bnxt_hwrm_rx_ring_free(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, bool close_path) @@ -11247,6 +11263,69 @@ int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init) return 0; } +static void bnxt_tx_queue_stop(struct bnxt *bp, int idx) +{ + struct bnxt_tx_ring_info *txr; + struct netdev_queue *txq; + struct bnxt_napi *bnapi; + int i; + + bnapi = bp->bnapi[idx]; + bnxt_for_each_napi_tx(i, bnapi, txr) { + WRITE_ONCE(txr->dev_state, BNXT_DEV_STATE_CLOSING); + synchronize_net(); + + if (!(bnapi->flags & BNXT_NAPI_FLAG_XDP)) { + txq = netdev_get_tx_queue(bp->dev, txr->txq_index); + if (txq) { + __netif_tx_lock_bh(txq); + netif_tx_stop_queue(txq); + __netif_tx_unlock_bh(txq); + } + } + bnxt_hwrm_tx_ring_free(bp, txr, true); + bnxt_hwrm_cp_ring_free(bp, txr->tx_cpr); + bnxt_free_one_tx_ring_skbs(bp, txr, txr->txq_index); + bnxt_clear_one_cp_ring(bp, txr->tx_cpr); + } +} + +static int bnxt_tx_queue_start(struct bnxt *bp, int idx) +{ + struct bnxt_tx_ring_info *txr; + struct netdev_queue *txq; + struct bnxt_napi *bnapi; + int rc, i; + + bnapi = bp->bnapi[idx]; + bnxt_for_each_napi_tx(i, bnapi, txr) { + rc = bnxt_hwrm_cp_ring_alloc_p5(bp, txr->tx_cpr); + if (rc) + return rc; + + rc = bnxt_hwrm_tx_ring_alloc(bp, txr, false); + if (rc) { + bnxt_hwrm_cp_ring_free(bp, txr->tx_cpr); + return rc; + } + txr->tx_prod = 0; + txr->tx_cons = 0; + txr->tx_hw_cons = 0; + + WRITE_ONCE(txr->dev_state, 0); + synchronize_net(); + + if (bnapi->flags & BNXT_NAPI_FLAG_XDP) + continue; + + txq = netdev_get_tx_queue(bp->dev, txr->txq_index); + if (txq) + netif_tx_start_queue(txq); + } + + return 0; +} + static void bnxt_free_irq(struct bnxt *bp) { struct bnxt_irq *irq; @@ -15647,6 +15726,16 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx) cpr = &rxr->bnapi->cp_ring; cpr->sw_stats->rx.rx_resets++; + if (bp->flags & BNXT_FLAG_SHARED_RINGS) { + rc = bnxt_tx_queue_start(bp, idx); + if (rc) + netdev_warn(bp->dev, + "tx queue restart failed: rc=%d\n", rc); + } + + napi_enable(&rxr->bnapi->napi); + bnxt_db_nq_arm(bp, &cpr->cp_db, cpr->cp_raw_cons); + for (i = 0; i <= BNXT_VNIC_NTUPLE; i++) { vnic = &bp->vnic_info[i]; @@ -15675,6 +15764,7 @@ static int bnxt_queue_stop(struct net_device *dev, void *qmem, int idx) struct bnxt *bp = netdev_priv(dev); struct bnxt_rx_ring_info *rxr; struct bnxt_vnic_info *vnic; + struct bnxt_napi *bnapi; int i; for (i = 0; i <= BNXT_VNIC_NTUPLE; i++) { @@ -15686,15 +15776,22 @@ static int bnxt_queue_stop(struct net_device *dev, void *qmem, int idx) /* Make sure NAPI sees that the VNIC is disabled */ synchronize_net(); rxr = &bp->rx_ring[idx]; - cancel_work_sync(&rxr->bnapi->cp_ring.dim.work); + bnapi = rxr->bnapi; + cancel_work_sync(&bnapi->cp_ring.dim.work); bnxt_hwrm_rx_ring_free(bp, rxr, false); bnxt_hwrm_rx_agg_ring_free(bp, rxr, false); page_pool_disable_direct_recycling(rxr->page_pool); if (bnxt_separate_head_pool()) page_pool_disable_direct_recycling(rxr->head_pool); + if (bp->flags & BNXT_FLAG_SHARED_RINGS) + bnxt_tx_queue_stop(bp, idx); + + napi_disable(&bnapi->napi); + bnxt_hwrm_cp_ring_free(bp, rxr->rx_cpr); bnxt_clear_one_cp_ring(bp, rxr->rx_cpr); + bnxt_db_nq(bp, &cpr->cp_db, cpr->cp_raw_cons); memcpy(qmem, rxr, sizeof(*rxr)); bnxt_init_rx_ring_struct(bp, qmem); From patchwork Mon Jan 13 06:39:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13936787 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 E9D31233144 for ; Mon, 13 Jan 2025 06:40:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750423; cv=none; b=KkQSPRuT1Qwe2VSIuipHMhAJWDcxXlwZQc3wk/20Mvr1kw8n5OkfJgxKn1ZMkqBfQzwWciULCISX8E4VUS4OshtbK0JkmFNmZBq9wN/qVjoOehNl3ImBeF6P8lrfZ9Kv4VStuslA4lOXwLF3TtPMyM5JFfdPlSrSzQD64x5kRto= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736750423; c=relaxed/simple; bh=mnedUmr9IljE/hJC4fKm2q61/HXseTzHXW4pQkrn7vI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iloYNQOjlncaM/PzwMghbPSMn5sj80q9EQ/hsmjaZbL5sYVUdJx3f79KZPmAsWjG6g2RJQKEbbmZPbqC76q7OnrSmmjavhOeW2NlO2/jUpd2xsDsut2jX9XU1uFGEUyKey4pV8uICe5Gj12zKIXLoDCLAps4Bkf7RrVAjGpSEYM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=PYGW4cn7; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="PYGW4cn7" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-21669fd5c7cso68094415ad.3 for ; Sun, 12 Jan 2025 22:40:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1736750421; x=1737355221; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vA/WKiwKiQZNmXyvLp7Dbup9U3dRaWdy45DN8g4yOEA=; b=PYGW4cn7b33kKrNfVjmG/B21x7YgOJZLqrFnUT4FG4i0WDjBHl638PmcPhPV3Iz4BM dH+6bFnsywiF7J4Tl6jle7Kdifg/kl6sSP9o6gIs7efMf8Mz7B7mQ6S0XBrIgcbQq6V4 vbcaBkXi6ojMBnzdCYvIHDOnxNg2jhMKTxJpQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736750421; x=1737355221; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vA/WKiwKiQZNmXyvLp7Dbup9U3dRaWdy45DN8g4yOEA=; b=oN6hP3idzg2sm978pUG6CS2ev+Z8/0rrUHKeapJRjqcLjjnkFJEs0Jqc8IPenrlyn4 blWnHieFdBdgrFshKnFTPqglUpUzAcoPvA2Q49Vn12QmNB/x1WmIBa+CZbLUlxUCIrdG yIhoVZv15urG+FagOR+DSO9pxPvkYXFn35R68/Y3NbpfgV0jE8MUPEdZMG9Vgvgf0byy Idlkl5Nk4IXaHSOtHBkGnCzEVf5Uu4P9VBoTalRsbQmuJk4k5OQgwz+zlTJD3Tblh7Wz FyW98vLhqWiyRa5iaoa5jKDV7Wc+dMSwrGR3lt8HZ5CBLkdKHp4hAu33Cz2LHianS+la LcVA== X-Gm-Message-State: AOJu0YwL2FI5e98IGXZ1QMBZ/QHVxgyjEv7Nl4bGm8Xo/RGMhKnX2d8y f//2XrGsqDR9XHUYB2tL+hbZScUoXo5A1PDF083Lv1faeuOc6s6yn/P04karSg== X-Gm-Gg: ASbGncvL/Z3UdGDGGIGKBzTimTWANo5fqNTxzcQRYRvY0fPyWl6vNMaaYo+cy+AXBTG eDxXzqKTIAiXf9AiimlGzpll9WfGJNGa4VbkXBfPYgPbdzq5TbggYxepGvjxXrO2UsxQn+bI7vs Ee5yzlCRHZAIvhD7kLOGPfPIxQxmQhCyyJeE/AlGUoMIZKiN+4CPJgkmCwcG31rfPyQRlg0hNND 85EIv8UVohIASXd79lwroq86AkF0UYtLqc+X8qcLCqa3PC1wGxN3Nwo/Z/NeyV9sPn5u1OBjTTU UJlVuh68kWyo7KrrbbrMEK718pHqMCWG X-Google-Smtp-Source: AGHT+IHsZzeOkmVV7zInYnWyUChuf43zF1VwwSXgxvtpQ1SVDNOAdZMX4rOEYW0riGwT2QtNN2MKOQ== X-Received: by 2002:a17:902:ec83:b0:215:7ce4:57bc with SMTP id d9443c01a7336-21a83f54a5cmr284780155ad.16.1736750419683; Sun, 12 Jan 2025 22:40:19 -0800 (PST) Received: from lvnvda3289.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f254264sm46488165ad.233.2025.01.12.22.40.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 22:40:19 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, somnath.kotur@broadcom.com, Manoj Panicker , Wei Huang , Ajit Khaparde , Bjorn Helgaas Subject: [PATCH net-next 10/10] bnxt_en: Add TPH support in BNXT driver Date: Sun, 12 Jan 2025 22:39:27 -0800 Message-ID: <20250113063927.4017173-11-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20250113063927.4017173-1-michael.chan@broadcom.com> References: <20250113063927.4017173-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Manoj Panicker Add TPH support to the Broadcom BNXT device driver. This allows the driver to utilize TPH functions for retrieving and configuring Steering Tags when changing interrupt affinity. With compatible NIC firmware, network traffic will be tagged correctly with Steering Tags, resulting in significant memory bandwidth savings and other advantages as demonstrated by real network benchmarks on TPH-capable platforms. Co-developed-by: Somnath Kotur Signed-off-by: Somnath Kotur Co-developed-by: Wei Huang Signed-off-by: Wei Huang Signed-off-by: Manoj Panicker Reviewed-by: Ajit Khaparde Reviewed-by: Andy Gospodarek Signed-off-by: Michael Chan --- Cc: Bjorn Helgaas Previous driver series fixing rtnl_lock and empty release function: https://lore.kernel.org/netdev/20241115200412.1340286-1-wei.huang2@amd.com/ v5 of the PCI series using netdev_rx_queue_restart(): https://lore.kernel.org/netdev/20240916205103.3882081-5-wei.huang2@amd.com/ v1 of the PCI series using open/close: https://lore.kernel.org/netdev/20240509162741.1937586-9-wei.huang2@amd.com/ --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 105 ++++++++++++++++++++++ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 7 ++ 2 files changed, 112 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index eddb4de959c6..8ca73da801a3 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -55,6 +55,8 @@ #include #include #include +#include +#include #include "bnxt_hsi.h" #include "bnxt.h" @@ -11326,6 +11328,83 @@ static int bnxt_tx_queue_start(struct bnxt *bp, int idx) return 0; } +static void bnxt_irq_affinity_notify(struct irq_affinity_notify *notify, + const cpumask_t *mask) +{ + struct bnxt_irq *irq; + u16 tag; + int err; + + irq = container_of(notify, struct bnxt_irq, affinity_notify); + + if (!irq->bp->tph_mode) + return; + + cpumask_copy(irq->cpu_mask, mask); + + if (irq->ring_nr >= irq->bp->rx_nr_rings) + return; + + if (pcie_tph_get_cpu_st(irq->bp->pdev, TPH_MEM_TYPE_VM, + cpumask_first(irq->cpu_mask), &tag)) + return; + + if (pcie_tph_set_st_entry(irq->bp->pdev, irq->msix_nr, tag)) + return; + + rtnl_lock(); + if (netif_running(irq->bp->dev)) { + err = netdev_rx_queue_restart(irq->bp->dev, irq->ring_nr); + if (err) + netdev_err(irq->bp->dev, + "RX queue restart failed: err=%d\n", err); + } + rtnl_unlock(); +} + +static void bnxt_irq_affinity_release(struct kref *ref) +{ + struct irq_affinity_notify *notify = + container_of(ref, struct irq_affinity_notify, kref); + struct bnxt_irq *irq; + + irq = container_of(notify, struct bnxt_irq, affinity_notify); + + if (!irq->bp->tph_mode) + return; + + if (pcie_tph_set_st_entry(irq->bp->pdev, irq->msix_nr, 0)) { + netdev_err(irq->bp->dev, + "Setting ST=0 for MSIX entry %d failed\n", + irq->msix_nr); + return; + } +} + +static void bnxt_release_irq_notifier(struct bnxt_irq *irq) +{ + irq_set_affinity_notifier(irq->vector, NULL); +} + +static void bnxt_register_irq_notifier(struct bnxt *bp, struct bnxt_irq *irq) +{ + struct irq_affinity_notify *notify; + + irq->bp = bp; + + /* Nothing to do if TPH is not enabled */ + if (!bp->tph_mode) + return; + + /* Register IRQ affinity notifier */ + notify = &irq->affinity_notify; + notify->irq = irq->vector; + notify->notify = bnxt_irq_affinity_notify; + notify->release = bnxt_irq_affinity_release; + + irq_set_affinity_notifier(irq->vector, notify); +} + static void bnxt_free_irq(struct bnxt *bp) { struct bnxt_irq *irq; @@ -11348,11 +11427,18 @@ static void bnxt_free_irq(struct bnxt *bp) free_cpumask_var(irq->cpu_mask); irq->have_cpumask = 0; } + + bnxt_release_irq_notifier(irq); + free_irq(irq->vector, bp->bnapi[i]); } irq->requested = 0; } + + /* Disable TPH support */ + pcie_disable_tph(bp->pdev); + bp->tph_mode = 0; } static int bnxt_request_irq(struct bnxt *bp) @@ -11372,6 +11458,12 @@ static int bnxt_request_irq(struct bnxt *bp) #ifdef CONFIG_RFS_ACCEL rmap = bp->dev->rx_cpu_rmap; #endif + + /* Enable TPH support as part of IRQ request */ + rc = pcie_enable_tph(bp->pdev, PCI_TPH_ST_IV_MODE); + if (!rc) + bp->tph_mode = PCI_TPH_ST_IV_MODE; + for (i = 0, j = 0; i < bp->cp_nr_rings; i++) { int map_idx = bnxt_cp_num_to_irq_num(bp, i); struct bnxt_irq *irq = &bp->irq_tbl[map_idx]; @@ -11395,8 +11487,11 @@ static int bnxt_request_irq(struct bnxt *bp) if (zalloc_cpumask_var(&irq->cpu_mask, GFP_KERNEL)) { int numa_node = dev_to_node(&bp->pdev->dev); + u16 tag; irq->have_cpumask = 1; + irq->msix_nr = map_idx; + irq->ring_nr = i; cpumask_set_cpu(cpumask_local_spread(i, numa_node), irq->cpu_mask); rc = irq_update_affinity_hint(irq->vector, irq->cpu_mask); @@ -11406,6 +11501,16 @@ static int bnxt_request_irq(struct bnxt *bp) irq->vector); break; } + + bnxt_register_irq_notifier(bp, irq); + + /* Init ST table entry */ + if (pcie_tph_get_cpu_st(irq->bp->pdev, TPH_MEM_TYPE_VM, + cpumask_first(irq->cpu_mask), + &tag)) + continue; + + pcie_tph_set_st_entry(irq->bp->pdev, irq->msix_nr, tag); } } return rc; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index a634ad76177d..7069d7f6f90b 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -1231,6 +1231,11 @@ struct bnxt_irq { u8 have_cpumask:1; char name[IFNAMSIZ + BNXT_IRQ_NAME_EXTRA]; cpumask_var_t cpu_mask; + + struct bnxt *bp; + int msix_nr; + int ring_nr; + struct irq_affinity_notify affinity_notify; }; #define HWRM_RING_ALLOC_TX 0x1 @@ -2226,6 +2231,8 @@ struct bnxt { struct net_device *dev; struct pci_dev *pdev; + u8 tph_mode; + atomic_t intr_sem; u32 flags;