From: Simon Horman <simon.horman@corigine.com>
To: Vlad Buslov <vladbu@nvidia.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,
marcelo.leitner@gmail.com,
Baowen Zheng <baowen.zheng@corigine.com>,
oss-drivers@corigine.com
Subject: Re: [PATCH net-next v1 1/7] net: flow_offload: provision conntrack info in ct_metadata
Date: Fri, 13 Jan 2023 10:12:38 +0100 [thread overview]
Message-ID: <Y8EghrLt1rtcYSv/@corigine.com> (raw)
In-Reply-To: <20230110133023.2366381-2-vladbu@nvidia.com>
+ Baowen Zheng, oss-drivers@corigine.com
On Tue, Jan 10, 2023 at 02:30:17PM +0100, Vlad Buslov wrote:
> In order to offload connections in other states besides "established" the
> driver offload callbacks need to have access to connection conntrack info.
> Extend flow offload intermediate representation data structure
> flow_action_entry->ct_metadata with new enum ip_conntrack_info field and
> fill it in tcf_ct_flow_table_add_action_meta() callback.
>
> Reject offloading IP_CT_NEW connections for now by returning an error in
> relevant driver callbacks based on value of ctinfo. Support for offloading
> such connections will need to be added to the drivers afterwards.
>
> Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
> ---
...
> diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
> index f693119541d5..2c550a1792b7 100644
> --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
> +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
> @@ -1964,6 +1964,23 @@ int nfp_fl_ct_stats(struct flow_cls_offload *flow,
> return 0;
> }
>
> +static bool
> +nfp_fl_ct_offload_supported(struct flow_cls_offload *flow)
> +{
> + struct flow_rule *flow_rule = flow->rule;
> + struct flow_action *flow_action =
> + &flow_rule->action;
> + struct flow_action_entry *act;
> + int i;
> +
> + flow_action_for_each(i, act, flow_action) {
> + if (act->id == FLOW_ACTION_CT_METADATA)
> + return act->ct_metadata.ctinfo != IP_CT_NEW;
> + }
> +
> + return false;
> +}
> +
Hi Vlad,
Some feedback from Baowen Zheng, who asked me to pass it on here:
It is confusing that after FLOW_ACTION_CT_METADATA check, this functoin
will return false, that is -EOPNOTSUPP.
Since this function is only used to check nft table, It seems better to
change its name to nfp_fl_ct_offload_nft_supported(). This would make things
clearer and may avoid it being used in the wrong way.
...
next prev parent reply other threads:[~2023-01-13 9:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-10 13:30 [PATCH net-next v1 0/7] Allow offloading of UDP NEW connections via act_ct Vlad Buslov
2023-01-10 13:30 ` [PATCH net-next v1 1/7] net: flow_offload: provision conntrack info in ct_metadata Vlad Buslov
2023-01-10 15:14 ` kernel test robot
2023-01-10 20:27 ` kernel test robot
2023-01-10 20:37 ` kernel test robot
2023-01-10 20:47 ` kernel test robot
2023-01-13 9:12 ` Simon Horman [this message]
2023-01-13 16:15 ` Vlad Buslov
2023-01-17 7:55 ` Simon Horman
2023-01-10 13:30 ` [PATCH net-next v1 2/7] netfilter: flowtable: fixup UDP timeout depending on ct state Vlad Buslov
2023-01-10 13:30 ` [PATCH net-next v1 3/7] netfilter: flowtable: allow unidirectional rules Vlad Buslov
2023-01-10 13:30 ` [PATCH net-next v1 4/7] netfilter: flowtable: allow updating offloaded rules asynchronously Vlad Buslov
2023-01-10 13:30 ` [PATCH net-next v1 5/7] net/sched: act_ct: set ctinfo in meta action depending on ct state Vlad Buslov
2023-01-10 13:30 ` [PATCH net-next v1 6/7] net/sched: act_ct: offload UDP NEW connections Vlad Buslov
2023-01-10 13:30 ` [PATCH net-next v1 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=Y8EghrLt1rtcYSv/@corigine.com \
--to=simon.horman@corigine.com \
--cc=baowen.zheng@corigine.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=oss-drivers@corigine.com \
--cc=ozsh@nvidia.com \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=vladbu@nvidia.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).