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

Add support for application filtering in UP4 plugin #410

Merged
merged 25 commits into from Feb 1, 2022

Conversation

osinstom
Copy link
Contributor

@osinstom osinstom commented Jan 17, 2022

This PR adds support fro application filtering in UP4 plugin.

Depends on: #432

@osinstom osinstom self-assigned this Jan 17, 2022
@osinstom osinstom marked this pull request as ready for review January 26, 2022 12:44
@osinstom
Copy link
Contributor Author

CC: @daniele-moro

tableID := t.tableID(TableApplications)
entry := &p4.TableEntry{
TableId: tableID,
// priority for UP4 cannot be greater than 65535
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does this information come from? Priority in p4rt is int32. This may be a problem because precedence is a uint32.

Copy link
Contributor

Choose a reason for hiding this comment

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

However, priority in ROC is from 0 (low) to 250 (high). We need to understand how precedence is calculated to do our assumption here.

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 is the outcome from STC testing. The UP4 app rejected table entry with the following message: Priority cannot be greater than 65535. I see that MAX_PRIORITY = 65535 is used among different ONOS modules: https://github.com/opennetworkinglab/onos/blob/2b4de873e4033b7973b399d25cb8828a73bc2e24/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java#L32. May it be the reason?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, definitely that's the reason, thanks for the explanation!

Copy link
Contributor

@ccascone ccascone Jan 30, 2022

Choose a reason for hiding this comment

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

It would be safer to check if precedence <= 65535 and return an error if not (maybe in an utility function shared with other translation functions, since we use ternary in different tables). Also, limiting the table entry priority to 255 (MaxUint8) is too conservative without any benefit. I would consider only the ONOS limit for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ccascone I'm going to merge this as is and add the precedence verification in a separate PR.

pfcpiface/p4rt_translator.go Outdated Show resolved Hide resolved
pfcpiface/p4rtc.go Outdated Show resolved Hide resolved
@osinstom
Copy link
Contributor Author

@pudelkoM @ccascone the PR is ready for re-review. STC tests are passing locally.

ccascone
ccascone previously approved these changes Jan 30, 2022
Copy link
Contributor

@ccascone ccascone left a comment

Choose a reason for hiding this comment

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

Overall LGTM, left mostly minor comments

pfcpiface/p4rt_translator.go Outdated Show resolved Hide resolved
pfcpiface/p4rt_translator.go Outdated Show resolved Hide resolved
tableID := t.tableID(TableApplications)
entry := &p4.TableEntry{
TableId: tableID,
// priority for UP4 cannot be greater than 65535
Copy link
Contributor

@ccascone ccascone Jan 30, 2022

Choose a reason for hiding this comment

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

It would be safer to check if precedence <= 65535 and return an error if not (maybe in an utility function shared with other translation functions, since we use ternary in different tables). Also, limiting the table entry priority to 255 (MaxUint8) is too conservative without any benefit. I would consider only the ONOS limit for now.


appProto, appProtoMask := pdr.appFilter.proto, pdr.appFilter.protoMask

appIPPrefixLen := 32 - bits.TrailingZeros32(appIPMask)
Copy link
Contributor

@ccascone ccascone Jan 30, 2022

Choose a reason for hiding this comment

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

Is there any guarantee that the mask is equivalent to an LPM? Can there be other zeros besides the trailing ones?

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 is guaranteed by the format of SDF Filter that uses IP/prefixlen.

Co-authored-by: Carmelo Cascone <carmelo@opennetworking.org>
@osinstom
Copy link
Contributor Author

retest this please

@osinstom
Copy link
Contributor Author

osinstom commented Feb 1, 2022

retest this please

1 similar comment
@osinstom
Copy link
Contributor Author

osinstom commented Feb 1, 2022

retest this please

@osinstom osinstom merged commit 675c303 into omec-project:master Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants