Commit a6c1fd04 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'bnxt_en-fix-2-compile-warnings-in-bnxt_dcb-c'

Michael Chan says:

====================
bnxt_en: Fix 2 compile warnings in bnxt_dcb.c

Fix 2 similar warnings in bnxt_dcb.c related to the cos2bw interface
definitions in bnxt_hsi.h.
====================

Link: https://lore.kernel.org/r/20230807145720.159645-1-michael.chan@broadcom.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 48d17c51 3d5ecada
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -98,7 +98,6 @@ static int bnxt_hwrm_queue_cos2bw_cfg(struct bnxt *bp, struct ieee_ets *ets,
{
	struct hwrm_queue_cos2bw_cfg_input *req;
	struct bnxt_cos2bw_cfg cos2bw;
	void *data;
	int rc, i;

	rc = hwrm_req_init(bp, req, HWRM_QUEUE_COS2BW_CFG);
@@ -129,11 +128,15 @@ static int bnxt_hwrm_queue_cos2bw_cfg(struct bnxt *bp, struct ieee_ets *ets,
				cpu_to_le32((ets->tc_tx_bw[i] * 100) |
					    BW_VALUE_UNIT_PERCENT1_100);
		}
		data = &req->unused_0 + qidx * (sizeof(cos2bw) - 4);
		memcpy(data, &cos2bw.cfg, sizeof(cos2bw) - 4);
		if (qidx == 0) {
			req->queue_id0 = cos2bw.queue_id;
			req->unused_0 = 0;
			req->queue_id0_min_bw = cos2bw.min_bw;
			req->queue_id0_max_bw = cos2bw.max_bw;
			req->queue_id0_tsa_assign = cos2bw.tsa;
			req->queue_id0_pri_lvl = cos2bw.pri_lvl;
			req->queue_id0_bw_weight = cos2bw.bw_weight;
		} else {
			memcpy(&req->cfg[i - 1], &cos2bw.cfg, sizeof(cos2bw.cfg));
		}
	}
	return hwrm_req_send(bp, req);
@@ -144,7 +147,6 @@ static int bnxt_hwrm_queue_cos2bw_qcfg(struct bnxt *bp, struct ieee_ets *ets)
	struct hwrm_queue_cos2bw_qcfg_output *resp;
	struct hwrm_queue_cos2bw_qcfg_input *req;
	struct bnxt_cos2bw_cfg cos2bw;
	void *data;
	int rc, i;

	rc = hwrm_req_init(bp, req, HWRM_QUEUE_COS2BW_QCFG);
@@ -158,13 +160,19 @@ static int bnxt_hwrm_queue_cos2bw_qcfg(struct bnxt *bp, struct ieee_ets *ets)
		return rc;
	}

	data = &resp->queue_id0 + offsetof(struct bnxt_cos2bw_cfg, queue_id);
	for (i = 0; i < bp->max_tc; i++, data += sizeof(cos2bw.cfg)) {
	for (i = 0; i < bp->max_tc; i++) {
		int tc;

		memcpy(&cos2bw.cfg, data, sizeof(cos2bw.cfg));
		if (i == 0)
		if (i == 0) {
			cos2bw.queue_id = resp->queue_id0;
			cos2bw.min_bw = resp->queue_id0_min_bw;
			cos2bw.max_bw = resp->queue_id0_max_bw;
			cos2bw.tsa = resp->queue_id0_tsa_assign;
			cos2bw.pri_lvl = resp->queue_id0_pri_lvl;
			cos2bw.bw_weight = resp->queue_id0_bw_weight;
		} else {
			memcpy(&cos2bw.cfg, &resp->cfg[i - 1], sizeof(cos2bw.cfg));
		}

		tc = bnxt_queue_to_tc(bp, cos2bw.queue_id);
		if (tc < 0)
+84 −560

File changed.

Preview size limit exceeded, changes collapsed.