@@ -920,7 +920,7 @@ static void mana_pf_deregister_filter(struct mana_port_context *apc)
920
920
921
921
static int mana_query_device_cfg (struct mana_context * ac , u32 proto_major_ver ,
922
922
u32 proto_minor_ver , u32 proto_micro_ver ,
923
- u16 * max_num_vports )
923
+ u16 * max_num_vports , u8 * bm_hostmode )
924
924
{
925
925
struct gdma_context * gc = ac -> gdma_dev -> gdma_context ;
926
926
struct mana_query_device_cfg_resp resp = {};
@@ -931,7 +931,7 @@ static int mana_query_device_cfg(struct mana_context *ac, u32 proto_major_ver,
931
931
mana_gd_init_req_hdr (& req .hdr , MANA_QUERY_DEV_CONFIG ,
932
932
sizeof (req ), sizeof (resp ));
933
933
934
- req .hdr .resp .msg_version = GDMA_MESSAGE_V2 ;
934
+ req .hdr .resp .msg_version = GDMA_MESSAGE_V3 ;
935
935
936
936
req .proto_major_ver = proto_major_ver ;
937
937
req .proto_minor_ver = proto_minor_ver ;
@@ -955,11 +955,16 @@ static int mana_query_device_cfg(struct mana_context *ac, u32 proto_major_ver,
955
955
956
956
* max_num_vports = resp .max_num_vports ;
957
957
958
- if (resp .hdr .response .msg_version = = GDMA_MESSAGE_V2 )
958
+ if (resp .hdr .response .msg_version > = GDMA_MESSAGE_V2 )
959
959
gc -> adapter_mtu = resp .adapter_mtu ;
960
960
else
961
961
gc -> adapter_mtu = ETH_FRAME_LEN ;
962
962
963
+ if (resp .hdr .response .msg_version >= GDMA_MESSAGE_V3 )
964
+ * bm_hostmode = resp .bm_hostmode ;
965
+ else
966
+ * bm_hostmode = 0 ;
967
+
963
968
debugfs_create_u16 ("adapter-MTU" , 0400 , gc -> mana_pci_debugfs , & gc -> adapter_mtu );
964
969
965
970
return 0 ;
@@ -2439,7 +2444,7 @@ static void mana_destroy_vport(struct mana_port_context *apc)
2439
2444
mana_destroy_txq (apc );
2440
2445
mana_uncfg_vport (apc );
2441
2446
2442
- if (gd -> gdma_context -> is_pf )
2447
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode )
2443
2448
mana_pf_deregister_hw_vport (apc );
2444
2449
}
2445
2450
@@ -2451,7 +2456,7 @@ static int mana_create_vport(struct mana_port_context *apc,
2451
2456
2452
2457
apc -> default_rxobj = INVALID_MANA_HANDLE ;
2453
2458
2454
- if (gd -> gdma_context -> is_pf ) {
2459
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode ) {
2455
2460
err = mana_pf_register_hw_vport (apc );
2456
2461
if (err )
2457
2462
return err ;
@@ -2675,7 +2680,7 @@ int mana_alloc_queues(struct net_device *ndev)
2675
2680
if (err )
2676
2681
goto destroy_vport ;
2677
2682
2678
- if (gd -> gdma_context -> is_pf ) {
2683
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode ) {
2679
2684
err = mana_pf_register_filter (apc );
2680
2685
if (err )
2681
2686
goto destroy_vport ;
@@ -2737,7 +2742,7 @@ static int mana_dealloc_queues(struct net_device *ndev)
2737
2742
2738
2743
mana_chn_setxdp (apc , NULL );
2739
2744
2740
- if (gd -> gdma_context -> is_pf )
2745
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode )
2741
2746
mana_pf_deregister_filter (apc );
2742
2747
2743
2748
/* No packet can be transmitted now since apc->port_is_up is false.
@@ -2978,6 +2983,7 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
2978
2983
struct gdma_context * gc = gd -> gdma_context ;
2979
2984
struct mana_context * ac = gd -> driver_data ;
2980
2985
struct device * dev = gc -> dev ;
2986
+ u8 bm_hostmode = 0 ;
2981
2987
u16 num_ports = 0 ;
2982
2988
int err ;
2983
2989
int i ;
@@ -3004,10 +3010,12 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
3004
3010
goto out ;
3005
3011
3006
3012
err = mana_query_device_cfg (ac , MANA_MAJOR_VERSION , MANA_MINOR_VERSION ,
3007
- MANA_MICRO_VERSION , & num_ports );
3013
+ MANA_MICRO_VERSION , & num_ports , & bm_hostmode );
3008
3014
if (err )
3009
3015
goto out ;
3010
3016
3017
+ ac -> bm_hostmode = bm_hostmode ;
3018
+
3011
3019
if (!resuming ) {
3012
3020
ac -> num_ports = num_ports ;
3013
3021
} else {
0 commit comments