-
Notifications
You must be signed in to change notification settings - Fork 732
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
[dash] Add outbound Privatelink traffic test #14757
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Prabhat Aravind <[email protected]>
Signed-off-by: Lawrence Lee <[email protected]>
Signed-off-by: Lawrence Lee <[email protected]>
@mukeshmv to review |
|
||
@pytest.fixture(scope="module") | ||
def dpu_ip(duthost, dpu_index): | ||
cmd = f"ip addr show | grep Ethernet-BP{dpu_index} | grep inet | awk '{{print $2}}'" |
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.
The interface is vendor-specific. It should be taken from platform.json
file: https://github.com/sonic-net/SONiC/blob/master/doc/smart-switch/pmon/smartswitch-pmon.md#313-npu-to-dpu-data-port-mapping
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.
Here is an example of Nvidia platform:
sonic-net/sonic-buildimage#20358
Signed-off-by: Lawrence Lee <[email protected]>
Signed-off-by: Lawrence Lee <[email protected]>
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.
Can we have a test plan to explain the test? espeicallly for the privatelink_config,
What do the variables defined in the file of privatelink_config.py mean? If there is a chart to introduce the different ips in the test, it will be better.
Thanks
return str(ip_address(overlay_dip)) | ||
|
||
|
||
def outbound_pl_packets(config, inner_packet_type='udp', vxlan_udp_dport=4789): |
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.
Do we have scenarios for inbound_pl_packets?
|
||
yield | ||
|
||
duthost.shell(f"ip route del {pl.SIP}") |
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.
Before yield, it uses replace to change the static route, which means that a route related to pl.sip may exist. So, if we use del to remove the pl.sip route, it seems that it cannot restore to the original route status. Right?
@@ -65,7 +65,7 @@ def test_outbound_direct( | |||
inner_packet_type, | |||
acl_default_rule, | |||
vxlan_udp_dport): | |||
asic_db_checker(["SAI_OBJECT_TYPE_VNET", "SAI_OBJECT_TYPE_ENI"]) | |||
# asic_db_checker(["SAI_OBJECT_TYPE_VNET", "SAI_OBJECT_TYPE_ENI"]) |
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.
why remove the line?
PL_ENCODING_IP = "::56b2:0:ff71:0:0" | ||
PL_ENCODING_MASK = "::ffff:ffff:ffff:0:0" | ||
PL_UNDERLAY_SIP1 = "55.1.2.3" | ||
PL_UNDERLAY_SIP2 = "55.2.3.4" |
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 seems that we don't use it
INBOUND_UNDERLAY_IP = "25.1.1.1" | ||
OUTBOUND_UNDERLAY_IP = "101.1.2.3" | ||
VNET_MAP_IP1 = "10.1.1.5" | ||
VNET_MAP_IP2 = "10.1.2.5" |
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 seems that we don't use it
ip_dst=pl.SIP, | ||
udp_dport=vxlan_udp_dport, | ||
with_udp_chksum=False, | ||
vxlan_vni=int(pl.VNET1_VNI), |
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 outbound packet. VNI should be set to VM_VNI
inner_packet = generate_inner_packet(inner_packet_type)( | ||
eth_src=pl.ENI_MAC, | ||
ip_src=config[LOCAL_CA_IP], | ||
ip_dst=pl.VNET_MAP_IP1, |
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.
p1.VNET_MAP_IP1 is PE (private endpoint). Right?
@theasianpianist the test misses the data plane interface configuration for both the NPU and DPU sides. There is a static route that the test adds on the NPU side to send traffic to the DPU, but no IP address configuration on the interfaces. Therefore, the test won’t work without some manual pre-configuration. My assumption is that the test should be atomic and apply the full configuration needed to pass. The test should be extended to set the IP address on the NPU, and the IP address and VIP address on the DPU. |
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.
As commented
|
||
VNET_MAPPING_CONFIG = { | ||
f"DASH_VNET_MAPPING_TABLE:{VNET1}:{VNET_MAP_IP1}": { | ||
"mac_address": REMOTE_MAC_STRING, |
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 attribute is not suppored by the PL features:
sonic-net/sonic-swss#3319
Instead of setting this attribute as a part of the configuration, the test should use REMOTE_MAC as a destination inner MAC in the original VXLAN packet sent by PTF
|
||
def outbound_pl_packets(config, inner_packet_type='udp', vxlan_udp_dport=4789): | ||
inner_packet = generate_inner_packet(inner_packet_type)( | ||
eth_src=pl.ENI_MAC, |
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.
The eth_dst
should be set to the actual destination MAC address:
eth_dst=pl.REMOTE_MAC,
ptfhost, | ||
messages, | ||
dpu_index, | ||
set=True, |
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.
'set' is a Python built-in name, better to use another name.
file.write(message.SerializeToString()) | ||
update_list.append(path) | ||
else: | ||
path = f"/APPL_DB/dpu{dpu_index}/{filename}" |
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.
should be gnmi_key instead of filename
logger.info(messages) | ||
apply_messages(localhost, duthost, ptfhost, messages, dpu_index) | ||
|
||
return |
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.
There is no clean up of the dash configurations.
/azp run Azure.sonic-mgmt |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-mgmt |
Azure Pipelines successfully started running 1 pipeline(s). |
gre_key=pl.ENCAP_VNI << 8, | ||
inner_frame=exp_inner_packet, | ||
ip_id=0, | ||
ip_ttl=63, |
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.
Expected TTL should be changed to 254 based on sonic-net/DASH#636 PR
"mac_address": ENI_MAC, | ||
"eni_id": ENI_ID, | ||
"admin_state": State.STATE_ENABLED, | ||
"pl_underlay_sip": PL_UNDERLAY_SIP1, |
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.
pl_underlay_sip
in the ENI table should be equal to the SIP address.
if proto_utils.ENABLE_PROTO: | ||
path = f"/APPL_DB/dpu{dpu_index}/{gnmi_key}:$/root/{filename}" | ||
else: | ||
path = f"/APPL_DB/dpu{dpu_index}/{gnmi_key}:@/root/{filename}" |
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.
For the path assignment, the else seems to be the same as the if.
else: | ||
path = "/APPL_DB/localhost/%s:@/root/%s" % (k, filename) | ||
path = "/APPL_DB/dpu1/%s:@/root/%s" % (k, filename) |
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.
Is this test only for DPU1?
Description of PR
Summary:
Fixes #14613
Type of change
Back port request
Approach
What is the motivation for this PR?
How did you do it?
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Smartswitch testbed only
Documentation