RE: [EXT] Re: [PATCH V3] octeontx2-pf: Add additional check for MCAM rules

From: Suman Ghosh
Date: Thu Jul 06 2023 - 13:35:06 EST


>-----Original Message-----
>From: Simon Horman <simon.horman@xxxxxxxxxxxx>
>Sent: Tuesday, July 4, 2023 7:17 PM
>To: Suman Ghosh <sumang@xxxxxxxxxxx>
>Cc: Sunil Kovvuri Goutham <sgoutham@xxxxxxxxxxx>; Geethasowjanya Akula
><gakula@xxxxxxxxxxx>; Subbaraya Sundeep Bhatta <sbhatta@xxxxxxxxxxx>;
>Hariprasad Kelam <hkelam@xxxxxxxxxxx>; davem@xxxxxxxxxxxxx;
>edumazet@xxxxxxxxxx; kuba@xxxxxxxxxx; pabeni@xxxxxxxxxx;
>netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
>Subject: [EXT] Re: [PATCH V3] octeontx2-pf: Add additional check for
>MCAM rules
>
>External Email
>
>----------------------------------------------------------------------
>On Mon, Jul 03, 2023 at 10:30:54PM +0530, Suman Ghosh wrote:
>> Due to hardware limitation, MCAM drop rule with ether_type == 802.1Q
>> and vlan_id == 0 is not supported. Hence rejecting such rules.
>>
>> Fixes: dce677da57c0 ("octeontx2-pf: Add vlan-etype to ntuple filters")
>> Signed-off-by: Suman Ghosh <sumang@xxxxxxxxxxx>
>> ---
>> Changes since v2:
>> - Added "fixes" tag
>>
>> .../net/ethernet/marvell/octeontx2/nic/otx2_flows.c | 7 +++++++
>> .../net/ethernet/marvell/octeontx2/nic/otx2_tc.c | 13
>+++++++++++++
>> 2 files changed, 20 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c
>> b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c
>> index 10e11262d48a..49ba27875111 100644
>> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c
>> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c
>> @@ -871,6 +871,13 @@ static int otx2_prepare_flow_request(struct
>ethtool_rx_flow_spec *fsp,
>> if (be16_to_cpu(fsp->m_ext.vlan_etype) != 0xFFFF)
>> return -EINVAL;
>>
>> + /* Drop rule with vlan_etype == 802.1Q
>> + * and vlan_id == 0 is not supported
>> + */
>> + if (vlan_etype == ETH_P_8021Q && !fsp->m_ext.vlan_tci &&
>> + fsp->ring_cookie == RX_CLS_FLOW_DISC)
>> + return -EINVAL;
>> +
>
>Hi Suman,
>
>vlan_etype appears to be uninitialised here.
[Suman] yes. Moved the assignment of vlan_etype before the checkin v4. Hence no need for initialization now.
>
>> vlan_etype = be16_to_cpu(fsp->h_ext.vlan_etype);
>
>Perhaps the new check should go here.
[Suman] Ack.
>
>> /* Only ETH_P_8021Q and ETH_P_802AD types supported */
>> if (vlan_etype != ETH_P_8021Q &&
>
>As noted by Jakub elsewhere, please allow 24h from the posting of v3
>before posting v4.
>
>--
>pw-bot: changes-requested