diff --git a/switchapi/es2k/lnw_v3/lnw_nexthop_table.h b/switchapi/es2k/lnw_v3/lnw_nexthop_table.h index 3c841ef..a0839ea 100644 --- a/switchapi/es2k/lnw_v3/lnw_nexthop_table.h +++ b/switchapi/es2k/lnw_v3/lnw_nexthop_table.h @@ -22,7 +22,6 @@ #define LNW_NEXTHOP_TABLE_ACTION_SET_NEXTHOP_LAG \ "linux_networking_control.set_nexthop_lag" -#define LNW_ACTION_SET_NEXTHOP_LAG_PARAM_RIF "router_interface_id" #define LNW_ACTION_SET_NEXTHOP_LAG_PARAM_DMAC_HIGH "dmac_high" #define LNW_ACTION_SET_NEXTHOP_LAG_PARAM_DMAC_LOW "dmac_low" #define LNW_ACTION_SET_NEXTHOP_LAG_PARAM_LAG_ID "lag_group_id" diff --git a/switchapi/es2k/lnw_v3/switch_pd_lag.c b/switchapi/es2k/lnw_v3/switch_pd_lag.c index 27c1d6e..b1b747a 100644 --- a/switchapi/es2k/lnw_v3/switch_pd_lag.c +++ b/switchapi/es2k/lnw_v3/switch_pd_lag.c @@ -470,6 +470,7 @@ switch_status_t switch_pd_tx_lacp_lag_table_entry( tdi_id_t field_id_hash = 0; tdi_id_t action_id = 0; tdi_id_t data_field_id = 0; + tdi_id_t rif_data_field_id = 0; tdi_dev_id_t dev_id = device; @@ -580,6 +581,15 @@ switch_status_t switch_pd_tx_lacp_lag_table_entry( goto dealloc_resources; } + status = tdi_data_field_id_with_action_get( + table_info_hdl, ACTION_SET_EGRESS_PORT_PARAM_ROUTER_INTF_ID, action_id, + &rif_data_field_id); + if (status != TDI_SUCCESS) { + krnlmon_log_error("Unable to get data field id param for: %s, error: %d", + ACTION_SET_EGRESS_PORT_PARAM_EGRESS_PORT, status); + goto dealloc_resources; + } + status = tdi_data_field_id_with_action_get( table_info_hdl, ACTION_SET_EGRESS_PORT_PARAM_EGRESS_PORT, action_id, &data_field_id); @@ -625,6 +635,13 @@ switch_status_t switch_pd_tx_lacp_lag_table_entry( } if (entry_add) { + status = tdi_data_field_set_value(data_hdl, rif_data_field_id, lag_id); + if (status != TDI_SUCCESS) { + krnlmon_log_error("Unable to set action value for ID: %d, error: %d", + data_field_id, status); + goto dealloc_resources; + } + status = tdi_data_field_set_value(data_hdl, data_field_id, egress_port); if (status != TDI_SUCCESS) { krnlmon_log_error("Unable to set action value for ID: %d, error: %d", diff --git a/switchapi/es2k/lnw_v3/switch_pd_routing.c b/switchapi/es2k/lnw_v3/switch_pd_routing.c index 7ca5440..49d248d 100644 --- a/switchapi/es2k/lnw_v3/switch_pd_routing.c +++ b/switchapi/es2k/lnw_v3/switch_pd_routing.c @@ -348,27 +348,9 @@ switch_status_t switch_pd_nexthop_table_entry( goto dealloc_resources; } - status = tdi_data_field_id_with_action_get( - table_info_hdl, LNW_ACTION_SET_NEXTHOP_LAG_PARAM_RIF, 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_NEXTHOP_LAG_PARAM_RIF, status); - goto dealloc_resources; - } - lag_id = api_nexthop_pd_info->rif_handle & ~(SWITCH_HANDLE_TYPE_LAG << SWITCH_HANDLE_TYPE_SHIFT); - status = tdi_data_field_set_value(data_hdl, data_field_id, lag_id); - if (status != TDI_SUCCESS) { - krnlmon_log_error("Unable to set action value for ID: %d, error: %d", - data_field_id, status); - goto dealloc_resources; - } - status = tdi_data_field_id_with_action_get( table_info_hdl, LNW_ACTION_SET_NEXTHOP_LAG_PARAM_DMAC_HIGH, action_id, &data_field_id); diff --git a/switchapi/es2k/switch_pd_p4_name_routing.h b/switchapi/es2k/switch_pd_p4_name_routing.h index af4d063..fc07cee 100644 --- a/switchapi/es2k/switch_pd_p4_name_routing.h +++ b/switchapi/es2k/switch_pd_p4_name_routing.h @@ -70,6 +70,7 @@ #define LNW_TX_LAG_TABLE_ACTION_SET_EGRESS_PORT \ "linux_networking_control.set_egress_port" +#define ACTION_SET_EGRESS_PORT_PARAM_ROUTER_INTF_ID "router_interface_id" #define ACTION_SET_EGRESS_PORT_PARAM_EGRESS_PORT "egress_port" #define LNW_LAG_HASH_SIZE 65536