Skip to content

Commit c63d11b

Browse files
committed
Merge branch 's390-next'
Julian Wiedmann says: ==================== s390/qeth: updates 2019-03-28 please apply the following patchset to net-next. This reworks the control IO code in qeth so that we no longer need to poll for cmd completion, and refactors the IDX setup code to also use this improved IO path. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 1571e2f + 2e873d1 commit c63d11b

File tree

5 files changed

+440
-371
lines changed

5 files changed

+440
-371
lines changed

drivers/s390/net/qeth_core.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#ifndef __QETH_CORE_H__
1111
#define __QETH_CORE_H__
1212

13+
#include <linux/completion.h>
1314
#include <linux/if.h>
1415
#include <linux/if_arp.h>
1516
#include <linux/etherdevice.h>
@@ -21,6 +22,7 @@
2122
#include <linux/hashtable.h>
2223
#include <linux/ip.h>
2324
#include <linux/refcount.h>
25+
#include <linux/wait.h>
2426
#include <linux/workqueue.h>
2527

2628
#include <net/ipv6.h>
@@ -538,7 +540,6 @@ struct qeth_qdio_info {
538540
enum qeth_channel_states {
539541
CH_STATE_UP,
540542
CH_STATE_DOWN,
541-
CH_STATE_ACTIVATING,
542543
CH_STATE_HALTED,
543544
CH_STATE_STOPPED,
544545
CH_STATE_RCD,
@@ -585,7 +586,10 @@ struct qeth_cmd_buffer {
585586
enum qeth_cmd_buffer_state state;
586587
struct qeth_channel *channel;
587588
struct qeth_reply *reply;
589+
long timeout;
588590
unsigned char *data;
591+
void (*finalize)(struct qeth_card *card, struct qeth_cmd_buffer *iob,
592+
unsigned int length);
589593
void (*callback)(struct qeth_card *card, struct qeth_channel *channel,
590594
struct qeth_cmd_buffer *iob);
591595
};
@@ -610,6 +614,11 @@ struct qeth_channel {
610614
int io_buf_no;
611615
};
612616

617+
static inline bool qeth_trylock_channel(struct qeth_channel *channel)
618+
{
619+
return atomic_cmpxchg(&channel->irq_pending, 0, 1) == 0;
620+
}
621+
613622
/**
614623
* OSA card related definitions
615624
*/
@@ -636,12 +645,11 @@ struct qeth_seqno {
636645

637646
struct qeth_reply {
638647
struct list_head list;
639-
wait_queue_head_t wait_q;
648+
struct completion received;
640649
int (*callback)(struct qeth_card *, struct qeth_reply *,
641650
unsigned long);
642651
u32 seqno;
643652
unsigned long offset;
644-
atomic_t received;
645653
int rc;
646654
void *param;
647655
refcount_t refcnt;
@@ -774,18 +782,19 @@ struct qeth_card {
774782
struct qeth_card_options options;
775783

776784
struct workqueue_struct *event_wq;
785+
struct workqueue_struct *cmd_wq;
777786
wait_queue_head_t wait_q;
778-
spinlock_t mclock;
779787
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
780788
DECLARE_HASHTABLE(mac_htable, 4);
781789
DECLARE_HASHTABLE(ip_htable, 4);
790+
struct mutex ip_lock;
782791
DECLARE_HASHTABLE(ip_mc_htable, 4);
792+
struct work_struct rx_mode_work;
783793
struct work_struct kernel_thread_starter;
784794
spinlock_t thread_mask_lock;
785795
unsigned long thread_start_mask;
786796
unsigned long thread_allowed_mask;
787797
unsigned long thread_running_mask;
788-
spinlock_t ip_lock;
789798
struct qeth_ipato ipato;
790799
struct list_head cmd_waiter_list;
791800
/* QDIO buffer handling */
@@ -983,8 +992,6 @@ void qeth_clear_qdio_buffers(struct qeth_card *);
983992
void qeth_setadp_promisc_mode(struct qeth_card *);
984993
int qeth_setadpparms_change_macaddr(struct qeth_card *);
985994
void qeth_tx_timeout(struct net_device *);
986-
void qeth_prepare_control_data(struct qeth_card *, int,
987-
struct qeth_cmd_buffer *);
988995
void qeth_release_buffer(struct qeth_channel *, struct qeth_cmd_buffer *);
989996
void qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
990997
u16 cmd_length);

0 commit comments

Comments
 (0)