DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
* [dpdk-dev] [PATCH 0/6] bnxt patch series
@ 2019-06-08 19:22 Ajit Khaparde
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 1/6] net/bnxt: add code to redirect tunnel packets Ajit Khaparde
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Ajit Khaparde @ 2019-06-08 19:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit

This is a patchset against dpdk-next-net tree on top of
commit d800226ab9ede99ab9bc56a691555568e6e587f1.
Please apply.


Kalesh AP (1):
  net/bnxt: fix output of port xstats

Naresh Kumar PBS (2):
  net/bnxt: fix interrupt vector array initialization
  net/bnxt: address build errors reported by intel compiler

Somnath Kotur (3):
  net/bnxt: add code to redirect tunnel packets
  net/bnxt: fix to check for NULL completion ring doorbell in
    int_handler
  net/bnxt: driver to use configured MTU value during load

 drivers/net/bnxt/bnxt.h        |   1 +
 drivers/net/bnxt/bnxt_cpr.c    |   2 +-
 drivers/net/bnxt/bnxt_ethdev.c |  28 ++--
 drivers/net/bnxt/bnxt_filter.h |   5 +-
 drivers/net/bnxt/bnxt_flow.c   | 236 ++++++++++++++++++++++++++++-----
 drivers/net/bnxt/bnxt_hwrm.c   |  88 +++++++++++-
 drivers/net/bnxt/bnxt_hwrm.h   |   7 +-
 drivers/net/bnxt/bnxt_irq.c    |   2 +-
 drivers/net/bnxt/bnxt_stats.c  |   2 +
 9 files changed, 321 insertions(+), 50 deletions(-)

-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [PATCH 1/6] net/bnxt: add code to redirect tunnel packets
  2019-06-08 19:22 [dpdk-dev] [PATCH 0/6] bnxt patch series Ajit Khaparde
