Skip to content

Commit

Permalink
Remove Linux Networking v2 from krnlmon codebase (#148)
Browse files Browse the repository at this point in the history
- Remove Linux Networking v2 from krnlmon codebase
- Remove //flags:lnw_version from bazel build (#149)

Signed-off-by: Sabeel Ansari <[email protected]>
Signed-off-by: Derek Foster <[email protected]>
Co-authored-by: Derek G Foster <[email protected]>
  • Loading branch information
5abeel and ffoulkes authored Jun 26, 2024
1 parent a0dd430 commit d62ee15
Show file tree
Hide file tree
Showing 18 changed files with 6 additions and 2,906 deletions.
8 changes: 0 additions & 8 deletions bazel/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,3 @@ TARGET_DEFINES = select(
},
no_match_error = NO_MATCH_ERROR,
)

LNW_DEFINES = select(
{
"//flags:lnw_v2": ["LNW_V2"],
"//flags:lnw_v3": ["LNW_V3"],
"//conditions:default": [],
},
)
4 changes: 2 additions & 2 deletions bazel/rules/library_rule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: Apache-2.0

load("@rules_cc//cc:defs.bzl", "cc_library")
load("//bazel:defs.bzl", "LNW_DEFINES", "TARGET_DEFINES")
load("//bazel:defs.bzl", "TARGET_DEFINES")

def krnlmon_cc_library(
name,
Expand All @@ -31,7 +31,7 @@ def krnlmon_cc_library(
hdrs = hdrs,
# alwayslink = alwayslink,
copts = copts,
defines = TARGET_DEFINES + LNW_DEFINES + defines,
defines = TARGET_DEFINES + defines,
include_prefix = include_prefix,
includes = includes,
strip_include_prefix = strip_include_prefix,
Expand Down
28 changes: 0 additions & 28 deletions bazel/rules/lnw_version_flag.bzl

This file was deleted.

5 changes: 0 additions & 5 deletions cmake/standalone.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ if(absl_VERSION VERSION_GREATER_EQUAL "20230125")
add_compile_definitions(ABSL_LEGACY_THREAD_ANNOTATIONS)
endif()

#-----------------------------------------------------------------------
# Linux Networking version
#-----------------------------------------------------------------------
include(LnwVersion)

#-----------------------------------------------------------------------
# Compiler settings
#-----------------------------------------------------------------------
Expand Down
26 changes: 0 additions & 26 deletions flags/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package(default_visibility = ["//visibility:public"])

load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("//bazel:rules/lnw_version_flag.bzl", "lnw_version_flag")

# Define "--//flags:ovs" command-line flag
bool_flag(
Expand Down Expand Up @@ -37,28 +36,3 @@ config_setting(
"target": "es2k",
},
)

lnw_version_flag(
name = "lnw_version",
build_setting_default = 3,
)

config_setting(
name = "lnw_v2",
define_values = {
"target": "es2k",
},
flag_values = {
"lnw_version": "2",
},
)

config_setting(
name = "lnw_v3",
define_values = {
"target": "es2k",
},
flag_values = {
"lnw_version": "3",
},
)
15 changes: 3 additions & 12 deletions switchapi/es2k/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,11 @@ load("//bazel:rules.bzl", "krnlmon_cc_library")

package(default_visibility = ["//visibility:public"])

SWITCH_PD_LAG = select({
"//flags:lnw_v2": ["//switchapi/es2k/lnw_v2:switch_pd_lag"],
"//flags:lnw_v3": ["//switchapi/es2k/lnw_v3:switch_pd_lag"],
})
SWITCH_PD_LAG = ["//switchapi/es2k/lnw_v3:switch_pd_lag"]

SWITCH_PD_LAG_HDR = select({
"//flags:lnw_v2": ["//switchapi/es2k/lnw_v2:switch_pd_lag_hdr"],
"//flags:lnw_v3": ["//switchapi/es2k/lnw_v3:switch_pd_lag_hdr"],
})
SWITCH_PD_LAG_HDR = ["//switchapi/es2k/lnw_v3:switch_pd_lag_hdr"]

SWITCH_PD_ROUTING = select({
"//flags:lnw_v2": ["//switchapi/es2k/lnw_v2:switch_pd_routing"],
"//flags:lnw_v3": ["//switchapi/es2k/lnw_v3:switch_pd_routing"],
})
SWITCH_PD_ROUTING = ["//switchapi/es2k/lnw_v3:switch_pd_routing"]

krnlmon_cc_library(
name = "switch_config",
Expand Down
6 changes: 1 addition & 5 deletions switchapi/es2k/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ target_sources(switchapi_o PRIVATE
switchapi_utils.c
)

if(LNW_V2)
add_subdirectory(lnw_v2)
elseif(LNW_V3)
add_subdirectory(lnw_v3)
endif()
add_subdirectory(lnw_v3)

target_link_libraries(switchapi_o PRIVATE
sde::tdi
Expand Down
44 changes: 0 additions & 44 deletions switchapi/es2k/lnw_v2/BUILD.bazel

This file was deleted.

13 changes: 0 additions & 13 deletions switchapi/es2k/lnw_v2/CMakeLists.txt

This file was deleted.

27 changes: 0 additions & 27 deletions switchapi/es2k/lnw_v2/lnw_ecmp_hash_table.h

This file was deleted.

20 changes: 0 additions & 20 deletions switchapi/es2k/lnw_v2/lnw_neighbor_mod_table.h

This file was deleted.

27 changes: 0 additions & 27 deletions switchapi/es2k/lnw_v2/lnw_nexthop_table.h

This file was deleted.

Loading

0 comments on commit d62ee15

Please sign in to comment.