All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edward Cree <ecree.xilinx@gmail.com>
To: Oz Shlomo <ozsh@nvidia.com>, netdev@vger.kernel.org
Cc: Jiri Pirko <jiri@nvidia.com>, Jamal Hadi Salim <jhs@mojatatu.com>,
	Simon Horman <simon.horman@corigine.com>,
	Baowen Zheng <baowen.zheng@corigine.com>,
	Vlad Buslov <vladbu@nvidia.com>, Ido Schimmel <idosch@nvidia.com>,
	Roi Dayan <roid@nvidia.com>
Subject: Re: [ RFC net-next v2 2/2] net: flow_offload: add action stats api
Date: Thu, 6 Oct 2022 10:53:08 +0100	[thread overview]
Message-ID: <c3868497-a299-3796-fe79-439dfb0653d2@gmail.com> (raw)
In-Reply-To: <0d15ac22-df7f-241a-52eb-a6dcf0a67385@nvidia.com>

On 04/10/2022 09:22, Oz Shlomo wrote:
>> @@ -588,6 +596,8 @@ struct flow_cls_offload {
>>       unsigned long cookie;
>>       struct flow_rule *rule;
>>       struct flow_stats stats;
>> +    struct flow_act_stat act_stats[FLOW_OFFLOAD_MAX_ACT_STATS];
> 
> Apparently this array can exceed the stack frame size for several archs (reported by the kernel test bot).

Seems to me like yet another sign this array shouldn't exist in the
 first place and you should be calling a driver offload function per
 action and not trying to squeeze all this through the existing
 flow-rule-centric API.
Why can't the action stats be stored in struct flow_action_entry,
 inside struct flow_rule?  Then, if you really want a single call
 for performance reasons, action-stats-aware drivers could just walk
 through flow_action_for_each(..., &flow_rule->action) and update
 each action's stats based on action->act_cookie.  That should still
 allow proper shared action handling, and seems far more elegant
 than this array.  (Any time you have two arrays and there's a close
 connection between a[i] and b[i], that's a good sign one's elements
 should be a struct member of the other's, rather than them being
 tied together only by index.)

-ed

      reply	other threads:[~2022-10-06  9:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03  6:17 [ RFC net-next v2 0/2] net: flow_offload: add support for per action hw stats Oz Shlomo
2022-10-03  6:17 ` [ RFC net-next v2 1/2] net: sched: Pass flow_stats instead of multiple stats args Oz Shlomo
2022-10-03  6:17 ` [ RFC net-next v2 2/2] net: flow_offload: add action stats api Oz Shlomo
2022-10-03  9:06   ` kernel test robot
2022-10-03  9:57   ` kernel test robot
2022-10-04  8:22   ` Oz Shlomo
2022-10-06  9:53     ` Edward Cree [this message]

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=c3868497-a299-3796-fe79-439dfb0653d2@gmail.com \
    --to=ecree.xilinx@gmail.com \
    --cc=baowen.zheng@corigine.com \
    --cc=idosch@nvidia.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=ozsh@nvidia.com \
    --cc=roid@nvidia.com \
    --cc=simon.horman@corigine.com \
    --cc=vladbu@nvidia.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.