netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 12/14] bnxt_en: Set default completion ring for async events.
Date: Thu, 29 Dec 2016 12:13:42 -0500	[thread overview]
Message-ID: <1483031624-20076-13-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1483031624-20076-1-git-send-email-michael.chan@broadcom.com>

With the added support for the bnxt_re RDMA driver, both drivers can be
allocating completion rings in any order.  The firmware does not know
which completion ring should be receiving async events.  Add an
extra step to tell firmware the completion ring number for receiving
async events after bnxt_en allocates the completion rings.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 338dbd0..1f54a7a 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3858,6 +3858,30 @@ static int hwrm_ring_alloc_send_msg(struct bnxt *bp,
 	return rc;
 }
 
+static int bnxt_hwrm_set_async_event_cr(struct bnxt *bp, int idx)
+{
+	int rc;
+
+	if (BNXT_PF(bp)) {
+		struct hwrm_func_cfg_input req = {0};
+
+		bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
+		req.fid = cpu_to_le16(0xffff);
+		req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_ASYNC_EVENT_CR);
+		req.async_event_cr = cpu_to_le16(idx);
+		rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
+	} else {
+		struct hwrm_func_vf_cfg_input req = {0};
+
+		bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_VF_CFG, -1, -1);
+		req.enables =
+			cpu_to_le32(FUNC_VF_CFG_REQ_ENABLES_ASYNC_EVENT_CR);
+		req.async_event_cr = cpu_to_le16(idx);
+		rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
+	}
+	return rc;
+}
+
 static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
 {
 	int i, rc = 0;
@@ -3874,6 +3898,12 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
 			goto err_out;
 		BNXT_CP_DB(cpr->cp_doorbell, cpr->cp_raw_cons);
 		bp->grp_info[i].cp_fw_ring_id = ring->fw_ring_id;
+
+		if (!i) {
+			rc = bnxt_hwrm_set_async_event_cr(bp, ring->fw_ring_id);
+			if (rc)
+				netdev_warn(bp->dev, "Failed to set async event completion ring.\n");
+		}
 	}
 
 	for (i = 0; i < bp->tx_nr_rings; i++) {
-- 
1.8.3.1

  parent reply	other threads:[~2016-12-29 17:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-29 17:13 [PATCH net-next 00/14] bnxt_en: updates for net-next Michael Chan
2016-12-29 17:13 ` [PATCH net-next 01/14] bnxt_en: Remove busy poll logic in the driver Michael Chan
2016-12-29 17:13 ` [PATCH net-next 02/14] bnxt_en: Use napi_complete_done() Michael Chan
2016-12-29 17:13 ` [PATCH net-next 03/14] bnxt_en: Improve the IRQ disable sequence during shutdown Michael Chan
2016-12-29 17:13 ` [PATCH net-next 04/14] bnxt_en: Fix and clarify link_info->advertising Michael Chan
2016-12-29 17:13 ` [PATCH net-next 05/14] bnxt_en: Refactor TPA code path Michael Chan
2016-12-29 17:13 ` [PATCH net-next 06/14] bnxt_en: Add function to get vnic capability Michael Chan
2016-12-29 17:13 ` [PATCH net-next 07/14] bnxt_en: Refactor code that determines RFS capability Michael Chan
2016-12-29 17:13 ` [PATCH net-next 08/14] bnxt_en: Add new hardware RFS mode Michael Chan
2016-12-29 17:13 ` [PATCH net-next 09/14] bnxt_en: Assign additional vnics to VFs Michael Chan
2016-12-29 17:13 ` [PATCH net-next 10/14] bnxt_en: Add IPV6 hardware RFS support Michael Chan
2016-12-29 17:13 ` [PATCH net-next 11/14] bnxt_en: Implement new scheme to reserve tx rings Michael Chan
2016-12-29 17:13 ` Michael Chan [this message]
2016-12-29 17:13 ` [PATCH net-next 13/14] bnxt_en: Handle no aggregation ring gracefully Michael Chan
2016-12-29 17:13 ` [PATCH net-next 14/14] MAINTAINERS: Add bnxt_en maintainer info Michael Chan
2016-12-29 19:42 ` [PATCH net-next 00/14] bnxt_en: updates for net-next David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1483031624-20076-13-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).