Skip to content

Commit 49632b5

Browse files
sudarsana.kalluru@cavium.comdavem330
authored andcommitted
qed: Add support for static dcbx.
The patch adds driver support for static/local dcbx mode. In this mode adapter brings up the dcbx link with locally configured parameters instead of performing the dcbx negotiation with the peer. The feature is useful when peer device/switch doesn't support dcbx. Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 05a79f9 commit 49632b5

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

drivers/net/ethernet/qlogic/qed/qed_dcbx.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,14 @@ qed_dcbx_get_operational_params(struct qed_hwfn *p_hwfn,
680680
DCBX_CONFIG_VERSION_CEE);
681681
p_operational->cee = val;
682682

683-
DP_VERBOSE(p_hwfn, QED_MSG_DCB, "Version support: ieee %d, cee %d\n",
684-
p_operational->ieee, p_operational->cee);
683+
val = !!(QED_MFW_GET_FIELD(flags, DCBX_CONFIG_VERSION) ==
684+
DCBX_CONFIG_VERSION_STATIC);
685+
p_operational->local = val;
686+
687+
DP_VERBOSE(p_hwfn, QED_MSG_DCB,
688+
"Version support: ieee %d, cee %d, static %d\n",
689+
p_operational->ieee, p_operational->cee,
690+
p_operational->local);
685691

686692
qed_dcbx_get_common_params(p_hwfn, &p_feat->app,
687693
p_feat->app.app_pri_tbl, &p_feat->ets,
@@ -1235,6 +1241,8 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn,
12351241
p_hwfn->p_dcbx_info->set.ver_num |= DCBX_CONFIG_VERSION_CEE;
12361242
if (dcbx_info->operational.ieee)
12371243
p_hwfn->p_dcbx_info->set.ver_num |= DCBX_CONFIG_VERSION_IEEE;
1244+
if (dcbx_info->operational.local)
1245+
p_hwfn->p_dcbx_info->set.ver_num |= DCBX_CONFIG_VERSION_STATIC;
12381246

12391247
p_hwfn->p_dcbx_info->set.enabled = dcbx_info->operational.enabled;
12401248
memcpy(&p_hwfn->p_dcbx_info->set.config.params,
@@ -1784,8 +1792,9 @@ static u8 qed_dcbnl_setdcbx(struct qed_dev *cdev, u8 mode)
17841792

17851793
DP_VERBOSE(hwfn, QED_MSG_DCB, "new mode = %x\n", mode);
17861794

1787-
if (!(mode & DCB_CAP_DCBX_VER_IEEE) && !(mode & DCB_CAP_DCBX_VER_CEE)) {
1788-
DP_INFO(hwfn, "Allowed mode is cee, ieee or both\n");
1795+
if (!(mode & DCB_CAP_DCBX_VER_IEEE) &&
1796+
!(mode & DCB_CAP_DCBX_VER_CEE) && !(mode & DCB_CAP_DCBX_STATIC)) {
1797+
DP_INFO(hwfn, "Allowed modes are cee, ieee or static\n");
17891798
return 1;
17901799
}
17911800

@@ -1805,6 +1814,11 @@ static u8 qed_dcbnl_setdcbx(struct qed_dev *cdev, u8 mode)
18051814
dcbx_set.enabled = true;
18061815
}
18071816

1817+
if (mode & DCB_CAP_DCBX_STATIC) {
1818+
dcbx_set.ver_num |= DCBX_CONFIG_VERSION_STATIC;
1819+
dcbx_set.enabled = true;
1820+
}
1821+
18081822
ptt = qed_ptt_acquire(hwfn);
18091823
if (!ptt)
18101824
return 1;
@@ -1813,7 +1827,7 @@ static u8 qed_dcbnl_setdcbx(struct qed_dev *cdev, u8 mode)
18131827

18141828
qed_ptt_release(hwfn, ptt);
18151829

1816-
return 0;
1830+
return rc;
18171831
}
18181832

18191833
static u8 qed_dcbnl_getfeatcfg(struct qed_dev *cdev, int featid, u8 *flags)

include/linux/qed/qed_if.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ struct qed_dcbx_operational_params {
144144
bool enabled;
145145
bool ieee;
146146
bool cee;
147+
bool local;
147148
u32 err;
148149
};
149150

0 commit comments

Comments
 (0)