@ 2019-06-08 19:22 ` Ajit Khaparde
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 2/6] net/bnxt: fix to check for NULL completion ring doorbell in int_handler Ajit Khaparde
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Ajit Khaparde @ 2019-06-08 19:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Somnath Kotur, Kalesh AP, Lance Richardson

From: Somnath Kotur <somnath.kotur@broadcom.com>

Add code to redirect GRE, NVGRE and VXLAN tunnel packets
to the specified VF.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |   1 +
 drivers/net/bnxt/bnxt_filter.h |   5 +-
 drivers/net/bnxt/bnxt_flow.c   | 236 ++++++++++++++++++++++++++++-----
 drivers/net/bnxt/bnxt_hwrm.c   |  83 ++++++++++++
 drivers/net/bnxt/bnxt_hwrm.h   |   5 +
 5 files changed, 295 insertions(+), 35 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 641790fef..942da7ff0 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -430,6 +430,7 @@ struct bnxt {
 	uint16_t		max_l2_ctx;
 	uint16_t		max_vnics;
 	uint16_t		max_stat_ctx;
+	uint16_t		first_vf_id;
 	uint16_t		vlan;
 	struct bnxt_pf_info	pf;
 	uint8_t			port_partition_type;
diff --git a/drivers/net/bnxt/bnxt_filter.h b/drivers/net/bnxt/bnxt_filter.h
index f8bad29de..4fda3f03a 100644
--- a/drivers/net/bnxt/bnxt_filter.h
+++ b/drivers/net/bnxt/bnxt_filter.h
@@ -19,7 +19,8 @@ struct bnxt_filter_info {
 #define HWRM_CFA_L2_FILTER	0
 #define HWRM_CFA_EM_FILTER	1
 #define HWRM_CFA_NTUPLE_FILTER	2
-	uint8_t                 filter_type;    //L2 or EM or NTUPLE filter
+#define HWRM_CFA_TUNNEL_REDIRECT_FILTER	3
+	uint8_t                 filter_type;
 	uint32_t                dst_id;
 
 	/* Filter Characteristics */
@@ -120,6 +121,8 @@ struct bnxt_filter_info *bnxt_get_l2_filter(struct bnxt *bp,
 	HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN
 #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_NVGRE	\
 	HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE
+#define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE  \
+	HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE
 #define L2_FILTER_ALLOC_INPUT_EN_L2_ADDR_MASK	\
 	HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK
 #define NTUPLE_FLTR_ALLOC_INPUT_IP_PROTOCOL_UDP	\
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 6f92e3de5..deb9733e9 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -109,9 +109,12 @@ bnxt_filter_type_check(const struct rte_flow_item pattern[],
 			}
 			use_ntuple |= 1;
 			break;
+		case RTE_FLOW_ITEM_TYPE_ANY:
+			use_ntuple = 0;
+			break;
 		default:
-			PMD_DRV_LOG(ERR, "Unknown Flow type\n");
-			use_ntuple |= 1;
+			PMD_DRV_LOG(DEBUG, "Unknown Flow type\n");
+			use_ntuple |= 0;
 		}
 		item++;
 	}
@@ -134,6 +137,8 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 	const struct rte_flow_item_eth *eth_spec, *eth_mask;
 	const struct rte_flow_item_nvgre *nvgre_spec;
 	const struct rte_flow_item_nvgre *nvgre_mask;
+	const struct rte_flow_item_gre *gre_spec;
+	const struct rte_flow_item_gre *gre_mask;
 	const struct rte_flow_item_vxlan *vxlan_spec;
 	const struct rte_flow_item_vxlan *vxlan_mask;
 	uint8_t vni_mask[] = {0xFF, 0xFF, 0xFF};
@@ -146,13 +151,23 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 	int use_ntuple;
 	uint32_t en = 0;
 	uint32_t en_ethertype;
-	int dflt_vnic;
+	int dflt_vnic, rc = 0;
 
 	use_ntuple = bnxt_filter_type_check(pattern, error);
 	PMD_DRV_LOG(DEBUG, "Use NTUPLE %d\n", use_ntuple);
 	if (use_ntuple < 0)
 		return use_ntuple;
 
+	if (use_ntuple && (bp->eth_dev->data->dev_conf.rxmode.mq_mode &
+	    ETH_MQ_RX_RSS)) {
+		PMD_DRV_LOG(ERR, "Cannot create ntuple flow on RSS queues\n");
+		rte_flow_error_set(error, EINVAL,
+				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+				   "Cannot create flow on RSS queues");
+		rc = -rte_errno;
+		return rc;
+	}
+
 	filter->filter_type = use_ntuple ?
 		HWRM_CFA_NTUPLE_FILTER : HWRM_CFA_EM_FILTER;
 	en_ethertype = use_ntuple ?
@@ -169,16 +184,11 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 			return -rte_errno;
 		}
 
-		if (!item->spec || !item->mask) {
-			rte_flow_error_set(error, EINVAL,
-					   RTE_FLOW_ERROR_TYPE_ITEM,
-					   item,
-					   "spec/mask is NULL");
-			return -rte_errno;
-		}
-
 		switch (item->type) {
 		case RTE_FLOW_ITEM_TYPE_ETH:
+			if (!item->spec || !item->mask)
+				break;
+
 			eth_spec = item->spec;
 			eth_mask = item->mask;
 
@@ -281,6 +291,10 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 			/* If mask is not involved, we could use EM filters. */
 			ipv4_spec = item->spec;
 			ipv4_mask = item->mask;
+
+			if (!item->spec || !item->mask)
+				break;
+
 			/* Only IP DST and SRC fields are maskable. */
 			if (ipv4_mask->hdr.version_ihl ||
 			    ipv4_mask->hdr.type_of_service ||
@@ -339,6 +353,9 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 			ipv6_spec = item->spec;
 			ipv6_mask = item->mask;
 
+			if (!item->spec || !item->mask)
+				break;
+
 			/* Only IP DST and SRC fields are maskable. */
 			if (ipv6_mask->hdr.vtc_flow ||
 			    ipv6_mask->hdr.payload_len ||
@@ -388,6 +405,9 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 			tcp_spec = item->spec;
 			tcp_mask = item->mask;
 
+			if (!item->spec || !item->mask)
+				break;
+
 			/* Check TCP mask. Only DST & SRC ports are maskable */
 			if (tcp_mask->hdr.sent_seq ||
 			    tcp_mask->hdr.recv_ack ||
@@ -430,6 +450,9 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 			udp_spec = item->spec;
 			udp_mask = item->mask;
 
+			if (!item->spec || !item->mask)
+				break;
+
 			if (udp_mask->hdr.dgram_len ||
 			    udp_mask->hdr.dgram_cksum) {
 				rte_flow_error_set(error,
@@ -479,6 +502,12 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 				return -rte_errno;
 			}
 
+			if (!vxlan_spec && !vxlan_mask) {
+				filter->tunnel_type =
+				CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN;
+				break;
+			}
+
 			if (vxlan_spec->rsvd1 || vxlan_spec->rsvd0[0] ||
 			    vxlan_spec->rsvd0[1] || vxlan_spec->rsvd0[2] ||
 			    vxlan_spec->flags != 0x8) {
@@ -530,6 +559,12 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 				return -rte_errno;
 			}
 
+			if (!nvgre_spec && !nvgre_mask) {
+				filter->tunnel_type =
+				CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_NVGRE;
+				break;
+			}
+
 			if (nvgre_spec->c_k_s_rsvd0_ver != 0x2000 ||
 			    nvgre_spec->protocol != 0x6558) {
 				rte_flow_error_set(error,
@@ -561,10 +596,34 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
 				 CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_NVGRE;
 			}
 			break;
+
+		case RTE_FLOW_ITEM_TYPE_GRE:
+			gre_spec = (const struct rte_flow_item_gre *)item->spec;
+			gre_mask = (const struct rte_flow_item_gre *)item->mask;
+
+			/*
+			 *Check if GRE item is used to describe protocol.
+			 * If yes, both spec and mask should be NULL.
+			 * If no, both spec and mask shouldn't be NULL.
+			 */
+			if (!!gre_spec ^ !!gre_mask) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid GRE item");
+				return -rte_errno;
+			}
+
+			if (!gre_spec && !gre_mask) {
+				filter->tunnel_type =
+				CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE;
+				break;
+			}
+			break;
+
 		case RTE_FLOW_ITEM_TYPE_VF:
 			vf_spec = item->spec;
 			vf = vf_spec->id;
-
 			if (!BNXT_PF(bp)) {
 				rte_flow_error_set(error,
 						   EINVAL,
@@ -724,17 +783,6 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
 	int dflt_vnic;
 	int rc;
 
-	if (bp->eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS) {
-		PMD_DRV_LOG(ERR, "Cannot create flow on RSS queues\n");
-		rte_flow_error_set(error,
-				   EINVAL,
-				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
-				   NULL,
-				   "Cannot create flow on RSS queues");
-		rc = -rte_errno;
-		goto ret;
-	}
-
 	rc =
 	bnxt_validate_and_parse_flow_type(bp, attr, pattern, error, filter);
 	if (rc != 0)
@@ -816,14 +864,25 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
 		act_vf = (const struct rte_flow_action_vf *)act->conf;
 		vf = act_vf->id;
 
-		if (!BNXT_PF(bp)) {
-			rte_flow_error_set(error,
-					   EINVAL,
-					   RTE_FLOW_ERROR_TYPE_ACTION,
-					   act,
-					   "Configuring on a VF!");
-			rc = -rte_errno;
-			goto ret;
+		if (filter->tunnel_type ==
+		    CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN ||
+		    filter->tunnel_type ==
+		    CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE) {
+			/* If issued on a VF, ensure id is 0 and is trusted */
+			if (BNXT_VF(bp)) {
+				if (!BNXT_VF_IS_TRUSTED(bp) || vf) {
+					rte_flow_error_set(error, EINVAL,
+						RTE_FLOW_ERROR_TYPE_ACTION,
+						act,
+						"Incorrect VF");
+					rc = -rte_errno;
+					goto ret;
+				}
+			}
+
+			filter->enables |= filter->tunnel_type;
+			filter->filter_type = HWRM_CFA_TUNNEL_REDIRECT_FILTER;
+			goto done;
 		}
 
 		if (vf >= bp->pdev->max_vfs) {
@@ -878,7 +937,7 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
 		bnxt_free_filter(bp, filter1);
 		filter1->fw_l2_filter_id = -1;
 	}
-
+done:
 	act = bnxt_flow_non_void_action(++act);
 	if (act->type != RTE_FLOW_ACTION_TYPE_END) {
 		rte_flow_error_set(error,
@@ -1006,6 +1065,7 @@ bnxt_flow_create(struct rte_eth_dev *dev,
 	struct rte_flow *flow;
 	unsigned int i;
 	int ret = 0;
+	uint32_t tun_type;
 
 	flow = rte_zmalloc("bnxt_flow", sizeof(struct rte_flow), 0);
 	if (!flow) {
@@ -1046,6 +1106,45 @@ bnxt_flow_create(struct rte_eth_dev *dev,
 		update_flow = true;
 	}
 
+	/* If tunnel redirection to a VF/PF is specified then only tunnel_type
+	 * is set and enable is set to the tunnel type. Issue hwrm cmd directly
+	 * in such a case.
+	 */
+	if (filter->filter_type == HWRM_CFA_TUNNEL_REDIRECT_FILTER &&
+	    filter->enables == filter->tunnel_type) {
+		ret = bnxt_hwrm_tunnel_redirect_query(bp, &tun_type);
+		if (ret) {
+			rte_flow_error_set(error, -ret,
+					   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+					   "Unable to query tunnel to VF");
+			goto free_filter;
+		}
+		if (tun_type == (1U << filter->tunnel_type)) {
+			ret =
+			bnxt_hwrm_tunnel_redirect_free(bp,
+						       filter->tunnel_type);
+			if (ret) {
+				PMD_DRV_LOG(ERR,
+					    "Unable to free existing tunnel\n");
+				rte_flow_error_set(error, -ret,
+						   RTE_FLOW_ERROR_TYPE_HANDLE,
+						   NULL,
+						   "Unable to free preexisting "
+						   "tunnel on VF");
+				goto free_filter;
+			}
+		}
+		ret = bnxt_hwrm_tunnel_redirect(bp, filter->tunnel_type);
+		if (ret) {
+			rte_flow_error_set(error, -ret,
+					   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+					   "Unable to redirect tunnel to VF");
+			goto free_filter;
+		}
+		vnic = &bp->vnic_info[0];
+		goto done;
+	}
+
 	if (filter->filter_type == HWRM_CFA_EM_FILTER) {
 		filter->enables |=
 			HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID;
@@ -1063,7 +1162,7 @@ bnxt_flow_create(struct rte_eth_dev *dev,
 		if (filter->dst_id == vnic->fw_vnic_id)
 			break;
 	}
-
+done:
 	if (!ret) {
 		flow->filter = filter;
 		flow->vnic = vnic;
@@ -1095,6 +1194,47 @@ bnxt_flow_create(struct rte_eth_dev *dev,
 	return flow;
 }
 
+static int bnxt_handle_tunnel_redirect_destroy(struct bnxt *bp,
+					       struct bnxt_filter_info *filter,
+					       struct rte_flow_error *error)
+{
+	uint16_t tun_dst_fid;
+	uint32_t tun_type;
+	int ret = 0;
+
+	ret = bnxt_hwrm_tunnel_redirect_query(bp, &tun_type);
+	if (ret) {
+		rte_flow_error_set(error, -ret,
+				   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+				   "Unable to query tunnel to VF");
+		return ret;
+	}
+	if (tun_type == (1U << filter->tunnel_type)) {
+		ret = bnxt_hwrm_tunnel_redirect_info(bp, filter->tunnel_type,
+						     &tun_dst_fid);
+		if (ret) {
+			rte_flow_error_set(error, -ret,
+					   RTE_FLOW_ERROR_TYPE_HANDLE,
+					   NULL,
+					   "tunnel_redirect info cmd fail");
+			return ret;
+		}
+		PMD_DRV_LOG(INFO, "Pre-existing tunnel fid = %x vf->fid = %x\n",
+			    tun_dst_fid + bp->first_vf_id, bp->fw_fid);
+
+		/* Tunnel doesn't belong to this VF, so don't send HWRM
+		 * cmd, just delete the flow from driver
+		 */
+		if (bp->fw_fid != (tun_dst_fid + bp->first_vf_id))
+			PMD_DRV_LOG(ERR,
+				    "Tunnel does not belong to this VF, skip hwrm_tunnel_redirect_free\n");
+		else
+			ret = bnxt_hwrm_tunnel_redirect_free(bp,
+							filter->tunnel_type);
+	}
+	return ret;
+}
+
 static int
 bnxt_flow_destroy(struct rte_eth_dev *dev,
 		  struct rte_flow *flow,
@@ -1105,6 +1245,17 @@ bnxt_flow_destroy(struct rte_eth_dev *dev,
 	struct bnxt_vnic_info *vnic = flow->vnic;
 	int ret = 0;
 
+	if (filter->filter_type == HWRM_CFA_TUNNEL_REDIRECT_FILTER &&
+	    filter->enables == filter->tunnel_type) {
+		ret = bnxt_handle_tunnel_redirect_destroy(bp,
+							  filter,
+							  error);
+		if (!ret)
+			goto done;
+		else
+			return ret;
+	}
+
 	ret = bnxt_match_filter(bp, filter);
 	if (ret == 0)
 		PMD_DRV_LOG(ERR, "Could not find matching flow\n");
@@ -1114,7 +1265,10 @@ bnxt_flow_destroy(struct rte_eth_dev *dev,
 		ret = bnxt_hwrm_clear_ntuple_filter(bp, filter);
 	else
 		ret = bnxt_hwrm_clear_l2_filter(bp, filter);
+
+done:
 	if (!ret) {
+		bnxt_free_filter(bp, filter);
 		STAILQ_REMOVE(&vnic->flow_list, flow, rte_flow, next);
 		rte_free(flow);
 	} else {
@@ -1140,6 +1294,19 @@ bnxt_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
 		STAILQ_FOREACH(flow, &vnic->flow_list, next) {
 			struct bnxt_filter_info *filter = flow->filter;
 
+			if (filter->filter_type ==
+			    HWRM_CFA_TUNNEL_REDIRECT_FILTER &&
+			    filter->enables == filter->tunnel_type) {
+				ret =
+				bnxt_handle_tunnel_redirect_destroy(bp,
+								    filter,
+								    error);
+				if (!ret)
+					goto done;
+				else
+					return ret;
+			}
+
 			if (filter->filter_type == HWRM_CFA_EM_FILTER)
 				ret = bnxt_hwrm_clear_em_filter(bp, filter);
 			if (filter->filter_type == HWRM_CFA_NTUPLE_FILTER)
@@ -1154,7 +1321,8 @@ bnxt_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
 					 "Failed to flush flow in HW.");
 				return -rte_errno;
 			}
-
+done:
+			bnxt_free_filter(bp, filter);
 			STAILQ_REMOVE(&vnic->flow_list, flow,
 				      rte_flow, next);
 			rte_free(flow);
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a4c879b35..09fee3d39 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -590,6 +590,7 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 	bp->max_tx_rings = rte_le_to_cpu_16(resp->max_tx_rings);
 	bp->max_rx_rings = rte_le_to_cpu_16(resp->max_rx_rings);
 	bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs);
+	bp->first_vf_id = rte_le_to_cpu_16(resp->first_vf_id);
 	/* TODO: For now, do not support VMDq/RFS on VFs. */
 	if (BNXT_PF(bp)) {
 		if (bp->pf.max_vfs)
@@ -4511,3 +4512,85 @@ int bnxt_hwrm_ext_port_qstats(struct bnxt *bp)
 
 	return rc;
 }
+
+int
+bnxt_hwrm_tunnel_redirect(struct bnxt *bp, uint8_t type)
+{
+	struct hwrm_cfa_redirect_tunnel_type_alloc_input req = {0};
+	struct hwrm_cfa_redirect_tunnel_type_alloc_output *resp =
+		bp->hwrm_cmd_resp_addr;
+	int rc = 0;
+
+	HWRM_PREP(req, CFA_REDIRECT_TUNNEL_TYPE_ALLOC, BNXT_USE_KONG(bp));
+	req.tunnel_type = type;
+	req.dest_fid = bp->fw_fid;
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_KONG(bp));
+	HWRM_CHECK_RESULT();
+
+	HWRM_UNLOCK();
+
+	return rc;
+}
+
+int
+bnxt_hwrm_tunnel_redirect_free(struct bnxt *bp, uint8_t type)
+{
+	struct hwrm_cfa_redirect_tunnel_type_free_input req = {0};
+	struct hwrm_cfa_redirect_tunnel_type_free_output *resp =
+		bp->hwrm_cmd_resp_addr;
+	int rc = 0;
+
+	HWRM_PREP(req, CFA_REDIRECT_TUNNEL_TYPE_FREE, BNXT_USE_KONG(bp));
+	req.tunnel_type = type;
+	req.dest_fid = bp->fw_fid;
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_KONG(bp));
+	HWRM_CHECK_RESULT();
+
+	HWRM_UNLOCK();
+
+	return rc;
+}
+
+int bnxt_hwrm_tunnel_redirect_query(struct bnxt *bp, uint32_t *type)
+{
+	struct hwrm_cfa_redirect_query_tunnel_type_input req = {0};
+	struct hwrm_cfa_redirect_query_tunnel_type_output *resp =
+		bp->hwrm_cmd_resp_addr;
+	int rc = 0;
+
+	HWRM_PREP(req, CFA_REDIRECT_QUERY_TUNNEL_TYPE, BNXT_USE_KONG(bp));
+	req.src_fid = bp->fw_fid;
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_KONG(bp));
+	HWRM_CHECK_RESULT();
+
+	if (type)
+		*type = resp->tunnel_mask;
+
+	HWRM_UNLOCK();
+
+	return rc;
+}
+
+int bnxt_hwrm_tunnel_redirect_info(struct bnxt *bp, uint8_t tun_type,
+				   uint16_t *dst_fid)
+{
+	struct hwrm_cfa_redirect_tunnel_type_info_input req = {0};
+	struct hwrm_cfa_redirect_tunnel_type_info_output *resp =
+		bp->hwrm_cmd_resp_addr;
+	int rc = 0;
+
+	HWRM_PREP(req, CFA_REDIRECT_TUNNEL_TYPE_INFO, BNXT_USE_KONG(bp));
+	req.src_fid = bp->fw_fid;
+	req.tunnel_type = tun_type;
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_KONG(bp));
+	HWRM_CHECK_RESULT();
+
+	if (dst_fid)
+		*dst_fid = resp->dest_fid;
+
+	PMD_DRV_LOG(DEBUG, "dst_fid: %x\n", resp->dest_fid);
+
+	HWRM_UNLOCK();
+
+	return rc;
+}
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index f286bcd8b..cd8bb79f9 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -191,4 +191,9 @@ int bnxt_hwrm_ext_port_qstats(struct bnxt *bp);
 int bnxt_hwrm_func_backing_store_qcaps(struct bnxt *bp);
 int bnxt_hwrm_func_backing_store_cfg(struct bnxt *bp, uint32_t enables);
 int bnxt_alloc_ctx_mem(struct bnxt *bp);
+int bnxt_hwrm_tunnel_redirect(struct bnxt *bp, uint8_t type);
+int bnxt_hwrm_tunnel_redirect_free(struct bnxt *bp, uint8_t type);
+int bnxt_hwrm_tunnel_redirect_query(struct bnxt *bp, uint32_t *type);
+int bnxt_hwrm_tunnel_redirect_info(struct bnxt *bp, uint8_t tun_type,
+				   uint16_t *dst_fid);
 #endif
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [PATCH 2/6] net/bnxt: fix to check for NULL completion ring doorbell in int_handler
  2019-06-08 19:22 [dpdk-dev] [PATCH 0/6] bnxt patch series Ajit Khaparde
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 1/6] net/bnxt: add code to redirect tunnel packets Ajit Khaparde
@ 2019-06-08 19:22 ` Ajit Khaparde
  2019-06-12 14:44   ` Ferruh Yigit
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 3/6] net/bnxt: driver to use configured MTU value during load Ajit Khaparde
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Ajit Khaparde @ 2019-06-08 19:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Somnath Kotur, Kalesh AP

From: Somnath Kotur <somnath.kotur@broadcom.com>

It is observed that sometimes during init, the bnxt_int_handler() gets
invoked while the cpr->cp_db.doorbell is not yet initialized. Check for
the same and return.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 918f3dcf4..e1b9a2b04 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -31,7 +31,7 @@ static void bnxt_int_handler(void *param)
 
 	raw_cons = cpr->cp_raw_cons;
 	while (1) {
-		if (!cpr || !cpr->cp_ring_struct)
+		if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.cp_doorbell)
 			return;
 
 		cons = RING_CMP(cpr->cp_ring_struct, raw_cons);
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [PATCH 3/6] net/bnxt: driver to use configured MTU value during load
  2019-06-08 19:22 [dpdk-dev] [PATCH 0/6] bnxt patch series Ajit Khaparde
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 1/6] net/bnxt: add code to redirect tunnel packets Ajit Khaparde
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 2/6] net/bnxt: fix to check for NULL completion ring doorbell in int_handler Ajit Khaparde
@ 2019-06-08 19:22 ` Ajit Khaparde
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 4/6] net/bnxt: fix output of port xstats Ajit Khaparde
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Ajit Khaparde @ 2019-06-08 19:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Somnath Kotur, Kalesh AP, Lance Richardson

