ngsdn-tutorial
ngsdn-tutorial copied to clipboard
P4 table entry insert from p4runtime docker container shell is broken in advanced branch
Hi, I see the following error when i call insert() on a table_enrty object created on p4runtime shell in advanced branch. Any help in this regard is much appreciated. Please look at the following logs
P4Runtime sh >>> te = table_entry["IngressPipeImpl.l2_exact_table"](action = "IngressPipeImpl.set_egress_port")
P4Runtime sh >>> te.match["hdr.ethernet.dst_addr"] = ("00:00:00:00:00:1B") field_id: 1 exact { value: "\033" } P4Runtime sh >>> te.action["port_num"] = ("4") param_id: 1 value: "\004"
P4Runtime sh >>> te Out[4]: table_id: 33605373 ("IngressPipeImpl.l2_exact_table") match { field_id: 1 ("hdr.ethernet.dst_addr") exact { value: "\x1b" } } action { action { action_id: 16812802 ("IngressPipeImpl.set_egress_port") params { param_id: 1 ("port_num") value: "\x04" } } }
P4Runtime sh >>> te.insert() --verbose DEBUG:root:Inserting entry
P4RuntimeWriteException Traceback (most recent call last)
/p4runtime-sh/venv/lib/python3.8/site-packages/p4runtime_shell-0.0.2-py3.8.egg/p4runtime_sh/shell.py in insert(self) 680 raise NotImplementedError("Insert not supported for {}".format(self._entity_type.name)) 681 logging.debug("Inserting entry") --> 682 self._write(p4runtime_pb2.Update.INSERT) 683 684 def delete(self):
/p4runtime-sh/venv/lib/python3.8/site-packages/p4runtime_shell-0.0.2-py3.8.egg/p4runtime_sh/shell.py in write(self, type) 674 update.type = type_ 675 getattr(update.entity, self._entity_type.name).CopyFrom(self._entry) --> 676 client.write_update(update) 677 678 def insert(self):
/p4runtime-sh/venv/lib/python3.8/site-packages/p4runtime_shell-0.0.2-py3.8.egg/p4runtime_sh/p4runtime.py in handle(*args, **kwargs) 121 if e.code() != grpc.StatusCode.UNKNOWN: 122 raise e --> 123 raise P4RuntimeWriteException(e) from None 124 return handle 125
P4RuntimeWriteException: Error(s) during Write: * At index 0: INVALID_ARGUMENT, 'Invalid bytestring format'
P4Runtime sh >>>
Thank you for your help in advance.
so did you solve this problem ? I have meet this one
Yes, you need to set canonical bytestrings as false before passing any flow configurations. you can do it with the following p4 runtime command. global_options["canonical_bytestrings"] = False
Thanks
On Sun, Apr 24, 2022 at 6:22 AM cxd @.***> wrote:
so did you solve this problem ? I have meet this one
— Reply to this email directly, view it on GitHub https://github.com/opennetworkinglab/ngsdn-tutorial/issues/91#issuecomment-1107830254, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQO2YXDB4SQ3F7SNR7YNHV3VGU4GTANCNFSM5ICWTOSA . You are receiving this because you authored the thread.Message ID: @.***>
-- regards, Sanjeeva Reddy.Y.