summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/mei_dev.h
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2018-02-25 20:07:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-14 19:33:13 +0100
commitaf336cabe08363ba8493e7d7e5d070353eb30caa (patch)
tree003025b642d6dcfab2a2f5ba220ce69ee69def65 /drivers/misc/mei/mei_dev.h
parent257355a44b9929e55d6fd47bfff66971dc4de948 (diff)
downloadop-kernel-dev-af336cabe08363ba8493e7d7e5d070353eb30caa.zip
op-kernel-dev-af336cabe08363ba8493e7d7e5d070353eb30caa.tar.gz
mei: limit the number of queued writes
Limit the number of queued writes per client. Writes above this threshold are blocked till place in the transmit queue is available. The limit is configurable via sysfs and defaults to 50. The implementation should provide blocking I/O behavior. Prior to this change one would end up in the hands of OOM. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/mei_dev.h')
-rw-r--r--drivers/misc/mei/mei_dev.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index c081114..be9c484 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -210,6 +210,7 @@ struct mei_cl_cb {
* @timer_count: watchdog timer for operation completion
* @notify_en: notification - enabled/disabled
* @notify_ev: pending notification event
+ * @tx_cb_queued: number of tx callbacks in queue
* @writing_state: state of the tx
* @rd_pending: pending read credits
* @rd_completed: completed read
@@ -234,6 +235,7 @@ struct mei_cl {
u8 timer_count;
u8 notify_en;
u8 notify_ev;
+ u8 tx_cb_queued;
enum mei_file_transaction_states writing_state;
struct list_head rd_pending;
struct list_head rd_completed;
@@ -241,6 +243,10 @@ struct mei_cl {
struct mei_cl_device *cldev;
};
+#define MEI_TX_QUEUE_LIMIT_DEFAULT 50
+#define MEI_TX_QUEUE_LIMIT_MAX 255
+#define MEI_TX_QUEUE_LIMIT_MIN 30
+
/**
* struct mei_hw_ops - hw specific ops
*
@@ -359,6 +365,7 @@ const char *mei_pg_state_str(enum mei_pg_state state);
* @write_waiting_list : write completion list
* @ctrl_wr_list : pending control write list
* @ctrl_rd_list : pending control read list
+ * @tx_queue_limit: tx queues per client linit
*
* @file_list : list of opened handles
* @open_handle_count: number of opened handles
@@ -423,6 +430,7 @@ struct mei_device {
struct list_head write_waiting_list;
struct list_head ctrl_wr_list;
struct list_head ctrl_rd_list;
+ u8 tx_queue_limit;
struct list_head file_list;
long open_handle_count;
OpenPOWER on IntegriCloud