Skip to content

Commit 62d3f4a

Browse files
committed
Merge branch 's390-qeyj-next'
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 <[email protected]>
2 parents e5b0a1b + 953fb4d commit 62d3f4a

File tree

5 files changed

+181
-233
lines changed

5 files changed

+181
-233
lines changed

arch/s390/include/asm/qdio.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ struct slibe {
137137
* @user0: user defineable value
138138
* @res4: reserved paramater
139139
* @user1: user defineable value
140-
* @user2: user defineable value
141140
*/
142141
struct qaob {
143142
u64 res0[6];
@@ -152,8 +151,7 @@ struct qaob {
152151
u16 dcount[QDIO_MAX_ELEMENTS_PER_BUFFER];
153152
u64 user0;
154153
u64 res4[2];
155-
u64 user1;
156-
u64 user2;
154+
u8 user1[16];
157155
} __attribute__ ((packed, aligned(256)));
158156

159157
/**

drivers/s390/net/qeth_core.h

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,17 @@ enum qeth_qdio_out_buffer_state {
417417
QETH_QDIO_BUF_EMPTY,
418418
/* Filled by driver; owned by hardware in order to be sent. */
419419
QETH_QDIO_BUF_PRIMED,
420-
/* Discovered by the TX completion code: */
421-
QETH_QDIO_BUF_PENDING,
422-
/* Finished by the TX completion code: */
423-
QETH_QDIO_BUF_NEED_QAOB,
424-
/* Received QAOB notification on CQ: */
425-
QETH_QDIO_BUF_QAOB_OK,
426-
QETH_QDIO_BUF_QAOB_ERROR,
420+
};
421+
422+
enum qeth_qaob_state {
423+
QETH_QAOB_ISSUED,
424+
QETH_QAOB_PENDING,
425+
QETH_QAOB_DONE,
426+
};
427+
428+
struct qeth_qaob_priv1 {
429+
unsigned int state;
430+
u8 queue_no;
427431
};
428432

429433
struct qeth_qdio_out_buffer {
@@ -433,9 +437,8 @@ struct qeth_qdio_out_buffer {
433437
unsigned int frames;
434438
unsigned int bytes;
435439
struct sk_buff_head skb_list;
436-
int is_header[QDIO_MAX_ELEMENTS_PER_BUFFER];
440+
DECLARE_BITMAP(from_kmem_cache, QDIO_MAX_ELEMENTS_PER_BUFFER);
437441

438-
struct qeth_qdio_out_q *q;
439442
struct list_head list_entry;
440443
struct qaob *aob;
441444
};
@@ -483,6 +486,7 @@ struct qeth_out_q_stats {
483486
u64 stopped;
484487
u64 doorbell;
485488
u64 coal_frames;
489+
u64 completion_irq;
486490
u64 completion_yield;
487491
u64 completion_timer;
488492

@@ -526,6 +530,7 @@ struct qeth_qdio_out_q {
526530

527531
unsigned int coalesce_usecs;
528532
unsigned int max_coalesced_frames;
533+
unsigned int rescan_usecs;
529534
};
530535

531536
#define qeth_for_each_output_queue(card, q, i) \
@@ -612,7 +617,6 @@ struct qeth_channel {
612617
struct ccw_device *ccwdev;
613618
struct qeth_cmd_buffer *active_cmd;
614619
enum qeth_channel_states state;
615-
atomic_t irq_pending;
616620
};
617621

618622
struct qeth_reply {
@@ -662,11 +666,6 @@ static inline struct ccw1 *__ccw_from_cmd(struct qeth_cmd_buffer *iob)
662666
return (struct ccw1 *)(iob->data + ALIGN(iob->length, 8));
663667
}
664668

665-
static inline bool qeth_trylock_channel(struct qeth_channel *channel)
666-
{
667-
return atomic_cmpxchg(&channel->irq_pending, 0, 1) == 0;
668-
}
669-
670669
/**
671670
* OSA card related definitions
672671
*/
@@ -886,13 +885,24 @@ static inline bool qeth_card_hw_is_reachable(struct qeth_card *card)
886885
return card->state == CARD_STATE_SOFTSETUP;
887886
}
888887

888+
static inline bool qeth_use_tx_irqs(struct qeth_card *card)
889+
{
890+
return !IS_IQD(card);
891+
}
892+
889893
static inline void qeth_unlock_channel(struct qeth_card *card,
890894
struct qeth_channel *channel)
891895
{
892-
atomic_set(&channel->irq_pending, 0);
896+
xchg(&channel->active_cmd, NULL);
893897
wake_up(&card->wait_q);
894898
}
895899

900+
static inline bool qeth_trylock_channel(struct qeth_channel *channel,
901+
struct qeth_cmd_buffer *cmd)
902+
{
903+
return cmpxchg(&channel->active_cmd, NULL, cmd) == NULL;
904+
}
905+
896906
struct qeth_trap_id {
897907
__u16 lparnr;
898908
char vmname[8];

0 commit comments

Comments
 (0)