@@ -671,6 +671,7 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc,
671
671
int blkaddr , ucast_idx , index ;
672
672
struct nix_rx_action action = { 0 };
673
673
u64 relaxed_mask ;
674
+ u8 flow_key_alg ;
674
675
675
676
if (!hw -> cap .nix_rx_multicast && is_cgx_vf (rvu , pcifunc ))
676
677
return ;
@@ -701,6 +702,8 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc,
701
702
action .op = NIX_RX_ACTIONOP_UCAST ;
702
703
}
703
704
705
+ flow_key_alg = action .flow_key_alg ;
706
+
704
707
/* RX_ACTION set to MCAST for CGX PF's */
705
708
if (hw -> cap .nix_rx_multicast && pfvf -> use_mce_list &&
706
709
is_pf_cgxmapped (rvu , rvu_get_pf (pcifunc ))) {
@@ -740,7 +743,7 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc,
740
743
req .vf = pcifunc ;
741
744
req .index = action .index ;
742
745
req .match_id = action .match_id ;
743
- req .flow_key_alg = action . flow_key_alg ;
746
+ req .flow_key_alg = flow_key_alg ;
744
747
745
748
rvu_mbox_handler_npc_install_flow (rvu , & req , & rsp );
746
749
}
@@ -854,6 +857,7 @@ void rvu_npc_install_allmulti_entry(struct rvu *rvu, u16 pcifunc, int nixlf,
854
857
u8 mac_addr [ETH_ALEN ] = { 0 };
855
858
struct nix_rx_action action = { 0 };
856
859
struct rvu_pfvf * pfvf ;
860
+ u8 flow_key_alg ;
857
861
u16 vf_func ;
858
862
859
863
/* Only CGX PF/VF can add allmulticast entry */
@@ -888,6 +892,7 @@ void rvu_npc_install_allmulti_entry(struct rvu *rvu, u16 pcifunc, int nixlf,
888
892
* (u64 * )& action = npc_get_mcam_action (rvu , mcam ,
889
893
blkaddr , ucast_idx );
890
894
895
+ flow_key_alg = action .flow_key_alg ;
891
896
if (action .op != NIX_RX_ACTIONOP_RSS ) {
892
897
* (u64 * )& action = 0 ;
893
898
action .op = NIX_RX_ACTIONOP_UCAST ;
@@ -924,7 +929,7 @@ void rvu_npc_install_allmulti_entry(struct rvu *rvu, u16 pcifunc, int nixlf,
924
929
req .vf = pcifunc | vf_func ;
925
930
req .index = action .index ;
926
931
req .match_id = action .match_id ;
927
- req .flow_key_alg = action . flow_key_alg ;
932
+ req .flow_key_alg = flow_key_alg ;
928
933
929
934
rvu_mbox_handler_npc_install_flow (rvu , & req , & rsp );
930
935
}
@@ -990,11 +995,38 @@ static void npc_update_vf_flow_entry(struct rvu *rvu, struct npc_mcam *mcam,
990
995
mutex_unlock (& mcam -> lock );
991
996
}
992
997
998
+ static void npc_update_rx_action_with_alg_idx (struct rvu * rvu , struct nix_rx_action action ,
999
+ struct rvu_pfvf * pfvf , int mcam_index , int blkaddr ,
1000
+ int alg_idx )
1001
+
1002
+ {
1003
+ struct npc_mcam * mcam = & rvu -> hw -> mcam ;
1004
+ struct rvu_hwinfo * hw = rvu -> hw ;
1005
+ int bank , op_rss ;
1006
+
1007
+ if (!is_mcam_entry_enabled (rvu , mcam , blkaddr , mcam_index ))
1008
+ return ;
1009
+
1010
+ op_rss = (!hw -> cap .nix_rx_multicast || !pfvf -> use_mce_list );
1011
+
1012
+ bank = npc_get_bank (mcam , mcam_index );
1013
+ mcam_index &= (mcam -> banksize - 1 );
1014
+
1015
+ /* If Rx action is MCAST update only RSS algorithm index */
1016
+ if (!op_rss ) {
1017
+ * (u64 * )& action = rvu_read64 (rvu , blkaddr ,
1018
+ NPC_AF_MCAMEX_BANKX_ACTION (mcam_index , bank ));
1019
+
1020
+ action .flow_key_alg = alg_idx ;
1021
+ }
1022
+ rvu_write64 (rvu , blkaddr ,
1023
+ NPC_AF_MCAMEX_BANKX_ACTION (mcam_index , bank ), * (u64 * )& action );
1024
+ }
1025
+
993
1026
void rvu_npc_update_flowkey_alg_idx (struct rvu * rvu , u16 pcifunc , int nixlf ,
994
1027
int group , int alg_idx , int mcam_index )
995
1028
{
996
1029
struct npc_mcam * mcam = & rvu -> hw -> mcam ;
997
- struct rvu_hwinfo * hw = rvu -> hw ;
998
1030
struct nix_rx_action action ;
999
1031
int blkaddr , index , bank ;
1000
1032
struct rvu_pfvf * pfvf ;
@@ -1050,15 +1082,16 @@ void rvu_npc_update_flowkey_alg_idx(struct rvu *rvu, u16 pcifunc, int nixlf,
1050
1082
/* If PF's promiscuous entry is enabled,
1051
1083
* Set RSS action for that entry as well
1052
1084
*/
1053
- if ((!hw -> cap .nix_rx_multicast || !pfvf -> use_mce_list ) &&
1054
- is_mcam_entry_enabled (rvu , mcam , blkaddr , index )) {
1055
- bank = npc_get_bank (mcam , index );
1056
- index &= (mcam -> banksize - 1 );
1085
+ npc_update_rx_action_with_alg_idx (rvu , action , pfvf , index , blkaddr ,
1086
+ alg_idx );
1057
1087
1058
- rvu_write64 (rvu , blkaddr ,
1059
- NPC_AF_MCAMEX_BANKX_ACTION (index , bank ),
1060
- * (u64 * )& action );
1061
- }
1088
+ index = npc_get_nixlf_mcam_index (mcam , pcifunc ,
1089
+ nixlf , NIXLF_ALLMULTI_ENTRY );
1090
+ /* If PF's allmulti entry is enabled,
1091
+ * Set RSS action for that entry as well
1092
+ */
1093
+ npc_update_rx_action_with_alg_idx (rvu , action , pfvf , index , blkaddr ,
1094
+ alg_idx );
1062
1095
}
1063
1096
1064
1097
void npc_enadis_default_mce_entry (struct rvu * rvu , u16 pcifunc ,
0 commit comments