Skip to content

Commit bffd5e8

Browse files
committed
Merge branch 'qed-fixes'
Sudarsana Reddy Kalluru says: ==================== qed: Fix series for multi-function mode implementation. The patch series addresses few issues in the switch dependent multi-function modes. Please consider applying it to 'net' tree. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents cf5cca6 + 7e3e375 commit bffd5e8

File tree

6 files changed

+73
-22
lines changed

6 files changed

+73
-22
lines changed

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

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,8 @@ qed_dcbx_dp_protocol(struct qed_hwfn *p_hwfn, struct qed_dcbx_results *p_data)
190190

191191
static void
192192
qed_dcbx_set_params(struct qed_dcbx_results *p_data,
193-
struct qed_hw_info *p_info,
194-
bool enable,
195-
u8 prio,
196-
u8 tc,
193+
struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
194+
bool enable, u8 prio, u8 tc,
197195
enum dcbx_protocol_type type,
198196
enum qed_pci_personality personality)
199197
{
@@ -206,19 +204,30 @@ qed_dcbx_set_params(struct qed_dcbx_results *p_data,
206204
else
207205
p_data->arr[type].update = DONT_UPDATE_DCB_DSCP;
208206

207+
/* Do not add vlan tag 0 when DCB is enabled and port in UFP/OV mode */
208+
if ((test_bit(QED_MF_8021Q_TAGGING, &p_hwfn->cdev->mf_bits) ||
209+
test_bit(QED_MF_8021AD_TAGGING, &p_hwfn->cdev->mf_bits)))
210+
p_data->arr[type].dont_add_vlan0 = true;
211+
209212
/* QM reconf data */
210-
if (p_info->personality == personality)
211-
qed_hw_info_set_offload_tc(p_info, tc);
213+
if (p_hwfn->hw_info.personality == personality)
214+
qed_hw_info_set_offload_tc(&p_hwfn->hw_info, tc);
215+
216+
/* Configure dcbx vlan priority in doorbell block for roce EDPM */
217+
if (test_bit(QED_MF_UFP_SPECIFIC, &p_hwfn->cdev->mf_bits) &&
218+
type == DCBX_PROTOCOL_ROCE) {
219+
qed_wr(p_hwfn, p_ptt, DORQ_REG_TAG1_OVRD_MODE, 1);
220+
qed_wr(p_hwfn, p_ptt, DORQ_REG_PF_PCP_BB_K2, prio << 1);
221+
}
212222
}
213223

214224
/* Update app protocol data and hw_info fields with the TLV info */
215225
static void
216226
qed_dcbx_update_app_info(struct qed_dcbx_results *p_data,
217-
struct qed_hwfn *p_hwfn,
218-
bool enable,
219-
u8 prio, u8 tc, enum dcbx_protocol_type type)
227+
struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
228+
bool enable, u8 prio, u8 tc,
229+
enum dcbx_protocol_type type)
220230
{
221-
struct qed_hw_info *p_info = &p_hwfn->hw_info;
222231
enum qed_pci_personality personality;
223232
enum dcbx_protocol_type id;
224233
int i;
@@ -231,7 +240,7 @@ qed_dcbx_update_app_info(struct qed_dcbx_results *p_data,
231240

232241
personality = qed_dcbx_app_update[i].personality;
233242

234-
qed_dcbx_set_params(p_data, p_info, enable,
243+
qed_dcbx_set_params(p_data, p_hwfn, p_ptt, enable,
235244
prio, tc, type, personality);
236245
}
237246
}
@@ -265,7 +274,7 @@ qed_dcbx_get_app_protocol_type(struct qed_hwfn *p_hwfn,
265274
* reconfiguring QM. Get protocol specific data for PF update ramrod command.
266275
*/
267276
static int
268-
qed_dcbx_process_tlv(struct qed_hwfn *p_hwfn,
277+
qed_dcbx_process_tlv(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
269278
struct qed_dcbx_results *p_data,
270279
struct dcbx_app_priority_entry *p_tbl,
271280
u32 pri_tc_tbl, int count, u8 dcbx_version)
@@ -309,7 +318,7 @@ qed_dcbx_process_tlv(struct qed_hwfn *p_hwfn,
309318
enable = true;
310319
}
311320

312-
qed_dcbx_update_app_info(p_data, p_hwfn, enable,
321+
qed_dcbx_update_app_info(p_data, p_hwfn, p_ptt, enable,
313322
priority, tc, type);
314323
}
315324
}
@@ -331,7 +340,7 @@ qed_dcbx_process_tlv(struct qed_hwfn *p_hwfn,
331340
continue;
332341

333342
enable = (type == DCBX_PROTOCOL_ETH) ? false : !!dcbx_version;
334-
qed_dcbx_update_app_info(p_data, p_hwfn, enable,
343+
qed_dcbx_update_app_info(p_data, p_hwfn, p_ptt, enable,
335344
priority, tc, type);
336345
}
337346

@@ -341,7 +350,8 @@ qed_dcbx_process_tlv(struct qed_hwfn *p_hwfn,
341350
/* Parse app TLV's to update TC information in hw_info structure for
342351
* reconfiguring QM. Get protocol specific data for PF update ramrod command.
343352
*/
344-
static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
353+
static int
354+
qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
345355
{
346356
struct dcbx_app_priority_feature *p_app;
347357
struct dcbx_app_priority_entry *p_tbl;
@@ -365,7 +375,7 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
365375
p_info = &p_hwfn->hw_info;
366376
num_entries = QED_MFW_GET_FIELD(p_app->flags, DCBX_APP_NUM_ENTRIES);
367377

368-
rc = qed_dcbx_process_tlv(p_hwfn, &data, p_tbl, pri_tc_tbl,
378+
rc = qed_dcbx_process_tlv(p_hwfn, p_ptt, &data, p_tbl, pri_tc_tbl,
369379
num_entries, dcbx_version);
370380
if (rc)
371381
return rc;
@@ -891,7 +901,7 @@ qed_dcbx_mib_update_event(struct qed_hwfn *p_hwfn,
891901
return rc;
892902

893903
if (type == QED_DCBX_OPERATIONAL_MIB) {
894-
rc = qed_dcbx_process_mib_info(p_hwfn);
904+
rc = qed_dcbx_process_mib_info(p_hwfn, p_ptt);
895905
if (!rc) {
896906
/* reconfigure tcs of QM queues according
897907
* to negotiation results
@@ -954,6 +964,7 @@ static void qed_dcbx_update_protocol_data(struct protocol_dcb_data *p_data,
954964
p_data->dcb_enable_flag = p_src->arr[type].enable;
955965
p_data->dcb_priority = p_src->arr[type].priority;
956966
p_data->dcb_tc = p_src->arr[type].tc;
967+
p_data->dcb_dont_add_vlan0 = p_src->arr[type].dont_add_vlan0;
957968
}
958969

959970
/* Set pf update ramrod command params */

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ struct qed_dcbx_app_data {
5555
u8 update; /* Update indication */
5656
u8 priority; /* Priority */
5757
u8 tc; /* Traffic Class */
58+
bool dont_add_vlan0; /* Do not insert a vlan tag with id 0 */
5859
};
5960

6061
#define QED_DCBX_VERSION_DISABLED 0

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ static int qed_vf_start(struct qed_hwfn *p_hwfn,
17061706
int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)
17071707
{
17081708
struct qed_load_req_params load_req_params;
1709-
u32 load_code, param, drv_mb_param;
1709+
u32 load_code, resp, param, drv_mb_param;
17101710
bool b_default_mtu = true;
17111711
struct qed_hwfn *p_hwfn;
17121712
int rc = 0, mfw_rc, i;
@@ -1852,6 +1852,19 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)
18521852

18531853
if (IS_PF(cdev)) {
18541854
p_hwfn = QED_LEADING_HWFN(cdev);
1855+
1856+
/* Get pre-negotiated values for stag, bandwidth etc. */
1857+
DP_VERBOSE(p_hwfn,
1858+
QED_MSG_SPQ,
1859+
"Sending GET_OEM_UPDATES command to trigger stag/bandwidth attention handling\n");
1860+
drv_mb_param = 1 << DRV_MB_PARAM_DUMMY_OEM_UPDATES_OFFSET;
1861+
rc = qed_mcp_cmd(p_hwfn, p_hwfn->p_main_ptt,
1862+
DRV_MSG_CODE_GET_OEM_UPDATES,
1863+
drv_mb_param, &resp, &param);
1864+
if (rc)
1865+
DP_NOTICE(p_hwfn,
1866+
"Failed to send GET_OEM_UPDATES attention request\n");
1867+
18551868
drv_mb_param = STORM_FW_VERSION;
18561869
rc = qed_mcp_cmd(p_hwfn, p_hwfn->p_main_ptt,
18571870
DRV_MSG_CODE_OV_UPDATE_STORM_FW_VER,

drivers/net/ethernet/qlogic/qed/qed_hsi.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12414,6 +12414,7 @@ struct public_drv_mb {
1241412414
#define DRV_MSG_SET_RESOURCE_VALUE_MSG 0x35000000
1241512415
#define DRV_MSG_CODE_OV_UPDATE_WOL 0x38000000
1241612416
#define DRV_MSG_CODE_OV_UPDATE_ESWITCH_MODE 0x39000000
12417+
#define DRV_MSG_CODE_GET_OEM_UPDATES 0x41000000
1241712418

1241812419
#define DRV_MSG_CODE_BW_UPDATE_ACK 0x32000000
1241912420
#define DRV_MSG_CODE_NIG_DRAIN 0x30000000
@@ -12541,6 +12542,9 @@ struct public_drv_mb {
1254112542
#define DRV_MB_PARAM_ESWITCH_MODE_VEB 0x1
1254212543
#define DRV_MB_PARAM_ESWITCH_MODE_VEPA 0x2
1254312544

12545+
#define DRV_MB_PARAM_DUMMY_OEM_UPDATES_MASK 0x1
12546+
#define DRV_MB_PARAM_DUMMY_OEM_UPDATES_OFFSET 0
12547+
1254412548
#define DRV_MB_PARAM_SET_LED_MODE_OPER 0x0
1254512549
#define DRV_MB_PARAM_SET_LED_MODE_ON 0x1
1254612550
#define DRV_MB_PARAM_SET_LED_MODE_OFF 0x2

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,13 +1581,29 @@ static void qed_mcp_update_stag(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
15811581
p_hwfn->mcp_info->func_info.ovlan = (u16)shmem_info.ovlan_stag &
15821582
FUNC_MF_CFG_OV_STAG_MASK;
15831583
p_hwfn->hw_info.ovlan = p_hwfn->mcp_info->func_info.ovlan;
1584-
if ((p_hwfn->hw_info.hw_mode & BIT(MODE_MF_SD)) &&
1585-
(p_hwfn->hw_info.ovlan != QED_MCP_VLAN_UNSET)) {
1586-
qed_wr(p_hwfn, p_ptt,
1587-
NIG_REG_LLH_FUNC_TAG_VALUE, p_hwfn->hw_info.ovlan);
1584+
if (test_bit(QED_MF_OVLAN_CLSS, &p_hwfn->cdev->mf_bits)) {
1585+
if (p_hwfn->hw_info.ovlan != QED_MCP_VLAN_UNSET) {
1586+
qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_FUNC_TAG_VALUE,
1587+
p_hwfn->hw_info.ovlan);
1588+
qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_FUNC_TAG_EN, 1);
1589+
1590+
/* Configure DB to add external vlan to EDPM packets */
1591+
qed_wr(p_hwfn, p_ptt, DORQ_REG_TAG1_OVRD_MODE, 1);
1592+
qed_wr(p_hwfn, p_ptt, DORQ_REG_PF_EXT_VID_BB_K2,
1593+
p_hwfn->hw_info.ovlan);
1594+
} else {
1595+
qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_FUNC_TAG_EN, 0);
1596+
qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_FUNC_TAG_VALUE, 0);
1597+
qed_wr(p_hwfn, p_ptt, DORQ_REG_TAG1_OVRD_MODE, 0);
1598+
qed_wr(p_hwfn, p_ptt, DORQ_REG_PF_EXT_VID_BB_K2, 0);
1599+
}
1600+
15881601
qed_sp_pf_update_stag(p_hwfn);
15891602
}
15901603

1604+
DP_VERBOSE(p_hwfn, QED_MSG_SP, "ovlan = %d hw_mode = 0x%x\n",
1605+
p_hwfn->mcp_info->func_info.ovlan, p_hwfn->hw_info.hw_mode);
1606+
15911607
/* Acknowledge the MFW */
15921608
qed_mcp_cmd(p_hwfn, p_ptt, DRV_MSG_CODE_S_TAG_UPDATE_ACK, 0,
15931609
&resp, &param);

drivers/net/ethernet/qlogic/qed/qed_reg_addr.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@
216216
0x00c000UL
217217
#define DORQ_REG_IFEN \
218218
0x100040UL
219+
#define DORQ_REG_TAG1_OVRD_MODE \
220+
0x1008b4UL
221+
#define DORQ_REG_PF_PCP_BB_K2 \
222+
0x1008c4UL
223+
#define DORQ_REG_PF_EXT_VID_BB_K2 \
224+
0x1008c8UL
219225
#define DORQ_REG_DB_DROP_REASON \
220226
0x100a2cUL
221227
#define DORQ_REG_DB_DROP_DETAILS \

0 commit comments

Comments
 (0)