Skip to content

Commit 221012b

Browse files
authored
Fix to correct the parameters passed to this API get_macsec_counters (#16978)
* Fix to correct the parameters passed to this API get_macsec_counters
1 parent 8c9030c commit 221012b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/common/macsec/macsec_helper.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import json
44
import logging
55
import time
6-
from collections import defaultdict, deque, Counter
6+
from collections import defaultdict, deque
77
from multiprocessing import Process
88

99
import cryptography.exceptions
@@ -401,10 +401,9 @@ def get_macsec_attr(host, port):
401401
else:
402402
peer_ssci = None
403403

404-
# Get the packet number
405-
ns = host.get_namespace_from_asic_id(asic.asic_index) if host.is_multi_asic else ''
406-
counters = Counter(get_macsec_counters(asic, ns, macsec_ingress_sa_name))
407-
pn = counters['SAI_MACSEC_SA_ATTR_CURRENT_XPN']
404+
# Get the packet number from ingress SA
405+
egress_dict, ingress_dict = get_macsec_counters(host, port)
406+
pn = ingress_dict['SAI_MACSEC_SA_ATTR_CURRENT_XPN']
408407

409408
return encrypt, send_sci, xpn_en, sci, an, sak, ssci, salt, int(peer_sci, 16), int(peer_an), peer_ssci, pn
410409

0 commit comments

Comments
 (0)