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 loongarch support #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

212dandan
Copy link

@212dandan 212dandan commented Dec 14, 2021

This commit is for a new architecture--loongarch.

Compilation and installation are normal in the loongarch architecture.
Tests unit test passed in pyroute2 project.
Examples,
First,loongarch architecture displays.
loongson@loongson-pc:~/dd/python-pyroute2$ lscpu | grep Architecture
Architecture: loongarch64

Second,tests unit test passed in pyroute2 project.
loongson@loongson-pc:~/dd/python-pyroute2$ python3.7 -m nose -v tests/unit
test_common.TestAddrPool.test_alloc_aligned ... ok
test_common.TestAddrPool.test_alloc_odd ... ok
test_common.TestAddrPool.test_free ... ok
test_common.TestAddrPool.test_free_fail ... ok
test_common.TestAddrPool.test_free_reverse_fail ... ok
test_common.TestAddrPool.test_locate ... ok
test_common.TestAddrPool.test_reverse ... ok
test_common.TestAddrPool.test_setaddr_allocated ... ok
test_common.TestAddrPool.test_setaddr_free ... ok
test_common.TestCommon.test_dqn2int ... ok
test_common.TestCommon.test_hexdump ... ok
test_common.TestCommon.test_uifname ... ok
test_common.TestCommon.test_uuid32 ... ok
Ran 13 tests in 0.247s
OK

Third,users test passed in the loongarch architecture.
Users test some netns:: interfaces those also pass, such as
loongson@loongson-pc:~/dd/python-pyroute2$ sudo python3
Python 3.7.3 (default, Sep 12 2020, 09:01:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import pyroute2
from pyroute2 import NetNS
from pprint import pprint
ns = NetNS('test')
pprint(ns.get_links())
[{'__align': (),
'attrs': [('IFLA_IFNAME', 'lo'),
('IFLA_TXQLEN', 1000),
......
ns.close()

loongson@loongson-pc:~/dd/python-pyroute2$ sudo python3
Python 3.7.3 (default, Sep 12 2020, 09:01:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from pyroute2 import netns
netns.create('test')
print(netns.listnetns())
['test', 'aaaaaa']
netns.remove('test')

The end, we look forward to your reply and we hope this submission could be merged.
Thanks.

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.

2 participants