From: Rasesh Mody <Rasesh.Mody@cavium.com>
To: <dev@dpdk.org>
Cc: <Dept-EngDPDKDev@cavium.com>, Rasesh Mody <Rasesh.Mody@cavium.com>
Subject: [dpdk-dev] [PATCH 04/25] net/qede/base: change return codes in SR-IOV
Date: Sat, 3 Dec 2016 01:11:08 -0800 [thread overview]
Message-ID: <1480756289-11835-5-git-send-email-Rasesh.Mody@cavium.com> (raw)
In-Reply-To: <1480756289-11835-1-git-send-email-Rasesh.Mody@cavium.com>
Change return codes in VF/SR-IOV base driver from int to
enum _ecore_status_t.
Signed-off-by: Rasesh Mody <Rasesh.Mody@cavium.com>
---
drivers/net/qede/base/ecore_sriov.c | 19 +++++++++++--------
drivers/net/qede/base/ecore_sriov.h | 4 ++--
drivers/net/qede/base/ecore_vf.c | 33 ++++++++++++++++++---------------
3 files changed, 31 insertions(+), 25 deletions(-)
diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c
index 38c2db3d..afc1db3f 100644
--- a/drivers/net/qede/base/ecore_sriov.c
+++ b/drivers/net/qede/base/ecore_sriov.c
@@ -1707,9 +1707,10 @@ ecore_iov_reconfigure_unicast_shadow(struct ecore_hwfn *p_hwfn,
return rc;
}
-static int ecore_iov_configure_vport_forced(struct ecore_hwfn *p_hwfn,
- struct ecore_vf_info *p_vf,
- u64 events)
+static enum _ecore_status_t
+ecore_iov_configure_vport_forced(struct ecore_hwfn *p_hwfn,
+ struct ecore_vf_info *p_vf,
+ u64 events)
{
enum _ecore_status_t rc = ECORE_SUCCESS;
struct ecore_filter_ucast filter;
@@ -3141,9 +3142,10 @@ ecore_iov_single_vf_flr_cleanup(struct ecore_hwfn *p_hwfn,
return rc;
}
-int ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)
+bool ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)
{
- u16 i, found = 0;
+ bool found;
+ u16 i;
DP_VERBOSE(p_hwfn, ECORE_MSG_IOV, "Marking FLR-ed VFs\n");
for (i = 0; i < (VF_MAX_STATIC / 32); i++)
@@ -3153,7 +3155,7 @@ int ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)
if (!p_hwfn->p_dev->p_iov_info) {
DP_NOTICE(p_hwfn, true, "VF flr but no IOV\n");
- return 0;
+ return false;
}
/* Mark VFs */
@@ -3182,7 +3184,7 @@ int ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)
* VF flr until ACKs, we're safe.
*/
p_flr[rel_vf_id / 64] |= 1ULL << (rel_vf_id % 64);
- found = 1;
+ found = true;
}
}
@@ -3961,7 +3963,8 @@ bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn, u16 rel_vf_id)
return (p_vf->state == VF_ENABLED);
}
-int ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn, int vfid)
+enum _ecore_status_t
+ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn, int vfid)
{
struct ecore_wfq_data *vf_vp_wfq;
struct ecore_vf_info *vf_info;
diff --git a/drivers/net/qede/base/ecore_sriov.h b/drivers/net/qede/base/ecore_sriov.h
index 3c5c68f9..884a90cb 100644
--- a/drivers/net/qede/base/ecore_sriov.h
+++ b/drivers/net/qede/base/ecore_sriov.h
@@ -277,8 +277,8 @@ u32 ecore_crc32(u32 crc,
*
* @return 1 iff one of the PF's vfs got FLRed. 0 otherwise.
*/
-int ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn,
- u32 *disabled_vfs);
+bool ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn,
+ u32 *disabled_vfs);
/**
* @brief Search extended TLVs in request/reply buffer.
diff --git a/drivers/net/qede/base/ecore_vf.c b/drivers/net/qede/base/ecore_vf.c
index c26b602b..4c44ee7a 100644
--- a/drivers/net/qede/base/ecore_vf.c
+++ b/drivers/net/qede/base/ecore_vf.c
@@ -65,13 +65,15 @@ static void ecore_vf_pf_req_end(struct ecore_hwfn *p_hwfn,
OSAL_MUTEX_RELEASE(&p_hwfn->vf_iov_info->mutex);
}
-static int ecore_send_msg2pf(struct ecore_hwfn *p_hwfn,
- u8 *done, u32 resp_size)
+static enum _ecore_status_t
+ecore_send_msg2pf(struct ecore_hwfn *p_hwfn,
+ u8 *done, u32 resp_size)
{
union vfpf_tlvs *p_req = p_hwfn->vf_iov_info->vf2pf_request;
struct ustorm_trigger_vf_zone trigger;
struct ustorm_vf_zone *zone_data;
- int rc = ECORE_SUCCESS, time = 100;
+ enum _ecore_status_t rc = ECORE_SUCCESS;
+ int time = 100;
zone_data = (struct ustorm_vf_zone *)PXP_VF_BAR0_START_USDM_ZONE_B;
@@ -475,7 +477,7 @@ enum _ecore_status_t ecore_vf_pf_rxq_start(struct ecore_hwfn *p_hwfn,
struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
struct pfvf_start_queue_resp_tlv *resp;
struct vfpf_start_rxq_tlv *req;
- int rc;
+ enum _ecore_status_t rc;
/* clear mailbox and prep first tlv */
req = ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_START_RXQ, sizeof(*req));
@@ -550,7 +552,7 @@ enum _ecore_status_t ecore_vf_pf_rxq_stop(struct ecore_hwfn *p_hwfn,
struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
struct vfpf_stop_rxqs_tlv *req;
struct pfvf_def_resp_tlv *resp;
- int rc;
+ enum _ecore_status_t rc;
/* clear mailbox and prep first tlv */
req = ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_STOP_RXQS, sizeof(*req));
@@ -591,7 +593,7 @@ enum _ecore_status_t ecore_vf_pf_txq_start(struct ecore_hwfn *p_hwfn,
struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
struct pfvf_start_queue_resp_tlv *resp;
struct vfpf_start_txq_tlv *req;
- int rc;
+ enum _ecore_status_t rc;
/* clear mailbox and prep first tlv */
req = ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_START_TXQ, sizeof(*req));
@@ -649,7 +651,7 @@ enum _ecore_status_t ecore_vf_pf_txq_stop(struct ecore_hwfn *p_hwfn, u16 tx_qid)
struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
struct vfpf_stop_txqs_tlv *req;
struct pfvf_def_resp_tlv *resp;
- int rc;
+ enum _ecore_status_t rc;
/* clear mailbox and prep first tlv */
req = ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_STOP_TXQS, sizeof(*req));
@@ -686,7 +688,7 @@ enum _ecore_status_t ecore_vf_pf_rxqs_update(struct ecore_hwfn *p_hwfn,
struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
struct pfvf_def_resp_tlv *resp = &p_iov->pf2vf_reply->default_resp;
struct vfpf_update_rxq_tlv *req;
- int rc;
+ enum _ecore_status_t rc;
/* clear mailbox and prep first tlv */
req = ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_UPDATE_RXQ, sizeof(*req));
@@ -728,7 +730,8 @@ ecore_vf_pf_vport_start(struct ecore_hwfn *p_hwfn, u8 vport_id,
struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
struct vfpf_vport_start_tlv *req;
struct pfvf_def_resp_tlv *resp;
- int rc, i;
+ enum _ecore_status_t rc;
+ int i;
/* clear mailbox and prep first tlv */
req = ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_VPORT_START, sizeof(*req));
@@ -770,7 +773,7 @@ enum _ecore_status_t ecore_vf_pf_vport_stop(struct ecore_hwfn *p_hwfn)
{
struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
struct pfvf_def_resp_tlv *resp = &p_iov->pf2vf_reply->default_resp;
- int rc;
+ enum _ecore_status_t rc;
/* clear mailbox and prep first tlv */
ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_VPORT_TEARDOWN,
@@ -868,7 +871,7 @@ ecore_vf_pf_vport_update(struct ecore_hwfn *p_hwfn,
u8 update_rx, update_tx;
u32 resp_size = 0;
u16 size, tlv;
- int rc;
+ enum _ecore_status_t rc;
resp = &p_iov->pf2vf_reply->default_resp;
resp_size = sizeof(*resp);
@@ -1076,7 +1079,7 @@ enum _ecore_status_t ecore_vf_pf_reset(struct ecore_hwfn *p_hwfn)
struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
struct pfvf_def_resp_tlv *resp;
struct vfpf_first_tlv *req;
- int rc;
+ enum _ecore_status_t rc;
/* clear mailbox and prep first tlv */
req = ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_CLOSE, sizeof(*req));
@@ -1109,8 +1112,8 @@ enum _ecore_status_t ecore_vf_pf_release(struct ecore_hwfn *p_hwfn)
struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
struct pfvf_def_resp_tlv *resp;
struct vfpf_first_tlv *req;
+ enum _ecore_status_t rc;
u32 size;
- int rc;
/* clear mailbox and prep first tlv */
req = ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_RELEASE, sizeof(*req));
@@ -1182,7 +1185,7 @@ enum _ecore_status_t ecore_vf_pf_filter_ucast(struct ecore_hwfn *p_hwfn,
struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
struct vfpf_ucast_filter_tlv *req;
struct pfvf_def_resp_tlv *resp;
- int rc;
+ enum _ecore_status_t rc;
/* Sanitize */
if (p_ucast->opcode == ECORE_FILTER_MOVE) {
@@ -1223,7 +1226,7 @@ enum _ecore_status_t ecore_vf_pf_int_cleanup(struct ecore_hwfn *p_hwfn)
{
struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
struct pfvf_def_resp_tlv *resp = &p_iov->pf2vf_reply->default_resp;
- int rc;
+ enum _ecore_status_t rc;
/* clear mailbox and prep first tlv */
ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_INT_CLEANUP,
--
2.11.0.rc1
next prev parent reply other threads:[~2016-12-03 9:12 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-03 9:11 [dpdk-dev] [PATCH 00/25] net/qede: update qede pmd to 2.0.0.1 Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 01/25] net/qede/base: add request for PF FLR before load request Rasesh Mody
2016-12-23 15:32 ` Ferruh Yigit
2016-12-23 19:07 ` Mody, Rasesh
2016-12-03 9:11 ` [dpdk-dev] [PATCH 02/25] net/qede/base: improve set field macro Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 03/25] net/qede/base: add handling of malicious VF Rasesh Mody
2016-12-03 9:11 ` Rasesh Mody [this message]
2016-12-03 9:11 ` [dpdk-dev] [PATCH 05/25] net/qede/base: make API non-static Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 06/25] net/qede/base: rename macro Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 07/25] net/qede/base: add check to validate txq Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 08/25] net/qede/base: fix updating VF queue zone id Rasesh Mody
2016-12-23 15:36 ` Ferruh Yigit
2016-12-03 9:11 ` [dpdk-dev] [PATCH 09/25] net/qede/base: improve Tx-switching performance Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 10/25] net/qede/base: semantic change Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 11/25] net/qede: remove unused struct member Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 12/25] net/qede/base: enhance resource info set printouts Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 13/25] net/qede/base: add new enum member to status codes Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 14/25] net/qede/base: add macros for converting pointer Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 15/25] net/qede: add new host ring type option Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 16/25] net/qede/base: add check for get nvm info return code Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 17/25] net/qede/base: retrieve FW crash dump info Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 18/25] net/qede/base: add support for external PHY Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 19/25] net/qede/base: add support for 2x10G mode Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 20/25] net/qede: add PCI ids for new chip variant Rasesh Mody
2016-12-23 15:39 ` Ferruh Yigit
2016-12-23 19:18 ` Mody, Rasesh
2016-12-03 9:11 ` [dpdk-dev] [PATCH 21/25] net/qede: add 50G device PCI id Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 22/25] net/qede/base: add support for new firmware Rasesh Mody
2016-12-23 15:40 ` Ferruh Yigit
2016-12-31 7:40 ` Mody, Rasesh
2016-12-03 9:11 ` [dpdk-dev] [PATCH 23/25] net/qede/base: semantic/formatting changes Rasesh Mody
2016-12-23 15:42 ` Ferruh Yigit
2016-12-31 7:41 ` Mody, Rasesh
2017-01-03 15:40 ` Ferruh Yigit
2017-01-05 7:16 ` Mody, Rasesh
2016-12-03 9:11 ` [dpdk-dev] [PATCH 24/25] net/qede/base: dcbx changes for base driver Rasesh Mody
2016-12-03 9:11 ` [dpdk-dev] [PATCH 25/25] net/qede: update PMD version to 2.0.0.1 Rasesh Mody
2016-12-09 16:53 ` [dpdk-dev] [PATCH 00/25] net/qede: update qede pmd " Ferruh Yigit
2016-12-09 17:48 ` Mody, Rasesh
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 00/26] " Rasesh Mody
2017-01-05 13:18 ` Ferruh Yigit
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 01/26] net/qede/base: add request for PF FLR before load request Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 02/26] net/qede/base: improve set field macro Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 03/26] net/qede/base: add handling of malicious VF Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 04/26] net/qede/base: change return codes in SR-IOV Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 05/26] net/qede/base: make API non-static Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 06/26] net/qede/base: rename macro Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 07/26] net/qede/base: add check to validate txq Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 08/26] net/qede/base: fix updating VF queue zone id Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 09/26] net/qede/base: improve Tx-switching performance Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 10/26] net/qede/base: semantic change Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 11/26] net/qede: remove unused struct member Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 12/26] net/qede/base: enhance resource info set printouts Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 13/26] net/qede/base: add new enum member to status codes Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 14/26] net/qede/base: add macros for converting pointer Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 15/26] net/qede: add new host ring type option Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 16/26] net/qede/base: add check for get nvm info return code Rasesh Mody
2017-01-05 7:03 ` [dpdk-dev] [PATCH v2 17/26] net/qede/base: retrieve FW crash dump info Rasesh Mody
2017-01-05 7:04 ` [dpdk-dev] [PATCH v2 18/26] net/qede/base: add support for external PHY Rasesh Mody
2017-01-05 7:04 ` [dpdk-dev] [PATCH v2 19/26] net/qede/base: add support for 2x10G mode Rasesh Mody
2017-01-05 7:04 ` [dpdk-dev] [PATCH v2 20/26] net/qede: add PCI ids for new chip variant Rasesh Mody
2017-01-05 7:04 ` [dpdk-dev] [PATCH v2 21/26] net/qede: add 50G device PCI id Rasesh Mody
2017-01-05 7:04 ` [dpdk-dev] [PATCH v2 22/26] net/qede/base: add support for new firmware Rasesh Mody
2017-01-05 7:04 ` [dpdk-dev] [PATCH v2 23/26] net/qede/base: semantic/formatting changes Rasesh Mody
2017-01-05 7:04 ` [dpdk-dev] [PATCH v2 24/26] net/qede/base: refactor some code bits Rasesh Mody
2017-01-05 7:04 ` [dpdk-dev] [PATCH v2 25/26] net/qede/base: dcbx changes for base driver Rasesh Mody
2017-01-05 7:04 ` [dpdk-dev] [PATCH v2 26/26] net/qede: update PMD version to 2.0.0.1 Rasesh Mody
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=1480756289-11835-5-git-send-email-Rasesh.Mody@cavium.com \
--to=rasesh.mody@cavium.com \
--cc=Dept-EngDPDKDev@cavium.com \
--cc=dev@dpdk.org \
/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).