]> git.droids-corp.org - dpdk.git/commitdiff
net/qede/base: introduce HW/SW channel
authorRasesh Mody <rasesh.mody@cavium.com>
Sat, 7 Oct 2017 06:30:58 +0000 (23:30 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 12 Oct 2017 00:36:58 +0000 (01:36 +0100)
Introduce 2 new API functions, one for the VF and the other for
PF [per-VF] which allows to decide whether to use HW/SW channel
for PF<->VF communication(a per-VF configuration). A HyperV might
have different VMs with different requirements.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/base/ecore_iov_api.h
drivers/net/qede/base/ecore_sriov.c
drivers/net/qede/base/ecore_sriov.h
drivers/net/qede/base/ecore_vf.c
drivers/net/qede/base/ecore_vf.h
drivers/net/qede/base/ecore_vf_api.h

index 1f0edeb0e662d46a4797a6d4a0ea315249ea0e44..218ef50b776ff8e250c8f77fa02809a0d0eac349 100644 (file)
@@ -720,6 +720,20 @@ u16 ecore_iov_get_next_active_vf(struct ecore_hwfn *p_hwfn, u16 rel_vf_id);
 
 void ecore_iov_bulletin_set_udp_ports(struct ecore_hwfn *p_hwfn, int vfid,
                                      u16 vxlan_port, u16 geneve_port);
+
+#ifdef CONFIG_ECORE_SW_CHANNEL
+/**
+ * @brief Set whether PF should communicate with VF using SW/HW channel
+ *        Needs to be called for an enabled VF before acquire is over
+ *        [latest good point for doing that is OSAL_IOV_VF_ACQUIRE()]
+ *
+ * @param p_hwfn
+ * @param vfid - relative vf index
+ * @param b_is_hw - true iff PF is to use HW channel for communication
+ */
+void ecore_iov_set_vf_hw_channel(struct ecore_hwfn *p_hwfn, int vfid,
+                                bool b_is_hw);
+#endif
 #endif /* CONFIG_ECORE_SRIOV */
 
 #define ecore_for_each_vf(_p_hwfn, _i)                                 \
index a1d4982274416e1060df9d9be38ced3d8b8ceae3..53d3d240eed81f5dcf2311468e0bcc193b2b40c9 100644 (file)
@@ -1381,7 +1381,7 @@ static void ecore_iov_send_response(struct ecore_hwfn *p_hwfn,
        mbx->sw_mbx.response_size =
            length + sizeof(struct channel_list_end_tlv);
 
-       if (!p_hwfn->p_dev->b_hw_channel)
+       if (!p_vf->b_hw_channel)
                return;
 #endif
 
@@ -4828,3 +4828,17 @@ ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn, int vfid)
        else
                return 0;
 }
+
+#ifdef CONFIG_ECORE_SW_CHANNEL
+void ecore_iov_set_vf_hw_channel(struct ecore_hwfn *p_hwfn, int vfid,
+                                bool b_is_hw)
+{
+       struct ecore_vf_info *vf_info;
+
+       vf_info = ecore_iov_get_vf_info(p_hwfn, (u16)vfid, true);
+       if (!vf_info)
+               return;
+
+       vf_info->b_hw_channel = b_is_hw;
+}
+#endif
index 4ff5425ac7403fa3016372cfc051dcaf6214a3d3..0e83f0fc213d89ddb52bc62b37ed0de5ef6390b7 100644 (file)
@@ -117,6 +117,11 @@ struct ecore_vf_info {
        struct ecore_bulletin   bulletin;
        dma_addr_t              vf_bulletin;
 
+#ifdef CONFIG_ECORE_SW_CHANNEL
+       /* Determine whether PF communicate with VF using HW/SW channel */
+       bool    b_hw_channel;
+#endif
+
        /* PF saves a copy of the last VF acquire message */
        struct vfpf_acquire_tlv acquire;
 
index b78d735c6bedde495859d61c2cd64b1c4368b5b7..9ad986cc68819bff51f505bc7595e44fac5be06a 100644 (file)
@@ -1861,3 +1861,10 @@ void ecore_vf_get_fw_version(struct ecore_hwfn *p_hwfn,
        *fw_rev = info->fw_rev;
        *fw_eng = info->fw_eng;
 }
+
+#ifdef CONFIG_ECORE_SW_CHANNEL
+void ecore_vf_set_hw_channel(struct ecore_hwfn *p_hwfn, bool b_is_hw)
+{
+       p_hwfn->vf_iov_info->b_hw_channel = b_is_hw;
+}
+#endif
index fdb0fe07e788d32a6460adc3ee5223d08cac4af2..de2758cbdfaa3db81b5b0113d63ed02e40e10acc 100644 (file)
@@ -50,6 +50,13 @@ struct ecore_vf_iov {
         */
        struct ecore_sb_info *sbs_info[PFVF_MAX_SBS_PER_VF];
 
+#ifdef CONFIG_ECORE_SW_CHANNEL
+       /* Would be set if the VF is to try communicating with it PF
+        * using a hw channel.
+        */
+       bool b_hw_channel;
+#endif
+
        /* Determines whether VF utilizes doorbells via limited register
         * bar or via the doorbell bar.
         */
index be3a326b45bd693349a4a20bc79295fb19f248fc..9815cf8a3a810769a1752b2654e7103c3e1048de 100644 (file)
@@ -163,5 +163,18 @@ void ecore_vf_get_fw_version(struct ecore_hwfn *p_hwfn,
                             u16 *fw_eng);
 void ecore_vf_bulletin_get_udp_ports(struct ecore_hwfn *p_hwfn,
                                     u16 *p_vxlan_port, u16 *p_geneve_port);
+
+#ifdef CONFIG_ECORE_SW_CHANNEL
+/**
+ * @brief set the VF to use a SW/HW channel when communicating with PF.
+ *        NOTICE: today the likely first place to call this from VF
+ *        would be OSAL_VF_FILL_ACQUIRE_RESC_REQ(); Might want to consider
+ *        something a bit more appropriate.
+ *
+ * @param p_hwfn
+ * @param b_is_hw - true iff VF is to use a HW-channel
+ */
+void ecore_vf_set_hw_channel(struct ecore_hwfn *p_hwfn, bool b_is_hw);
+#endif
 #endif
 #endif