From: Somnath Kotur <somnath.kotur@broadcom.com>

The MTU value of a port can be (re)configured out-of-band.
FW will be returning this configured MTU as part of func_qcfg cmd.
Driver to use this value during load time.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_cpr.c    | 2 +-
 drivers/net/bnxt/bnxt_ethdev.c | 7 ++++++-
 drivers/net/bnxt/bnxt_hwrm.c   | 5 ++++-
 drivers/net/bnxt/bnxt_hwrm.h   | 2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 0fd6e51e5..655bcf1a8 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -35,7 +35,7 @@ void bnxt_handle_async_event(struct bnxt *bp,
 		break;
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE:
 		PMD_DRV_LOG(INFO, "Async event: VF config changed\n");
-		bnxt_hwrm_func_qcfg(bp);
+		bnxt_hwrm_func_qcfg(bp, NULL);
 		break;
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED:
 		PMD_DRV_LOG(INFO, "Port conn async event\n");
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index ee775b125..e527df1bf 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3654,6 +3654,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 	uint32_t total_alloc_len;
 	rte_iova_t mz_phys_addr;
 	struct bnxt *bp;
+	uint16_t mtu;
 	int rc;
 
 	if (version_printed++ == 0)
@@ -3906,12 +3907,16 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 		pci_dev->mem_resource[0].phys_addr,
 		pci_dev->mem_resource[0].addr);
 
-	rc = bnxt_hwrm_func_qcfg(bp);
+	rc = bnxt_hwrm_func_qcfg(bp, &mtu);
 	if (rc) {
 		PMD_DRV_LOG(ERR, "hwrm func qcfg failed\n");
 		goto error_free;
 	}
 
+	if (mtu >= ETHER_MIN_MTU && mtu <= BNXT_MAX_MTU &&
+	    mtu != eth_dev->data->mtu)
+		eth_dev->data->mtu = mtu;
+
 	if (BNXT_PF(bp)) {
 		//if (bp->pf.active_vfs) {
 			// TODO: Deallocate VF resources?
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 09fee3d39..696974c83 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2638,7 +2638,7 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 }
 
 /* JIRA 22088 */
-int bnxt_hwrm_func_qcfg(struct bnxt *bp)
+int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)
 {
 	struct hwrm_func_qcfg_input req = {0};
 	struct hwrm_func_qcfg_output *resp = bp->hwrm_cmd_resp_addr;
@@ -2663,6 +2663,9 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp)
 		PMD_DRV_LOG(INFO, "Trusted VF cap enabled\n");
 	}
 
+	if (mtu)
+		*mtu = resp->mtu;
+
 	switch (resp->port_partition_type) {
 	case HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0:
 	case HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5:
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index cd8bb79f9..e35462cb4 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -127,7 +127,7 @@ void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index);
 int bnxt_alloc_hwrm_resources(struct bnxt *bp);
 int bnxt_get_hwrm_link_config(struct bnxt *bp, struct rte_eth_link *link);
 int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up);
