Skip to content

Commit

Permalink
Krnlmon fixes for LAG and ECMP defects
Browse files Browse the repository at this point in the history
Modify p4 program mapping file with correct table, key and action names

Signed-off-by: Sandeep N <[email protected]>
  • Loading branch information
n-sandeep committed Nov 23, 2023
1 parent b25515a commit a6ef227
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
8 changes: 5 additions & 3 deletions switchapi/es2k/switch_pd_fdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,12 @@ switch_status_t switch_pd_l2_rx_forward_table_entry(
LNW_L2_FWD_RX_TABLE, (unsigned int)api_l2_rx_info->rif_handle);

status = tdi_action_name_to_id(
table_info_hdl, LNW_L2_FWD_RX_TABLE_ACTION_RX_L2_FWD_LAG, &action_id);
table_info_hdl,
LNW_L2_FWD_RX_TABLE_ACTION_RX_L2_FWD_LAG_AND_RECIRCULATE, &action_id);
if (status != TDI_SUCCESS) {
krnlmon_log_error("Unable to get action allocator ID for: %s, error: %d",
LNW_L2_FWD_RX_TABLE_ACTION_RX_L2_FWD_LAG, status);
krnlmon_log_error(
"Unable to get action allocator ID for: %s, error: %d",
LNW_L2_FWD_RX_TABLE_ACTION_RX_L2_FWD_LAG_AND_RECIRCULATE, status);
goto dealloc_resources;
}

Expand Down
16 changes: 8 additions & 8 deletions switchapi/es2k/switch_pd_lag.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ switch_status_t switch_pd_tx_lag_table_entry(switch_device_t device,
}

status = tdi_data_field_id_with_action_get(
table_info_hdl, LNW_ACTION_SET_EGRESS_PORT_PARAM_EGRESS_PORT, action_id,
table_info_hdl, ACTION_SET_EGRESS_PORT_PARAM_EGRESS_PORT, action_id,
&data_field_id);
if (status != TDI_SUCCESS) {
krnlmon_log_error("Unable to get data field id param for: %s, error: %d",
LNW_ACTION_SET_EGRESS_PORT_PARAM_EGRESS_PORT, status);
ACTION_SET_EGRESS_PORT_PARAM_EGRESS_PORT, status);
goto dealloc_resources;
}

Expand Down Expand Up @@ -346,10 +346,10 @@ switch_status_t switch_pd_rx_lag_table_entry(switch_device_t device,
}

status = tdi_action_name_to_id(
table_info_hdl, LNW_RX_LAG_TABLE_ACTION_SET_EGRESS_PORT, &action_id);
table_info_hdl, LNW_RX_LAG_TABLE_ACTION_FWD_TO_VSI, &action_id);
if (status != TDI_SUCCESS) {
krnlmon_log_error("Unable to get action allocator ID for: %s, error: %d",
LNW_RX_LAG_TABLE_ACTION_SET_EGRESS_PORT, status);
LNW_RX_LAG_TABLE_ACTION_FWD_TO_VSI, status);
goto dealloc_resources;
}

Expand All @@ -362,12 +362,12 @@ switch_status_t switch_pd_rx_lag_table_entry(switch_device_t device,
goto dealloc_resources;
}

status = tdi_data_field_id_with_action_get(
table_info_hdl, LNW_ACTION_SET_EGRESS_PORT_PARAM_EGRESS_PORT, action_id,
&data_field_id);
status = tdi_data_field_id_with_action_get(table_info_hdl,
LNW_ACTION_FWD_TO_VSI_PARAM_PORT,
action_id, &data_field_id);
if (status != TDI_SUCCESS) {
krnlmon_log_error("Unable to get data field id param for: %s, error: %d",
LNW_ACTION_SET_EGRESS_PORT_PARAM_EGRESS_PORT, status);
LNW_ACTION_FWD_TO_VSI_PARAM_PORT, status);
goto dealloc_resources;
}

