All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <mleitner@redhat.com>
To: Roi Dayan <roid@mellanox.com>
Cc: netdev@vger.kernel.org, pablo@netfilter.org, davem@davemloft.net,
	Jiri Pirko <jiri@mellanox.com>, Paul Blakey <paulb@mellanox.com>,
	Oz Shlomo <ozsh@mellanox.com>, Alaa Hleihel <alaa@mellanox.com>
Subject: Re: [PATCH net 1/2] net/sched: act_ct: Make tcf_ct_flow_table_restore_skb inline
Date: Mon, 15 Jun 2020 11:06:44 -0300	[thread overview]
Message-ID: <20200615140644.GR47542@localhost.localdomain> (raw)
In-Reply-To: <20200614111249.6145-2-roid@mellanox.com>

On Sun, Jun 14, 2020 at 02:12:48PM +0300, Roi Dayan wrote:
> From: Alaa Hleihel <alaa@mellanox.com>
> 
> Currently, tcf_ct_flow_table_restore_skb is exported by act_ct
> module, therefore modules using it will have hard-dependency
> on act_ct and will require loading it all the time.
> 
> This can lead to an unnecessary overhead on systems that do not
> use hardware connection tracking action (ct_metadata action) in
> the first place.
> 
> To relax the hard-dependency between the modules, we unexport this
> function and make it a static inline one.
> 
> Fixes: 30b0cf90c6dd ("net/sched: act_ct: Support restoring conntrack info on skbs")
> Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
> Reviewed-by: Roi Dayan <roid@mellanox.com>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

> ---
>  include/net/tc_act/tc_ct.h | 11 ++++++++++-
>  net/sched/act_ct.c         | 11 -----------
>  2 files changed, 10 insertions(+), 12 deletions(-)
> 
> diff --git a/include/net/tc_act/tc_ct.h b/include/net/tc_act/tc_ct.h
> index 79654bcb9a29..8250d6f0a462 100644
> --- a/include/net/tc_act/tc_ct.h
> +++ b/include/net/tc_act/tc_ct.h
> @@ -66,7 +66,16 @@ static inline struct nf_flowtable *tcf_ct_ft(const struct tc_action *a)
>  #endif /* CONFIG_NF_CONNTRACK */
>  
>  #if IS_ENABLED(CONFIG_NET_ACT_CT)
> -void tcf_ct_flow_table_restore_skb(struct sk_buff *skb, unsigned long cookie);
> +static inline void
> +tcf_ct_flow_table_restore_skb(struct sk_buff *skb, unsigned long cookie)
> +{
> +	enum ip_conntrack_info ctinfo = cookie & NFCT_INFOMASK;
> +	struct nf_conn *ct;
> +
> +	ct = (struct nf_conn *)(cookie & NFCT_PTRMASK);
> +	nf_conntrack_get(&ct->ct_general);
> +	nf_ct_set(skb, ct, ctinfo);
> +}
>  #else
>  static inline void
>  tcf_ct_flow_table_restore_skb(struct sk_buff *skb, unsigned long cookie) { }
> diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
> index e29f0f45d688..e9f3576cbf71 100644
> --- a/net/sched/act_ct.c
> +++ b/net/sched/act_ct.c
> @@ -1543,17 +1543,6 @@ static void __exit ct_cleanup_module(void)
>  	destroy_workqueue(act_ct_wq);
>  }
>  
> -void tcf_ct_flow_table_restore_skb(struct sk_buff *skb, unsigned long cookie)
> -{
> -	enum ip_conntrack_info ctinfo = cookie & NFCT_INFOMASK;
> -	struct nf_conn *ct;
> -
> -	ct = (struct nf_conn *)(cookie & NFCT_PTRMASK);
> -	nf_conntrack_get(&ct->ct_general);
> -	nf_ct_set(skb, ct, ctinfo);
> -}
> -EXPORT_SYMBOL_GPL(tcf_ct_flow_table_restore_skb);
> -
>  module_init(ct_init_module);
>  module_exit(ct_cleanup_module);
>  MODULE_AUTHOR("Paul Blakey <paulb@mellanox.com>");
> -- 
> 2.8.4
> 


  reply	other threads:[~2020-06-15 14:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-14 11:12 [PATCH net 0/2] remove dependency between mlx5, act_ct, nf_flow_table Roi Dayan
2020-06-14 11:12 ` [PATCH net 1/2] net/sched: act_ct: Make tcf_ct_flow_table_restore_skb inline Roi Dayan
2020-06-15 14:06   ` Marcelo Ricardo Leitner [this message]
2020-06-14 11:12 ` [PATCH net 2/2] netfilter: flowtable: Make nf_flow_table_offload_add/del_cb inline Roi Dayan
2020-06-15 14:24   ` Marcelo Ricardo Leitner
2020-06-16  1:07 ` [PATCH net 0/2] remove dependency between mlx5, act_ct, nf_flow_table David Miller

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=20200615140644.GR47542@localhost.localdomain \
    --to=mleitner@redhat.com \
    --cc=alaa@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jiri@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ozsh@mellanox.com \
    --cc=pablo@netfilter.org \
    --cc=paulb@mellanox.com \
    --cc=roid@mellanox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.