From: Rasesh Mody <rasesh.mody@cavium.com>
To: dev@dpdk.org, ferruh.yigit@intel.com
Cc: Rasesh Mody <rasesh.mody@cavium.com>, Dept-EngDPDKDev@cavium.com
Subject: [dpdk-dev] [PATCH 03/17] net/qede/base: introduce HW/SW channel
Date: Fri, 6 Oct 2017 23:30:58 -0700 [thread overview]
Message-ID: <1507357872-26475-4-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1507357872-26475-1-git-send-email-rasesh.mody@cavium.com>
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 | 14 ++++++++++++++
drivers/net/qede/base/ecore_sriov.c | 16 +++++++++++++++-
drivers/net/qede/base/ecore_sriov.h | 5 +++++
drivers/net/qede/base/ecore_vf.c | 7 +++++++
drivers/net/qede/base/ecore_vf.h | 7 +++++++
drivers/net/qede/base/ecore_vf_api.h | 13 +++++++++++++
6 files changed, 61 insertions(+), 1 deletion(-)
diff --git a/drivers/net/qede/base/ecore_iov_api.h b/drivers/net/qede/base/ecore_iov_api.h
index 1f0edeb..218ef50 100644
--- a/drivers/net/qede/base/ecore_iov_api.h
+++ b/drivers/net/qede/base/ecore_iov_api.h
@@ -720,6 +720,20 @@ enum _ecore_status_t
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) \
diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c
index a1d4982..53d3d24 100644
--- a/drivers/net/qede/base/ecore_sriov.c
+++ b/drivers/net/qede/base/ecore_sriov.c
@@ -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 @@ enum _ecore_status_t
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
diff --git a/drivers/net/qede/base/ecore_sriov.h b/drivers/net/qede/base/ecore_sriov.h
index 4ff5425..0e83f0f 100644
--- a/drivers/net/qede/base/ecore_sriov.h
+++ b/drivers/net/qede/base/ecore_sriov.h
@@ -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;
diff --git a/drivers/net/qede/base/ecore_vf.c b/drivers/net/qede/base/ecore_vf.c
index b78d735..9ad986c 100644
--- a/drivers/net/qede/base/ecore_vf.c
+++ b/drivers/net/qede/base/ecore_vf.c
@@ -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
diff --git a/drivers/net/qede/base/ecore_vf.h b/drivers/net/qede/base/ecore_vf.h
index fdb0fe0..de2758c 100644
--- a/drivers/net/qede/base/ecore_vf.h
+++ b/drivers/net/qede/base/ecore_vf.h
@@ -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.
*/
diff --git a/drivers/net/qede/base/ecore_vf_api.h b/drivers/net/qede/base/ecore_vf_api.h
index be3a326..9815cf8 100644
--- a/drivers/net/qede/base/ecore_vf_api.h
+++ b/drivers/net/qede/base/ecore_vf_api.h
@@ -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
--
1.7.10.3
next prev parent reply other threads:[~2017-10-07 6:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-07 6:30 [dpdk-dev] [PATCH 00/17] update QEDE base driver to 8.30.8.0 Rasesh Mody
2017-10-07 6:30 ` [dpdk-dev] [PATCH 01/17] net/qede/base: add xcvr type and DON FW defines Rasesh Mody
2017-10-07 6:30 ` [dpdk-dev] [PATCH 02/17] net/qede/base: add NVRAM config options Rasesh Mody
2017-10-07 6:30 ` Rasesh Mody [this message]
2017-10-07 6:30 ` [dpdk-dev] [PATCH 04/17] net/qede/base: add LLDP support Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 05/17] net/qede/base: add check for DMA engine state Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 06/17] net/qede/base: use the correct size value Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 07/17] net/qede/base: add various OS abtraction macros Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 08/17] net/qede/base: add/fix comments Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 09/17] net/qede/base: add/change/revise logs Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 10/17] net/qede/base: semantic changes Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 11/17] net/qede/base: code cleanup Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 12/17] net/qede/base: check device personality for feature setting Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 13/17] net/qede/base: change default page size of ILT clients Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 14/17] net/qede/base: fix access to an uninitialized list Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 15/17] net/qede/base: fix for VF malicious indication Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 16/17] net/qede/base: fix return code to align with FW Rasesh Mody
2017-10-07 6:31 ` [dpdk-dev] [PATCH 17/17] net/qede/base: update base driver version to 8.30.8.0 Rasesh Mody
2017-10-09 3:33 ` [dpdk-dev] [PATCH 00/17] update QEDE base driver " Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1507357872-26475-4-git-send-email-rasesh.mody@cavium.com \
--to=rasesh.mody@cavium.com \
--cc=Dept-EngDPDKDev@cavium.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).