CHAIN_F_BINDING = 0x4,
};
+/**
+ * enum flowtable_flags - flowtable flags
+ *
+ */
+enum flowtable_flags {
+ FLOWTABLE_F_HW_OFFLOAD = 0x1, /* NF_FLOWTABLE_HW_OFFLOAD in linux nf_flow_table.h */
+};
+
/**
* struct prio_spec - extendend priority specification for mixed
* textual/numerical parsing.
nftnl_flowtable_set_u32(flo, NFTNL_FLOWTABLE_PRIO, 0);
}
+ if (cmd->flowtable->flags & FLOWTABLE_F_HW_OFFLOAD) {
+ nftnl_flowtable_set_u32(flo, NFTNL_FLOWTABLE_FLAGS,
+ NFT_FLOWTABLE_HW_OFFLOAD);
+ }
+
if (cmd->flowtable->dev_expr) {
dev_array = nft_flowtable_dev_array(cmd);
nftnl_flowtable_set_data(flo, NFTNL_FLOWTABLE_DEVICES,
xstrdup(nftnl_flowtable_get_str(nlo, NFTNL_FLOWTABLE_NAME));
flowtable->handle.handle.id =
nftnl_flowtable_get_u64(nlo, NFTNL_FLOWTABLE_HANDLE);
+ if (nftnl_flowtable_is_set(nlo, NFTNL_FLOWTABLE_FLAGS))
+ flowtable->flags = nftnl_flowtable_get_u32(nlo, NFTNL_FLOWTABLE_FLAGS);
dev_array = nftnl_flowtable_get(nlo, NFTNL_FLOWTABLE_DEVICES);
while (dev_array[len])
len++;
flowtable_block : /* empty */ { $$ = $<flowtable>-1; }
| flowtable_block common_block
| flowtable_block stmt_separator
+ | flowtable_block ft_flags_spec stmt_separator
| flowtable_block HOOK STRING prio_spec stmt_separator
{
$$->hook.loc = @3;
}
;
+ft_flags_spec : FLAGS OFFLOAD
+ {
+ $<flowtable>0->flags |= FLOWTABLE_F_HW_OFFLOAD;
+ }
+ ;
+
policy_spec : POLICY policy_expr
{
if ($<chain>0->policy) {
nft_print(octx, " }%s", opts->stmt_separator);
}
+ if (flowtable->flags & NFT_FLOWTABLE_HW_OFFLOAD)
+ nft_print(octx, "%s%sflags offload;%s", opts->tab, opts->tab,
+ opts->stmt_separator);
+
if (flowtable->flags & NFT_FLOWTABLE_COUNTER)
nft_print(octx, "%s%scounter%s", opts->tab, opts->tab,
opts->stmt_separator);