Expand Down
14 changes: 6 additions & 8 deletions switchapi/es2k/switch_pd_p4_name_mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,18 @@ extern "C" {

#define LNW_L2_FWD_RX_TABLE_ACTION_L2_FWD "linux_networking_control.l2_fwd"
#define LNW_ACTION_L2_FWD_PARAM_PORT "port"
#define LNW_L2_FWD_RX_TABLE_ACTION_RX_L2_FWD_LAG \
"linux_networking_control.rx_l2_fwd_lag_and_recirculate"
#define LNW_L2_FWD_RX_TABLE_ACTION_RX_L2_FWD_LAG_AND_RECIRCULATE \
"linux_networking_control.l2_fwd_lag_and_recirculate"
#define LNW_ACTION_RX_L2_FWD_LAG_PARAM_LAG_ID "lag_group_id"

/* RX_LAG_TABLE */
#define LNW_RX_LAG_TABLE "linux_networking_control.rx_lag_table"

#define LNW_RX_LAG_TABLE_KEY_PORT_ID "vmeta.common.port_id"
#define LNW_RX_LAG_TABLE_KEY_LAG_ID "user_meta.cmeta.lag_group_id"
#define LNW_RX_LAG_TABLE_ACTION_SET_EGRESS_PORT \
"linux_networking_control.set_egress_port"
#define LNW_ACTION_SET_EGRESS_PORT_PARAM_EGRESS_PORT "egress_port"

#define LNW_RX_LAG_TABLE_ACTION_FWD_TO_VSI "linux_networking_control.fwd_to_vsi"
#define LNW_ACTION_SET_EGRESS_PORT_PARAM_PORT "port"
#define LNW_ACTION_FWD_TO_VSI_PARAM_PORT "port"

// NOP TODO
/* L2_FWD_RX_WITH_TUNNEL_TABLE */
Expand Down Expand Up @@ -177,8 +174,7 @@ extern "C" {
#define LNW_ECMP_HASH_TABLE_KEY_HOST_INFO_TX_EXT_FLEX \
"user_meta.cmeta.flex[15:0]"
#define LNW_ECMP_HASH_TABLE_KEY_META_COMMON_HASH "vmeta.common.hash[2:0]"
#define LNW_ECMP_HASH_TABLE_KEY_USER_META_BIT32_ZEROS \
"user_meta.cmeta.bit32_zeros[15:3]"
#define LNW_ECMP_HASH_TABLE_KEY_ZERO_PADDING "zero_padding"

#define LNW_ECMP_HASH_TABLE_ACTION_SET_NEXTHOP_ID \
"linux_networking_control.set_nexthop_id"
Expand All @@ -198,6 +194,8 @@ extern "C" {
#define LNW_TX_LAG_TABLE_ACTION_SET_EGRESS_PORT \
"linux_networking_control.set_egress_port"

#define ACTION_SET_EGRESS_PORT_PARAM_EGRESS_PORT "egress_port"

#define LNW_LAG_HASH_SIZE 65536

/* Only 3 bits is allocated for hash size per group in LNW.p4
Expand Down
8 changes: 4 additions & 4 deletions switchapi/es2k/switch_pd_routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1613,12 +1613,12 @@ switch_status_t switch_pd_ecmp_hash_table_entry(
goto dealloc_resources;
}

status = tdi_key_field_id_get(table_info_hdl,
LNW_ECMP_HASH_TABLE_KEY_USER_META_BIT32_ZEROS,
&field_id_meta_bit32_zero);
status =
tdi_key_field_id_get(table_info_hdl, LNW_ECMP_HASH_TABLE_KEY_ZERO_PADDING,
&field_id_meta_bit32_zero);
if (status != TDI_SUCCESS) {
krnlmon_log_error("Unable to get field ID for key: %s, error: %d",
LNW_ECMP_HASH_TABLE_KEY_USER_META_BIT32_ZEROS, status);
LNW_ECMP_HASH_TABLE_KEY_ZERO_PADDING, status);
goto dealloc_resources;
}

Expand Down

0 comments on commit a6ef227

Please sign in to comment.