lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 27 Oct 2022 11:10:21 +0300
From:   Roi Dayan <roid@...dia.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     Amritha Nambiar <amritha.nambiar@...el.com>,
        netdev@...r.kernel.org, alexander.duyck@...il.com,
        jhs@...atatu.com, jiri@...nulli.us, xiyou.wangcong@...il.com,
        vinicius.gomes@...el.com, sridhar.samudrala@...el.com,
        Maor Dickman <maord@...dia.com>,
        Tariq Toukan <tariqt@...dia.com>,
        Saeed Mahameed <saeedm@...dia.com>,
        Leon Romanovsky <leon@...nel.org>,
        Pablo Neira Ayuso <pablo@...filter.org>
Subject: Re: [net-next PATCH v3 1/3] act_skbedit: skbedit queue mapping for
 receive queue



On 27/10/2022 10:12, Roi Dayan wrote:
> 
> 
> On 26/10/2022 19:17, Jakub Kicinski wrote:
>> On Wed, 26 Oct 2022 14:40:39 +0300 Roi Dayan wrote:
>>> This patch broke mlx5_core TC offloads.
>>> We have a generic code part going over the enum values and have a list
>>> of action pointers to handle parsing each action without knowing the action.
>>> The list of actions depends on being aligned with the values order of
>>> the enum which I think usually new values should go to the end of the list.
>>> I'm not sure if other code parts are broken from this change but at
>>> least one part is.
>>> New values were always inserted at the end.
>>>
>>> Can you make a fixup patch to move FLOW_ACTION_RX_QUEUE_MAPPING to
>>> the end of the enum list?
>>> i.e. right before NUM_FLOW_ACTIONS.
>>
>> Odd, can you point us to the exact code that got broken?
>> There are no guarantees on ordering of kernel-internal enum
>> and I think it's a bad idea to make such precedent.
> 
> 
> ok. I were in the thought order is kept.
> 
> You can see our usage in drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> in function parse_tc_actions().
> we loop over the actions and get a struct with function pointers
> that represent the flow action and we use those function pointers
> to parse whats needed without parse_tc_actions() knowing the action.
> 
> the function pointers are in drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c
> see static struct mlx5e_tc_act *tc_acts_fdb[NUM_FLOW_ACTIONS].
> each function handling code is in a different file under that sub folder.
> 
> if order is not important i guess i'll do a function to return the ops i need
> per enum value.
> please let me know if to continue this road.
> thanks

Hi,

going to do this change, which I didn't remember to do from the start.

static struct mlx5e_tc_act *tc_acts_fdb[NUM_FLOW_ACTIONS] = {                                       
        [FLOW_ACTION_ACCEPT] = &mlx5e_tc_act_accept,                                                
        [FLOW_ACTION_DROP] = &mlx5e_tc_act_drop,                                                    
        [FLOW_ACTION_TRAP] = &mlx5e_tc_act_trap,                                                    
        [FLOW_ACTION_GOTO] = &mlx5e_tc_act_goto,                 
.
.
.


then the ordering is not important.

Thanks,
Roi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