i40e: program fragmented IPv4 filter input set
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 27 Dec 2017 13:24:12 +0000 (08:24 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Apr 2018 09:02:12 +0000 (11:02 +0200)
[ Upstream commit 02b4016bfe43d2d5ed043be7ffa56cda6a4d1100 ]

When implementing support for IP_USER_FLOW filters, we correctly
programmed a filter for both the non fragmented IPv4/Other filter, as
well as the fragmented IPv4 filters. However, we did not properly
program the input set for fragmented IPv4 PCTYPE. This meant that the
filters would almost certainly not match, unless the user specified all
of the flow types.

Add support to program the fragmented IPv4 filter input set. Since we
always program these filters together, we'll assume that the two input
sets must match, and will thus always program the input sets to the same
value.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c

index 05e89864f781c361289f0a3170078a661988389b..fc27ba5caa556ba6e9105b40db28561fd70a1e8a 100644 (file)
@@ -3648,6 +3648,16 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi,
 
        i40e_write_fd_input_set(pf, index, new_mask);
 
+       /* IP_USER_FLOW filters match both IPv4/Other and IPv4/Fragmented
+        * frames. If we're programming the input set for IPv4/Other, we also
+        * need to program the IPv4/Fragmented input set. Since we don't have
+        * separate support, we'll always assume and enforce that the two flow
+        * types must have matching input sets.
+        */
+       if (index == I40E_FILTER_PCTYPE_NONF_IPV4_OTHER)
+               i40e_write_fd_input_set(pf, I40E_FILTER_PCTYPE_FRAG_IPV4,
+                                       new_mask);
+
        /* Add the new offset and update table, if necessary */
        if (new_flex_offset) {
                err = i40e_add_flex_offset(&pf->l4_flex_pit_list, src_offset,
index b1cde1b051a464c80c198a45c80ceffc8cdae0ff..d36b799116e4839ac62a3d2a4346510078773a2a 100644 (file)
@@ -5828,6 +5828,9 @@ static void i40e_fdir_filter_exit(struct i40e_pf *pf)
        /* Reprogram the default input set for Other/IPv4 */
        i40e_write_fd_input_set(pf, I40E_FILTER_PCTYPE_NONF_IPV4_OTHER,
                                I40E_L3_SRC_MASK | I40E_L3_DST_MASK);
+
+       i40e_write_fd_input_set(pf, I40E_FILTER_PCTYPE_FRAG_IPV4,
+                               I40E_L3_SRC_MASK | I40E_L3_DST_MASK);
 }
 
 /**