Thread (15 messages) 15 messages, 4 authors, 2021-06-01

Re: [PATCH net-next v2 8/8] nfp: flower-ct: add tc merge functionality

From: Marcelo Ricardo Leitner <hidden>
Date: 2021-06-01 14:22:46

On Tue, Jun 01, 2021 at 03:43:25PM +0200, Louis Peens wrote:

On 2021/05/31 20:24, Marcelo Ricardo Leitner wrote:
quoted
On Mon, May 31, 2021 at 02:46:07PM +0200, Simon Horman wrote:
quoted
+static int nfp_ct_do_tc_merge(struct nfp_fl_ct_zone_entry *zt,
+			      struct nfp_fl_ct_flow_entry *ct_entry1,
+			      struct nfp_fl_ct_flow_entry *ct_entry2)
+{
+	struct nfp_fl_ct_flow_entry *post_ct_entry, *pre_ct_entry;
+	struct nfp_fl_ct_tc_merge *m_entry;
+	unsigned long new_cookie[2];
+	int err;
+
+	if (ct_entry1->type == CT_TYPE_PRE_CT) {
+		pre_ct_entry = ct_entry1;
+		post_ct_entry = ct_entry2;
+	} else {
+		post_ct_entry = ct_entry1;
+		pre_ct_entry = ct_entry2;
+	}
+
+	if (post_ct_entry->netdev != pre_ct_entry->netdev)
+		return -EINVAL;
+	if (post_ct_entry->chain_index != pre_ct_entry->chain_index)
+		return -EINVAL;
I would expect this to always fail with OVS/OVN offload, as it always
jump to a new chain after an action:ct call.
Ah, I can see that this may look confusing, I will considering adding
a short comment here for future me as well. The origin for the chain_index
is different for pre_ct and post_ct. For pre_ct the chain_index is populated from
the GOTO action, and for post_ct it is from the match. This checks that the
chain in the action matches the chain in the filter of the next
flow.

The assignment happens in the nfp_fl_ct_handle_pre_ct and nfp_fl_ct_handle_post_ct
functions of [PATCH net-next v2 5/8] nfp: flower-ct: add nfp_fl_ct_flow_entries
Got it. Thanks.

  Marcelo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help