summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/qlogic/qed/qed_sp.h
diff options
context:
space:
mode:
authorDenis Bolotin <denis.bolotin@cavium.com>2018-11-08 16:46:10 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-27 16:13:07 +0100
commitb228e58a6f1f56a4cc2dd0dae4881fbc99f367cb (patch)
treedab2b1579ea4990da7939ab80bad28fd873bfe6e /drivers/net/ethernet/qlogic/qed/qed_sp.h
parentb2e5004e1e024e7f919bade2723c7c28fc3b56df (diff)
qed: Fix SPQ entries not returned to pool in error flows
[ Upstream commit fb5e7438e7a3c8966e04ccb0760170e9e06f3699 ] qed_sp_destroy_request() API was added for SPQ users that need to free/return the entry they acquired in their error flows. Signed-off-by: Denis Bolotin <denis.bolotin@cavium.com> Signed-off-by: Michal Kalderon <michal.kalderon@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_sp.h')
-rw-r--r--drivers/net/ethernet/qlogic/qed/qed_sp.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_sp.h b/drivers/net/ethernet/qlogic/qed/qed_sp.h
index 04259df8a5c2..3157c0d99441 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_sp.h
+++ b/drivers/net/ethernet/qlogic/qed/qed_sp.h
@@ -399,6 +399,17 @@ struct qed_sp_init_data {
struct qed_spq_comp_cb *p_comp_data;
};
+/**
+ * @brief Returns a SPQ entry to the pool / frees the entry if allocated.
+ * Should be called on in error flows after initializing the SPQ entry
+ * and before posting it.
+ *
+ * @param p_hwfn
+ * @param p_ent
+ */
+void qed_sp_destroy_request(struct qed_hwfn *p_hwfn,
+ struct qed_spq_entry *p_ent);
+
int qed_sp_init_request(struct qed_hwfn *p_hwfn,
struct qed_spq_entry **pp_ent,
u8 cmd,