[P4-dev] bug in cli/pd_thrift_client.py?

Antonin Bas antonin at barefootnetworks.com
Thu Feb 18 14:04:36 EST 2016


Hi Ronald,

I pushed a fix for this:
https://github.com/p4lang/p4factory/commit/2fce7d46bdf6046fb5f3a35a7750e4d553422a8c
This extra parameter is the max length of the returned string, so I am not
sure 0 should work (I hard-coded it to 4096).

This CLI was mostly meant to be used with the first version of the software
switch (bmv1), which we are about to deprecate. bmv1 will not support
future versions of the P4 language and all the development effort now goes
to bmv2, written in C++.
David Hancock sent a great email yesterday to the p4-dev mailing list,
explaining how to get started with bmv2:
http://lists.p4.org/pipermail/p4-dev_lists.p4.org/2016-February/000161.html

Thanks,

Antonin

On Thu, Feb 18, 2016 at 8:21 AM, Ronald van der Pol <
Ronald.vanderPol at rvdp.org> wrote:

> I am trying to run the p4factory/targets/simple_router example.
> (git clone of today).
>
> It works fine, except:
>
> $ python ../../cli/pd_cli.py -p simple_router -i p4_pd_rpc.simple_router
> -s $PWD/tests/pd_thrift:$PWD/../../testutils -m "dump_table forward 0" -c
> localhost:22222
> forward_get_entry() takes exactly 5 arguments (4 given)
> Try 'help dump_table' for more information
>
> Looks like a problem in cli/pd_thrift_client.py. The hack below makes
> it work, but I am not sure how it is supposed to work.
>
> diff --git a/cli/pd_thrift_client.py b/cli/pd_thrift_client.py
> index 0f04795..3956ab1 100644
> --- a/cli/pd_thrift_client.py
> +++ b/cli/pd_thrift_client.py
> @@ -161,7 +161,7 @@ class ThriftClient(object):
>      return
> self.get_get_next_entry_handles_function(table_name)(self._session_handle,
> self._dev_target.dev_id, entry_handle, n)
>
>    def show_entry(self, table_name, entry_handle):
> -    return self.get_show_entry_function(table_name)(self._session_handle,
> self._dev_target.dev_id, entry_handle)
> +    return self.get_show_entry_function(table_name)(self._session_handle,
> self._dev_target.dev_id, entry_handle, 0)
>
>         rvdp
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>



-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20160218/18127759/attachment-0002.html>


More information about the P4-dev mailing list