DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com,
	Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,
	stable@dpdk.org, Somnath Kotur <somnath.kotur@broadcom.com>
Subject: [dpdk-dev] [PATCH 3/7] net/bnxt: cleanup comments in source
Date: Sun, 13 Oct 2019 17:01:16 -0700	[thread overview]
Message-ID: <20191014000120.3020-4-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20191014000120.3020-1-ajit.khaparde@broadcom.com>

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

- updated one comment for more readability and understanding
- fixed typo in comments
- moved a comment to right place
- removed one out-of-date comment
- removed few commented code

Fixes: f2a768d4d186 ("net/bnxt: add completion ring")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_cpr.c    |  2 --
 drivers/net/bnxt/bnxt_filter.c |  1 -
 drivers/net/bnxt/bnxt_flow.c   |  7 -------
 drivers/net/bnxt/bnxt_hwrm.c   | 28 +++++++++-------------------
 4 files changed, 9 insertions(+), 29 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 118cf034d2..e6f30fecbf 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -58,8 +58,6 @@ void bnxt_handle_async_event(struct bnxt *bp,
 	struct bnxt_error_recovery_info *info;
 	uint32_t event_data;
 
-	/* TODO: HWRM async events are not defined yet */
-	/* Needs to handle: link events, error events, etc. */
 	switch (event_id) {
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE:
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE:
diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index e95d47d296..8120b39165 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -82,7 +82,6 @@ void bnxt_free_all_filters(struct bnxt *bp)
 	struct bnxt_filter_info *filter, *temp_filter;
 	unsigned int i;
 
-//	for (i = 0; i < MAX_FF_POOLS; i++) {
 	for (i = 0; i < bp->nr_vnics; i++) {
 		vnic = &bp->vnic_info[i];
 		filter = STAILQ_FIRST(&vnic->filter);
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 5aeb001408..85d23540fe 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1087,10 +1087,6 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
 		    vnic->fw_vnic_id != INVALID_HW_RING_ID)
 			goto use_vnic;
 
-		//if (!rxq ||
-		    //bp->vnic_info[0].fw_grp_ids[act_q->index] !=
-		    //INVALID_HW_RING_ID ||
-		    //!rxq->rx_deferred_start) {
 		if (!rxq ||
 		    bp->vnic_info[0].fw_grp_ids[act_q->index] !=
 		    INVALID_HW_RING_ID) {
@@ -1320,9 +1316,6 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
 			}
 			rxq = bp->rx_queues[rss->queue[i]];
 
-			//if (bp->vnic_info[0].fw_grp_ids[rss->queue[i]] !=
-			    //INVALID_HW_RING_ID ||
-			    //!rxq->rx_deferred_start) {
 			if (bp->vnic_info[0].fw_grp_ids[rss->queue[i]] !=
 			    INVALID_HW_RING_ID) {
 				PMD_DRV_LOG(ERR,
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 5b430b9415..1a1ea1bdef 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -74,9 +74,9 @@ static void bnxt_hwrm_set_pg_attr(struct bnxt_ring_mem_info *rmem,
 
 /*
  * HWRM Functions (sent to HWRM)
- * These are named bnxt_hwrm_*() and return -1 if bnxt_hwrm_send_message()
- * fails (ie: a timeout), and a positive non-zero HWRM error code if the HWRM
- * command was failed by the ChiMP.
+ * These are named bnxt_hwrm_*() and return 0 on success or -110 if the
+ * HWRM command times out, or a negative error code if the HWRM
+ * command was failed by the FW.
  */
 
 static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
@@ -176,11 +176,11 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
 }
 
 /*
- * HWRM_PREP() should be used to prepare *ALL* HWRM commands.  It grabs the
+ * HWRM_PREP() should be used to prepare *ALL* HWRM commands. It grabs the
  * spinlock, and does initial processing.
  *
  * HWRM_CHECK_RESULT() returns errors on failure and may not be used.  It
- * releases the spinlock only if it returns.  If the regular int return codes
+ * releases the spinlock only if it returns. If the regular int return codes
  * are not used by the function, HWRM_CHECK_RESULT() should not be used
  * directly, rather it should be copied and modified to suit the function.
  *
@@ -518,7 +518,6 @@ static int bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
 	struct hwrm_port_mac_ptp_qcfg_output *resp = bp->hwrm_cmd_resp_addr;
 	struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
 
-/*	if (bp->hwrm_spec_code < 0x10801 || ptp)  TBD  */
 	if (ptp)
 		return 0;
 
@@ -2161,10 +2160,6 @@ int bnxt_hwrm_func_clr_stats(struct bnxt *bp, uint16_t fid)
 	return rc;
 }
 
-/*
- * HWRM utility functions
- */
-
 int bnxt_clear_all_hwrm_stat_ctxs(struct bnxt *bp)
 {
 	unsigned int i;
@@ -2383,6 +2378,10 @@ int bnxt_alloc_all_hwrm_ring_grps(struct bnxt *bp)
 	return rc;
 }
 
+/*
+ * HWRM utility functions
+ */
+
 void bnxt_free_hwrm_resources(struct bnxt *bp)
 {
 	/* Release memzone */
@@ -2432,8 +2431,6 @@ int bnxt_clear_hwrm_vnic_filters(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 			rc = bnxt_hwrm_clear_l2_filter(bp, filter);
 		STAILQ_REMOVE(&vnic->filter, filter, bnxt_filter_info, next);
 		bnxt_free_filter(bp, filter);
-		//if (rc)
-			//break;
 	}
 	return rc;
 }
@@ -2458,8 +2455,6 @@ bnxt_clear_hwrm_vnic_flows(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 
 		STAILQ_REMOVE(&vnic->flow_list, flow, rte_flow, next);
 		rte_free(flow);
-		//if (rc)
-			//break;
 	}
 	return rc;
 }
@@ -2514,7 +2509,6 @@ void bnxt_free_all_hwrm_resources(struct bnxt *bp)
 	for (i = bp->max_vnics - 1; i >= 0; i--) {
 		struct bnxt_vnic_info *vnic = &bp->vnic_info[i];
 
-		// If the VNIC ID is invalid we are not currently using the VNIC
 		if (vnic->fw_vnic_id == INVALID_HW_RING_ID)
 			continue;
 
@@ -4226,10 +4220,6 @@ int bnxt_hwrm_set_ntuple_filter(struct bnxt *bp,
 	    HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR)
 		memcpy(req.src_macaddr, filter->src_macaddr,
 		       RTE_ETHER_ADDR_LEN);
-	//if (enables &
-	    //HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR)
-		//memcpy(req.dst_macaddr, filter->dst_macaddr,
-		       //RTE_ETHER_ADDR_LEN);
 	if (enables &
 	    HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE)
 		req.ethertype = rte_cpu_to_be_16(filter->ethertype);
-- 
2.20.1 (Apple Git-117)


  parent reply	other threads:[~2019-10-14  0:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14  0:01 [dpdk-dev] [PATCH 0/7] patchset for bnxt Ajit Khaparde
2019-10-14  0:01 ` [dpdk-dev] [PATCH 1/7] net/bnxt: fix dereference before null check Ajit Khaparde
2019-10-14  0:01 ` [dpdk-dev] [PATCH 2/7] net/bnxt: reset Rx allocation state on Rx queue restart Ajit Khaparde
2019-10-14  0:01 ` Ajit Khaparde [this message]
2019-10-14  0:01 ` [dpdk-dev] [PATCH 4/7] net/bnxt: move macro definitions to header file Ajit Khaparde
2019-10-14  0:01 ` [dpdk-dev] [PATCH 5/7] net/bnxt: fix race between interrupt handler and dev config Ajit Khaparde
2019-10-14  0:01 ` [dpdk-dev] [PATCH 6/7] net/bnxt: fix endianness while retrieving MTU from FW Ajit Khaparde
2019-10-14  0:01 ` [dpdk-dev] [PATCH 7/7] net/bnxt: fix error handling Ajit Khaparde
2019-10-14  3:58 ` [dpdk-dev] [PATCH 0/7] patchset for bnxt Ajit Khaparde

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=20191014000120.3020-4-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=stable@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).