summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_core.h
diff options
context:
space:
mode:
authorJulian Wiedmann2019-06-11 18:38:00 +0200
committerDavid S. Miller2019-06-14 07:39:32 +0200
commitd9b9f40bba7db1147e8069fd3eba711b2247ee67 (patch)
tree0de606247851098ecb47f8e2f6293d8d4a9915f3 /drivers/s390/net/qeth_core.h
parents390/qeth: command-chain the IDX sequence (diff)
downloadkernel-qcow2-linux-d9b9f40bba7db1147e8069fd3eba711b2247ee67.tar.gz
kernel-qcow2-linux-d9b9f40bba7db1147e8069fd3eba711b2247ee67.tar.xz
kernel-qcow2-linux-d9b9f40bba7db1147e8069fd3eba711b2247ee67.zip
s390/qeth: allocate a single cmd on read channel
We statically allocate 8 cmd buffers on the read channel, when the only IO left that's still using them is the long-running READ. Replace this with a single allocated cmd, that gets restarted whenever the READ completed. This introduces refcounting for allocated cmds, so that the READ cmd can survive the IO completion. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_core.h')
-rw-r--r--drivers/s390/net/qeth_core.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 962945a63235..5bcdede5e955 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -579,6 +579,7 @@ struct qeth_channel;
struct qeth_cmd_buffer {
enum qeth_cmd_buffer_state state;
unsigned int length;
+ refcount_t ref_count;
struct qeth_channel *channel;
struct qeth_reply *reply;
long timeout;
@@ -588,6 +589,11 @@ struct qeth_cmd_buffer {
void (*callback)(struct qeth_card *card, struct qeth_cmd_buffer *iob);
};
+static inline void qeth_get_cmd(struct qeth_cmd_buffer *iob)
+{
+ refcount_inc(&iob->ref_count);
+}
+
static inline struct qeth_ipa_cmd *__ipa_cmd(struct qeth_cmd_buffer *iob)
{
return (struct qeth_ipa_cmd *)(iob->data + IPA_PDU_HEADER_SIZE);
@@ -771,6 +777,7 @@ struct qeth_card {
enum qeth_card_states state;
spinlock_t lock;
struct ccwgroup_device *gdev;
+ struct qeth_cmd_buffer *read_cmd;
struct qeth_channel read;
struct qeth_channel write;
struct qeth_channel data;