Skip to content
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

Merged
merged 5 commits into from
Apr 2, 2024

Conversation

nupuruttarwar
Copy link
Contributor

No description provided.

@nupuruttarwar
Copy link
Contributor Author

This is a draft PR and not ready for review. This will be ready for review one combined recipe P4 is tested on hardware

@nupuruttarwar nupuruttarwar marked this pull request as ready for review April 1, 2024 03:42
Copy link
Contributor

@ffoulkes ffoulkes left a 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.

@@ -3,7 +3,9 @@
# Copyright 2022-2023 Intel Corporation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright date?

Copy link
Contributor

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.

@@ -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>
Copy link
Contributor

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.

@@ -0,0 +1,26 @@
# CMake build file for krnlmon/switchapi/es2k
#
# Copyright 2022-2023 Intel Corporation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Copyright 2022-2023 Intel Corporation
# Copyright 2022-2024 Intel Corporation

Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The extern "C" isn't needed. This file defines preprocessor symbols, which are are the same for both C and C++.
  2. 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
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Should be removed, along with the superfluous extern "C".
  2. 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.

@@ -18,7 +18,7 @@

#include "switchapi/switch_nhop.h"

#include "switch_pd_routing.h"
#include "switchapi/es2k/lnw_v3/switch_pd_routing.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "switchapi/es2k/lnw_v3/switch_pd_routing.h"
#include "switch_pd_routing.h"

@@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#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"
Copy link
Contributor

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!

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Okay.

@ffoulkes
Copy link
Contributor

ffoulkes commented Apr 2, 2024

@nupuruttarwar
I've implemented the LNW_VERSION cmake variable: PR #110.

If you bracket any V3-specific changes in common code with #ifdef LNW_V3, it will make it easier to find them later.
I've set the default to V3, so LNW_V3 will be defined (if --target=es2k) unless the user overrides it. (Assuming that the code in question incorporates the change, either directly or by rebasing your PR on main once it's merged.)

@nupuruttarwar nupuruttarwar force-pushed the combined_rcp_kmon branch 2 times, most recently from e010344 to dded0ab Compare April 2, 2024 18:28
Copy link
Contributor

@ffoulkes ffoulkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -3,7 +3,9 @@
# Copyright 2022-2023 Intel Corporation
Copy link
Contributor

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.

@@ -0,0 +1,26 @@
# CMake build file for krnlmon/switchapi/es2k
#
# Copyright 2022-2023 Intel Corporation
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Okay.

@ffoulkes
Copy link
Contributor

ffoulkes commented Apr 2, 2024

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.

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]>
Copy link
Collaborator

@5abeel 5abeel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nupuruttarwar nupuruttarwar merged commit 62112e1 into main Apr 2, 2024
4 checks passed
@nupuruttarwar nupuruttarwar deleted the combined_rcp_kmon branch April 2, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants