diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2019-06-11 18:37:57 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-13 22:39:31 -0700 |
commit | 405548959cc7e81b4ec0a88a06cc8e1060d4666f (patch) | |
tree | ab22cdae7ae9ca50f413938dbbbdd5c9370f81ef /drivers/s390/net/qeth_core.h | |
parent | s390/qeth: remove 'channel' parameter from callbacks (diff) | |
download | linux-dev-405548959cc7e81b4ec0a88a06cc8e1060d4666f.tar.xz linux-dev-405548959cc7e81b4ec0a88a06cc8e1060d4666f.zip |
s390/qeth: add support for dynamically allocated cmds
qeth currently uses a fixed set of statically allocated cmd buffers for
the read and write IO channels. This (1) doesn't play well with the single
RCD cmd we need to issue on the data channel, (2) doesn't provide the
necessary flexibility for certain IDX improvements, and (3) is also rather
wasteful since the buffers are idle most of the time.
Add a new type of cmd buffer that is dynamically allocated, and keeps
its ccw chain in the DMA data area. Since this touches most callers of
qeth_setup_ccw(), also add a new CCW flags parameter for future usage.
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.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index c1292d3420a2..2fee41f773a1 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -560,6 +560,7 @@ enum qeth_prot_versions { enum qeth_cmd_buffer_state { BUF_STATE_FREE, BUF_STATE_LOCKED, + BUF_STATE_MALLOC, }; enum qeth_cq { @@ -579,6 +580,7 @@ struct qeth_channel; struct qeth_cmd_buffer { enum qeth_cmd_buffer_state state; + unsigned int length; struct qeth_channel *channel; struct qeth_reply *reply; long timeout; @@ -608,6 +610,13 @@ struct qeth_channel { int io_buf_no; }; +static inline struct ccw1 *__ccw_from_cmd(struct qeth_cmd_buffer *iob) +{ + if (iob->state != BUF_STATE_MALLOC) + return iob->channel->ccw; + return (struct ccw1 *)(iob->data + ALIGN(iob->length, 8)); +} + static inline bool qeth_trylock_channel(struct qeth_channel *channel) { return atomic_cmpxchg(&channel->irq_pending, 0, 1) == 0; |