20
20
#define RSVD_MCAM_ENTRIES_PER_NIXLF 1 /* Ucast for LFs */
21
21
22
22
#define NPC_PARSE_RESULT_DMAC_OFFSET 8
23
- #define NPC_HW_TSTAMP_OFFSET 8
23
+ #define NPC_HW_TSTAMP_OFFSET 8ULL
24
24
#define NPC_KEX_CHAN_MASK 0xFFFULL
25
25
#define NPC_KEX_PF_FUNC_MASK 0xFFFFULL
26
26
@@ -915,7 +915,7 @@ void rvu_npc_enable_allmulti_entry(struct rvu *rvu, u16 pcifunc, int nixlf,
915
915
static void npc_update_vf_flow_entry (struct rvu * rvu , struct npc_mcam * mcam ,
916
916
int blkaddr , u16 pcifunc , u64 rx_action )
917
917
{
918
- int actindex , index , bank ;
918
+ int actindex , index , bank , entry ;
919
919
bool enable ;
920
920
921
921
if (!(pcifunc & RVU_PFVF_FUNC_MASK ))
@@ -926,7 +926,7 @@ static void npc_update_vf_flow_entry(struct rvu *rvu, struct npc_mcam *mcam,
926
926
if (mcam -> entry2target_pffunc [index ] == pcifunc ) {
927
927
bank = npc_get_bank (mcam , index );
928
928
actindex = index ;
929
- index &= (mcam -> banksize - 1 );
929
+ entry = index & (mcam -> banksize - 1 );
930
930
931
931
/* read vf flow entry enable status */
932
932
enable = is_mcam_entry_enabled (rvu , mcam , blkaddr ,
@@ -936,7 +936,7 @@ static void npc_update_vf_flow_entry(struct rvu *rvu, struct npc_mcam *mcam,
936
936
false);
937
937
/* update 'action' */
938
938
rvu_write64 (rvu , blkaddr ,
939
- NPC_AF_MCAMEX_BANKX_ACTION (index , bank ),
939
+ NPC_AF_MCAMEX_BANKX_ACTION (entry , bank ),
940
940
rx_action );
941
941
if (enable )
942
942
npc_enable_mcam_entry (rvu , mcam , blkaddr ,
@@ -2020,14 +2020,15 @@ int rvu_npc_init(struct rvu *rvu)
2020
2020
2021
2021
/* Enable below for Rx pkts.
2022
2022
* - Outer IPv4 header checksum validation.
2023
- * - Detect outer L2 broadcast address and set NPC_RESULT_S[L2M].
2023
+ * - Detect outer L2 broadcast address and set NPC_RESULT_S[L2B].
2024
+ * - Detect outer L2 multicast address and set NPC_RESULT_S[L2M].
2024
2025
* - Inner IPv4 header checksum validation.
2025
2026
* - Set non zero checksum error code value
2026
2027
*/
2027
2028
rvu_write64 (rvu , blkaddr , NPC_AF_PCK_CFG ,
2028
2029
rvu_read64 (rvu , blkaddr , NPC_AF_PCK_CFG ) |
2029
- BIT_ULL ( 32 ) | BIT_ULL ( 24 ) | BIT_ULL ( 6 ) |
2030
- BIT_ULL (2 ) | BIT_ULL (1 ));
2030
+ (( u64 ) NPC_EC_OIP4_CSUM << 32 ) | ( NPC_EC_IIP4_CSUM << 24 ) |
2031
+ BIT_ULL (7 ) | BIT_ULL ( 6 ) | BIT_ULL ( 2 ) | BIT_ULL (1 ));
2031
2032
2032
2033
rvu_npc_setup_interfaces (rvu , blkaddr );
2033
2034
@@ -2154,7 +2155,7 @@ static void npc_unmap_mcam_entry_and_cntr(struct rvu *rvu,
2154
2155
int blkaddr , u16 entry , u16 cntr )
2155
2156
{
2156
2157
u16 index = entry & (mcam -> banksize - 1 );
2157
- u16 bank = npc_get_bank (mcam , entry );
2158
+ u32 bank = npc_get_bank (mcam , entry );
2158
2159
2159
2160
/* Remove mapping and reduce counter's refcnt */
2160
2161
mcam -> entry2cntr_map [entry ] = NPC_MCAM_INVALID_MAP ;
@@ -2777,8 +2778,8 @@ int rvu_mbox_handler_npc_mcam_shift_entry(struct rvu *rvu,
2777
2778
struct npc_mcam * mcam = & rvu -> hw -> mcam ;
2778
2779
u16 pcifunc = req -> hdr .pcifunc ;
2779
2780
u16 old_entry , new_entry ;
2781
+ int blkaddr , rc = 0 ;
2780
2782
u16 index , cntr ;
2781
- int blkaddr , rc ;
2782
2783
2783
2784
blkaddr = rvu_get_blkaddr (rvu , BLKTYPE_NPC , 0 );
2784
2785
if (blkaddr < 0 )
@@ -2979,10 +2980,11 @@ int rvu_mbox_handler_npc_mcam_unmap_counter(struct rvu *rvu,
2979
2980
index = find_next_bit (mcam -> bmap , mcam -> bmap_entries , entry );
2980
2981
if (index >= mcam -> bmap_entries )
2981
2982
break ;
2983
+ entry = index + 1 ;
2984
+
2982
2985
if (mcam -> entry2cntr_map [index ] != req -> cntr )
2983
2986
continue ;
2984
2987
2985
- entry = index + 1 ;
2986
2988
npc_unmap_mcam_entry_and_cntr (rvu , mcam , blkaddr ,
2987
2989
index , req -> cntr );
2988
2990
}
0 commit comments