[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9e8bf9f7-38e9-8bb8-b568-873288a011ca@nvidia.com>
Date: Tue, 15 Mar 2022 11:53:20 +0200
From: Roi Dayan <roid@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, Maor Dickman <maord@...dia.com>,
"David S. Miller" <davem@...emloft.net>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...dia.com>
Subject: Re: [PATCH net-next 1/3] net/sched: add vlan push_eth and pop_eth
action to the hardware IR
On 2022-03-15 7:02 AM, Jakub Kicinski wrote:
> Sorry for the late review.
>
> On Wed, 9 Mar 2022 15:02:54 +0200 Roi Dayan wrote:
>> @@ -211,6 +213,8 @@ struct flow_action_entry {
>> __be16 proto;
>> u8 prio;
>> } vlan;
>> + unsigned char vlan_push_eth_dst[ETH_ALEN];
>> + unsigned char vlan_push_eth_src[ETH_ALEN];
>
> Let's wrap these two in a struct, like all other members here,
> and add the customary comment indicating which action its for.
>
ok.
>> struct { /* FLOW_ACTION_MANGLE */
>> /* FLOW_ACTION_ADD */
>> enum flow_action_mangle_base htype;
>> diff --git a/include/net/tc_act/tc_vlan.h b/include/net/tc_act/tc_vlan.h
>> index f94b8bc26f9e..8a3422c70f9f 100644
>> --- a/include/net/tc_act/tc_vlan.h
>> +++ b/include/net/tc_act/tc_vlan.h
>> @@ -78,4 +78,18 @@ static inline u8 tcf_vlan_push_prio(const struct tc_action *a)
>>
>> return tcfv_push_prio;
>> }
>> +
>> +static inline void tcf_vlan_push_dst(unsigned char *dest, const struct tc_action *a)
>> +{
>> + rcu_read_lock();
>> + memcpy(dest, rcu_dereference(to_vlan(a)->vlan_p)->tcfv_push_dst, ETH_ALEN);
>> + rcu_read_unlock();
>> +}
>> +
>> +static inline void tcf_vlan_push_src(unsigned char *dest, const struct tc_action *a)
>> +{
>> + rcu_read_lock();
>> + memcpy(dest, rcu_dereference(to_vlan(a)->vlan_p)->tcfv_push_src, ETH_ALEN);
>> + rcu_read_unlock();
>> +}
>
> The use of these two helpers separately makes no sense, we can't push
> half a header. It should be one helper populating both src and dst, IMO.
ok.
Powered by blists - more mailing lists