]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: explicitly fail on extended MAC field for ethtool_rx_flow_spec
authorJacob Keller <jacob.e.keller@intel.com>
Mon, 6 Feb 2017 22:39:12 +0000 (14:39 -0800)
committerJack Vogel <jack.vogel@oracle.com>
Sat, 10 Jun 2017 01:57:03 +0000 (18:57 -0700)
Although we will fail the filter later due to checking flow_type which
will have a bogus invalid type, it is possible future refactoring will
remove this hidden failure case. Avoid a possible issue in the future by
explicitly checking the flow type at the start.

Change-Id: Ia98eb26f7b93ccbe38c7141e8f203ef496fc6598
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>
Orabug: 26132523
(cherry picked from commit 1ec8deac8c63505194e773b9657824ed3c2fbdd8)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_ethtool.c

index 0e93305357417adab2c5b231ab346b3107f2f1bc..5422d8065b843dc699af90612d6df5a86d4a612f 100644 (file)
@@ -2723,6 +2723,10 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
 
        fsp = (struct ethtool_rx_flow_spec *)&cmd->fs;
 
+       /* Extended MAC field is not supported */
+       if (fsp->flow_type & FLOW_MAC_EXT)
+               return -EINVAL;
+
        if (fsp->location >= (pf->hw.func_caps.fd_filters_best_effort +
                              pf->hw.func_caps.fd_filters_guaranteed)) {
                return -EINVAL;