-
Notifications
You must be signed in to change notification settings - Fork 2
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
IPDK IPsec acceleration/offload scripts #7
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated code should be removed
ipsec_accel/common/utils.py
Outdated
@@ -0,0 +1,315 @@ | |||
#!/usr/bin/python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicated code from ipu_playbook/ovs_offload/common/utils.py
We should remove this from here and re-use the code used in the previously committed location. I see some new code in functions split_mac
, split_mac_2
and ip_dec_to_hex
. These can be added to the other file to bring it in line with the needed functionality
ipsec_accel/requirements.txt
Outdated
@@ -0,0 +1 @@ | |||
PyYAML |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyPYAML is already listed in requirements.txt in the main folder of ipu-playbook. We can remove this file
Signed-off-by: Sai Pracheetha Beeyam <[email protected]>
if not re.match("fn_id",line): | ||
continue | ||
fields = line.split() | ||
#print("fields=",fields) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the debug statements that are left over and commented can be removed
acc_mac = lines[0].split()[1] | ||
print("acc_mac:",acc_mac) | ||
|
||
#get acc vsi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a good idea to follow a Python style guide (something like a Pylint
or Flake8
linters are popular and will make sure all the script follow the PEP8 format styling.
If you dont want to address this right away, we can look into it as a follow-on PR
# Copyright 2022-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Common python APIs and utilities for Intel® Infrastructure Processing Unit (Intel® IPU) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Python
(with uppercase P)
@@ -0,0 +1,40 @@ | |||
import socket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a better idea to use a name for this script that is not the same name as the p4sde/bin/tdishell
@@ -0,0 +1,59 @@ | |||
import argparse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing at start of file
#!/usr/bin/python
#
# Copyright 2022-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import socket | ||
import re | ||
import argparse | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a short blub of comment describing what this script achieves
sleep 4 | ||
|
||
echo "" | ||
echo "Check the Interfaces are up" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update language to describing what the verb action more clearly.
echo "Check the Interfaces are up" | |
echo "Checking if the interfaces are up" |
echo 8 > /sys/class/net/'''+host_idpf_intf+'''/device/sriov_numvfs | ||
|
||
echo "" | ||
echo "Wait for the interfaces to come up" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above
echo "Wait for the interfaces to come up" | |
echo "Waiting for the interfaces to come up" |
Same comment applies to other echo statements in this file. Please review
|
||
host_command_list.append(host_idpf) | ||
host_command_list.append(f"chmod +x ./{file}") | ||
#host_command_list.append(f"./{file}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused code
acc_path = test_setup.test_config['test_params']['acc_path'] | ||
acc_p4_path = f'{acc_path}/fxp-net_linux-networking' | ||
file = f'{path}/es2k_skip_p4.conf' | ||
p4_config = 'cat <<EOF > ./'+file+''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion for future improvement: Use a file and ingest that instead of hardcoding values inside a Python script
No description provided.