Hi All,

Thanks, Asaf and Raslan for resolving this issue.

After doing the below FW configurations that separate the logical vs physical link status of the NIC, this issue gets resolved:
mlxconfig -d 0000:04:00.1  set  KEEP_ETH_LINK_UP_P1=0  KEEP_ETH_LINK_UP_P2=0

Regards,
Haider

From: Haider Ali
Sent: Tuesday, May 17, 2022 11:46 AM
To: users <users@dpdk.org>
Subject: link up / down not working with Mellanox
 
Hi,

I am trying to test the link-up and link-down features of Mellanox using this link https://dpdk-test-plans.readthedocs.io/en/latest/shutdown_api_test_plan.html. But found that even after setting the link-down, NIC is forwarding the traffic. Please check my test setup:

Server 1:
$ sudo ./build/app/dpdk-testpmd -l 0,2 -n 4 --file-prefix=ha -a 0000:04:00.1 -- -i --rxq=1 --txq=1
testpmd> set fwd mac
testpmd> start
testpmd> set link-down port 0
Port 0: link state change event

Server 2:
>>> sendp(Ether()/IP()/TCP()/Raw('x'*300),iface='enp4s0f1')
$ sudo tcpdump -i enp4s0f1 -vve

22:59:52.469337 00:00:00:00:00:00 (oui Ethernet) > Broadcast, ethertype IPv4 (0x0800), length 354: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto TCP (6), length 340)
    localhost.ftp-data > localhost.http: Flags [S], cksum 0xf9b9 (correct), seq 0:300, win 8192, length 300: HTTP

22:59:52.469379 b8:ce:f6:ed:9f:af (oui Unknown) > 02:00:00:00:00:00 (oui Unknown), ethertype IPv4 (0x0800), length 354: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto TCP (6), length 340)
    localhost.ftp-data > localhost.http: Flags [S], cksum 0xf9b9 (correct), seq 0:300, win 8192, length 300: HTTP


Please correct me if I am doing anything wrong.

Regards,
Haider