] [
.I COOKIESPEC
] [
+.I FLAGS
+] [
.I CONTROL
]
:=
.BI cookie " COOKIE"
+.I FLAGS
+:=
+.I no_percpu
+
.I ACTDETAIL
:=
.I ACTNAME ACTPARAMS
The value to be stored is completely arbitrary and does not require a specific
format. It is stored inside the action structure itself.
+.TP
+.I FLAGS
+Action-specific flags. Currently, the only supported flag is
+.I no_percpu
+which indicates that action is expected to have minimal software data-path
+traffic and doesn't need to allocate stat counters with percpu allocator.
+This option is intended to be used by hardware-offloaded actions.
+
.TP
.BI since " MSTIME"
When dumping large number of actions, a millisecond time-filter can be
addattr_l(n, MAX_MSG, TCA_ACT_COOKIE,
&act_ck, act_ck_len);
+ if (*argv && strcmp(*argv, "no_percpu") == 0) {
+ struct nla_bitfield32 flags =
+ { TCA_ACT_FLAGS_NO_PERCPU_STATS,
+ TCA_ACT_FLAGS_NO_PERCPU_STATS };
+
+ addattr_l(n, MAX_MSG, TCA_ACT_FLAGS, &flags,
+ sizeof(struct nla_bitfield32));
+ NEXT_ARG_FWD();
+ }
+
addattr_nest_end(n, tail);
ok++;
}
strsz, b1, sizeof(b1)));
print_string(PRINT_FP, NULL, "%s", _SL_);
}
+ if (tb[TCA_ACT_FLAGS]) {
+ struct nla_bitfield32 *flags = RTA_DATA(tb[TCA_ACT_FLAGS]);
+
+ if (flags->selector & TCA_ACT_FLAGS_NO_PERCPU_STATS)
+ print_bool(PRINT_ANY, "no_percpu", "\tno_percpu",
+ flags->value &
+ TCA_ACT_FLAGS_NO_PERCPU_STATS);
+ print_string(PRINT_FP, NULL, "%s", _SL_);
+ }
return 0;
}