Hi
I have entires in my BMV as follows:
In [10]: bfrt.switch.pipe.ig_ctl.srv6.ipoe_transit.dump
-------> bfrt.switch.pipe.ig_ctl.srv6.ipoe_transit.dump()
----- ipoe_transit Dump Start -----
Default Entry:
Entry data (action : NoAction):
Entry 0:
Entry key:
hdr.ipv4.src_addr : (‘0x00000000’, ‘0x00000000’)
hdr.ipv4.dst_addr : (‘0xC0A80201’, ‘0xFFFFFFFF’)
$MATCH_PRIORITY : 0
Entry data (action : ig_ctl.srv6.fup_encap_dt2d_e):
src_addr : 0xFD010000000000000000000000000001
next_hop : 0xFC123456000000000000000000000000
src_mac : 0x00CAE1C90000
dst_mac : 0x00C86A020003
client_mac : 0x0C3311BF0000
Entry 1:
Entry key:
hdr.ipv4.src_addr : (‘0x00000000’, ‘0x00000000’)
hdr.ipv4.dst_addr : (‘0xC0A80266’, ‘0xFFFFFFFF’)
$MATCH_PRIORITY : 0
Entry data (action : ig_ctl.srv6.fup_encap_dt2d_e):
src_addr : 0xFD010000000000000000000000000001
next_hop : 0xFC123456000000000000000000000000
src_mac : 0x00CAE1C90000
dst_mac : 0x00C86A020003
client_mac : 0x0C3311BF0000
----- ipoe_transit Dump End -----
In [11]:
I want to delete the second one from my Python program so I have the following:
srv6_end = bfrt_info.table_get('pipe.ig_ctl.srv6.ipoe_transit')
keys_to_delete = []
ip_in_int = int(ipaddress.ip_address(x[0]))
print(hex(ip_in_int))
search_key = srv6_end.make_key([
gc.KeyTuple('$MATCH_PRIORITY', 0x00), gc.KeyTuple('hdr.ipv4.src_addr', 0x00000000, 0x00000000), gc.KeyTuple('hdr.ipv4.dst_addr', ip_in_int, 0xffffffff)])
print(search_key)
srv6_end_entry_del(gc.Target(), search_key)
I’ve cheked the keys in the table against the ‘search_key’ that I generate and they appear to be identical:
search_key:
{‘$MATCH_PRIORITY’: {‘value’: 0}, ‘hdr.ipv4.dst_addr’: {‘value’: 3232236134, ‘mask’: 4294967295}, ‘hdr.ipv4.src_addr’: {‘value’: 0, ‘mask’: 0}}
displayed keys in Python from the BMV:
{‘$MATCH_PRIORITY’: {‘value’: 0}, ‘hdr.ipv4.dst_addr’: {‘value’: 3232236033, ‘mask’: 4294967295}, ‘hdr.ipv4.src_addr’: {‘value’: 0, ‘mask’: 0}}
{‘$MATCH_PRIORITY’: {‘value’: 0}, ‘hdr.ipv4.dst_addr’: {‘value’: 3232236134, ‘mask’: 4294967295}, ‘hdr.ipv4.src_addr’: {‘value’: 0, ‘mask’: 0}}
(the second one matches as is the one I wish to delete).
I can’t delete the key.
Where am I going wrong please?
Thanks
David