Commit 71a8a63b authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nf_flow_table: move priority to struct nf_flowtable

Hardware offload needs access to the priority field, store this field in
the nf_flowtable object.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 0a9b3385
...@@ -24,6 +24,7 @@ struct nf_flowtable_type { ...@@ -24,6 +24,7 @@ struct nf_flowtable_type {
struct nf_flowtable { struct nf_flowtable {
struct list_head list; struct list_head list;
struct rhashtable rhashtable; struct rhashtable rhashtable;
int priority;
const struct nf_flowtable_type *type; const struct nf_flowtable_type *type;
struct delayed_work gc_work; struct delayed_work gc_work;
}; };
......
...@@ -1155,7 +1155,6 @@ void nft_unregister_obj(struct nft_object_type *obj_type); ...@@ -1155,7 +1155,6 @@ void nft_unregister_obj(struct nft_object_type *obj_type);
* @table: the table the flow table is contained in * @table: the table the flow table is contained in
* @name: name of this flow table * @name: name of this flow table
* @hooknum: hook number * @hooknum: hook number
* @priority: hook priority
* @ops_len: number of hooks in array * @ops_len: number of hooks in array
* @genmask: generation mask * @genmask: generation mask
* @use: number of references to this flow table * @use: number of references to this flow table
...@@ -1169,7 +1168,6 @@ struct nft_flowtable { ...@@ -1169,7 +1168,6 @@ struct nft_flowtable {
struct nft_table *table; struct nft_table *table;
char *name; char *name;
int hooknum; int hooknum;
int priority;
int ops_len; int ops_len;
u32 genmask:2, u32 genmask:2,
use:30; use:30;
......
...@@ -5706,10 +5706,10 @@ static int nf_tables_flowtable_parse_hook(const struct nft_ctx *ctx, ...@@ -5706,10 +5706,10 @@ static int nf_tables_flowtable_parse_hook(const struct nft_ctx *ctx,
if (!ops) if (!ops)
return -ENOMEM; return -ENOMEM;
flowtable->hooknum = hooknum; flowtable->hooknum = hooknum;
flowtable->priority = priority; flowtable->data.priority = priority;
flowtable->ops = ops; flowtable->ops = ops;
flowtable->ops_len = n; flowtable->ops_len = n;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
flowtable->ops[i].pf = NFPROTO_NETDEV; flowtable->ops[i].pf = NFPROTO_NETDEV;
...@@ -5969,7 +5969,7 @@ static int nf_tables_fill_flowtable_info(struct sk_buff *skb, struct net *net, ...@@ -5969,7 +5969,7 @@ static int nf_tables_fill_flowtable_info(struct sk_buff *skb, struct net *net,
if (!nest) if (!nest)
goto nla_put_failure; goto nla_put_failure;
if (nla_put_be32(skb, NFTA_FLOWTABLE_HOOK_NUM, htonl(flowtable->hooknum)) || if (nla_put_be32(skb, NFTA_FLOWTABLE_HOOK_NUM, htonl(flowtable->hooknum)) ||
nla_put_be32(skb, NFTA_FLOWTABLE_HOOK_PRIORITY, htonl(flowtable->priority))) nla_put_be32(skb, NFTA_FLOWTABLE_HOOK_PRIORITY, htonl(flowtable->data.priority)))
goto nla_put_failure; goto nla_put_failure;
nest_devs = nla_nest_start_noflag(skb, NFTA_FLOWTABLE_HOOK_DEVS); nest_devs = nla_nest_start_noflag(skb, NFTA_FLOWTABLE_HOOK_DEVS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment