[P4-dev] generate_digest

Antonin Bas antonin at barefootnetworks.com
Thu Dec 8 13:37:30 EST 2016


Hi Yun,

This means that one of the table operations in learn_client.cpp is failing.
There are 2 table operations in learn_client.cpp, both are entry adds. If
you changed anything to the definitions of tables "smac" and "dmac" in the
P4 program (e.g. you added a new match field to the match key), you need to
update learn_client.cpp appropriately.
If you need more help, you can send us your modified P4 program in full.
You can also try to catch the exception in learn_client.cpp and print the
error code. For example:

try {
client->bm_mt_add_entry(/* your arguments */);
} catch (runtime::InvalidTableOperation &ito) {
const char *what = runtime::
_TableOperationErrorCode_VALUES_TO_NAMES.find(ito.code)->second;
std::cout << "Invalid table operation (" << ito.code << "): " << what <<
std::endl;
}

Best,

Antonin

On Thu, Dec 8, 2016 at 8:24 AM, yun chen <tingyun0313 at gmail.com> wrote:

> hello,
>
> I'm trying to add some item in generate_digest and learn_client.
> But after I add in the generate_digest.p4 like below
>
> field_list mac_learn_digest {
>     ethernet.srcAddr;
>     ethernet.etherType;
>     standard_metadata.ingress_port;
> }
>
> and learn_client.cpp
>
> typedef struct {
>   char src_addr[6];
>   uint16_t etherType;
>   uint16_t ingress_port;
> } __attribute__((packed)) sample_t;
>
> it will core dump and show
>
> terminate called after throwing an instance of
> 'bm_runtime::standard::InvalidTableOperation'
>   what():  Default TException.
>
>
> I don't know how to fix it, what should I do?
>
> Yun Chen
>
> _______________________________________________
> 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/20161208/fd099fab/attachment-0002.html>


More information about the P4-dev mailing list