提交 e43521dc 编写于 作者: P Przemyslaw Patynowski 提交者: sanglipeng

i40e: Disallow ip4 and ip6 l4_4_bytes

stable inclusion
from stable-v5.10.159
commit a2506b19d7a33c0dc2686368876f1d563430421f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7NTXH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a2506b19d7a33c0dc2686368876f1d563430421f

--------------------------------

[ Upstream commit d64aaf3f ]

Return -EOPNOTSUPP, when user requests l4_4_bytes for raw IP4 or
IP6 flow director filters. Flow director does not support filtering
on l4 bytes for PCTYPEs used by IP4 and IP6 filters.
Without this patch, user could create filters with l4_4_bytes fields,
which did not do any filtering on L4, but only on L3 fields.

Fixes: 36777d9f ("i40e: check current configured input set when adding ntuple filters")
Signed-off-by: NPrzemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: NKamil Maziarz  <kamil.maziarz@intel.com>
Reviewed-by: NJacob Keller <jacob.e.keller@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 d652de71
...@@ -4246,11 +4246,7 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi, ...@@ -4246,11 +4246,7 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi,
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* First 4 bytes of L4 header */ /* First 4 bytes of L4 header */
if (usr_ip4_spec->l4_4_bytes == htonl(0xFFFFFFFF)) if (usr_ip4_spec->l4_4_bytes)
new_mask |= I40E_L4_SRC_MASK | I40E_L4_DST_MASK;
else if (!usr_ip4_spec->l4_4_bytes)
new_mask &= ~(I40E_L4_SRC_MASK | I40E_L4_DST_MASK);
else
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* Filtering on Type of Service is not supported. */ /* Filtering on Type of Service is not supported. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册