Skip to content

Commit d64aaf3

Browse files
Kaaameanguy11
authored andcommitted
i40e: Disallow ip4 and ip6 l4_4_bytes
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: 36777d9 ("i40e: check current configured input set when adding ntuple filters") Signed-off-by: Przemyslaw Patynowski <[email protected]> Signed-off-by: Kamil Maziarz <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Tested-by: Gurucharan G <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent 0850197 commit d64aaf3

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4464,11 +4464,7 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi,
44644464
return -EOPNOTSUPP;
44654465

44664466
/* First 4 bytes of L4 header */
4467-
if (usr_ip4_spec->l4_4_bytes == htonl(0xFFFFFFFF))
4468-
new_mask |= I40E_L4_SRC_MASK | I40E_L4_DST_MASK;
4469-
else if (!usr_ip4_spec->l4_4_bytes)
4470-
new_mask &= ~(I40E_L4_SRC_MASK | I40E_L4_DST_MASK);
4471-
else
4467+
if (usr_ip4_spec->l4_4_bytes)
44724468
return -EOPNOTSUPP;
44734469

44744470
/* Filtering on Type of Service is not supported. */
@@ -4507,11 +4503,7 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi,
45074503
else
45084504
return -EOPNOTSUPP;
45094505

4510-
if (usr_ip6_spec->l4_4_bytes == htonl(0xFFFFFFFF))
4511-
new_mask |= I40E_L4_SRC_MASK | I40E_L4_DST_MASK;
4512-
else if (!usr_ip6_spec->l4_4_bytes)
4513-
new_mask &= ~(I40E_L4_SRC_MASK | I40E_L4_DST_MASK);
4514-
else
4506+
if (usr_ip6_spec->l4_4_bytes)
45154507
return -EOPNOTSUPP;
45164508

45174509
/* Filtering on Traffic class is not supported. */

0 commit comments

Comments
 (0)