From: Stephen Hurd <stephen.hurd@broadcom.com>
To: dev@dpdk.org, ajit.khaparde@broadcom.com, bruce.richardson@intel.com
Subject: [dpdk-dev] [PATCH v4 08/39] bnxt: add completion ring support
Date: Mon, 6 Jun 2016 15:08:12 -0700 [thread overview]
Message-ID: <1465250923-78695-8-git-send-email-stephen.hurd@broadcom.com> (raw)
In-Reply-To: <1465250923-78695-1-git-send-email-stephen.hurd@broadcom.com>
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Structures, macros, and functions for working with completion rings
in the driver.
Completion Ring is used by the Ethernet controller to provide the
status of transmitted & received packets, report errors, status changes
to the host software.
v4:
Address review comments and fix issues pointed out by checkpatch.
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: David Christensen <david.christensen@broadcom.com>
Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
---
drivers/net/bnxt/Makefile | 1 +
drivers/net/bnxt/bnxt.h | 5 +
drivers/net/bnxt/bnxt_cpr.c | 140 +++++++++++++++++++
drivers/net/bnxt/bnxt_cpr.h | 88 ++++++++++++
drivers/net/bnxt/bnxt_hwrm.c | 18 +++
drivers/net/bnxt/bnxt_hwrm.h | 2 +
drivers/net/bnxt/hsi_struct_def_dpdk.h | 239 ++++++++++++++++++++++++++++++++-
7 files changed, 487 insertions(+), 6 deletions(-)
create mode 100644 drivers/net/bnxt/bnxt_cpr.c
create mode 100644 drivers/net/bnxt/bnxt_cpr.h
diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile
index 757ea62..afd1690 100644
--- a/drivers/net/bnxt/Makefile
+++ b/drivers/net/bnxt/Makefile
@@ -48,6 +48,7 @@ EXPORT_MAP := rte_pmd_bnxt_version.map
#
# all source are stored in SRCS-y
#
+SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_cpr.c
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_ethdev.c
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_hwrm.c
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_ring.c
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index d0f84f4..bdd355f 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -42,6 +42,8 @@
#include <rte_lcore.h>
#include <rte_spinlock.h>
+#include "bnxt_cpr.h"
+
#define BNXT_MAX_MTU 9000
#define VLAN_TAG_SIZE 4
@@ -137,6 +139,9 @@ struct bnxt {
unsigned int tx_cp_nr_rings;
struct bnxt_tx_queue **tx_queues;
+ /* Default completion ring */
+ struct bnxt_cp_ring_info *def_cp_ring;
+
struct bnxt_vnic_info *vnic_info;
STAILQ_HEAD(, bnxt_vnic_info) free_vnic_list;
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
new file mode 100644
index 0000000..ba8c0d4
--- /dev/null
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -0,0 +1,140 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) Broadcom Limited.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Broadcom Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "bnxt.h"
+#include "bnxt_cpr.h"
+#include "bnxt_hwrm.h"
+#include "bnxt_ring.h"
+
+/*
+ * Async event handling
+ */
+void bnxt_handle_async_event(struct bnxt *bp __rte_unused,
+ struct cmpl_base *cmp)
+{
+ struct hwrm_async_event_cmpl *async_cmp =
+ (struct hwrm_async_event_cmpl *)cmp;
+
+ /* TODO: HWRM async events are not defined yet */
+ /* Needs to handle: link events, error events, etc. */
+ switch (async_cmp->event_id) {
+ case 0:
+ /* Assume LINK_CHANGE == 0 */
+ RTE_LOG(INFO, PMD, "Link change event\n");
+
+ /* Can just prompt the update_op routine to do a qcfg
+ * instead of doing the actual qcfg
+ */
+ break;
+ case 1:
+ break;
+ default:
+ RTE_LOG(ERR, PMD, "handle_async_event id = 0x%x\n",
+ async_cmp->event_id);
+ break;
+ }
+}
+
+void bnxt_handle_fwd_req(struct bnxt *bp, struct cmpl_base *cmpl)
+{
+ struct hwrm_fwd_req_cmpl *fwd_cmpl = (struct hwrm_fwd_req_cmpl *)cmpl;
+ struct input *fwd_cmd;
+ uint16_t logical_vf_id, error_code;
+
+ /* Qualify the fwd request */
+ if (fwd_cmpl->source_id < bp->pf.first_vf_id) {
+ RTE_LOG(ERR, PMD,
+ "FWD req's source_id 0x%x > first_vf_id 0x%x\n",
+ fwd_cmpl->source_id, bp->pf.first_vf_id);
+ error_code = HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED;
+ goto reject;
+ } else if (fwd_cmpl->req_len_type >> HWRM_FWD_REQ_CMPL_REQ_LEN_SFT >
+ 128 - sizeof(struct input)) {
+ RTE_LOG(ERR, PMD,
+ "FWD req's cmd len 0x%x > 108 bytes allowed\n",
+ fwd_cmpl->req_len_type >> HWRM_FWD_REQ_CMPL_REQ_LEN_SFT);
+ error_code = HWRM_ERR_CODE_INVALID_PARAMS;
+ goto reject;
+ }
+
+ /* Locate VF's forwarded command */
+ logical_vf_id = fwd_cmpl->source_id - bp->pf.first_vf_id;
+ fwd_cmd = (struct input *)((uint8_t *)bp->pf.vf_req_buf +
+ (logical_vf_id * 128));
+
+ /* Provision the request */
+ switch (fwd_cmd->req_type) {
+ case HWRM_CFA_L2_FILTER_ALLOC:
+ case HWRM_CFA_L2_FILTER_FREE:
+ case HWRM_CFA_L2_FILTER_CFG:
+ case HWRM_CFA_L2_SET_RX_MASK:
+ break;
+ default:
+ error_code = HWRM_ERR_CODE_INVALID_PARAMS;
+ goto reject;
+ }
+
+ /* Forward */
+ fwd_cmd->target_id = fwd_cmpl->source_id;
+ bnxt_hwrm_exec_fwd_resp(bp, fwd_cmd);
+ return;
+
+reject:
+ /* TODO: Encap the reject error resp into the hwrm_err_iput? */
+ /* Use the error_code for the reject cmd */
+ RTE_LOG(ERR, PMD,
+ "Error 0x%x found in the forward request\n", error_code);
+}
+
+/* For the default completion ring only */
+void bnxt_free_def_cp_ring(struct bnxt *bp)
+{
+ struct bnxt_cp_ring_info *cpr = bp->def_cp_ring;
+ struct bnxt_ring_struct *ring = cpr->cp_ring_struct;
+
+ bnxt_free_ring(ring);
+}
+
+/* For the default completion ring only */
+void bnxt_init_def_ring_struct(struct bnxt *bp)
+{
+ struct bnxt_cp_ring_info *cpr = bp->def_cp_ring;
+ struct bnxt_ring_struct *ring = cpr->cp_ring_struct;
+
+ ring->bd = (void *)cpr->cp_desc_ring;
+ ring->bd_dma = cpr->cp_desc_mapping;
+ ring->ring_size = rte_align32pow2(DEFAULT_CP_RING_SIZE);
+ ring->ring_mask = ring->ring_size - 1;
+ ring->vmem_size = 0;
+ ring->vmem = NULL;
+}
diff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h
new file mode 100644
index 0000000..878c7c9
--- /dev/null
+++ b/drivers/net/bnxt/bnxt_cpr.h
@@ -0,0 +1,88 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) Broadcom Limited.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Broadcom Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _BNXT_CPR_H_
+#define _BNXT_CPR_H_
+
+#include "hsi_struct_def_dpdk.h"
+
+#define CMP_VALID(cmp, raw_cons, ring) \
+ (!!(((struct cmpl_base *)(cmp))->info3_v & CMPL_BASE_V) == \
+ !((raw_cons) & ((ring)->ring_size)))
+
+#define CMP_TYPE(cmp) \
+ (((struct cmpl_base *)cmp)->type & CMPL_BASE_TYPE_MASK)
+
+#define ADV_RAW_CMP(idx, n) ((idx) + (n))
+#define NEXT_RAW_CMP(idx) ADV_RAW_CMP(idx, 1)
+#define RING_CMP(ring, idx) ((idx) & (ring)->ring_mask)
+#define NEXT_CMP(idx) RING_CMP(ADV_RAW_CMP(idx, 1))
+
+#define DB_CP_REARM_FLAGS (DB_KEY_CP | DB_IDX_VALID)
+#define DB_CP_FLAGS (DB_KEY_CP | DB_IDX_VALID | DB_IRQ_DIS)
+
+#define B_CP_DB_REARM(cpr, raw_cons) \
+ (*(uint32_t *)((cpr)->cp_doorbell) = (DB_CP_REARM_FLAGS | \
+ RING_CMP(&cpr->cp_ring_struct, raw_cons)))
+
+#define B_CP_DIS_DB(cpr, raw_cons) \
+ (*(uint32_t *)((cpr)->cp_doorbell) = (DB_CP_FLAGS | \
+ RING_CMP(&cpr->cp_ring_struct, raw_cons)))
+
+struct bnxt_ring_struct;
+struct bnxt_cp_ring_info {
+ uint32_t cp_raw_cons;
+ void *cp_doorbell;
+
+ struct cmpl_base *cp_desc_ring;
+
+ phys_addr_t cp_desc_mapping;
+
+ struct ctx_hw_stats *hw_stats;
+ phys_addr_t hw_stats_map;
+ uint32_t hw_stats_ctx_id;
+
+ struct bnxt_ring_struct *cp_ring_struct;
+};
+
+#define RX_CMP_L2_ERRORS \
+ (RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK | RX_PKT_CMPL_ERRORS_CRC_ERROR)
+
+
+struct bnxt;
+void bnxt_free_def_cp_ring(struct bnxt *bp);
+void bnxt_init_def_ring_struct(struct bnxt *bp);
+void bnxt_handle_async_event(struct bnxt *bp, struct cmpl_base *cmp);
+void bnxt_handle_fwd_req(struct bnxt *bp, struct cmpl_base *cmp);
+
+#endif
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a2d7815..f591ead 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -135,6 +135,24 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, uint32_t msg_len)
} \
}
+int bnxt_hwrm_exec_fwd_resp(struct bnxt *bp, void *fwd_cmd)
+{
+ int rc;
+ struct hwrm_exec_fwd_resp_input req = {.req_type = 0 };
+ struct hwrm_exec_fwd_resp_output *resp = bp->hwrm_cmd_resp_addr;
+
+ HWRM_PREP(req, EXEC_FWD_RESP, -1, resp);
+
+ memcpy(req.encap_request, fwd_cmd,
+ sizeof(req.encap_request));
+
+ rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
+
+ HWRM_CHECK_RESULT;
+
+ return rc;
+}
+
int bnxt_hwrm_func_qcaps(struct bnxt *bp)
{
int rc = 0;
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index eef3be6..b792313 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -41,6 +41,8 @@
#define HWRM_SEQ_ID_INVALID -1U
+int bnxt_hwrm_exec_fwd_resp(struct bnxt *bp, void *fwd_cmd);
+
int bnxt_hwrm_func_driver_register(struct bnxt *bp, uint32_t flags,
uint32_t *vf_req_fwd);
int bnxt_hwrm_func_qcaps(struct bnxt *bp);
diff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h
index 3c032e0..9efb68b 100644
--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h
+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h
@@ -53,12 +53,143 @@
/*
* Request types
*/
-#define HWRM_VER_GET (UINT32_C(0x0))
-#define HWRM_FUNC_QCAPS (UINT32_C(0x15))
-#define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a))
-#define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d))
-#define HWRM_PORT_PHY_CFG (UINT32_C(0x20))
-#define HWRM_QUEUE_QPORTCFG (UINT32_C(0x30))
+#define HWRM_VER_GET (UINT32_C(0x0))
+#define HWRM_FUNC_QCAPS (UINT32_C(0x15))
+#define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a))
+#define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d))
+#define HWRM_PORT_PHY_CFG (UINT32_C(0x20))
+#define HWRM_QUEUE_QPORTCFG (UINT32_C(0x30))
+#define HWRM_CFA_L2_FILTER_ALLOC (UINT32_C(0x90))
+#define HWRM_CFA_L2_FILTER_FREE (UINT32_C(0x91))
+#define HWRM_CFA_L2_FILTER_CFG (UINT32_C(0x92))
+#define HWRM_CFA_L2_SET_RX_MASK (UINT32_C(0x93))
+#define HWRM_EXEC_FWD_RESP (UINT32_C(0xd0))
+
+/* Return Codes */
+#define HWRM_ERR_CODE_INVALID_PARAMS (UINT32_C(0x2))
+#define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED (UINT32_C(0x3))
+
+/* HWRM Forwarded Request (16 bytes) */
+struct hwrm_fwd_req_cmpl {
+ /* Length of forwarded request in bytes. */
+ /*
+ * This field indicates the exact type of the completion. By convention,
+ * the LSB identifies the length of the record in 16B units. Even values
+ * indicate 16B records. Odd values indicate 32B records.
+ */
+ #define HWRM_FWD_REQ_CMPL_TYPE_MASK UINT32_C(0x3f)
+ #define HWRM_FWD_REQ_CMPL_TYPE_SFT 0
+ /* Forwarded HWRM Request */
+ #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ (UINT32_C(0x22) << 0)
+ /* Length of forwarded request in bytes. */
+ #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK UINT32_C(0xffc0)
+ #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT 6
+ uint16_t req_len_type;
+
+ /*
+ * Source ID of this request. Typically used in forwarding requests and
+ * responses. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 - 0xFFFE -
+ * Reserved for internal processors 0xFFFF - HWRM
+ */
+ uint16_t source_id;
+
+ uint32_t unused_0;
+
+ /* Address of forwarded request. */
+ /*
+ * This value is written by the NIC such that it will be different for
+ * each pass through the completion queue. The even passes will write 1.
+ * The odd passes will write 0.
+ */
+ #define HWRM_FWD_REQ_CMPL_V UINT32_C(0x1)
+ /* Address of forwarded request. */
+ #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
+ #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
+ uint64_t req_buf_addr_v;
+} __attribute__((packed));
+
+/* HWRM Asynchronous Event Completion Record (16 bytes) */
+struct hwrm_async_event_cmpl {
+ /*
+ * This field indicates the exact type of the completion. By convention,
+ * the LSB identifies the length of the record in 16B units. Even values
+ * indicate 16B records. Odd values indicate 32B records.
+ */
+ #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK UINT32_C(0x3f)
+ #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT 0
+ /* HWRM Asynchronous Event Information */
+ #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT \
+ (UINT32_C(0x2e) << 0)
+ uint16_t type;
+
+ /* Identifiers of events. */
+ /* Link status changed */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE \
+ (UINT32_C(0x0) << 0)
+ /* Link MTU changed */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE \
+ (UINT32_C(0x1) << 0)
+ /* Link speed changed */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE \
+ (UINT32_C(0x2) << 0)
+ /* DCB Configuration changed */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE \
+ (UINT32_C(0x3) << 0)
+ /* Port connection not allowed */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \
+ (UINT32_C(0x4) << 0)
+ /* Link speed configuration was not allowed */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
+ (UINT32_C(0x5) << 0)
+ /* Function driver unloaded */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD \
+ (UINT32_C(0x10) << 0)
+ /* Function driver loaded */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD \
+ (UINT32_C(0x11) << 0)
+ /* PF driver unloaded */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD \
+ (UINT32_C(0x20) << 0)
+ /* PF driver loaded */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD \
+ (UINT32_C(0x21) << 0)
+ /* VF Function Level Reset (FLR) */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR (UINT32_C(0x30) << 0)
+ /* VF MAC Address Change */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE \
+ (UINT32_C(0x31) << 0)
+ /* PF-VF communication channel status change. */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
+ (UINT32_C(0x32) << 0)
+ /* HWRM Error */
+ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR \
+ (UINT32_C(0xff) << 0)
+ uint16_t event_id;
+
+ /* Event specific data */
+ uint32_t event_data2;
+
+ /* opaque is 7 b */
+ /*
+ * This value is written by the NIC such that it will be different for
+ * each pass through the completion queue. The even passes will write 1.
+ * The odd passes will write 0.
+ */
+ #define HWRM_ASYNC_EVENT_CMPL_V UINT32_C(0x1)
+ /* opaque is 7 b */
+ #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
+ #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
+ uint8_t opaque_v;
+
+ /* 8-lsb timestamp from POR (100-msec resolution) */
+ uint8_t timestamp_lo;
+
+ /* 16-lsb timestamp from POR (100-msec resolution) */
+ uint16_t timestamp_hi;
+
+ /* Event specific data */
+ uint32_t event_data1;
+} __attribute__((packed));
/*
* Note: The Hardware Resource Manager (HWRM) manages various hardware resources
@@ -122,6 +253,102 @@ struct output {
uint16_t resp_len;
} __attribute__((packed));
+/* hwrm_exec_fwd_resp */
+/*
+ * Description: This command is used to send an encapsulated request to the
+ * HWRM. This command instructs the HWRM to execute the request and forward the
+ * response of the encapsulated request to the location specified in the
+ * original request that is encapsulated. The target id of this command shall be
+ * set to 0xFFFF (HWRM). The response location in this command shall be used to
+ * acknowledge the receipt of the encapsulated request and forwarding of the
+ * response.
+ */
+
+/* Input (128 bytes) */
+struct hwrm_exec_fwd_resp_input {
+ /*
+ * This value indicates what type of request this is. The format for the
+ * rest of the command is determined by this field.
+ */
+ uint16_t req_type;
+
+ /*
+ * This value indicates the what completion ring the request will be
+ * optionally completed on. If the value is -1, then no CR completion
+ * will be generated. Any other value must be a valid CR ring_id value
+ * for this function.
+ */
+ uint16_t cmpl_ring;
+
+ /* This value indicates the command sequence number. */
+ uint16_t seq_id;
+
+ /*
+ * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
+ * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
+ */
+ uint16_t target_id;
+
+ /*
+ * This is the host address where the response will be written when the
+ * request is complete. This area must be 16B aligned and must be
+ * cleared to zero before the request is made.
+ */
+ uint64_t resp_addr;
+
+ /*
+ * This is an encapsulated request. This request should be executed by
+ * the HWRM and the response should be provided in the response buffer
+ * inside the encapsulated request.
+ */
+ uint32_t encap_request[26];
+
+ /*
+ * This value indicates the target id of the response to the
+ * encapsulated request. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 -
+ * 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
+ */
+ uint16_t encap_resp_target_id;
+
+ uint16_t unused_0[3];
+} __attribute__((packed));
+
+/* Output (16 bytes) */
+struct hwrm_exec_fwd_resp_output {
+ /*
+ * Pass/Fail or error type Note: receiver to verify the in parameters,
+ * and fail the call with an error when appropriate
+ */
+ uint16_t error_code;
+
+ /* This field returns the type of original request. */
+ uint16_t req_type;
+
+ /* This field provides original sequence number of the command. */
+ uint16_t seq_id;
+
+ /*
+ * This field is the length of the response in bytes. The last byte of
+ * the response is a valid flag that will read as '1' when the command
+ * has been completely written to memory.
+ */
+ uint16_t resp_len;
+
+ uint32_t unused_0;
+ uint8_t unused_1;
+ uint8_t unused_2;
+ uint8_t unused_3;
+
+ /*
+ * This field is used in Output records to indicate that the output is
+ * completely written to RAM. This field should be read as '1' to
+ * indicate that the output has been completely written. When writing a
+ * command completion or response to an internal processor, the order of
+ * writes has to be such that this field is written last.
+ */
+ uint8_t valid;
+} __attribute__((packed));
+
/* hwrm_func_qcaps */
/*
* Description: This command returns capabilities of a function. The input FID
--
1.9.1
next prev parent reply other threads:[~2016-06-06 22:09 UTC|newest]
Thread overview: 132+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 22:08 [dpdk-dev] [PATCH v4 01/39] bnxt: new driver for Broadcom NetXtreme-C devices Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 02/39] bnxt: add HWRM init code Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 03/39] bnxt: add driver register/unregister support Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 04/39] bnxt: add dev infos get operation Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 05/39] bnxt: add dev configure operation Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 06/39] bnxt: add vnic functions and structs Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 07/39] bnxt: declare ring structs and free() func Stephen Hurd
2016-06-06 22:08 ` Stephen Hurd [this message]
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 09/39] bnxt: add L2 filter alloc/init/free Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 10/39] bnxt: add Tx queue operations (nonfunctional) Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 11/39] bnxt: add Rx queue create/destroy operations Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 12/39] bnxt: Add statistics operations Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 13/39] bnxt: initial Tx code implementation Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 14/39] bnxt: initial Rx " Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 15/39] bnxt: Code to alloc/free ring Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 16/39] bnxt: add HWRM function reset command Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 17/39] bnxt: add HWRM vnic alloc function Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 18/39] bnxt: add HWRM vnic free function Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 19/39] bnxt: add HWRM vnic configure function Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 20/39] bnxt: add API to allow configuration of vnic Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 21/39] bnxt: add HWRM API to configure RSS Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 22/39] bnxt: add API for L2 Rx mask set/clear functions Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 23/39] bnxt: add HWRM stats context allocation Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 24/39] bnxt: add HWRM ring alloc/free functions Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 25/39] bnxt: add ring group " Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 26/39] bnxt: add HWRM stat context free function Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 27/39] bnxt: Add HWRM API to set and clear filters Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 28/39] bnxt: add ring alloc, free and group init Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 29/39] bnxt: add HWRM port PHY config call and helpers Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 30/39] bnxt: add start/stop/link update operations Stephen Hurd
2016-06-08 10:02 ` Bruce Richardson
2016-06-08 10:41 ` Bruce Richardson
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 31/39] bnxt: add promiscuous enable/disable operations Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 32/39] bnxt: add all multicast " Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 33/39] bnxt: free memory in close operation Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 34/39] bnxt: add MAC address add/remove dev_ops Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 35/39] bnxt: add set link up/down operations Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 36/39] bnxt: add reta update/query operations Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 37/39] bnxt: add RSS device operations Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 38/39] bnxt: add flow control operations Stephen Hurd
2016-06-06 22:08 ` [dpdk-dev] [PATCH v4 39/39] bnxt: Replace bnxt_ring_struct with bnxt_ring Stephen Hurd
2016-06-07 6:25 ` [dpdk-dev] [PATCH v4 01/39] bnxt: new driver for Broadcom NetXtreme-C devices Thomas Monjalon
2016-06-08 10:31 ` Bruce Richardson
2016-06-08 10:21 ` Bruce Richardson
2016-06-08 10:41 ` Bruce Richardson
2016-06-14 13:14 ` Bruce Richardson
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 01/38] " Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 02/38] bnxt: add HWRM init code Stephen Hurd
2016-06-15 16:25 ` Ferruh Yigit
2016-06-15 20:28 ` Stephen Hurd
2016-06-16 9:46 ` Bruce Richardson
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 03/38] bnxt: add driver register/unregister support Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 04/38] bnxt: add dev infos get operation Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 05/38] bnxt: add dev configure operation Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 06/38] bnxt: add vnic functions and structs Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 07/38] bnxt: declare generic ring structs and free() func Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 08/38] bnxt: add completion ring support Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 09/38] bnxt: add L2 filter alloc/init/free Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 10/38] bnxt: add Tx queue operations (nonfunctional) Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 11/38] bnxt: add Rx queue create/destroy operations Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 12/38] bnxt: add statistics operations Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 13/38] bnxt: add initial Tx code implementation Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 14/38] bnxt: add initial Rx " Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 15/38] bnxt: add code to alloc/free Tx Rx and cmpl rings Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 16/38] bnxt: add HWRM function reset command Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 17/38] bnxt: add HWRM vnic alloc function Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 18/38] bnxt: add HWRM vnic free function Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 19/38] bnxt: add HWRM vnic configure function Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 20/38] bnxt: add API to allow configuration of vnic Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 21/38] bnxt: add HWRM API to configure RSS Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 22/38] bnxt: add API for L2 Rx mask set/clear functions Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 23/38] bnxt: add HWRM API for stats context allocation Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 24/38] bnxt: add HWRM ring alloc/free functions Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 25/38] bnxt: add ring group " Stephen Hurd
2016-06-14 22:55 ` [dpdk-dev] [PATCH v5 26/38] bnxt: add HWRM stat context free function Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 27/38] bnxt: add HWRM API to set and clear filters Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 28/38] bnxt: allocate and free all HWRM rings and groups Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 29/38] bnxt: add HWRM port PHY config call and helpers Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 30/38] bnxt: add start/stop/link update operations Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 31/38] bnxt: add promiscuous enable/disable operations Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 32/38] bnxt: add all multicast " Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 33/38] bnxt: free memory in close operation Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 34/38] bnxt: add MAC address add/remove dev ops Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 35/38] bnxt: add set link up/down operations Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 36/38] bnxt: add reta update/query operations Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 37/38] bnxt: add RSS device operations Stephen Hurd
2016-06-14 22:56 ` [dpdk-dev] [PATCH v5 38/38] bnxt: add flow control operations Stephen Hurd
2016-06-15 15:28 ` [dpdk-dev] [PATCH v5 01/38] bnxt: new driver for Broadcom NetXtreme-C devices Bruce Richardson
2016-06-15 15:30 ` Bruce Richardson
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 00/38] new bnxt poll mode driver library Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 01/38] bnxt: new driver for Broadcom NetXtreme-C devices Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 02/38] bnxt: add HWRM init code Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 03/38] bnxt: add driver register/unregister support Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 04/38] bnxt: add dev infos get operation Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 05/38] bnxt: add dev configure operation Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 06/38] bnxt: add vnic functions and structs Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 07/38] bnxt: declare generic ring structs and free() func Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 08/38] bnxt: add completion ring support Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 09/38] bnxt: add L2 filter alloc/init/free Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 10/38] bnxt: add Tx queue operations (nonfunctional) Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 11/38] bnxt: add Rx queue create/destroy operations Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 12/38] bnxt: add statistics operations Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 13/38] bnxt: add initial Tx code implementation Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 14/38] bnxt: add initial Rx " Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 15/38] bnxt: add code to alloc/free Tx Rx and cmpl rings Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 16/38] bnxt: add HWRM function reset command Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 17/38] bnxt: add HWRM vnic alloc function Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 18/38] bnxt: add HWRM vnic free function Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 19/38] bnxt: add HWRM vnic configure function Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 20/38] bnxt: add API to allow configuration of vnic Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 21/38] bnxt: add HWRM API to configure RSS Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 22/38] bnxt: add API for L2 Rx mask set/clear functions Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 23/38] bnxt: add HWRM API for stats context allocation Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 24/38] bnxt: add HWRM ring alloc/free functions Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 25/38] bnxt: add ring group " Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 26/38] bnxt: add HWRM stat context free function Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 27/38] bnxt: add HWRM API to set and clear filters Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 28/38] bnxt: allocate and free all HWRM rings and groups Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 29/38] bnxt: add HWRM port PHY config call and helpers Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 30/38] bnxt: add start/stop/link update operations Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 31/38] bnxt: add promiscuous enable/disable operations Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 32/38] bnxt: add all multicast " Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 33/38] bnxt: free memory in close operation Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 34/38] bnxt: add MAC address add/remove dev ops Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 35/38] bnxt: add set link up/down operations Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 36/38] bnxt: add reta update/query operations Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 37/38] bnxt: add RSS device operations Stephen Hurd
2016-06-15 21:23 ` [dpdk-dev] [PATCH v6 38/38] bnxt: add flow control operations Stephen Hurd
2016-06-16 14:24 ` [dpdk-dev] [PATCH v6 00/38] new bnxt poll mode driver library Bruce Richardson
2016-06-16 18:51 ` Ajit Khaparde
2016-06-21 14:25 ` Ajit Khaparde
2016-06-21 14:46 ` Bruce Richardson
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=1465250923-78695-8-git-send-email-stephen.hurd@broadcom.com \
--to=stephen.hurd@broadcom.com \
--cc=ajit.khaparde@broadcom.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.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).