Skip to content
Snippets Groups Projects
Commit 9ca5abc9 authored by Reinier van der Walle's avatar Reinier van der Walle
Browse files

WIP: added eth_200g IP

parent 22053a35
No related branches found
No related tags found
No related merge requests found
Pipeline #88814 passed
......@@ -318,13 +318,17 @@ async def tb_rdma_packetiser(dut):
dut._log.debug("src_out data = \n%s", hexdump(data))
# Verify icrc
icrc = int.from_bytes(packet[-4:], "big")
# calculation of icrc is done as in:
# https://github.com/secdev/scapy/blob/master/scapy/contrib/roce.py
# ICRC could be calculated using the scapy library (if installed) with the code below.
# from scapy.layers.l2 import Ether
# from scapy.contrib.roce import BTH # for compute_icrc function
# exp_icrc = int.from_bytes(Ether(packet)['BTH'].compute_icrc(None), 'little')
icrc = int.from_bytes(packet[-4:], "big")
try:
from scapy.layers.l2 import Ether
from scapy.contrib.roce import BTH # for compute_icrc function
Ether(packet).show() # print packet if scapy is installed.
exp_icrc = int.from_bytes(Ether(packet)['BTH'].compute_icrc(None), 'little')
except ModuleNotFoundError:
ones = (0xFF).to_bytes(1, 'little')
pseudo_packet = ([ones] * 8 + [packet[14:15]] +
[ones] + [packet[16:22]] + [ones] +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment