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

Added default action code for tc backend #6

Closed
wants to merge 1 commit into from

Conversation

Sosutha
Copy link
Owner

@Sosutha Sosutha commented Mar 20, 2024

  • Added default action code in control block for tc backend

  • Updated testcase outputs

#4 (comment)

@Sosutha
Copy link
Owner Author

Sosutha commented Mar 20, 2024

@jhsmt @vbnogueira Please review

@Sosutha Sosutha force-pushed the p4tc_fix_for_default_miss branch from 33d6fdf to 9b6b137 Compare March 20, 2024 11:43
Copy link

@vbnogueira vbnogueira left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@psivanup psivanup left a comment

Choose a reason for hiding this comment

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

Looks fine, except the good to have comment.

auto actionNameStr = defaultActionName.c_str();
for (long unsigned int i = 0; i < defaultActionName.size(); i++) {
if (actionNameStr[i] == '/') {
defaultActionName =

Choose a reason for hiding this comment

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

will cstring's find/ findlast solve the purpose?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Both these functions returns pointer to the character in the string, but not actual position, hence they cannot be used

Choose a reason for hiding this comment

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

ref: test_backend.cpp
fieldString = fieldString.substr(fieldString.find('.') - fieldString.begin() + 1);

Copy link
Owner Author

Choose a reason for hiding this comment

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

Updated

Copy link

@maheswari-s maheswari-s left a comment

Choose a reason for hiding this comment

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

Looks fine

@Sosutha Sosutha force-pushed the p4tc_fix_for_default_miss branch from 9b6b137 to 9c81206 Compare March 21, 2024 06:49
Copy link

@usha1830 usha1830 left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Just see if we can bring the common code in generated C files out of the if/else

if (value->is_default_miss_act)
{
/* send_to_port(p4tc_filter_fields.ipv4_tbl_1_next_hop_vport) */
compiler_meta__->drop = false;

Choose a reason for hiding this comment

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

this statement and the other common statements in if/else can be moved outside if

Copy link
Owner Author

@Sosutha Sosutha Mar 26, 2024

Choose a reason for hiding this comment

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

Moving the common statements out of if/else requires more common code from ebpf to be replicated. Hence implemented like this

* Added default action code in control block for tc backend

*  Updated testcase outputs
@Sosutha Sosutha force-pushed the p4tc_fix_for_default_miss branch from 9c81206 to a6f5d3d Compare March 26, 2024 07:39
@Sosutha Sosutha closed this Apr 1, 2024
@Sosutha Sosutha deleted the p4tc_fix_for_default_miss branch April 1, 2024 12:27
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.

5 participants