@@ -925,7 +925,7 @@ static void mana_pf_deregister_filter(struct mana_port_context *apc)
925
925
926
926
static int mana_query_device_cfg (struct mana_context * ac , u32 proto_major_ver ,
927
927
u32 proto_minor_ver , u32 proto_micro_ver ,
928
- u16 * max_num_vports )
928
+ u16 * max_num_vports , u8 * bm_hostmode )
929
929
{
930
930
struct gdma_context * gc = ac -> gdma_dev -> gdma_context ;
931
931
struct mana_query_device_cfg_resp resp = {};
@@ -936,7 +936,7 @@ static int mana_query_device_cfg(struct mana_context *ac, u32 proto_major_ver,
936
936
mana_gd_init_req_hdr (& req .hdr , MANA_QUERY_DEV_CONFIG ,
937
937
sizeof (req ), sizeof (resp ));
938
938
939
- req .hdr .resp .msg_version = GDMA_MESSAGE_V2 ;
939
+ req .hdr .resp .msg_version = GDMA_MESSAGE_V3 ;
940
940
941
941
req .proto_major_ver = proto_major_ver ;
942
942
req .proto_minor_ver = proto_minor_ver ;
@@ -960,11 +960,16 @@ static int mana_query_device_cfg(struct mana_context *ac, u32 proto_major_ver,
960
960
961
961
* max_num_vports = resp .max_num_vports ;
962
962
963
- if (resp .hdr .response .msg_version = = GDMA_MESSAGE_V2 )
963
+ if (resp .hdr .response .msg_version > = GDMA_MESSAGE_V2 )
964
964
gc -> adapter_mtu = resp .adapter_mtu ;
965
965
else
966
966
gc -> adapter_mtu = ETH_FRAME_LEN ;
967
967
968
+ if (resp .hdr .response .msg_version >= GDMA_MESSAGE_V3 )
969
+ * bm_hostmode = resp .bm_hostmode ;
970
+ else
971
+ * bm_hostmode = 0 ;
972
+
968
973
debugfs_create_u16 ("adapter-MTU" , 0400 , gc -> mana_pci_debugfs , & gc -> adapter_mtu );
969
974
970
975
return 0 ;
@@ -2450,7 +2455,7 @@ static void mana_destroy_vport(struct mana_port_context *apc)
2450
2455
mana_destroy_txq (apc );
2451
2456
mana_uncfg_vport (apc );
2452
2457
2453
- if (gd -> gdma_context -> is_pf )
2458
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode )
2454
2459
mana_pf_deregister_hw_vport (apc );
2455
2460
}
2456
2461
@@ -2462,7 +2467,7 @@ static int mana_create_vport(struct mana_port_context *apc,
2462
2467
2463
2468
apc -> default_rxobj = INVALID_MANA_HANDLE ;
2464
2469
2465
- if (gd -> gdma_context -> is_pf ) {
2470
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode ) {
2466
2471
err = mana_pf_register_hw_vport (apc );
2467
2472
if (err )
2468
2473
return err ;
@@ -2686,7 +2691,7 @@ int mana_alloc_queues(struct net_device *ndev)
2686
2691
if (err )
2687
2692
goto destroy_vport ;
2688
2693
2689
- if (gd -> gdma_context -> is_pf ) {
2694
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode ) {
2690
2695
err = mana_pf_register_filter (apc );
2691
2696
if (err )
2692
2697
goto destroy_vport ;
@@ -2748,7 +2753,7 @@ static int mana_dealloc_queues(struct net_device *ndev)
2748
2753
2749
2754
mana_chn_setxdp (apc , NULL );
2750
2755
2751
- if (gd -> gdma_context -> is_pf )
2756
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode )
2752
2757
mana_pf_deregister_filter (apc );
2753
2758
2754
2759
/* No packet can be transmitted now since apc->port_is_up is false.
@@ -2989,6 +2994,7 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
2989
2994
struct gdma_context * gc = gd -> gdma_context ;
2990
2995
struct mana_context * ac = gd -> driver_data ;
2991
2996
struct device * dev = gc -> dev ;
2997
+ u8 bm_hostmode = 0 ;
2992
2998
u16 num_ports = 0 ;
2993
2999
int err ;
2994
3000
int i ;
@@ -3015,10 +3021,12 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
3015
3021
goto out ;
3016
3022
3017
3023
err = mana_query_device_cfg (ac , MANA_MAJOR_VERSION , MANA_MINOR_VERSION ,
3018
- MANA_MICRO_VERSION , & num_ports );
3024
+ MANA_MICRO_VERSION , & num_ports , & bm_hostmode );
3019
3025
if (err )
3020
3026
goto out ;
3021
3027
3028
+ ac -> bm_hostmode = bm_hostmode ;
3029
+
3022
3030
if (!resuming ) {
3023
3031
ac -> num_ports = num_ports ;
3024
3032
} else {
0 commit comments