Skip to content

AGW: pipelined: use pyroute2 to manage TC queue and filters#5240

Merged
pshelar merged 1 commit intomagma:masterfrom
pshelar:pyroute2-ops3
Mar 3, 2021
Merged

AGW: pipelined: use pyroute2 to manage TC queue and filters#5240
pshelar merged 1 commit intomagma:masterfrom
pshelar:pyroute2-ops3

Conversation

@pshelar
Copy link
Copy Markdown
Contributor

@pshelar pshelar commented Mar 2, 2021

Following commit adds second implementation for executing
TC commands. This is using netlink socket rather than executing
tc commands. I have seen good improvement over current master.
following numbers are using pipelined_cli.py enforcement stress_test_grpc

With pyroute2

Starting attaches
Finished 600 attaches in 9.850383 seconds
Actual attach rate = 61 UEs per sec
Starting detaches
Finished 600 detaches in 6.381709 seconds

with current master

Starting attaches
Finished 600 attaches in 22.11333 seconds
Actual attach rate = 27 UEs per sec
Starting detaches
Finished 600 detaches in 6.360227 seconds

Signed-off-by: Pravin B Shelar [email protected]

Summary

Test Plan

make test

Additional Information

  • This change is backwards-breaking

@pshelar pshelar requested review from ardzoht and koolzz as code owners March 2, 2021 00:27
@magmabot magmabot added the component: agw Access gateway-related issue label Mar 2, 2021
Copy link
Copy Markdown
Contributor

@koolzz koolzz left a comment

Choose a reason for hiding this comment

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

those stress test numbers look gooooooooooood

self._uplink = config['nat_iface']
self._downlink = config['enodeb_iface']
self._max_rate = config["qos"]["max_rate"]
self._enable_pyroute2 = config["qos"].get('enable_pyroute2', False)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should this be true by default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I still want to make sure all tests works fine before making it default

def __init__(self):
self._ipr = IPRoute()
self._iface_if_index = {}
LOG.info("initialized")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

rm log? or expand

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This msg is logs shows which TC backend implementation we are using.

ret = self._ipr.tc("add-class", "htb", if_index,
htb_queue, parent=parent_qid,
rate=str(rate).lower(), ceil=max_bw, prio=1)
LOG.debug("Return: %s", ret)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Return from tc add subclass

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, it returns class state from kernel.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah I just meant expand log msg so its clear

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

logger has prefix set. So in log it looks like:

Mar  1 21:59:15 magma-dev pipelined[11667]: INFO:pipelined.qos.tc_pyroute2:initialized

try:
if_index = self._get_if_index(iface)

class_id = int(0x10000) | int(qid, 16)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see 0x10000 used a bunch, make it a const?

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 2, 2021

Codecov Report

Merging #5240 (7b1a8c6) into master (e5fcba4) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5240   +/-   ##
=======================================
  Coverage   63.61%   63.61%           
=======================================
  Files         301      301           
  Lines       20300    20300           
=======================================
+ Hits        12913    12914    +1     
+ Misses       5486     5485    -1     
  Partials     1901     1901           
Impacted Files Coverage Δ
...oud/go/services/state/indexer/reindex/reindexer.go 66.89% <0.00%> (+0.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5fcba4...3039e61. Read the comment docs.

@pshelar pshelar force-pushed the pyroute2-ops3 branch 2 times, most recently from 3039e61 to 7a26d76 Compare March 2, 2021 19:02
@pshelar pshelar requested review from kkahrs and tmdzk as code owners March 2, 2021 19:02
@pshelar pshelar force-pushed the pyroute2-ops3 branch 2 times, most recently from 29bedeb to 1a5f1cd Compare March 2, 2021 19:45
Comment thread lte/gateway/release/build-magma.sh Outdated
"libtins-dev" # required for Connection tracker
"libmnl-dev" # required for Connection tracker
"getenvoy-envoy" # for envoy dep
"python3-pyroute2"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As It's a python dep can you add it to the setup.py instead of here?

@pshelar pshelar requested a review from tmdzk March 2, 2021 23:50
Following commit adds second implementation for executing
TC commands. This is using netlink socket rather than executing
`tc` commands. I have seen good improvement over current master.
following numbers are using `pipelined_cli.py enforcement
stress_test_grpc`

With pyroute2
------------
Starting attaches
Finished 600 attaches in 9.850383 seconds
Actual attach rate = 61 UEs per sec
Starting detaches
Finished 600 detaches in 6.381709 seconds

with current master
-------------------
Starting attaches
Finished 600 attaches in 22.11333 seconds
Actual attach rate = 27 UEs per sec
Starting detaches
Finished 600 detaches in 6.360227 seconds

Signed-off-by: Pravin B Shelar <[email protected]>
@pshelar pshelar added the apply-v1.4 Needs to be applied to v1.4 release branch as well label Mar 3, 2021
@pshelar pshelar merged commit 161d672 into magma:master Mar 3, 2021
rsarwad pushed a commit to rsarwad/magma that referenced this pull request Mar 3, 2021
Following commit adds second implementation for executing
TC commands. This is using netlink socket rather than executing
`tc` commands. I have seen good improvement over current master.
following numbers are using `pipelined_cli.py enforcement
stress_test_grpc`

With pyroute2
------------
Starting attaches
Finished 600 attaches in 9.850383 seconds
Actual attach rate = 61 UEs per sec
Starting detaches
Finished 600 detaches in 6.381709 seconds

with current master
-------------------
Starting attaches
Finished 600 attaches in 22.11333 seconds
Actual attach rate = 27 UEs per sec
Starting detaches
Finished 600 detaches in 6.360227 seconds

Signed-off-by: Pravin B Shelar <[email protected]>
@themarwhal themarwhal added the backported-v1.4 Has been backported to v1.4 release branch label Mar 3, 2021
themarwhal pushed a commit that referenced this pull request Mar 3, 2021
Following commit adds second implementation for executing
TC commands. This is using netlink socket rather than executing
`tc` commands. I have seen good improvement over current master.
following numbers are using `pipelined_cli.py enforcement
stress_test_grpc`

With pyroute2
------------
Starting attaches
Finished 600 attaches in 9.850383 seconds
Actual attach rate = 61 UEs per sec
Starting detaches
Finished 600 detaches in 6.381709 seconds

with current master
-------------------
Starting attaches
Finished 600 attaches in 22.11333 seconds
Actual attach rate = 27 UEs per sec
Starting detaches
Finished 600 detaches in 6.360227 seconds

Signed-off-by: Pravin B Shelar <[email protected]>
chandra-77 pushed a commit to chandra-77/magma that referenced this pull request Mar 30, 2021
Following commit adds second implementation for executing
TC commands. This is using netlink socket rather than executing
`tc` commands. I have seen good improvement over current master.
following numbers are using `pipelined_cli.py enforcement
stress_test_grpc`

With pyroute2
------------
Starting attaches
Finished 600 attaches in 9.850383 seconds
Actual attach rate = 61 UEs per sec
Starting detaches
Finished 600 detaches in 6.381709 seconds

with current master
-------------------
Starting attaches
Finished 600 attaches in 22.11333 seconds
Actual attach rate = 27 UEs per sec
Starting detaches
Finished 600 detaches in 6.360227 seconds

Signed-off-by: Pravin B Shelar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apply-v1.4 Needs to be applied to v1.4 release branch as well backported-v1.4 Has been backported to v1.4 release branch component: agw Access gateway-related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants