-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Krnlmon changes to support linux_networking-v3 (Combined Recipe) #84
Conversation
This is a draft PR and not ready for review. This will be ready for review one combined recipe P4 is tested on hardware |
a222c07
to
6c01b4c
Compare
Signed-off-by: nupuruttarwar <[email protected]>
4f3537c
to
5d56747
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. I've noted some things I think should be addressed before this PR is merged.
switchapi/es2k/CMakeLists.txt
Outdated
@@ -3,7 +3,9 @@ | |||
# Copyright 2022-2023 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright date?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You modified this file, so the end date should be changed to 2024.
switchapi/es2k/CMakeLists.txt
Outdated
@@ -28,8 +26,10 @@ add_library(switchapi_target_o OBJECT | |||
switch_tunnel.c | |||
switch_vrf.c | |||
switchapi_utils.c | |||
$<TARGET_OBJECTS:switchapi_lnwv3_target_o> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this. You've specified it in the parent folder's cmake listfile.
switchapi/es2k/lnw_v3/CMakeLists.txt
Outdated
@@ -0,0 +1,26 @@ | |||
# CMake build file for krnlmon/switchapi/es2k | |||
# | |||
# Copyright 2022-2023 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Copyright 2022-2023 Intel Corporation | |
# Copyright 2022-2024 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You modified this file after copying it, so the end copyright date should be 2024.
#ifndef __SWITCH_PD_P4_NAME_ROUTING_MAPPING__ | ||
#define __SWITCH_PD_P4_NAME_ROUTING_MAPPING__ | ||
|
||
#ifdef __cplusplus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The
extern "C"
isn't needed. This file defines preprocessor symbols, which are are the same for both C and C++. - The end-of-line comment on the #endif is unnecessary. We're only conditionalizing one line; there's no confusion over which condition we're closing; and extra text adds visual noise and makes the line within the conditional harder to read.
I've been removing the comment from the #endifs (and deleting the occasional superfluous extern "C"
) as I work on files.
"linux_networking_control.ecmp_v6_hash_action" | ||
|
||
#ifdef __cplusplus | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Should be removed, along with the superfluous
extern "C"
. - I generally include an end-of-line comment on the closing brace (
// extern "C"
), to make it clear what kind of block we're closing. I do something similar for namespaces in C++.
This is another change I've been making as I edit files.
switchapi/es2k/switch_nhop.c
Outdated
@@ -18,7 +18,7 @@ | |||
|
|||
#include "switchapi/switch_nhop.h" | |||
|
|||
#include "switch_pd_routing.h" | |||
#include "switchapi/es2k/lnw_v3/switch_pd_routing.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "switchapi/es2k/lnw_v3/switch_pd_routing.h" | |
#include "switch_pd_routing.h" |
switchapi/es2k/switch_lag.c
Outdated
@@ -18,7 +18,7 @@ | |||
|
|||
#include "ipu_types/ipu_types.h" | |||
#include "switch_pd_utils.h" | |||
#include "switchapi/es2k/switch_pd_lag.h" | |||
#include "switchapi/es2k/lnw_v3/switch_pd_lag.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "switchapi/es2k/lnw_v3/switch_pd_lag.h" | |
#include "lnw_v3/switch_pd_lag.h" |
If there is more than one occurrence, we should consider creating a wrapper file. Or, better still, define a common interface to the different implementations of switch_pd_lag.c
.
@@ -135,7 +135,7 @@ | |||
#define LNW_L2_FWD_TX_TABLE_KEY_BRIDGE_ID "user_meta.pmeta.bridge_id" | |||
#define LNW_L2_FWD_TX_TABLE_KEY_DST_MAC "dst_mac" | |||
|
|||
#define LNW_L2_FWD_TX_TABLE_ACTION_L2_FWD "linux_networking_control.l2_fwd" | |||
#define LNW_L2_FWD_TX_TABLE_ACTION_L2_FWD "linux_networking_control.l2_fwd_tx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Danger, Will Robinson! Non-obvious breaking change between V2 and V3!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was changed for debug purposes, will change it back to l2_fwd. Thanks for pointing it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Okay.
@nupuruttarwar If you bracket any V3-specific changes in common code with |
80554be
to
69241ad
Compare
…in branch Signed-off-by: nupuruttarwar <[email protected]>
69241ad
to
60094cf
Compare
fa733a8
to
ea56f08
Compare
e010344
to
dded0ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
switchapi/es2k/CMakeLists.txt
Outdated
@@ -3,7 +3,9 @@ | |||
# Copyright 2022-2023 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You modified this file, so the end date should be changed to 2024.
switchapi/es2k/lnw_v3/CMakeLists.txt
Outdated
@@ -0,0 +1,26 @@ | |||
# CMake build file for krnlmon/switchapi/es2k | |||
# | |||
# Copyright 2022-2023 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You modified this file after copying it, so the end copyright date should be 2024.
@@ -135,7 +135,7 @@ | |||
#define LNW_L2_FWD_TX_TABLE_KEY_BRIDGE_ID "user_meta.pmeta.bridge_id" | |||
#define LNW_L2_FWD_TX_TABLE_KEY_DST_MAC "dst_mac" | |||
|
|||
#define LNW_L2_FWD_TX_TABLE_ACTION_L2_FWD "linux_networking_control.l2_fwd" | |||
#define LNW_L2_FWD_TX_TABLE_ACTION_L2_FWD "linux_networking_control.l2_fwd_tx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Okay.
Something I failed to mention: It would have been appropriate to provide a CL comment that provided more detail on the nature of the changes, and any limitations; primarily for the benefit of the reviewers. This would mention the intention to provide side-by-side support for V2 and V3 (in a subsequent update), and to update the Bazel build (also in a subsequent update). It's a way of capturing the information and sharing it with the rest of the team. |
dded0ab
to
861f456
Compare
This PR inroduces support for linux networking version V3 which addresses scalability issues in V2 version. Mainly tunnel and and forwarding tables are moved to be exact match type to provide a scale of upto 1M entries. And lag and ecmp tables are moved to WCM since scale of 1K is enough for these cases. We have conditionalized V2 code under LNW_V2 and V3 code under LNW_V3. The intention is to provide side-by-side support for V2 and V3. Also, Bazel build will be updated for V3 codebase in a subsequent update. Once V3 version is stable, plan is to deprecate V2 version Signed-off-by: nupuruttarwar <[email protected]>
861f456
to
9641887
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.