-int bnxt_hwrm_func_qcfg(struct bnxt *bp);
+int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu);
 int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp);
 int bnxt_hwrm_func_reserve_vf_resc(struct bnxt *bp, bool test);
 int bnxt_hwrm_allocate_pf_only(struct bnxt *bp);
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [PATCH 4/6] net/bnxt: fix output of port xstats
  2019-06-08 19:22 [dpdk-dev] [PATCH 0/6] bnxt patch series Ajit Khaparde
                   ` (2 preceding siblings ...)
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 3/6] net/bnxt: driver to use configured MTU value during load Ajit Khaparde
@ 2019-06-08 19:22 ` Ajit Khaparde
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 5/6] net/bnxt: fix interrupt vector array initialization Ajit Khaparde
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Ajit Khaparde @ 2019-06-08 19:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP, Lance Richardson

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

If the HWRM_PORT_QSTATS_EXT fails to initialize
fw_rx_port_stats_ext_size or fw_tx_port_stats_ext_size,
the driver can end up passing junk statistics to the application.

Instead of relying on the application to initialize the xstats
buffer before calling the xstats_get dev_op, memset xstats
with zeros to avoid returning or displaying incorrect statistics.

Also fixed the buffer starting offset.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 6 ++++--
 drivers/net/bnxt/bnxt_stats.c  | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e527df1bf..4133d0bef 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3775,7 +3775,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 			goto skip_ext_stats;
 
 		bp->hw_rx_port_stats_ext = (void *)
