Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ec8deac authored by Jacob Keller's avatar Jacob Keller Committed by Jeff Kirsher
Browse files

i40e: explicitly fail on extended MAC field for ethtool_rx_flow_spec



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: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 097dbf52
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -2771,6 +2771,10 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,


	fsp = (struct ethtool_rx_flow_spec *)&cmd->fs;
	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 +
	if (fsp->location >= (pf->hw.func_caps.fd_filters_best_effort +
			      pf->hw.func_caps.fd_filters_guaranteed)) {
			      pf->hw.func_caps.fd_filters_guaranteed)) {
		return -EINVAL;
		return -EINVAL;