Skip to content

[201911]Handled both REDIRECT and REDIRECT_ACTION ACL rules in ACL or…#1397

Merged
abdosi merged 2 commits intosonic-net:201911from
madhanmellanox:201911updatemm
Aug 14, 2020
Merged

[201911]Handled both REDIRECT and REDIRECT_ACTION ACL rules in ACL or…#1397
abdosi merged 2 commits intosonic-net:201911from
madhanmellanox:201911updatemm

Conversation

@madhanmellanox
Copy link
Contributor

…chagent

What I did
In ACL orchagent code, code is modified to handled both REDIRECT and REDIRECT_ACTION ACL rules.

Why I did it
Currently, the code only handles REDIRECT ACL rule and not REDIRECT_ACTION ACL rule.

How I verified it
I verified by configuring both types of ACL rules and verified it is working.
Details if related

@lgtm-com
Copy link

lgtm-com bot commented Aug 12, 2020

This pull request introduces 2 alerts when merging 017585d into 2c9fc8c - view on LGTM.com

new alerts:

  • 1 for Wrong name for an argument in a call
  • 1 for Unused local variable

@madhanmellanox
Copy link
Contributor Author

retest this please

@madhanmellanox
Copy link
Contributor Author

@abdosi this is a double commit to 201911 branch, the fix is already in master branch. Since, the cherry-pick to 201911 had conflicts, I raised this PR. Can you please merge this PR.
sonic-net/sonic-buildimage#4786

@abdosi
Copy link
Contributor

abdosi commented Aug 14, 2020

is this PR ref to this Master PR #1278 ?

@madhanmellanox
Copy link
Contributor Author

is this PR ref to this Master PR #1278 ?

Yes this PR ref to the Master PR #1278

Copy link
Contributor

@wendani wendani left a comment

Choose a reason for hiding this comment

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

vs test case fails as commented

for k, v in qualifiers.items():
fvs[k] = v

self.config_db.create_entry("ACL_RULE", "{}|{}".format(table_name, rule_name), fvs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not available in 201911 branch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wendani, since in 201911 branch, vstests were not working then, I did not include my test case when it was merged to 201911. @abdosi knows about it.

("priority", "20"),
("L4_SRC_PORT", "65000"),
("PACKET_ACTION", "REDIRECT:10.0.0.2@Ethernet4")])
tbl.set("test_acl_table|redirect_rule", fvs)
Copy link
Contributor

Choose a reason for hiding this comment

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

sleep here for the rule to sync to asic db

assert False

# remove acl rule
tbl = swsscommon.Table(self.cdb, "ACL_TABLE")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be "ACL_RULE"

assert status == False

config_qualifiers = {"L4_SRC_PORT": "65000"}
self.dvs_acl.create_redirect_action_acl_rule("test_acl_table", "redirect_action_rule", config_qualifiers, intf="Ethernet4", priority="20")
Copy link
Contributor

Choose a reason for hiding this comment

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

No data member dvs_acl

elif fv[0] == "SAI_ACL_ENTRY_ATTR_FIELD_L4_SRC_PORT":
assert fv[1] == "65000&mask:0xffff"
elif fv[0] == "SAI_ACL_ENTRY_ATTR_ACTION_REDIRECT":
assert fv[1] == next_hop_id
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be object id of physical port Ethernet4

(status, fvs) = atbl.get(acl_entry[0])
assert status == False

tbl._del("test_acl_table")
Copy link
Contributor

Choose a reason for hiding this comment

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

tbl here points to ACL_RULE still


time.sleep(1)

keys = atbl.getKeys()
Copy link
Contributor

Choose a reason for hiding this comment

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

atbl here still points to ASIC_STATE:SAI_OBJECT_TYPE_ACL_ENTRY

("PACKET_ACTION", "REDIRECT:10.0.0.2@Ethernet4")])
tbl.set("test_acl_table|redirect_rule", fvs)

# check acl table in asic db
Copy link
Contributor

Choose a reason for hiding this comment

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

entry

EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
… naming mode "alias" sonic-net#1397 (sonic-net#1411)

#### What I did
Added fix for Issue in CLI output alignment with shorter alias names in intf naming mode "alias"

#### How I did it
Added code to remove last few extra characters from string (-------…) using Slicing & Positive Indexing in python, to match the width to alias's name(not interface)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants