netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Buslov <vladbu@nvidia.com>
To: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<pablo@netfilter.org>, <netdev@vger.kernel.org>,
	<netfilter-devel@vger.kernel.org>, <jhs@mojatatu.com>,
	<xiyou.wangcong@gmail.com>, <jiri@resnulli.us>, <ozsh@nvidia.com>,
	<simon.horman@corigine.com>
Subject: Re: [PATCH net-next v2 1/7] net: flow_offload: provision conntrack info in ct_metadata
Date: Tue, 17 Jan 2023 19:28:09 +0200	[thread overview]
Message-ID: <87edrtcbks.fsf@nvidia.com> (raw)
In-Reply-To: <Y8a6JCG6iUFTr1Q1@t14s.localdomain>

On Tue 17 Jan 2023 at 12:09, Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> wrote:
> On Tue, Jan 17, 2023 at 12:04:32PM -0300, Marcelo Ricardo Leitner wrote:
>> On Fri, Jan 13, 2023 at 05:55:42PM +0100, Vlad Buslov wrote:
>> ...
>> >  struct flow_match {
>> > @@ -288,6 +289,7 @@ struct flow_action_entry {
>> >  		} ct;
>> >  		struct {
>> >  			unsigned long cookie;
>> > +			enum ip_conntrack_info ctinfo;
>> >  			u32 mark;
>> >  			u32 labels[4];
>> >  			bool orig_dir;
>> > diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
>> > index 0ca2bb8ed026..515577f913a3 100644
>> > --- a/net/sched/act_ct.c
>> > +++ b/net/sched/act_ct.c
>> > @@ -187,6 +187,7 @@ static void tcf_ct_flow_table_add_action_meta(struct nf_conn *ct,
>> >  	/* aligns with the CT reference on the SKB nf_ct_set */
>> >  	entry->ct_metadata.cookie = (unsigned long)ct | ctinfo;
>>                                                    ^^^^^^^^^^^
>
> Hmm. Thought that just came up and still need to dig into, but wanted
> to share/ask already. Would it be a problem to update the cookie later
> on then, to reflect the new ctinfo?

Not sure I'm following, but every time the flow changes state it is
updated in the driver since new metadata is generated by calling
tcf_ct_flow_table_fill_actions() from nf_flow_offload_rule_alloc().

>
>> 
>> >  	entry->ct_metadata.orig_dir = dir == IP_CT_DIR_ORIGINAL;
>> > +	entry->ct_metadata.ctinfo = ctinfo;
>> 
>> tcf_ct_flow_table_restore_skb() is doing:
>>         enum ip_conntrack_info ctinfo = cookie & NFCT_INFOMASK;
>> 
>> Not sure if it really needs this duplication then.
>> 
>> >  
>> >  	act_ct_labels = entry->ct_metadata.labels;
>> >  	ct_labels = nf_ct_labels_find(ct);
>> > -- 
>> > 2.38.1
>> > 


  reply	other threads:[~2023-01-17 17:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 16:55 [PATCH net-next v2 0/7] Allow offloading of UDP NEW connections via act_ct Vlad Buslov
2023-01-13 16:55 ` [PATCH net-next v2 1/7] net: flow_offload: provision conntrack info in ct_metadata Vlad Buslov
2023-01-17 14:42   ` Pablo Neira Ayuso
2023-01-17 17:43     ` Vlad Buslov
2023-01-17 15:04   ` Marcelo Ricardo Leitner
2023-01-17 15:09     ` Marcelo Ricardo Leitner
2023-01-17 17:28       ` Vlad Buslov [this message]
2023-01-19  4:15         ` Marcelo Ricardo Leitner
2023-01-17 17:25     ` Vlad Buslov
2023-01-13 16:55 ` [PATCH net-next v2 2/7] netfilter: flowtable: fixup UDP timeout depending on ct state Vlad Buslov
2023-01-13 16:55 ` [PATCH net-next v2 3/7] netfilter: flowtable: allow unidirectional rules Vlad Buslov
2023-01-17 15:15   ` Marcelo Ricardo Leitner
2023-01-17 17:31     ` Vlad Buslov
2023-01-13 16:55 ` [PATCH net-next v2 4/7] netfilter: flowtable: allow updating offloaded rules asynchronously Vlad Buslov
2023-01-17 15:28   ` Marcelo Ricardo Leitner
2023-01-17 17:33     ` Vlad Buslov
2023-01-17 17:47       ` Marcelo Ricardo Leitner
2023-01-13 16:55 ` [PATCH net-next v2 5/7] net/sched: act_ct: set ctinfo in meta action depending on ct state Vlad Buslov
2023-01-13 16:55 ` [PATCH net-next v2 6/7] net/sched: act_ct: offload UDP NEW connections Vlad Buslov
2023-01-17 15:41   ` Marcelo Ricardo Leitner
2023-01-17 17:36     ` Vlad Buslov
2023-01-17 17:56       ` Marcelo Ricardo Leitner
2023-01-17 19:12         ` Vlad Buslov
2023-01-19  4:18           ` Marcelo Ricardo Leitner
2023-01-13 16:55 ` [PATCH net-next v2 7/7] netfilter: nf_conntrack: allow early drop of offloaded UDP conns Vlad Buslov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edrtcbks.fsf@nvidia.com \
    --to=vladbu@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=ozsh@nvidia.com \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=simon.horman@corigine.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).