Skip to content

Commit

Permalink
Merge branch 's390-qeyj-next'
Browse files Browse the repository at this point in the history
Julian Wiedmann says:

====================
s390/qeth: updates 2021-06-11

please apply the following patch series for qeth to netdev's net-next tree.

This enables TX NAPI for those devices that didn't use it previously, so
that we can eventually rip out the qdio layer's internal interrupt
machinery.

Other than that it's just the normal mix of minor improvements and
cleanups.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 11, 2021
2 parents e5b0a1b + 953fb4d commit 62d3f4a
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 233 deletions.
4 changes: 1 addition & 3 deletions arch/s390/include/asm/qdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ struct slibe {
* @user0: user defineable value
* @res4: reserved paramater
* @user1: user defineable value
* @user2: user defineable value
*/
struct qaob {
u64 res0[6];
Expand All @@ -152,8 +151,7 @@ struct qaob {
u16 dcount[QDIO_MAX_ELEMENTS_PER_BUFFER];
u64 user0;
u64 res4[2];
u64 user1;
u64 user2;
u8 user1[16];
} __attribute__ ((packed, aligned(256)));

/**
Expand Down
42 changes: 26 additions & 16 deletions drivers/s390/net/qeth_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,17 @@ enum qeth_qdio_out_buffer_state {
QETH_QDIO_BUF_EMPTY,
/* Filled by driver; owned by hardware in order to be sent. */
QETH_QDIO_BUF_PRIMED,
/* Discovered by the TX completion code: */
QETH_QDIO_BUF_PENDING,
/* Finished by the TX completion code: */
QETH_QDIO_BUF_NEED_QAOB,
/* Received QAOB notification on CQ: */
QETH_QDIO_BUF_QAOB_OK,
QETH_QDIO_BUF_QAOB_ERROR,
};

enum qeth_qaob_state {
QETH_QAOB_ISSUED,
QETH_QAOB_PENDING,
QETH_QAOB_DONE,
};

struct qeth_qaob_priv1 {
unsigned int state;
u8 queue_no;
};

struct qeth_qdio_out_buffer {
Expand All @@ -433,9 +437,8 @@ struct qeth_qdio_out_buffer {
unsigned int frames;
unsigned int bytes;
struct sk_buff_head skb_list;
int is_header[QDIO_MAX_ELEMENTS_PER_BUFFER];
DECLARE_BITMAP(from_kmem_cache, QDIO_MAX_ELEMENTS_PER_BUFFER);

struct qeth_qdio_out_q *q;
struct list_head list_entry;
struct qaob *aob;
};
Expand Down Expand Up @@ -483,6 +486,7 @@ struct qeth_out_q_stats {
u64 stopped;
u64 doorbell;
u64 coal_frames;
u64 completion_irq;
u64 completion_yield;
u64 completion_timer;

Expand Down Expand Up @@ -526,6 +530,7 @@ struct qeth_qdio_out_q {

unsigned int coalesce_usecs;
unsigned int max_coalesced_frames;
unsigned int rescan_usecs;
};

#define qeth_for_each_output_queue(card, q, i) \
Expand Down Expand Up @@ -612,7 +617,6 @@ struct qeth_channel {
struct ccw_device *ccwdev;
struct qeth_cmd_buffer *active_cmd;
enum qeth_channel_states state;
atomic_t irq_pending;
};

struct qeth_reply {
Expand Down Expand Up @@ -662,11 +666,6 @@ static inline struct ccw1 *__ccw_from_cmd(struct qeth_cmd_buffer *iob)
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;
}

/**
* OSA card related definitions
*/
Expand Down Expand Up @@ -886,13 +885,24 @@ static inline bool qeth_card_hw_is_reachable(struct qeth_card *card)
return card->state == CARD_STATE_SOFTSETUP;
}

static inline bool qeth_use_tx_irqs(struct qeth_card *card)
{
return !IS_IQD(card);
}

static inline void qeth_unlock_channel(struct qeth_card *card,
struct qeth_channel *channel)
{
atomic_set(&channel->irq_pending, 0);
xchg(&channel->active_cmd, NULL);
wake_up(&card->wait_q);
}

static inline bool qeth_trylock_channel(struct qeth_channel *channel,
struct qeth_cmd_buffer *cmd)
{
return cmpxchg(&channel->active_cmd, NULL, cmd) == NULL;
}

struct qeth_trap_id {
__u16 lparnr;
char vmname[8];
Expand Down
Loading

0 comments on commit 62d3f4a

Please sign in to comment.