@@ -921,7 +921,7 @@ static void mana_pf_deregister_filter(struct mana_port_context *apc)
921
921
922
922
static int mana_query_device_cfg (struct mana_context * ac , u32 proto_major_ver ,
923
923
u32 proto_minor_ver , u32 proto_micro_ver ,
924
- u16 * max_num_vports )
924
+ u16 * max_num_vports , u8 * bm_hostmode )
925
925
{
926
926
struct gdma_context * gc = ac -> gdma_dev -> gdma_context ;
927
927
struct mana_query_device_cfg_resp resp = {};
@@ -932,7 +932,7 @@ static int mana_query_device_cfg(struct mana_context *ac, u32 proto_major_ver,
932
932
mana_gd_init_req_hdr (& req .hdr , MANA_QUERY_DEV_CONFIG ,
933
933
sizeof (req ), sizeof (resp ));
934
934
935
- req .hdr .resp .msg_version = GDMA_MESSAGE_V2 ;
935
+ req .hdr .resp .msg_version = GDMA_MESSAGE_V3 ;
936
936
937
937
req .proto_major_ver = proto_major_ver ;
938
938
req .proto_minor_ver = proto_minor_ver ;
@@ -956,11 +956,16 @@ static int mana_query_device_cfg(struct mana_context *ac, u32 proto_major_ver,
956
956
957
957
* max_num_vports = resp .max_num_vports ;
958
958
959
- if (resp .hdr .response .msg_version = = GDMA_MESSAGE_V2 )
959
+ if (resp .hdr .response .msg_version > = GDMA_MESSAGE_V2 )
960
960
gc -> adapter_mtu = resp .adapter_mtu ;
961
961
else
962
962
gc -> adapter_mtu = ETH_FRAME_LEN ;
963
963
964
+ if (resp .hdr .response .msg_version >= GDMA_MESSAGE_V3 )
965
+ * bm_hostmode = resp .bm_hostmode ;
966
+ else
967
+ * bm_hostmode = 0 ;
968
+
964
969
debugfs_create_u16 ("adapter-MTU" , 0400 , gc -> mana_pci_debugfs , & gc -> adapter_mtu );
965
970
966
971
return 0 ;
@@ -2441,7 +2446,7 @@ static void mana_destroy_vport(struct mana_port_context *apc)
2441
2446
mana_destroy_txq (apc );
2442
2447
mana_uncfg_vport (apc );
2443
2448
2444
- if (gd -> gdma_context -> is_pf )
2449
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode )
2445
2450
mana_pf_deregister_hw_vport (apc );
2446
2451
}
2447
2452
@@ -2453,7 +2458,7 @@ static int mana_create_vport(struct mana_port_context *apc,
2453
2458
2454
2459
apc -> default_rxobj = INVALID_MANA_HANDLE ;
2455
2460
2456
- if (gd -> gdma_context -> is_pf ) {
2461
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode ) {
2457
2462
err = mana_pf_register_hw_vport (apc );
2458
2463
if (err )
2459
2464
return err ;
@@ -2689,7 +2694,7 @@ int mana_alloc_queues(struct net_device *ndev)
2689
2694
goto destroy_vport ;
2690
2695
}
2691
2696
2692
- if (gd -> gdma_context -> is_pf ) {
2697
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode ) {
2693
2698
err = mana_pf_register_filter (apc );
2694
2699
if (err )
2695
2700
goto destroy_vport ;
@@ -2751,7 +2756,7 @@ static int mana_dealloc_queues(struct net_device *ndev)
2751
2756
2752
2757
mana_chn_setxdp (apc , NULL );
2753
2758
2754
- if (gd -> gdma_context -> is_pf )
2759
+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode )
2755
2760
mana_pf_deregister_filter (apc );
2756
2761
2757
2762
/* No packet can be transmitted now since apc->port_is_up is false.
@@ -2998,6 +3003,7 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
2998
3003
struct gdma_context * gc = gd -> gdma_context ;
2999
3004
struct mana_context * ac = gd -> driver_data ;
3000
3005
struct device * dev = gc -> dev ;
3006
+ u8 bm_hostmode = 0 ;
3001
3007
u16 num_ports = 0 ;
3002
3008
int err ;
3003
3009
int i ;
@@ -3026,10 +3032,12 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
3026
3032
}
3027
3033
3028
3034
err = mana_query_device_cfg (ac , MANA_MAJOR_VERSION , MANA_MINOR_VERSION ,
3029
- MANA_MICRO_VERSION , & num_ports );
3035
+ MANA_MICRO_VERSION , & num_ports , & bm_hostmode );
3030
3036
if (err )
3031
3037
goto out ;
3032
3038
3039
+ ac -> bm_hostmode = bm_hostmode ;
3040
+
3033
3041
if (!resuming ) {
3034
3042
ac -> num_ports = num_ports ;
3035
3043
} else {
0 commit comments