From patchwork Sat Jul 13 23:43:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13732553 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 8DA7516C69E for ; Sat, 13 Jul 2024 23:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720914249; cv=none; b=UEONjpAmxKMNkuIkPNBiHCpGIorWww7rqiFwNIIlXvQPbVZlcWmNoDdSFivrghf67KlaS8rYq8OWSBjsMEyt8IdmZV8CLMUlQX+IhUwGo25/o6ONyfg5Ds1Tn9S1adK0xd3BEFKl+LGBEUMqnqF+hDOP0y7Ff4zzRdE1XNrKJ/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720914249; c=relaxed/simple; bh=JO5unTtKVFCWh7olQ9fNM8OwAtk5emmSZB+l5awaUSI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FtnL7AW3YgyFKHZ5m/Hlx2hUXwshBXajDw18qIsEriyXe9HUl5pkZ59QFGvLLQLywspMZxvuumNPwC3cdokIGPJjfjw+GXej+a3NJAJ6WGbTV6rOsoVKuzN1aeiRS7gtoje0EzBkfnu8FlCSoTtxy0VhUnnRxfL8lx3/OzW5YBE= 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=T7TdXpGM; arc=none smtp.client-ip=209.85.222.169 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="T7TdXpGM" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-79efb4a46b6so215518385a.2 for ; Sat, 13 Jul 2024 16:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1720914246; x=1721519046; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=LWkis2EbV5Qx1HwZk5h5XIa/3JXLabK7UZPW1SNVhJg=; b=T7TdXpGMel6T/qrXfkvf2ZSEr4KdBp4WWqWPgqFiW0Je3jvbmlFtjSjXdTf9iPPUQl Ucakiey6VtkWfvDRAWMCFRE45bjCTXxlqteuAhEi8toX/c55AHjs0kCIAUzKc6bDHy2k N6uX+5/3aeDGMqsmB+zDiid/eB2GZn3rgq6+0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720914246; x=1721519046; h=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=LWkis2EbV5Qx1HwZk5h5XIa/3JXLabK7UZPW1SNVhJg=; b=YfDAPWHgMjgw4VPL1dHKHOOGKt4VfxjsNNGe/ndYoJLcPiAmrCUyMHY52wN8fOhIZK r065NDa0G5Be0LwkFz97zBREGqb6soMRCuWCKtZnycIjtap+tJSYgsibttlcxTm07JTo szICCGwYFrfBAjdj6Ix1ghI1nmQR4SFvHisSZmgCSVdIkeHbiimAogQQiPoa7T1LD65W kEJRHX73pYRuniDK0Pc0S8WKex6kAqBg1BDeJhtX99I6ch9XmgenmLnX+0RDwIAOKuVJ iA6ofegy8sJV5Y5kqm/9Z0/1qgovgUBzD/B9gAvH3Kx2My8dP6icysPWTE3Fmcffu+Wf nbjQ== X-Gm-Message-State: AOJu0Yy3AakPMdk5lQIRj0s2NLKN63EtTvSDtqctMrgGb006Xojj5ZqA LeK88Qt97bHHQ0b6hPkXhEASstouxcxCd6BKuRzQ5tuD2rZGPRTuUv8oKTFGAg== X-Google-Smtp-Source: AGHT+IHjvHnKlNF/p2g6E11m1jsrdE35aOZYfewnxn665b0/+i+/Y00+uUqseTih0QLr9LUXcaLgug== X-Received: by 2002:a05:620a:1a0c:b0:79f:a53:5638 with SMTP id af79cd13be357-79f19a6a830mr2221383185a.44.1720914246178; Sat, 13 Jul 2024 16:44:06 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a160bbe6f7sm78124585a.37.2024.07.13.16.44.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jul 2024 16:44:05 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, Hongguang Gao , Kalesh AP , Somnath Kotur Subject: [PATCH net-next 4/9] bnxt_en: Deprecate support for legacy INTX mode Date: Sat, 13 Jul 2024 16:43:34 -0700 Message-ID: <20240713234339.70293-5-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 In-Reply-To: <20240713234339.70293-1-michael.chan@broadcom.com> References: <20240713234339.70293-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 Firmware has deprecated support for legacy INTX in 2022 and INTX hasn't been tested for many years before that. If MSIX capability is not found in probe, abort. Reviewed-by: Hongguang Gao Reviewed-by: Kalesh AP Reviewed-by: Somnath Kotur Signed-off-by: Michael Chan Reviewed-by: Simon Horman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 41 ++++------------------- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 - 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 4f9d9a1d9c88..7599fc3f8e27 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -10745,7 +10745,7 @@ static int bnxt_get_num_msix(struct bnxt *bp) return bnxt_nq_rings_in_use(bp); } -static int bnxt_init_msix(struct bnxt *bp) +static int bnxt_init_int_mode(struct bnxt *bp) { int i, total_vecs, max, rc = 0, min = 1, ulp_msix, tx_cp; struct msix_entry *msix_ent; @@ -10803,7 +10803,7 @@ static int bnxt_init_msix(struct bnxt *bp) return 0; msix_setup_exit: - netdev_err(bp->dev, "bnxt_init_msix err: %x\n", rc); + netdev_err(bp->dev, "bnxt_init_int_mode err: %x\n", rc); kfree(bp->irq_tbl); bp->irq_tbl = NULL; pci_disable_msix(bp->pdev); @@ -10811,35 +10811,6 @@ static int bnxt_init_msix(struct bnxt *bp) return rc; } -static int bnxt_init_inta(struct bnxt *bp) -{ - bp->irq_tbl = kzalloc(sizeof(struct bnxt_irq), GFP_KERNEL); - if (!bp->irq_tbl) - return -ENOMEM; - - bp->total_irqs = 1; - bp->rx_nr_rings = 1; - bp->tx_nr_rings = 1; - bp->cp_nr_rings = 1; - bp->flags |= BNXT_FLAG_SHARED_RINGS; - bp->irq_tbl[0].vector = bp->pdev->irq; - return 0; -} - -static int bnxt_init_int_mode(struct bnxt *bp) -{ - int rc = -ENODEV; - - if (bp->flags & BNXT_FLAG_MSIX_CAP) - rc = bnxt_init_msix(bp); - - if (!(bp->flags & BNXT_FLAG_USING_MSIX) && BNXT_PF(bp)) { - /* fallback to INTA */ - rc = bnxt_init_inta(bp); - } - return rc; -} - static void bnxt_clear_int_mode(struct bnxt *bp) { if (bp->flags & BNXT_FLAG_USING_MSIX) @@ -12885,7 +12856,7 @@ bool bnxt_rfs_capable(struct bnxt *bp, bool new_rss_ctx) !BNXT_SUPPORTS_NTUPLE_VNIC(bp)) return bnxt_rfs_supported(bp); - if (!(bp->flags & BNXT_FLAG_MSIX_CAP) || !bnxt_can_reserve_rings(bp) || !bp->rx_nr_rings) + if (!bnxt_can_reserve_rings(bp) || !bp->rx_nr_rings) return false; hwr.grp = bp->rx_nr_rings; @@ -15743,8 +15714,10 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) if (BNXT_PF(bp)) SET_NETDEV_DEVLINK_PORT(dev, &bp->dl_port); - if (pdev->msix_cap) - bp->flags |= BNXT_FLAG_MSIX_CAP; + if (!pdev->msix_cap) { + dev_err(&pdev->dev, "MSIX capability not found, aborting\n"); + return -ENODEV; + } rc = bnxt_init_board(pdev, dev); if (rc < 0) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index af4d9bb947b3..06030244d740 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -2199,7 +2199,6 @@ struct bnxt { #define BNXT_FLAG_AGG_RINGS (BNXT_FLAG_JUMBO | BNXT_FLAG_GRO | \ BNXT_FLAG_LRO) #define BNXT_FLAG_USING_MSIX 0x40 - #define BNXT_FLAG_MSIX_CAP 0x80 #define BNXT_FLAG_RFS 0x100 #define BNXT_FLAG_SHARED_RINGS 0x200 #define BNXT_FLAG_PORT_STATS 0x400