summaryrefslogtreecommitdiff
path: root/drivers/net/ipa/ipa_endpoint.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2022-01-12 14:39:54 +0000
committerDavid S. Miller <davem@davemloft.net>2022-01-12 14:39:54 +0000
commit0bbed88af55ed804d19aeb23b32b72b29e1435ee (patch)
treecfaa51320c91242f4f89a7fc31e26cef6b7f8ea0 /drivers/net/ipa/ipa_endpoint.h
parentc12837d1bb31032bead9060dec99ef310d5b9fb7 (diff)
parent998c0bd2b3715244da7639cc4e6a2062cb79c3f4 (diff)
Merge branch 'ipa-fixes'
Alex Elder says: ==================== net: ipa: fix two replenish bugs This series contains two fixes for bugs in the IPA receive buffer replenishing code. The (new) second patch defines a bitmap to represent endpoint the replenish enabled flag. Its purpose is to prepare for the third patch, which adds an additional flag. Version 2 of this series uses bitmap operations in the second bug fix rather than an atomic variable, as suggested by Jakub. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/ipa_endpoint.h')
-rw-r--r--drivers/net/ipa/ipa_endpoint.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/net/ipa/ipa_endpoint.h b/drivers/net/ipa/ipa_endpoint.h
index 0a859d10312d..0313cdc607de 100644
--- a/drivers/net/ipa/ipa_endpoint.h
+++ b/drivers/net/ipa/ipa_endpoint.h
@@ -41,6 +41,19 @@ enum ipa_endpoint_name {
#define IPA_ENDPOINT_MAX 32 /* Max supported by driver */
/**
+ * enum ipa_replenish_flag: RX buffer replenish flags
+ *
+ * @IPA_REPLENISH_ENABLED: Whether receive buffer replenishing is enabled
+ * @IPA_REPLENISH_ACTIVE: Whether replenishing is underway
+ * @IPA_REPLENISH_COUNT: Number of defined replenish flags
+ */
+enum ipa_replenish_flag {
+ IPA_REPLENISH_ENABLED,
+ IPA_REPLENISH_ACTIVE,
+ IPA_REPLENISH_COUNT, /* Number of flags (must be last) */
+};
+
+/**
* struct ipa_endpoint - IPA endpoint information
* @ipa: IPA pointer
* @ee_id: Execution environmnent endpoint is associated with
@@ -51,7 +64,7 @@ enum ipa_endpoint_name {
* @trans_tre_max: Maximum number of TRE descriptors per transaction
* @evt_ring_id: GSI event ring used by the endpoint
* @netdev: Network device pointer, if endpoint uses one
- * @replenish_enabled: Whether receive buffer replenishing is enabled
+ * @replenish_flags: Replenishing state flags
* @replenish_ready: Number of replenish transactions without doorbell
* @replenish_saved: Replenish requests held while disabled
* @replenish_backlog: Number of buffers needed to fill hardware queue
@@ -72,7 +85,7 @@ struct ipa_endpoint {
struct net_device *netdev;
/* Receive buffer replenishing for RX endpoints */
- bool replenish_enabled;
+ DECLARE_BITMAP(replenish_flags, IPA_REPLENISH_COUNT);
u32 replenish_ready;
atomic_t replenish_saved;
atomic_t replenish_backlog;