Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For table with empty key, table_add method will return Error: Invalid table name (xxx) #38

Closed
Benature opened this issue Jun 24, 2022 · 7 comments

Comments

@Benature
Copy link
Contributor

I have some tables that have no match keys, when I use controller.table_add to add table action, it output with

Error: Invalid table name (get_swid)
@edgar-costa
Copy link
Collaborator

This seems related to issue: #35

You can not do a table_add with a keyless table. You can only set the default action.

@Benature
Copy link
Contributor Author

But default action in P4 cannot make actions' arguments specific for each switch.

@edgar-costa
Copy link
Collaborator

You should be able to set the default action with 1 argument no?

@edgar-costa
Copy link
Collaborator

@Benature
Copy link
Contributor Author

Thank you, but using table_set_default, I still get the Error: Invalid table name (test_tbl)

the p4 code of the table is

    action test_action(bit<32> arg) {
        meta.test = arg;
    }
    table test_tbl{
        key = {}
        actions = {
            test_action;
            NoAction;
        }
        default_action = NoAction;
    }

@edgar-costa
Copy link
Collaborator

Maybe it is a bug, I would have to try it myself.

Can you try to define the table without the line key = {}

@Benature
Copy link
Contributor Author

Benature commented Jun 25, 2022

OK, I've tried this, there is no difference.

    action test_action(bit<32> arg) {
        meta.test = arg;
    }
    table test_tbl{
        actions = {
            test_action;
            NoAction;
        }
        default_action = NoAction;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants