@@ -271,8 +271,8 @@ qed_dcbx_process_tlv(struct qed_hwfn *p_hwfn,
271
271
struct dcbx_app_priority_entry * p_tbl ,
272
272
u32 pri_tc_tbl , int count , u8 dcbx_version )
273
273
{
274
- u8 tc , priority_map ;
275
274
enum dcbx_protocol_type type ;
275
+ u8 tc , priority_map ;
276
276
bool enable , ieee ;
277
277
u16 protocol_id ;
278
278
int priority ;
@@ -556,8 +556,9 @@ qed_dcbx_get_pfc_data(struct qed_hwfn *p_hwfn,
556
556
p_params -> pfc .prio [7 ] = !!(pfc_map & DCBX_PFC_PRI_EN_BITMAP_PRI_7 );
557
557
558
558
DP_VERBOSE (p_hwfn , QED_MSG_DCB ,
559
- "PFC params: willing %d, pfc_bitmap %d\n" ,
560
- p_params -> pfc .willing , pfc_map );
559
+ "PFC params: willing %d, pfc_bitmap %u max_tc = %u enabled = %d\n" ,
560
+ p_params -> pfc .willing , pfc_map , p_params -> pfc .max_tc ,
561
+ p_params -> pfc .enabled );
561
562
}
562
563
563
564
static void
@@ -576,10 +577,10 @@ qed_dcbx_get_ets_data(struct qed_hwfn *p_hwfn,
576
577
p_params -> max_ets_tc = QED_MFW_GET_FIELD (p_ets -> flags ,
577
578
DCBX_ETS_MAX_TCS );
578
579
DP_VERBOSE (p_hwfn , QED_MSG_DCB ,
579
- "ETS params: willing %d, ets_cbs %d pri_tc_tbl_0 %x max_ets_tc %d\n" ,
580
- p_params -> ets_willing ,
581
- p_params -> ets_cbs ,
582
- p_ets -> pri_tc_tbl [ 0 ], p_params -> max_ets_tc );
580
+ "ETS params: willing %d, enabled = %d ets_cbs %d pri_tc_tbl_0 %x max_ets_tc %d\n" ,
581
+ p_params -> ets_willing , p_params -> ets_enabled ,
582
+ p_params -> ets_cbs , p_ets -> pri_tc_tbl [ 0 ],
583
+ p_params -> max_ets_tc );
583
584
584
585
if (p_params -> ets_enabled && !p_params -> max_ets_tc ) {
585
586
p_params -> max_ets_tc = QED_MAX_PFC_PRIORITIES ;
@@ -620,8 +621,7 @@ qed_dcbx_get_common_params(struct qed_hwfn *p_hwfn,
620
621
}
621
622
622
623
static void
623
- qed_dcbx_get_local_params (struct qed_hwfn * p_hwfn ,
624
- struct qed_ptt * p_ptt , struct qed_dcbx_get * params )
624
+ qed_dcbx_get_local_params (struct qed_hwfn * p_hwfn , struct qed_dcbx_get * params )
625
625
{
626
626
struct dcbx_features * p_feat ;
627
627
@@ -633,8 +633,7 @@ qed_dcbx_get_local_params(struct qed_hwfn *p_hwfn,
633
633
}
634
634
635
635
static void
636
- qed_dcbx_get_remote_params (struct qed_hwfn * p_hwfn ,
637
- struct qed_ptt * p_ptt , struct qed_dcbx_get * params )
636
+ qed_dcbx_get_remote_params (struct qed_hwfn * p_hwfn , struct qed_dcbx_get * params )
638
637
{
639
638
struct dcbx_features * p_feat ;
640
639
@@ -647,7 +646,6 @@ qed_dcbx_get_remote_params(struct qed_hwfn *p_hwfn,
647
646
648
647
static void
649
648
qed_dcbx_get_operational_params (struct qed_hwfn * p_hwfn ,
650
- struct qed_ptt * p_ptt ,
651
649
struct qed_dcbx_get * params )
652
650
{
653
651
struct qed_dcbx_operational_params * p_operational ;
@@ -668,6 +666,7 @@ qed_dcbx_get_operational_params(struct qed_hwfn *p_hwfn,
668
666
if (!enabled ) {
669
667
p_operational -> enabled = enabled ;
670
668
p_operational -> valid = false;
669
+ DP_VERBOSE (p_hwfn , QED_MSG_DCB , "Dcbx is disabled\n" );
671
670
return ;
672
671
}
673
672
@@ -681,8 +680,14 @@ qed_dcbx_get_operational_params(struct qed_hwfn *p_hwfn,
681
680
DCBX_CONFIG_VERSION_CEE );
682
681
p_operational -> cee = val ;
683
682
684
- DP_VERBOSE (p_hwfn , QED_MSG_DCB , "Version support: ieee %d, cee %d\n" ,
685
- 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 );
686
691
687
692
qed_dcbx_get_common_params (p_hwfn , & p_feat -> app ,
688
693
p_feat -> app .app_pri_tbl , & p_feat -> ets ,
@@ -697,7 +702,6 @@ qed_dcbx_get_operational_params(struct qed_hwfn *p_hwfn,
697
702
698
703
static void
699
704
qed_dcbx_get_local_lldp_params (struct qed_hwfn * p_hwfn ,
700
- struct qed_ptt * p_ptt ,
701
705
struct qed_dcbx_get * params )
702
706
{
703
707
struct lldp_config_params_s * p_local ;
@@ -712,7 +716,6 @@ qed_dcbx_get_local_lldp_params(struct qed_hwfn *p_hwfn,
712
716
713
717
static void
714
718
qed_dcbx_get_remote_lldp_params (struct qed_hwfn * p_hwfn ,
715
- struct qed_ptt * p_ptt ,
716
719
struct qed_dcbx_get * params )
717
720
{
718
721
struct lldp_status_params_s * p_remote ;
@@ -726,25 +729,24 @@ qed_dcbx_get_remote_lldp_params(struct qed_hwfn *p_hwfn,
726
729
}
727
730
728
731
static int
729
- qed_dcbx_get_params (struct qed_hwfn * p_hwfn , struct qed_ptt * p_ptt ,
730
- struct qed_dcbx_get * p_params ,
732
+ qed_dcbx_get_params (struct qed_hwfn * p_hwfn , struct qed_dcbx_get * p_params ,
731
733
enum qed_mib_read_type type )
732
734
{
733
735
switch (type ) {
734
736
case QED_DCBX_REMOTE_MIB :
735
- qed_dcbx_get_remote_params (p_hwfn , p_ptt , p_params );
737
+ qed_dcbx_get_remote_params (p_hwfn , p_params );
736
738
break ;
737
739
case QED_DCBX_LOCAL_MIB :
738
- qed_dcbx_get_local_params (p_hwfn , p_ptt , p_params );
740
+ qed_dcbx_get_local_params (p_hwfn , p_params );
739
741
break ;
740
742
case QED_DCBX_OPERATIONAL_MIB :
741
- qed_dcbx_get_operational_params (p_hwfn , p_ptt , p_params );
743
+ qed_dcbx_get_operational_params (p_hwfn , p_params );
742
744
break ;
743
745
case QED_DCBX_REMOTE_LLDP_MIB :
744
- qed_dcbx_get_remote_lldp_params (p_hwfn , p_ptt , p_params );
746
+ qed_dcbx_get_remote_lldp_params (p_hwfn , p_params );
745
747
break ;
746
748
case QED_DCBX_LOCAL_LLDP_MIB :
747
- qed_dcbx_get_local_lldp_params (p_hwfn , p_ptt , p_params );
749
+ qed_dcbx_get_local_lldp_params (p_hwfn , p_params );
748
750
break ;
749
751
default :
750
752
DP_ERR (p_hwfn , "MIB read err, unknown mib type %d\n" , type );
@@ -902,25 +904,23 @@ qed_dcbx_mib_update_event(struct qed_hwfn *p_hwfn,
902
904
qed_sp_pf_update (p_hwfn );
903
905
}
904
906
}
905
- qed_dcbx_get_params (p_hwfn , p_ptt , & p_hwfn -> p_dcbx_info -> get , type );
907
+
908
+ qed_dcbx_get_params (p_hwfn , & p_hwfn -> p_dcbx_info -> get , type );
906
909
qed_dcbx_aen (p_hwfn , type );
907
910
908
911
return rc ;
909
912
}
910
913
911
914
int qed_dcbx_info_alloc (struct qed_hwfn * p_hwfn )
912
915
{
913
- int rc = 0 ;
914
-
915
916
p_hwfn -> p_dcbx_info = kzalloc (sizeof (* p_hwfn -> p_dcbx_info ), GFP_KERNEL );
916
917
if (!p_hwfn -> p_dcbx_info )
917
- rc = - ENOMEM ;
918
+ return - ENOMEM ;
918
919
919
- return rc ;
920
+ return 0 ;
920
921
}
921
922
922
- void qed_dcbx_info_free (struct qed_hwfn * p_hwfn ,
923
- struct qed_dcbx_info * p_dcbx_info )
923
+ void qed_dcbx_info_free (struct qed_hwfn * p_hwfn )
924
924
{
925
925
kfree (p_hwfn -> p_dcbx_info );
926
926
}
@@ -959,14 +959,9 @@ void qed_dcbx_set_pf_update_params(struct qed_dcbx_results *p_src,
959
959
p_dcb_data = & p_dest -> fcoe_dcb_data ;
960
960
qed_dcbx_update_protocol_data (p_dcb_data , p_src , DCBX_PROTOCOL_FCOE );
961
961
p_dcb_data = & p_dest -> roce_dcb_data ;
962
-
963
- if (p_src -> arr [DCBX_PROTOCOL_ROCE ].update )
964
- qed_dcbx_update_protocol_data (p_dcb_data , p_src ,
965
- DCBX_PROTOCOL_ROCE );
966
- if (p_src -> arr [DCBX_PROTOCOL_ROCE_V2 ].update )
967
- qed_dcbx_update_protocol_data (p_dcb_data , p_src ,
968
- DCBX_PROTOCOL_ROCE_V2 );
969
-
962
+ qed_dcbx_update_protocol_data (p_dcb_data , p_src , DCBX_PROTOCOL_ROCE );
963
+ p_dcb_data = & p_dest -> rroce_dcb_data ;
964
+ qed_dcbx_update_protocol_data (p_dcb_data , p_src , DCBX_PROTOCOL_ROCE_V2 );
970
965
p_dcb_data = & p_dest -> iscsi_dcb_data ;
971
966
qed_dcbx_update_protocol_data (p_dcb_data , p_src , DCBX_PROTOCOL_ISCSI );
972
967
p_dcb_data = & p_dest -> eth_dcb_data ;
@@ -992,7 +987,7 @@ static int qed_dcbx_query_params(struct qed_hwfn *p_hwfn,
992
987
if (rc )
993
988
goto out ;
994
989
995
- rc = qed_dcbx_get_params (p_hwfn , p_ptt , p_get , type );
990
+ rc = qed_dcbx_get_params (p_hwfn , p_get , type );
996
991
997
992
out :
998
993
qed_ptt_release (p_hwfn , p_ptt );
@@ -1167,6 +1162,9 @@ qed_dcbx_set_local_params(struct qed_hwfn *p_hwfn,
1167
1162
local_admin -> config = DCBX_CONFIG_VERSION_DISABLED ;
1168
1163
}
1169
1164
1165
+ DP_VERBOSE (p_hwfn , QED_MSG_DCB , "Dcbx version = %d\n" ,
1166
+ local_admin -> config );
1167
+
1170
1168
if (params -> override_flags & QED_DCBX_OVERRIDE_PFC_CFG )
1171
1169
qed_dcbx_set_pfc_data (p_hwfn , & local_admin -> features .pfc ,
1172
1170
& params -> config .params );
@@ -1243,6 +1241,8 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn,
1243
1241
p_hwfn -> p_dcbx_info -> set .ver_num |= DCBX_CONFIG_VERSION_CEE ;
1244
1242
if (dcbx_info -> operational .ieee )
1245
1243
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 ;
1246
1246
1247
1247
p_hwfn -> p_dcbx_info -> set .enabled = dcbx_info -> operational .enabled ;
1248
1248
memcpy (& p_hwfn -> p_dcbx_info -> set .config .params ,
@@ -1792,8 +1792,9 @@ static u8 qed_dcbnl_setdcbx(struct qed_dev *cdev, u8 mode)
1792
1792
1793
1793
DP_VERBOSE (hwfn , QED_MSG_DCB , "new mode = %x\n" , mode );
1794
1794
1795
- if (!(mode & DCB_CAP_DCBX_VER_IEEE ) && !(mode & DCB_CAP_DCBX_VER_CEE )) {
1796
- 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" );
1797
1798
return 1 ;
1798
1799
}
1799
1800
@@ -1813,6 +1814,11 @@ static u8 qed_dcbnl_setdcbx(struct qed_dev *cdev, u8 mode)
1813
1814
dcbx_set .enabled = true;
1814
1815
}
1815
1816
1817
+ if (mode & DCB_CAP_DCBX_STATIC ) {
1818
+ dcbx_set .ver_num |= DCBX_CONFIG_VERSION_STATIC ;
1819
+ dcbx_set .enabled = true;
1820
+ }
1821
+
1816
1822
ptt = qed_ptt_acquire (hwfn );
1817
1823
if (!ptt )
1818
1824
return 1 ;
@@ -1821,7 +1827,7 @@ static u8 qed_dcbnl_setdcbx(struct qed_dev *cdev, u8 mode)
1821
1827
1822
1828
qed_ptt_release (hwfn , ptt );
1823
1829
1824
- return 0 ;
1830
+ return rc ;
1825
1831
}
1826
1832
1827
1833
static u8 qed_dcbnl_getfeatcfg (struct qed_dev * cdev , int featid , u8 * flags )
@@ -2200,15 +2206,46 @@ qed_dcbnl_ieee_peer_getpfc(struct qed_dev *cdev, struct ieee_pfc *pfc)
2200
2206
return qed_dcbnl_get_ieee_pfc (cdev , pfc , true);
2201
2207
}
2202
2208
2209
+ static int qed_get_sf_ieee_value (u8 selector , u8 * sf_ieee )
2210
+ {
2211
+ switch (selector ) {
2212
+ case IEEE_8021QAZ_APP_SEL_ETHERTYPE :
2213
+ * sf_ieee = QED_DCBX_SF_IEEE_ETHTYPE ;
2214
+ break ;
2215
+ case IEEE_8021QAZ_APP_SEL_STREAM :
2216
+ * sf_ieee = QED_DCBX_SF_IEEE_TCP_PORT ;
2217
+ break ;
2218
+ case IEEE_8021QAZ_APP_SEL_DGRAM :
2219
+ * sf_ieee = QED_DCBX_SF_IEEE_UDP_PORT ;
2220
+ break ;
2221
+ case IEEE_8021QAZ_APP_SEL_ANY :
2222
+ * sf_ieee = QED_DCBX_SF_IEEE_TCP_UDP_PORT ;
2223
+ break ;
2224
+ default :
2225
+ return - EINVAL ;
2226
+ }
2227
+
2228
+ return 0 ;
2229
+ }
2230
+
2203
2231
static int qed_dcbnl_ieee_getapp (struct qed_dev * cdev , struct dcb_app * app )
2204
2232
{
2205
2233
struct qed_hwfn * hwfn = QED_LEADING_HWFN (cdev );
2206
2234
struct qed_dcbx_get * dcbx_info ;
2207
2235
struct qed_app_entry * entry ;
2208
- bool ethtype ;
2209
2236
u8 prio = 0 ;
2237
+ u8 sf_ieee ;
2210
2238
int i ;
2211
2239
2240
+ DP_VERBOSE (hwfn , QED_MSG_DCB , "selector = %d protocol = %d\n" ,
2241
+ app -> selector , app -> protocol );
2242
+
2243
+ if (qed_get_sf_ieee_value (app -> selector , & sf_ieee )) {
2244
+ DP_INFO (cdev , "Invalid selector field value %d\n" ,
2245
+ app -> selector );
2246
+ return - EINVAL ;
2247
+ }
2248
+
2212
2249
dcbx_info = qed_dcbnl_get_dcbx (hwfn , QED_DCBX_OPERATIONAL_MIB );
2213
2250
if (!dcbx_info )
2214
2251
return - EINVAL ;
@@ -2219,11 +2256,9 @@ static int qed_dcbnl_ieee_getapp(struct qed_dev *cdev, struct dcb_app *app)
2219
2256
return - EINVAL ;
2220
2257
}
2221
2258
2222
- /* ieee defines the selector field value for ethertype to be 1 */
2223
- ethtype = !!((app -> selector - 1 ) == DCB_APP_IDTYPE_ETHTYPE );
2224
2259
for (i = 0 ; i < QED_DCBX_MAX_APP_PROTOCOL ; i ++ ) {
2225
2260
entry = & dcbx_info -> operational .params .app_entry [i ];
2226
- if ((entry -> ethtype == ethtype ) &&
2261
+ if ((entry -> sf_ieee == sf_ieee ) &&
2227
2262
(entry -> proto_id == app -> protocol )) {
2228
2263
prio = entry -> prio ;
2229
2264
break ;
@@ -2251,14 +2286,22 @@ static int qed_dcbnl_ieee_setapp(struct qed_dev *cdev, struct dcb_app *app)
2251
2286
struct qed_dcbx_set dcbx_set ;
2252
2287
struct qed_app_entry * entry ;
2253
2288
struct qed_ptt * ptt ;
2254
- bool ethtype ;
2289
+ u8 sf_ieee ;
2255
2290
int rc , i ;
2256
2291
2292
+ DP_VERBOSE (hwfn , QED_MSG_DCB , "selector = %d protocol = %d pri = %d\n" ,
2293
+ app -> selector , app -> protocol , app -> priority );
2257
2294
if (app -> priority < 0 || app -> priority >= QED_MAX_PFC_PRIORITIES ) {
2258
2295
DP_INFO (hwfn , "Invalid priority %d\n" , app -> priority );
2259
2296
return - EINVAL ;
2260
2297
}
2261
2298
2299
+ if (qed_get_sf_ieee_value (app -> selector , & sf_ieee )) {
2300
+ DP_INFO (cdev , "Invalid selector field value %d\n" ,
2301
+ app -> selector );
2302
+ return - EINVAL ;
2303
+ }
2304
+
2262
2305
dcbx_info = qed_dcbnl_get_dcbx (hwfn , QED_DCBX_OPERATIONAL_MIB );
2263
2306
if (!dcbx_info )
2264
2307
return - EINVAL ;
@@ -2276,11 +2319,9 @@ static int qed_dcbnl_ieee_setapp(struct qed_dev *cdev, struct dcb_app *app)
2276
2319
if (rc )
2277
2320
return - EINVAL ;
2278
2321
2279
- /* ieee defines the selector field value for ethertype to be 1 */
2280
- ethtype = !!((app -> selector - 1 ) == DCB_APP_IDTYPE_ETHTYPE );
2281
2322
for (i = 0 ; i < QED_DCBX_MAX_APP_PROTOCOL ; i ++ ) {
2282
2323
entry = & dcbx_set .config .params .app_entry [i ];
2283
- if ((entry -> ethtype == ethtype ) &&
2324
+ if ((entry -> sf_ieee == sf_ieee ) &&
2284
2325
(entry -> proto_id == app -> protocol ))
2285
2326
break ;
2286
2327
/* First empty slot */
@@ -2296,7 +2337,7 @@ static int qed_dcbnl_ieee_setapp(struct qed_dev *cdev, struct dcb_app *app)
2296
2337
}
2297
2338
2298
2339
dcbx_set .override_flags |= QED_DCBX_OVERRIDE_APP_CFG ;
2299
- dcbx_set .config .params .app_entry [i ].ethtype = ethtype ;
2340
+ dcbx_set .config .params .app_entry [i ].sf_ieee = sf_ieee ;
2300
2341
dcbx_set .config .params .app_entry [i ].proto_id = app -> protocol ;
2301
2342
dcbx_set .config .params .app_entry [i ].prio = BIT (app -> priority );
2302
2343
0 commit comments