From patchwork Mon Mar 25 22:28:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13603103 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (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 3BE3E823B5 for ; Mon, 25 Mar 2024 22:29:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711405776; cv=none; b=R62HnnWJ3Qicmvn8n1Pf664sOAJFf3GyFtJXsQQyv8FWtoimBBZzhAyPXsQijwY2U/xFEUxYaylNffcTsz3VVLTuyG+UOqTTGMTfC+aWL8u7RDo/z+0rBG9Rjzjlsw/Sr5J5MFeybhHTUxeaXU7AeQDh+jTgITl1A9PgxUpOE0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711405776; c=relaxed/simple; bh=HAdtbMG6cTTPcUE4qWXCsLscaQVG9EtrL+InkjczBx0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=SMmo99a7qIeVRTymDkHcAI4ypAG6PxVO4mox/FNJ0OwpVIRQtHoEtoW3X9BeuIhM4sLDqAerwm9/CNdgf/LImomzly7aQ69i+1a9PX7RNLvJxravI8BS7YxPx316XwxgNj1lPaN96dSChGFFAXtydKSsrhs/pEN80OZbxagW+XE= 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=ciS29TCq; arc=none smtp.client-ip=209.85.210.52 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="ciS29TCq" Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-6e6b01c3dc3so2873437a34.2 for ; Mon, 25 Mar 2024 15:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1711405774; x=1712010574; 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=FQyKvsLz6FLG0eabSBvrp4QJY0EIBpHE5YSHnAVee1s=; b=ciS29TCqIs0kiVhd86rTGRq/XTfiFgRFDCriB2+Ja+6DSpe8ji9zVQoFh25zSJNmV6 vcu/oe3e14EiBmrIJIpx/9fmP8ZzSXj2NXM5amGRFFEYePfiAyjbYQZESTZx8CbY3dnX PISooCTkT1dNfsE8Q68b7xGORdCGtIeAYYIfo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711405774; x=1712010574; 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=FQyKvsLz6FLG0eabSBvrp4QJY0EIBpHE5YSHnAVee1s=; b=FhSO25JC94Ieo+0lVtm56cXChZVEp6G8kffrW+JGmLl5J9SEqtsdZRVGiGG/lUxnp/ hk+DZfoBVxCwudaUaqqn/DTfGLf32tb7yG+eckCQb9R3J7pVvOLC0whw1R5IzW8Kp182 lfaEm5HVAWQebFN92HZKvb7gfyVTQpWHhbCzL5h0H2CJMhxiw4yz0eL+Ds08BknNNqmy N1n/LSs/qrAt3KAPEyDNeBkIDUGSoduS9vsYEcJLmAddunXgJ23acd/ketExEoMXFalT +EVByIFt4d1HP7aRPT0XuoIKjDkVsu6z/r+Va7aeyBwKWJh684wjuG7ip5U2jBjp4enn Q3JA== X-Gm-Message-State: AOJu0Yz26Zec2hjviSwkxSTx+XULICvXlOcByLiijfxnHHRxdgdV+gDY MDdPLeGStXbcW9bocLBr8KDqE8wGDoDUN7xUv0GLoFRRo7uTOr+u6FIikZjfxw== X-Google-Smtp-Source: AGHT+IFrj6zJYXIuR5mHmTi6way7B25gEO7hsGgJpmAabfn+t+zY6Z1NUkTqP6Ynm1xZGz+bzrRd5w== X-Received: by 2002:a05:6830:3d03:b0:6e6:8c5d:44d1 with SMTP id eu3-20020a0568303d0300b006e68c5d44d1mr10141009otb.33.1711405773848; Mon, 25 Mar 2024 15:29:33 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id t10-20020a63dd0a000000b005e438fe702dsm6301610pgg.65.2024.03.25.15.29.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2024 15:29:32 -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 Subject: [PATCH net-next 03/12] bnxt_en: Add helper function bnxt_hwrm_vnic_rss_cfg_p5() Date: Mon, 25 Mar 2024 15:28:53 -0700 Message-Id: <20240325222902.220712-4-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20240325222902.220712-1-michael.chan@broadcom.com> References: <20240325222902.220712-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: Pavan Chebbi This is a pure refactoring patch. The new function bnxt_hwrm_vnic_set_rss_p5() will set up the P5_PLUS specific RSS ring table and then call bnxt_hwrm_vnic_cfg() to setup the vnic for proper RSS operations. This new function will be used later for additional RSS contexts. Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 31 +++++++++++++++-------- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 493b724848c8..dd2c5033af02 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -9825,6 +9825,23 @@ static int __bnxt_setup_vnic(struct bnxt *bp, u16 vnic_id) return rc; } +int bnxt_hwrm_vnic_rss_cfg_p5(struct bnxt *bp, u16 vnic_id) +{ + int rc; + + rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic_id, true); + if (rc) { + netdev_err(bp->dev, "hwrm vnic %d set rss failure rc: %d\n", + vnic_id, rc); + return rc; + } + rc = bnxt_hwrm_vnic_cfg(bp, vnic_id); + if (rc) + netdev_err(bp->dev, "hwrm vnic %d cfg failure rc: %x\n", + vnic_id, rc); + return rc; +} + static int __bnxt_setup_vnic_p5(struct bnxt *bp, u16 vnic_id) { int rc, i, nr_ctxs; @@ -9842,18 +9859,10 @@ static int __bnxt_setup_vnic_p5(struct bnxt *bp, u16 vnic_id) if (i < nr_ctxs) return -ENOMEM; - rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic_id, true); - if (rc) { - netdev_err(bp->dev, "hwrm vnic %d set rss failure rc: %d\n", - vnic_id, rc); - return rc; - } - rc = bnxt_hwrm_vnic_cfg(bp, vnic_id); - if (rc) { - netdev_err(bp->dev, "hwrm vnic %d cfg failure rc: %x\n", - vnic_id, rc); + rc = bnxt_hwrm_vnic_rss_cfg_p5(bp, vnic_id); + if (rc) return rc; - } + if (bp->flags & BNXT_FLAG_AGG_RINGS) { rc = bnxt_hwrm_vnic_set_hds(bp, vnic_id); if (rc) { diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index dd849e715c9b..fbb53308cb81 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -2721,6 +2721,7 @@ int bnxt_hwrm_free_wol_fltr(struct bnxt *bp); int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp, bool all); int bnxt_hwrm_func_qcaps(struct bnxt *bp); int bnxt_hwrm_fw_set_time(struct bnxt *); +int bnxt_hwrm_vnic_rss_cfg_p5(struct bnxt *bp, u16 vnic_id); int bnxt_open_nic(struct bnxt *, bool, bool); int bnxt_half_open_nic(struct bnxt *bp); void bnxt_half_close_nic(struct bnxt *bp);