@@ -920,7 +920,7 @@ static void mana_pf_deregister_filter(struct mana_port_context *apc)
920920
921921static int mana_query_device_cfg (struct mana_context * ac , u32 proto_major_ver ,
922922 u32 proto_minor_ver , u32 proto_micro_ver ,
923- u16 * max_num_vports )
923+ u16 * max_num_vports , u8 * bm_hostmode )
924924{
925925 struct gdma_context * gc = ac -> gdma_dev -> gdma_context ;
926926 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,
931931 mana_gd_init_req_hdr (& req .hdr , MANA_QUERY_DEV_CONFIG ,
932932 sizeof (req ), sizeof (resp ));
933933
934- req .hdr .resp .msg_version = GDMA_MESSAGE_V2 ;
934+ req .hdr .resp .msg_version = GDMA_MESSAGE_V3 ;
935935
936936 req .proto_major_ver = proto_major_ver ;
937937 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,
955955
956956 * max_num_vports = resp .max_num_vports ;
957957
958- if (resp .hdr .response .msg_version = = GDMA_MESSAGE_V2 )
958+ if (resp .hdr .response .msg_version > = GDMA_MESSAGE_V2 )
959959 gc -> adapter_mtu = resp .adapter_mtu ;
960960 else
961961 gc -> adapter_mtu = ETH_FRAME_LEN ;
962962
963+ if (resp .hdr .response .msg_version >= GDMA_MESSAGE_V3 )
964+ * bm_hostmode = resp .bm_hostmode ;
965+ else
966+ * bm_hostmode = 0 ;
967+
963968 debugfs_create_u16 ("adapter-MTU" , 0400 , gc -> mana_pci_debugfs , & gc -> adapter_mtu );
964969
965970 return 0 ;
@@ -2439,7 +2444,7 @@ static void mana_destroy_vport(struct mana_port_context *apc)
24392444 mana_destroy_txq (apc );
24402445 mana_uncfg_vport (apc );
24412446
2442- if (gd -> gdma_context -> is_pf )
2447+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode )
24432448 mana_pf_deregister_hw_vport (apc );
24442449}
24452450
@@ -2451,7 +2456,7 @@ static int mana_create_vport(struct mana_port_context *apc,
24512456
24522457 apc -> default_rxobj = INVALID_MANA_HANDLE ;
24532458
2454- if (gd -> gdma_context -> is_pf ) {
2459+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode ) {
24552460 err = mana_pf_register_hw_vport (apc );
24562461 if (err )
24572462 return err ;
@@ -2675,7 +2680,7 @@ int mana_alloc_queues(struct net_device *ndev)
26752680 if (err )
26762681 goto destroy_vport ;
26772682
2678- if (gd -> gdma_context -> is_pf ) {
2683+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode ) {
26792684 err = mana_pf_register_filter (apc );
26802685 if (err )
26812686 goto destroy_vport ;
@@ -2737,7 +2742,7 @@ static int mana_dealloc_queues(struct net_device *ndev)
27372742
27382743 mana_chn_setxdp (apc , NULL );
27392744
2740- if (gd -> gdma_context -> is_pf )
2745+ if (gd -> gdma_context -> is_pf && ! apc -> ac -> bm_hostmode )
27412746 mana_pf_deregister_filter (apc );
27422747
27432748 /* 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)
29782983 struct gdma_context * gc = gd -> gdma_context ;
29792984 struct mana_context * ac = gd -> driver_data ;
29802985 struct device * dev = gc -> dev ;
2986+ u8 bm_hostmode = 0 ;
29812987 u16 num_ports = 0 ;
29822988 int err ;
29832989 int i ;
@@ -3004,10 +3010,12 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
30043010 goto out ;
30053011
30063012 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 );
30083014 if (err )
30093015 goto out ;
30103016
3017+ ac -> bm_hostmode = bm_hostmode ;
3018+
30113019 if (!resuming ) {
30123020 ac -> num_ports = num_ports ;
30133021 } else {
0 commit comments