@@ -121,6 +121,7 @@ static const u16 bnxt_vf_req_snif[] = {
121
121
static const u16 bnxt_async_events_arr [] = {
122
122
HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE ,
123
123
HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD ,
124
+ HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED ,
124
125
};
125
126
126
127
static bool bnxt_vf_pciid (enum board_idx idx )
@@ -1236,6 +1237,19 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_napi *bnapi, u32 *raw_cons,
1236
1237
return rc ;
1237
1238
}
1238
1239
1240
+ #define BNXT_GET_EVENT_PORT (data ) \
1241
+ ((data) & \
1242
+ HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK)
1243
+
1244
+ #define BNXT_EVENT_POLICY_MASK \
1245
+ HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK
1246
+
1247
+ #define BNXT_EVENT_POLICY_SFT \
1248
+ HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT
1249
+
1250
+ #define BNXT_GET_EVENT_POLICY (data ) \
1251
+ (((data) & BNXT_EVENT_POLICY_MASK) >> BNXT_EVENT_POLICY_SFT)
1252
+
1239
1253
static int bnxt_async_event_process (struct bnxt * bp ,
1240
1254
struct hwrm_async_event_cmpl * cmpl )
1241
1255
{
@@ -1249,6 +1263,22 @@ static int bnxt_async_event_process(struct bnxt *bp,
1249
1263
case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD :
1250
1264
set_bit (BNXT_HWRM_PF_UNLOAD_SP_EVENT , & bp -> sp_event );
1251
1265
break ;
1266
+ case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED : {
1267
+ u32 data1 = le32_to_cpu (cmpl -> event_data1 );
1268
+ u16 port_id = BNXT_GET_EVENT_PORT (data1 );
1269
+
1270
+ if (BNXT_VF (bp ))
1271
+ break ;
1272
+
1273
+ if (bp -> pf .port_id != port_id )
1274
+ break ;
1275
+
1276
+ bp -> link_info .last_port_module_event =
1277
+ BNXT_GET_EVENT_POLICY (data1 );
1278
+
1279
+ set_bit (BNXT_HWRM_PORT_MODULE_SP_EVENT , & bp -> sp_event );
1280
+ break ;
1281
+ }
1252
1282
default :
1253
1283
netdev_err (bp -> dev , "unhandled ASYNC event (id 0x%x)\n" ,
1254
1284
event_id );
@@ -5447,6 +5477,28 @@ static void bnxt_timer(unsigned long data)
5447
5477
mod_timer (& bp -> timer , jiffies + bp -> current_interval );
5448
5478
}
5449
5479
5480
+ static void bnxt_port_module_event (struct bnxt * bp )
5481
+ {
5482
+ struct bnxt_link_info * link_info = & bp -> link_info ;
5483
+ struct hwrm_port_phy_qcfg_output * resp = & link_info -> phy_qcfg_resp ;
5484
+
5485
+ if (bnxt_update_link (bp , true))
5486
+ return ;
5487
+
5488
+ if (link_info -> last_port_module_event != 0 ) {
5489
+ netdev_warn (bp -> dev , "Unqualified SFP+ module detected on port %d\n" ,
5490
+ bp -> pf .port_id );
5491
+ if (bp -> hwrm_spec_code >= 0x10201 ) {
5492
+ netdev_warn (bp -> dev , "Module part number %s\n" ,
5493
+ resp -> phy_vendor_partnumber );
5494
+ }
5495
+ }
5496
+ if (link_info -> last_port_module_event == 1 )
5497
+ netdev_warn (bp -> dev , "TX is disabled\n" );
5498
+ if (link_info -> last_port_module_event == 3 )
5499
+ netdev_warn (bp -> dev , "Shutdown SFP+ module\n" );
5500
+ }
5501
+
5450
5502
static void bnxt_cfg_ntp_filters (struct bnxt * );
5451
5503
5452
5504
static void bnxt_sp_task (struct work_struct * work )
@@ -5494,6 +5546,9 @@ static void bnxt_sp_task(struct work_struct *work)
5494
5546
rtnl_unlock ();
5495
5547
}
5496
5548
5549
+ if (test_and_clear_bit (BNXT_HWRM_PORT_MODULE_SP_EVENT , & bp -> sp_event ))
5550
+ bnxt_port_module_event (bp );
5551
+
5497
5552
if (test_and_clear_bit (BNXT_PERIODIC_STATS_SP_EVENT , & bp -> sp_event ))
5498
5553
bnxt_hwrm_port_qstats (bp );
5499
5554
0 commit comments