Skip to contentSkip to conversation

netfilter: nf_flow_table_offload: set hw_stats_type of flow_action_entry to FLOW_ACTION_HW_STATS_ANY

PATCH In review [email protected] 2 participants 4 messages Mar 20, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 netfilter: nf_flow_table_offload: set hw_stats_type of flow_action_entry to FLOW_ACTION_HW_STATS_ANY

From: wenxu <[email protected]>

Set hw_stats_type of flow_action_entry to FLOW_ACTION_HW_STATS_ANY to follow the driver behavior.

---
 net/netfilter/nf_flow_table_offload.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/netfilter/nf_flow_table_offload.c +5 -1
index a68136a..88d2ac5 100644
@@ -165,8 +165,12 @@ static void flow_offload_mangle(struct flow_action_entry *entry,
 flow_action_entry_next(struct nf_flow_rule *flow_rule)
 {
 	int i = flow_rule->rule->action.num_entries++;
+	struct flow_action_entry *entry;
+
+	entry = &flow_rule->rule->action.entries[i];
+	entry->hw_stats_type = FLOW_ACTION_HW_STATS_ANY;
 
-	return &flow_rule->rule->action.entries[i];
+	return entry;
 }
 
 static int flow_offload_eth_src(struct net *net,
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 4 lines · On Fri, Mar 20, 2020 at 08:57:09PM +0800, [email protected] wrote:

From: wenxu <[email protected]>

Set hw_stats_type of flow_action_entry to FLOW_ACTION_HW_STATS_ANY to follow the driver behavior.

Now you have to explain me how you are going to use this.

There is no support for packet/bytes stats right now.

Thank you.

author
#2 lore raw
Quoted 10 lines · Pablo Neira Ayuso
Quoted 4 lines · On Fri, Mar 20, 2020 at 08:57:09PM +0800, [email protected] wrote:

From: wenxu <[email protected]>

Set hw_stats_type of flow_action_entry to FLOW_ACTION_HW_STATS_ANY to follow the driver behavior.

Now you have to explain me how you are going to use this.

There is no support for packet/bytes stats right now.

Thank you.

The FLOW_ACTION_HW_STATS_ANY flags is the default behavior and

can avoid the failure of flow inserting. We don't nedd to use this.

Quoted 1 line
#3 lore raw
Quoted 7 lines · wenxu
Quoted 5 lines · Pablo Neira Ayuso
Quoted 4 lines · On Fri, Mar 20, 2020 at 08:57:09PM +0800, [email protected] wrote:

From: wenxu <[email protected]>

Set hw_stats_type of flow_action_entry to FLOW_ACTION_HW_STATS_ANY to follow the driver behavior.

Quoted 8 lines
Quoted 5 lines

Now you have to explain me how you are going to use this.

There is no support for packet/bytes stats right now.

Thank you.

The FLOW_ACTION_HW_STATS_ANY flags is the default behavior and can avoid the failure of flow inserting. We don't nedd to use this.

OK, no worries, I'll keep back this patch. Thank you.