mbox series

[net-next,0/4] net/sched: act_api: contiguous action arrays

Message ID 20231130152041.13513-1-pctammela@mojatatu.com (mailing list archive)
Headers show
Series net/sched: act_api: contiguous action arrays | expand

Message

Pedro Tammela Nov. 30, 2023, 3:20 p.m. UTC
When dealing with action arrays in act_api it's natural to ask if they
are always contiguous (no NULL pointers in between). Yes, they are in
all cases so far, so make use of the already present tcf_act_for_each_action
macro to explicitly document this assumption.

There was an instance where it was not, but it was refactorable (patch 2)
to make the array contiguous.

Pedro Tammela (4):
  net/sched: act_api: use tcf_act_for_each_action
  net/sched: act_api: avoid non-contiguous action array
  net/sched: act_api: stop loop over ops array on NULL in
    tcf_action_init
  net/sched: act_api: use tcf_act_for_each_action in tcf_idr_insert_many

 net/sched/act_api.c | 57 ++++++++++++++++++++++++---------------------
 1 file changed, 30 insertions(+), 27 deletions(-)

Comments

Jakub Kicinski Dec. 1, 2023, 5:33 p.m. UTC | #1
On Thu, 30 Nov 2023 12:20:37 -0300 Pedro Tammela wrote:
> When dealing with action arrays in act_api it's natural to ask if they
> are always contiguous (no NULL pointers in between). Yes, they are in
> all cases so far, so make use of the already present tcf_act_for_each_action
> macro to explicitly document this assumption.
> 
> There was an instance where it was not, but it was refactorable (patch 2)
> to make the array contiguous.

Hi Pedro, this appears not to apply.
Pedro Tammela Dec. 1, 2023, 5:34 p.m. UTC | #2
On 01/12/2023 14:33, Jakub Kicinski wrote:
> On Thu, 30 Nov 2023 12:20:37 -0300 Pedro Tammela wrote:
>> When dealing with action arrays in act_api it's natural to ask if they
>> are always contiguous (no NULL pointers in between). Yes, they are in
>> all cases so far, so make use of the already present tcf_act_for_each_action
>> macro to explicitly document this assumption.
>>
>> There was an instance where it was not, but it was refactorable (patch 2)
>> to make the array contiguous.
> 
> Hi Pedro, this appears not to apply.

Oops, will respin, thanks!