-			(bp->hw_rx_port_stats + sizeof(struct rx_port_stats));
+			((uint8_t *)bp->hw_rx_port_stats +
+			 sizeof(struct rx_port_stats));
 		bp->hw_rx_port_stats_ext_map = bp->hw_rx_port_stats_map +
 			sizeof(struct rx_port_stats);
 		bp->flags |= BNXT_FLAG_EXT_RX_PORT_STATS;
@@ -3783,7 +3784,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 
 		if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_9_2) {
 			bp->hw_tx_port_stats_ext = (void *)
-			(bp->hw_tx_port_stats + sizeof(struct tx_port_stats));
+				((uint8_t *)bp->hw_tx_port_stats +
+				 sizeof(struct tx_port_stats));
 			bp->hw_tx_port_stats_ext_map =
 				bp->hw_tx_port_stats_map +
 				sizeof(struct tx_port_stats);
diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index ad2888774..3cd5144ec 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -415,6 +415,8 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
 	unsigned int stat_size = sizeof(uint64_t);
 	unsigned int stat_count;
 
+	memset(xstats, 0, sizeof(*xstats));
+
 	bnxt_hwrm_port_qstats(bp);
 	bnxt_hwrm_func_qstats_tx_drop(bp, 0xffff, &tx_drop_pkts);
 	bnxt_hwrm_ext_port_qstats(bp);
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [PATCH 5/6] net/bnxt: fix interrupt vector array initialization
  2019-06-08 19:22 [dpdk-dev] [PATCH 0/6] bnxt patch series Ajit Khaparde
                   ` (3 preceding siblings ...)
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 4/6] net/bnxt: fix output of port xstats Ajit Khaparde
@ 2019-06-08 19:22 ` Ajit Khaparde
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 6/6] net/bnxt: address build errors reported by intel compiler Ajit Khaparde
  2019-06-12 15:41 ` [dpdk-dev] [PATCH 0/6] bnxt patch series Ferruh Yigit
  6 siblings, 0 replies; 10+ messages in thread
From: Ajit Khaparde @ 2019-06-08 19:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Naresh Kumar PBS, Lance Richardson

From: Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>

Initialize the vector array when it is valid, thereby
preventing a case were it may be accessed when
the array is unallocated

Fixes: 1fe427fd08ee ("net/bnxt: support enable/disable interrupt")

Signed-off-by: Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 4133d0bef..4dd845992 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -412,13 +412,12 @@ static int bnxt_init_chip(struct bnxt *bp)
 			"intr_handle->nb_efd = %d intr_handle->max_intr = %d\n",
 			 intr_handle->intr_vec, intr_handle->nb_efd,
 			intr_handle->max_intr);
-	}
-
-	for (queue_id = 0; queue_id < bp->eth_dev->data->nb_rx_queues;
-	     queue_id++) {
-		intr_handle->intr_vec[queue_id] = vec;
-		if (vec < base + intr_handle->nb_efd - 1)
-			vec++;
+		for (queue_id = 0; queue_id < bp->eth_dev->data->nb_rx_queues;
+		     queue_id++) {
+			intr_handle->intr_vec[queue_id] = vec;
+			if (vec < base + intr_handle->nb_efd - 1)
+				vec++;
+		}
 	}
 
 	/* enable uio/vfio intr/eventfd mapping */
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [PATCH 6/6] net/bnxt: address build errors reported by intel compiler
  2019-06-08 19:22 [dpdk-dev] [PATCH 0/6] bnxt patch series Ajit Khaparde
                   ` (4 preceding siblings ...)
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 5/6] net/bnxt: fix interrupt vector array initialization Ajit Khaparde
@ 2019-06-08 19:22 ` Ajit Khaparde
  2019-06-12 15:41 ` [dpdk-dev] [PATCH 0/6] bnxt patch series Ferruh Yigit
  6 siblings, 0 replies; 10+ messages in thread
