i40e/i40evf: add VIRTCHNL_VF_OFFLOAD flag
authorAnjali Singhai Jain <anjali.singhai@intel.com>
Fri, 10 Jul 2015 23:36:08 +0000 (19:36 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 26 Aug 2015 22:09:54 +0000 (15:09 -0700)
Add virtual channel offload capability to support RX polling mode in the
VF.

Change-ID: Ib643ae2a7506dfc75fc489fc207493fabefa4832
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_register.h
drivers/net/ethernet/intel/i40e/i40e_virtchnl.h
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h

index acae6c7..dc0402f 100644 (file)
 #define I40E_PFINT_CEQCTL_CAUSE_ENA_MASK I40E_MASK(0x1, I40E_PFINT_CEQCTL_CAUSE_ENA_SHIFT)
 #define I40E_PFINT_CEQCTL_INTEVENT_SHIFT 31
 #define I40E_PFINT_CEQCTL_INTEVENT_MASK I40E_MASK(0x1, I40E_PFINT_CEQCTL_INTEVENT_SHIFT)
+#define I40E_GLINT_CTL 0x0003F800 /* Reset: CORER */
+#define I40E_GLINT_CTL_DIS_AUTOMASK_PF0_SHIFT 0
+#define I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_PF0_SHIFT)
+#define I40E_GLINT_CTL_DIS_AUTOMASK_VF0_SHIFT 1
+#define I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_VF0_SHIFT)
+#define I40E_GLINT_CTL_DIS_AUTOMASK_N_SHIFT 2
+#define I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_N_SHIFT)
 #define I40E_PFINT_DYN_CTL0 0x00038480 /* Reset: PFR */
 #define I40E_PFINT_DYN_CTL0_INTENA_SHIFT 0
 #define I40E_PFINT_DYN_CTL0_INTENA_MASK I40E_MASK(0x1, I40E_PFINT_DYN_CTL0_INTENA_SHIFT)
index a7ab463..0f8d415 100644 (file)
@@ -152,6 +152,7 @@ struct i40e_virtchnl_vsi_resource {
 #define I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ                0x00000008
 #define I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG       0x00000010
 #define I40E_VIRTCHNL_VF_OFFLOAD_VLAN          0x00010000
+#define I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING    0x00020000
 
 struct i40e_virtchnl_vf_resource {
        u16 num_vsis;
index ca7a568..d99c116 100644 (file)
@@ -335,6 +335,18 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id,
                wr32(hw, reg_idx, reg);
        }
 
+       /* if the vf is running in polling mode and using interrupt zero,
+        * need to disable auto-mask on enabling zero interrupt for VFs.
+        */
+       if ((vf->driver_caps & I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING) &&
+           (vector_id == 0)) {
+               reg = rd32(hw, I40E_GLINT_CTL);
+               if (!(reg & I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK)) {
+                       reg |= I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK;
+                       wr32(hw, I40E_GLINT_CTL, reg);
+               }
+       }
+
 irq_list_done:
        i40e_flush(hw);
 }
index 1e89dea..e6db20e 100644 (file)
@@ -152,6 +152,7 @@ struct i40e_virtchnl_vsi_resource {
 #define I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ                0x00000008
 #define I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG       0x00000010
 #define I40E_VIRTCHNL_VF_OFFLOAD_VLAN          0x00010000
+#define I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING    0x00020000
 
 struct i40e_virtchnl_vf_resource {
        u16 num_vsis;