]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: Code cleanup in i40e_add_fdir_ethtool
authorShannon Nelson <shannon.nelson@intel.com>
Tue, 12 Apr 2016 15:30:42 +0000 (08:30 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 7 Jul 2016 17:41:07 +0000 (10:41 -0700)
Orabug: 23176970

A little bit of code cleanup in prep for more cloud filter work.

Change-ID: I0dc33ce0d4c207944336a07437640fef920c100c
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bab3a34bb5f0b4056e37edf1bf6d097b147de453)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_ethtool.c

index 36bb01f54d949362cc1963bda8d1ccb111943412..dcaf696b552411cd0eb21f8c39a8bf2617c5cbdc 100644 (file)
@@ -2489,7 +2489,6 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
 
        if (!vsi)
                return -EINVAL;
-
        pf = vsi->back;
 
        if (!(pf->flags & I40E_FLAG_FD_SB_ENABLED))
@@ -2547,15 +2546,18 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
        input->src_ip[0] = fsp->h_u.tcp_ip4_spec.ip4dst;
 
        if (ntohl(fsp->m_ext.data[1])) {
-               if (ntohl(fsp->h_ext.data[1]) >= pf->num_alloc_vfs) {
-                       netif_info(pf, drv, vsi->netdev, "Invalid VF id\n");
+               vf_id = ntohl(fsp->h_ext.data[1]);
+               if (vf_id >= pf->num_alloc_vfs) {
+                       netif_info(pf, drv, vsi->netdev,
+                                  "Invalid VF id %d\n", vf_id);
                        goto free_input;
                }
-               vf_id = ntohl(fsp->h_ext.data[1]);
                /* Find vsi id from vf id and override dest vsi */
                input->dest_vsi = pf->vf[vf_id].lan_vsi_id;
                if (input->q_index >= pf->vf[vf_id].num_queue_pairs) {
-                       netif_info(pf, drv, vsi->netdev, "Invalid queue id\n");
+                       netif_info(pf, drv, vsi->netdev,
+                                  "Invalid queue id %d for VF %d\n",
+                                  input->q_index, vf_id);
                        goto free_input;
                }
        }