Skip to content

Commit

Permalink
Combine versions of switch_pd_p4_name_routing.h (#136)
Browse files Browse the repository at this point in the history
- As a result of the preceding extractions, the LNWv2 and LNWv3
  versions of switch_pd_p4_name_routing.h are identical. Moved
  the header file to the switchapi/es2k folder.

Signed-off-by: Derek Foster <[email protected]>
  • Loading branch information
ffoulkes authored May 29, 2024
1 parent 79e9b5b commit e3ed10d
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 125 deletions.
2 changes: 2 additions & 0 deletions switchapi/es2k/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ target_sources(switchapi_o PRIVATE
switch_pd_fdb.c
switch_pd_lag.h
switch_pd_p4_name_mapping.h
switch_pd_p4_name_routing.h
switch_pd_routing.h
switch_pd_tunnel.c
switch_pd_utils.c
switch_pd_utils.h
Expand Down
1 change: 0 additions & 1 deletion switchapi/es2k/lnw_v2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ target_sources(switchapi_o PRIVATE
lnw_nexthop_table.h
switch_pd_lag.c
switch_pd_lag.h
switch_pd_p4_name_routing.h
switch_pd_routing.c
)
1 change: 1 addition & 0 deletions switchapi/es2k/lnw_v2/switch_pd_lag.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "switch_pd_lag.h"

#include "switchapi/es2k/switch_pd_p4_name_mapping.h"
#include "switchapi/es2k/switch_pd_p4_name_routing.h"
#include "switchapi/es2k/switch_pd_utils.h"
#include "switchapi/switch_internal.h"
#include "switchapi/switch_lag.h"
Expand Down
1 change: 1 addition & 0 deletions switchapi/es2k/lnw_v2/switch_pd_routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "switchapi/es2k/lnw_v2/lnw_neighbor_mod_table.h"
#include "switchapi/es2k/lnw_v2/lnw_nexthop_table.h"
#include "switchapi/es2k/switch_pd_p4_name_mapping.h"
#include "switchapi/es2k/switch_pd_p4_name_routing.h"
#include "switchapi/es2k/switch_pd_utils.h"
#include "switchapi/switch_base_types.h"
#include "switchapi/switch_internal.h"
Expand Down
1 change: 0 additions & 1 deletion switchapi/es2k/lnw_v3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ target_sources(switchapi_o PRIVATE
lnw_nexthop_table.h
switch_pd_lag.c
switch_pd_lag.h
switch_pd_p4_name_routing.h
switch_pd_routing.c
)
1 change: 1 addition & 0 deletions switchapi/es2k/lnw_v3/switch_pd_lag.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "switch_pd_lag.h"

#include "switchapi/es2k/switch_pd_p4_name_mapping.h"
#include "switchapi/es2k/switch_pd_p4_name_routing.h"
#include "switchapi/es2k/switch_pd_utils.h"
#include "switchapi/switch_internal.h"
#include "switchapi/switch_lag.h"
Expand Down
112 changes: 0 additions & 112 deletions switchapi/es2k/lnw_v3/switch_pd_p4_name_routing.h

This file was deleted.

1 change: 1 addition & 0 deletions switchapi/es2k/lnw_v3/switch_pd_routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "switchapi/es2k/lnw_v3/lnw_ecmp_nexthop_table.h"
#include "switchapi/es2k/lnw_v3/lnw_nexthop_table.h"
#include "switchapi/es2k/switch_pd_p4_name_mapping.h"
#include "switchapi/es2k/switch_pd_p4_name_routing.h"
#include "switchapi/es2k/switch_pd_utils.h"
#include "switchapi/switch_base_types.h"
#include "switchapi/switch_internal.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* limitations under the License.
*/

#ifndef __SWITCH_PD_P4_NAME_ROUTING_MAPPING__
#define __SWITCH_PD_P4_NAME_ROUTING_MAPPING__
#ifndef __SWITCH_PD_P4_NAME_ROUTING_H__
#define __SWITCH_PD_P4_NAME_ROUTING_H__

#define LNW_KEY_MATCH_PRIORITY "$MATCH_PRIORITY"
/* List of tables and corresponding actions */
Expand Down Expand Up @@ -109,4 +109,4 @@
#define LNW_IPV6_TABLE_ACTION_ECMP_V6_HASH_ACTION \
"linux_networking_control.ecmp_v6_hash_action"

#endif /* __SWITCH_PD_P4_NAME_ROUTING_MAPPING__ */
#endif /* __SWITCH_PD_P4_NAME_ROUTING_H__ */
9 changes: 1 addition & 8 deletions switchapi/es2k/switch_pd_routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@
#ifndef __SWITCH_PD_ROUTING_H__
#define __SWITCH_PD_ROUTING_H__

#if defined(LNW_V2)
#include "switchapi/es2k/lnw_v2/switch_pd_p4_name_routing.h"
#elif defined(LNW_V3)
#include "switchapi/es2k/lnw_v3/switch_pd_p4_name_routing.h"
#else
#error "ASSERT: Unknown LNW version!"
#endif

#include "switch_pd_p4_name_routing.h"
#include "switchapi/switch_base_types.h"
#include "switchapi/switch_handle.h"
#include "switchapi/switch_l3.h"
Expand Down

0 comments on commit e3ed10d

Please sign in to comment.