From: Ajit Khaparde @ 2019-06-08 19:22 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Naresh Kumar PBS, Lance Richardson

From: Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>

Address build errors reported by intel compiler while compiling
on Windows. Instead of typeof() using the actual type in ALLOW_FUNC

Signed-off-by: Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 4dd845992..c76f7d5db 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3639,7 +3639,7 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp)
 
 #define ALLOW_FUNC(x)	\
 	{ \
-		typeof(x) arg = (x); \
+		uint32_t arg = (x); \
 		bp->pf.vf_req_fwd[((arg) >> 5)] &= \
 		~rte_cpu_to_le_32(1 << ((arg) & 0x1f)); \
 	}
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH 2/6] net/bnxt: fix to check for NULL completion ring doorbell in int_handler
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 2/6] net/bnxt: fix to check for NULL completion ring doorbell in int_handler Ajit Khaparde
@ 2019-06-12 14:44   ` Ferruh Yigit
  2019-06-12 14:49     ` Ferruh Yigit
  0 siblings, 1 reply; 10+ messages in thread
From: Ferruh Yigit @ 2019-06-12 14:44 UTC (permalink / raw)
  To: Ajit Khaparde, dev; +Cc: Somnath Kotur, Kalesh AP

On 6/8/2019 8:22 PM, Ajit Khaparde wrote:
> From: Somnath Kotur <somnath.kotur@broadcom.com>
> 
> It is observed that sometimes during init, the bnxt_int_handler() gets
> invoked while the cpr->cp_db.doorbell is not yet initialized. Check for
> the same and return.
> 
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_irq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
> index 918f3dcf4..e1b9a2b04 100644
> --- a/drivers/net/bnxt/bnxt_irq.c
> +++ b/drivers/net/bnxt/bnxt_irq.c
> @@ -31,7 +31,7 @@ static void bnxt_int_handler(void *param)
>  
>  	raw_cons = cpr->cp_raw_cons;
>  	while (1) {
> -		if (!cpr || !cpr->cp_ring_struct)
> +		if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.cp_doorbell)

