Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
authorDavid S. Miller <davem@davemloft.net>
Sat, 24 Sep 2016 12:14:57 +0000 (08:14 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 24 Sep 2016 12:14:57 +0000 (08:14 -0400)
Jeff Kirsher says:

====================
40GbE Intel Wired LAN Driver Updates 2016-09-22

This series contains updates to i40e and i40evf only.

Sridhar fixes link state event handling by updating the carrier and
starts/stops the Tx queues based on the link state notification from PF.

Brady fixes an issue where a user defined RSS hash key was not being
set because a user defined indirection table is not supplied when changing
the hash key, so if an indirection table is not supplied now, then a
default one is created and the hash key is correctly set.  Also fixed
an issue where when NPAR was enabled, we were still using pf->mac_seid
to perform the dump port query. Instead, go through the VSI to determine
the correct ID to use in either case.

Mitch provides one fix where a conditional return code was reversed, so
he does a "switheroo" to fix the issue.

Carolyn has two fixes, first fixes an issue in the virt channel code,
where a return code was not checked for NULL when applicable.  Second,
fixes an issue where we were byte swapping the port parameter, then
byte swapping it again in function execution.

Colin Ian King fixes a potential NULL pointer dereference.

Bimmy changes up i40evf_up_complete() to be void since it always returns
success anyways, which allows cleaning up of code which checked the
return code from this function.

Alex fixed an issue where the driver was incorrectly assuming that we
would always be pulling no more than 1 descriptor from each fragment.
So to correct this, we just need to make certain to test all the way to
the end of the fragments as it is possible for us to span 2 descriptors
in the block before us so we need to guarantee that even the last 6
descriptors have enough data to fill a full frame.

v2: dropped patches 1-3, 10 and 12 from the original series since Or
    Gerlitz pointed out several areas of improvement in the implementation
    of the VF Port representor netdev.  Sridhar is re-working the series
    for later submission.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
1  2 
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

@@@ -502,8 -502,16 +502,16 @@@ static int i40e_config_vsi_tx_queue(str
        u32 qtx_ctl;
        int ret = 0;
  
+       if (!i40e_vc_isvalid_vsi_id(vf, info->vsi_id)) {
+               ret = -ENOENT;
+               goto error_context;
+       }
        pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_id, vsi_queue_id);
        vsi = i40e_find_vsi_from_id(pf, vsi_id);
+       if (!vsi) {
+               ret = -ENOENT;
+               goto error_context;
+       }
  
        /* clear the context structure first */
        memset(&tx_ctx, 0, sizeof(struct i40e_hmc_obj_txq));
@@@ -1476,7 -1484,8 +1484,8 @@@ static int i40e_vc_config_promiscuous_m
  
        vsi = i40e_find_vsi_from_id(pf, info->vsi_id);
        if (!test_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states) ||
-           !i40e_vc_isvalid_vsi_id(vf, info->vsi_id)) {
+           !i40e_vc_isvalid_vsi_id(vf, info->vsi_id) ||
+           !vsi) {
                aq_ret = I40E_ERR_PARAM;
                goto error_param;
        }
@@@ -2217,8 -2226,8 +2226,8 @@@ static int i40e_vc_iwarp_qvmap_msg(stru
  error_param:
        /* send the response to the VF */
        return i40e_vc_send_resp_to_vf(vf,
-                              config ? I40E_VIRTCHNL_OP_RELEASE_IWARP_IRQ_MAP :
-                              I40E_VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP,
+                              config ? I40E_VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP :
+                              I40E_VIRTCHNL_OP_RELEASE_IWARP_IRQ_MAP,
                               aq_ret);
  }
  
@@@ -2747,12 -2756,11 +2756,12 @@@ error_param
   * @vf_id: VF identifier
   * @vlan_id: mac address
   * @qos: priority setting
 + * @vlan_proto: vlan protocol
   *
   * program VF vlan id and/or qos
   **/
 -int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
 -                            int vf_id, u16 vlan_id, u8 qos)
 +int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id,
 +                            u16 vlan_id, u8 qos, __be16 vlan_proto)
  {
        u16 vlanprio = vlan_id | (qos << I40E_VLAN_PRIORITY_SHIFT);
        struct i40e_netdev_priv *np = netdev_priv(netdev);
                goto error_pvid;
        }
  
 +      if (vlan_proto != htons(ETH_P_8021Q)) {
 +              dev_err(&pf->pdev->dev, "VF VLAN protocol is not supported\n");
 +              ret = -EPROTONOSUPPORT;
 +              goto error_pvid;
 +      }
 +
        vf = &(pf->vf[vf_id]);
        vsi = pf->vsi[vf->lan_vsi_idx];
        if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) {