diff options
author | Michael Chan <michael.chan@broadcom.com> | 2018-08-05 16:51:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-05 20:08:26 -0400 |
commit | aabfc016e9a6db2a8c2da815fc84bfd5a2e8d221 (patch) | |
tree | d77a39d7b0563edf6a7e24a4f3ca9242ca3070ae | |
parent | afdc8a84844a2163e25ad735f9f69d220ae02529 (diff) |
bnxt_en: Do not use the CNP CoS queue for networking traffic.
The CNP CoS queue is reserved for internal RDMA Congestion Notification
Packets (CNP) and should not be used for a TC. Modify the CoS queue
discovery code to skip over the CNP CoS queue and to reduce
bp->max_tc accordingly. However, if RDMA is disabled in NVRAM, the
the CNP CoS queue can be used for a TC.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt.c | 22 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.h | 4 |
2 files changed, 18 insertions, 8 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index dde904bccab9..d7f51ab85b45 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c | |||
@@ -5281,7 +5281,8 @@ static int bnxt_hwrm_queue_qportcfg(struct bnxt *bp) | |||
5281 | int rc = 0; | 5281 | int rc = 0; |
5282 | struct hwrm_queue_qportcfg_input req = {0}; | 5282 | struct hwrm_queue_qportcfg_input req = {0}; |
5283 | struct hwrm_queue_qportcfg_output *resp = bp->hwrm_cmd_resp_addr; | 5283 | struct hwrm_queue_qportcfg_output *resp = bp->hwrm_cmd_resp_addr; |
5284 | u8 i, *qptr; | 5284 | u8 i, j, *qptr; |
5285 | bool no_rdma; | ||
5285 | 5286 | ||
5286 | bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_QUEUE_QPORTCFG, -1, -1); | 5287 | bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_QUEUE_QPORTCFG, -1, -1); |
5287 | 5288 | ||
@@ -5299,19 +5300,24 @@ static int bnxt_hwrm_queue_qportcfg(struct bnxt *bp) | |||
5299 | if (bp->max_tc > BNXT_MAX_QUEUE) | 5300 | if (bp->max_tc > BNXT_MAX_QUEUE) |
5300 | bp->max_tc = BNXT_MAX_QUEUE; | 5301 | bp->max_tc = BNXT_MAX_QUEUE; |
5301 | 5302 | ||
5303 | no_rdma = !(bp->flags & BNXT_FLAG_ROCE_CAP); | ||
5304 | qptr = &resp->queue_id0; | ||
5305 | for (i = 0, j = 0; i < bp->max_tc; i++) { | ||
5306 | bp->q_info[j].queue_id = *qptr++; | ||
5307 | bp->q_info[j].queue_profile = *qptr++; | ||
5308 | bp->tc_to_qidx[j] = j; | ||
5309 | if (!BNXT_CNPQ(bp->q_info[j].queue_profile) || | ||
5310 | (no_rdma && BNXT_PF(bp))) | ||
5311 | j++; | ||
5312 | } | ||
5313 | bp->max_tc = max_t(u8, j, 1); | ||
5314 | |||
5302 | if (resp->queue_cfg_info & QUEUE_QPORTCFG_RESP_QUEUE_CFG_INFO_ASYM_CFG) | 5315 | if (resp->queue_cfg_info & QUEUE_QPORTCFG_RESP_QUEUE_CFG_INFO_ASYM_CFG) |
5303 | bp->max_tc = 1; | 5316 | bp->max_tc = 1; |
5304 | 5317 | ||
5305 | if (bp->max_lltc > bp->max_tc) | 5318 | if (bp->max_lltc > bp->max_tc) |
5306 | bp->max_lltc = bp->max_tc; | 5319 | bp->max_lltc = bp->max_tc; |
5307 | 5320 | ||
5308 | qptr = &resp->queue_id0; | ||
5309 | for (i = 0; i < bp->max_tc; i++) { | ||
5310 | bp->q_info[i].queue_id = *qptr++; | ||
5311 | bp->q_info[i].queue_profile = *qptr++; | ||
5312 | bp->tc_to_qidx[i] = i; | ||
5313 | } | ||
5314 | |||
5315 | qportcfg_exit: | 5321 | qportcfg_exit: |
5316 | mutex_unlock(&bp->hwrm_cmd_lock); | 5322 | mutex_unlock(&bp->hwrm_cmd_lock); |
5317 | return rc; | 5323 | return rc; |
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.h index c0e16c03195a..6eed231de565 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.h | |||
@@ -43,6 +43,10 @@ struct bnxt_dscp2pri_entry { | |||
43 | ((q_profile) == \ | 43 | ((q_profile) == \ |
44 | QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE) | 44 | QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE) |
45 | 45 | ||
46 | #define BNXT_CNPQ(q_profile) \ | ||
47 | ((q_profile) == \ | ||
48 | QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP) | ||
49 | |||
46 | #define HWRM_STRUCT_DATA_SUBTYPE_HOST_OPERATIONAL 0x0300 | 50 | #define HWRM_STRUCT_DATA_SUBTYPE_HOST_OPERATIONAL 0x0300 |
47 | 51 | ||
48 | void bnxt_dcb_init(struct bnxt *bp); | 52 | void bnxt_dcb_init(struct bnxt *bp); |