This conflicts with patch from Lance Richardson, which is already merged to
next-net, and renames 'cp_doorbell' to 'doorbell'

Can you please send new version of the patchset rebasing latest next-net?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH 2/6] net/bnxt: fix to check for NULL completion ring doorbell in int_handler
  2019-06-12 14:44   ` Ferruh Yigit
@ 2019-06-12 14:49     ` Ferruh Yigit
  0 siblings, 0 replies; 10+ messages in thread
From: Ferruh Yigit @ 2019-06-12 14:49 UTC (permalink / raw)
  To: Ajit Khaparde, dev; +Cc: Somnath Kotur, Kalesh AP

On 6/12/2019 3:44 PM, Ferruh Yigit wrote:
> On 6/8/2019 8:22 PM, Ajit Khaparde wrote:
>> From: Somnath Kotur <somnath.kotur@broadcom.com>
>>
>> It is observed that sometimes during init, the bnxt_int_handler() gets
>> invoked while the cpr->cp_db.doorbell is not yet initialized. Check for
>> the same and return.
>>
>> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
>> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>> ---
>>  drivers/net/bnxt/bnxt_irq.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
>> index 918f3dcf4..e1b9a2b04 100644
>> --- a/drivers/net/bnxt/bnxt_irq.c
>> +++ b/drivers/net/bnxt/bnxt_irq.c
>> @@ -31,7 +31,7 @@ static void bnxt_int_handler(void *param)
>>  
>>  	raw_cons = cpr->cp_raw_cons;
>>  	while (1) {
>> -		if (!cpr || !cpr->cp_ring_struct)
>> +		if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.cp_doorbell)
> 
> This conflicts with patch from Lance Richardson, which is already merged to
> next-net, and renames 'cp_doorbell' to 'doorbell'
> 
> Can you please send new version of the patchset rebasing latest next-net?
> 

This looks simple enough to resolve,
another issue is s/ETHER_MIN_MTU/RTE_ETHER_MIN_MTU, also straightforward
Let me resolve myself instead of sending new version

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH 0/6] bnxt patch series
  2019-06-08 19:22 [dpdk-dev] [PATCH 0/6] bnxt patch series Ajit Khaparde
                   ` (5 preceding siblings ...)
  2019-06-08 19:22 ` [dpdk-dev] [PATCH 6/6] net/bnxt: address build errors reported by intel compiler Ajit Khaparde
@ 2019-06-12 15:41 ` Ferruh Yigit
  6 siblings, 0 replies; 10+ messages in thread
From: Ferruh Yigit @ 2019-06-12 15:41 UTC (permalink / raw)
  To: Ajit Khaparde, dev

On 6/8/2019 8:22 PM, Ajit Khaparde wrote:
> This is a patchset against dpdk-next-net tree on top of
> commit d800226ab9ede99ab9bc56a691555568e6e587f1.
> Please apply.
> 
> 
> Kalesh AP (1):
>   net/bnxt: fix output of port xstats
> 
> Naresh Kumar PBS (2):
>   net/bnxt: fix interrupt vector array initialization
>   net/bnxt: address build errors reported by intel compiler
> 
> Somnath Kotur (3):
>   net/bnxt: add code to redirect tunnel packets
>   net/bnxt: fix to check for NULL completion ring doorbell in
>     int_handler
>   net/bnxt: driver to use configured MTU value during load

Series applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-08 19:22 [dpdk-dev] [PATCH 0/6] bnxt patch series Ajit Khaparde
2019-06-08 19:22 ` [dpdk-dev] [PATCH 1/6] net/bnxt: add code to redirect tunnel packets Ajit Khaparde
2019-06-08 19:22 ` [dpdk-dev] [PATCH 2/6] net/bnxt: fix to check for NULL completion ring doorbell in int_handler Ajit Khaparde
2019-06-12 14:44   ` Ferruh Yigit
2019-06-12 14:49     ` Ferruh Yigit
2019-06-08 19:22 ` [dpdk-dev] [PATCH 3/6] net/bnxt: driver to use configured MTU value during load Ajit Khaparde
2019-06-08 19:22 ` [dpdk-dev] [PATCH 4/6] net/bnxt: fix output of port xstats Ajit Khaparde
2019-06-08 19:22 ` [dpdk-dev] [PATCH 5/6] net/bnxt: fix interrupt vector array initialization Ajit Khaparde
2019-06-08 19:22 ` [dpdk-dev] [PATCH 6/6] net/bnxt: address build errors reported by intel compiler Ajit Khaparde
2019-06-12 15:41 ` [dpdk-dev] [PATCH 0/6] bnxt patch series Ferruh Yigit

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org dpdk-dev@archiver.kernel.org
	public-inbox-index dpdk-dev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox