Skip to content

Commit

Permalink
Address Key_mask issue (#79)
Browse files Browse the repository at this point in the history
* Address Key_mask issue

When table match key fields are of different match types
like EXACT match and LPM match, key mask calculated only
for LPM key, which leads to key match failure.

To mitigate the issue calculating key mask for both EXACT and
LPM key types.

Signed-off-by: Anand Sunkad <[email protected]>

* Update pipe_mgr_dpdk_ctx_util.c

Signed-off-by: Anand Sunkad <[email protected]>
Co-authored-by: Vishnu Swaroop Kumar Sarma, Duddu <[email protected]>
  • Loading branch information
asunkad and swaroopsarma authored Dec 9, 2022
1 parent d811fb1 commit 6ad678c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pipe_mgr/shared/dal/dpdk/pipe_mgr_dpdk_ctx_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ int pipe_mgr_dpdk_encode_match_key_and_mask(
struct pipe_mgr_dpdk_stage_table *stage_table;
struct pipe_mgr_match_key_fields *match_fields;
struct dal_dpdk_table_metadata *meta;
uint64_t mask = (uint64_t)-1;
int status = BF_SUCCESS;
uint32_t offset;
int match_bytes;
Expand Down Expand Up @@ -103,7 +104,11 @@ int pipe_mgr_dpdk_encode_match_key_and_mask(
/* Copy to entry. */
memcpy(&entry->key_mask[offset], (uint8_t *)&val,
match_bytes);
} else if (entry->key_mask) {
memcpy(&entry->key_mask[offset], (uint8_t *)&mask,
match_bytes);
}

match_fields = match_fields->next;
index_2 += match_bytes;
}
Expand Down

0 comments on commit 6ad678c

Please sign in to comment.