54
54
#include "bnxt.h"
55
55
#include "bnxt_sriov.h"
56
56
#include "bnxt_ethtool.h"
57
+ #include "bnxt_dcb.h"
57
58
58
59
#define BNXT_TX_TIMEOUT (5 * HZ)
59
60
@@ -186,11 +187,11 @@ static const u16 bnxt_vf_req_snif[] = {
186
187
};
187
188
188
189
static const u16 bnxt_async_events_arr [] = {
189
- HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE ,
190
- HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD ,
191
- HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED ,
192
- HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE ,
193
- HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE ,
190
+ ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE ,
191
+ ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD ,
192
+ ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED ,
193
+ ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE ,
194
+ ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE ,
194
195
};
195
196
196
197
static bool bnxt_vf_pciid (enum board_idx idx )
@@ -1476,8 +1477,8 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_napi *bnapi, u32 *raw_cons,
1476
1477
}
1477
1478
1478
1479
#define BNXT_GET_EVENT_PORT (data ) \
1479
- ((data) & \
1480
- HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK )
1480
+ ((data) & \
1481
+ ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK )
1481
1482
1482
1483
static int bnxt_async_event_process (struct bnxt * bp ,
1483
1484
struct hwrm_async_event_cmpl * cmpl )
@@ -1486,7 +1487,7 @@ static int bnxt_async_event_process(struct bnxt *bp,
1486
1487
1487
1488
/* TODO CHIMP_FW: Define event id's for link change, error etc */
1488
1489
switch (event_id ) {
1489
- case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE : {
1490
+ case ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE : {
1490
1491
u32 data1 = le32_to_cpu (cmpl -> event_data1 );
1491
1492
struct bnxt_link_info * link_info = & bp -> link_info ;
1492
1493
@@ -1502,13 +1503,13 @@ static int bnxt_async_event_process(struct bnxt *bp,
1502
1503
set_bit (BNXT_LINK_SPEED_CHNG_SP_EVENT , & bp -> sp_event );
1503
1504
/* fall thru */
1504
1505
}
1505
- case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE :
1506
+ case ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE :
1506
1507
set_bit (BNXT_LINK_CHNG_SP_EVENT , & bp -> sp_event );
1507
1508
break ;
1508
- case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD :
1509
+ case ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD :
1509
1510
set_bit (BNXT_HWRM_PF_UNLOAD_SP_EVENT , & bp -> sp_event );
1510
1511
break ;
1511
- case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED : {
1512
+ case ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED : {
1512
1513
u32 data1 = le32_to_cpu (cmpl -> event_data1 );
1513
1514
u16 port_id = BNXT_GET_EVENT_PORT (data1 );
1514
1515
@@ -1521,7 +1522,7 @@ static int bnxt_async_event_process(struct bnxt *bp,
1521
1522
set_bit (BNXT_HWRM_PORT_MODULE_SP_EVENT , & bp -> sp_event );
1522
1523
break ;
1523
1524
}
1524
- case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE :
1525
+ case ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE :
1525
1526
if (BNXT_PF (bp ))
1526
1527
goto async_event_process_exit ;
1527
1528
set_bit (BNXT_RESET_TASK_SILENT_SP_EVENT , & bp -> sp_event );
@@ -4261,12 +4262,16 @@ static int bnxt_hwrm_queue_qportcfg(struct bnxt *bp)
4261
4262
goto qportcfg_exit ;
4262
4263
}
4263
4264
bp -> max_tc = resp -> max_configurable_queues ;
4265
+ bp -> max_lltc = resp -> max_configurable_lossless_queues ;
4264
4266
if (bp -> max_tc > BNXT_MAX_QUEUE )
4265
4267
bp -> max_tc = BNXT_MAX_QUEUE ;
4266
4268
4267
4269
if (resp -> queue_cfg_info & QUEUE_QPORTCFG_RESP_QUEUE_CFG_INFO_ASYM_CFG )
4268
4270
bp -> max_tc = 1 ;
4269
4271
4272
+ if (bp -> max_lltc > bp -> max_tc )
4273
+ bp -> max_lltc = bp -> max_tc ;
4274
+
4270
4275
qptr = & resp -> queue_id0 ;
4271
4276
for (i = 0 ; i < bp -> max_tc ; i ++ ) {
4272
4277
bp -> q_info [i ].queue_id = * qptr ++ ;
@@ -4993,7 +4998,7 @@ static void bnxt_enable_napi(struct bnxt *bp)
4993
4998
}
4994
4999
}
4995
5000
4996
- static void bnxt_tx_disable (struct bnxt * bp )
5001
+ void bnxt_tx_disable (struct bnxt * bp )
4997
5002
{
4998
5003
int i ;
4999
5004
struct bnxt_tx_ring_info * txr ;
@@ -5011,7 +5016,7 @@ static void bnxt_tx_disable(struct bnxt *bp)
5011
5016
netif_carrier_off (bp -> dev );
5012
5017
}
5013
5018
5014
- static void bnxt_tx_enable (struct bnxt * bp )
5019
+ void bnxt_tx_enable (struct bnxt * bp )
5015
5020
{
5016
5021
int i ;
5017
5022
struct bnxt_tx_ring_info * txr ;
@@ -6337,17 +6342,10 @@ static int bnxt_change_mtu(struct net_device *dev, int new_mtu)
6337
6342
return 0 ;
6338
6343
}
6339
6344
6340
- static int bnxt_setup_tc (struct net_device * dev , u32 handle , __be16 proto ,
6341
- struct tc_to_netdev * ntc )
6345
+ int bnxt_setup_mq_tc (struct net_device * dev , u8 tc )
6342
6346
{
6343
6347
struct bnxt * bp = netdev_priv (dev );
6344
6348
bool sh = false;
6345
- u8 tc ;
6346
-
6347
- if (ntc -> type != TC_SETUP_MQPRIO )
6348
- return - EINVAL ;
6349
-
6350
- tc = ntc -> tc ;
6351
6349
6352
6350
if (tc > bp -> max_tc ) {
6353
6351
netdev_err (dev , "too many traffic classes requested: %d Max supported is %d\n" ,
@@ -6390,6 +6388,15 @@ static int bnxt_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
6390
6388
return 0 ;
6391
6389
}
6392
6390
6391
+ static int bnxt_setup_tc (struct net_device * dev , u32 handle , __be16 proto ,
6392
+ struct tc_to_netdev * ntc )
6393
+ {
6394
+ if (ntc -> type != TC_SETUP_MQPRIO )
6395
+ return - EINVAL ;
6396
+
6397
+ return bnxt_setup_mq_tc (dev , ntc -> tc );
6398
+ }
6399
+
6393
6400
#ifdef CONFIG_RFS_ACCEL
6394
6401
static bool bnxt_fltr_match (struct bnxt_ntuple_filter * f1 ,
6395
6402
struct bnxt_ntuple_filter * f2 )
@@ -6680,6 +6687,7 @@ static void bnxt_remove_one(struct pci_dev *pdev)
6680
6687
6681
6688
bnxt_hwrm_func_drv_unrgtr (bp );
6682
6689
bnxt_free_hwrm_resources (bp );
6690
+ bnxt_dcb_free (bp );
6683
6691
pci_iounmap (pdev , bp -> bar2 );
6684
6692
pci_iounmap (pdev , bp -> bar1 );
6685
6693
pci_iounmap (pdev , bp -> bar0 );
@@ -6907,6 +6915,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
6907
6915
dev -> min_mtu = ETH_ZLEN ;
6908
6916
dev -> max_mtu = 9500 ;
6909
6917
6918
+ bnxt_dcb_init (bp );
6919
+
6910
6920
#ifdef CONFIG_BNXT_SRIOV
6911
6921
init_waitqueue_head (& bp -> sriov_cfg_wait );
6912
6922
#endif
0 commit comments