netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: wenxu <wenxu@ucloud.cn>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next] netfilter:nf_flow_table: add HW stats type support in flowtable
Date: Fri, 20 Mar 2020 20:36:17 +0800	[thread overview]
Message-ID: <84bc5ac8-0f3c-c609-84e0-035bdd979c6d@ucloud.cn> (raw)
In-Reply-To: <20200320121048.siaonqjufl4btb72@salvia>


在 2020/3/20 20:10, Pablo Neira Ayuso 写道:
> On Fri, Mar 20, 2020 at 03:34:17PM +0800, wenxu@ucloud.cn wrote:
> [...]
>> diff --git a/net/netfilter/nf_flow_table_offload.c b/net/netfilter/nf_flow_table_offload.c
>> index ad54931..60289a6 100644
>> --- a/net/netfilter/nf_flow_table_offload.c
>> +++ b/net/netfilter/nf_flow_table_offload.c
>> @@ -165,8 +165,16 @@ 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;
>> +
>> +	BUILD_BUG_ON(NFTA_HW_STATS_TYPE_ANY != FLOW_ACTION_HW_STATS_ANY);
>> +	BUILD_BUG_ON(NFTA_HW_STATS_TYPE_IMMEDIATE != FLOW_ACTION_HW_STATS_IMMEDIATE);
>> +	BUILD_BUG_ON(NFTA_HW_STATS_TYPE_DELAYED != FLOW_ACTION_HW_STATS_DELAYED);
>> +
>> +	entry = &flow_rule->rule->action.entries[i];
>> +	entry->hw_stats_type = flow_rule->hw_stats_type;
> Please, use FLOW_ACTION_HW_STATS_ANY by now. Remove the uapi code,
> from this patch.
>
> I'm not sure how users will be using this new knob.
>
> At this stage, I think the drivers knows much better what type to pick
> than the user.
Yes, I agree.
>
> You also have to explain me how you are testing things.

I test the flowtable offload with mlnx driver. ALL the flow add in 
driver failed for checking

the hw_stats_type of flow action.


static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
                                 struct flow_action *flow_action,
                                 struct mlx5e_tc_flow *flow,
                                 struct netlink_ext_ack *extack)
{
         ................


         if (!flow_action_hw_stats_check(flow_action, extack,
FLOW_ACTION_HW_STATS_DELAYED_BIT))
                 return -EOPNOTSUPP;

Indeed always set the hw_stats_type of flow_action to 
FLOW_ACTION_HW_STATS_ANY can fix this.

But maybe it can provide a knob for user? Curently with this patch the 
user don't

need set any value with default value FLOW_ACTION_HW_STATS in the kernel.

>
> Thank you.
>

  reply	other threads:[~2020-03-20 12:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20  7:34 [PATCH nf-next] netfilter:nf_flow_table: add HW stats type support in flowtable wenxu
2020-03-20 12:10 ` Pablo Neira Ayuso
2020-03-20 12:36   ` wenxu [this message]
2020-03-20 13:03     ` Pablo Neira Ayuso

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=84bc5ac8-0f3c-c609-84e0-035bdd979c6d@ucloud.cn \
    --to=wenxu@ucloud.cn \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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).