Skip to content

Commit cea0aa9

Browse files
committed
Merge branch 's390-next'
Julian Wiedmann says: ==================== s390/qeth: updates 2019-04-17 please apply some additional qeth patches to net-next. This patchset converts the driver to use the kernel's multiqueue model. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 3a6f789 + 54a5094 commit cea0aa9

6 files changed

Lines changed: 233 additions & 152 deletions

File tree

‎drivers/s390/net/qeth_core.h‎

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa,
219219
/* QDIO queue and buffer handling */
220220
/*****************************************************************************/
221221
#define QETH_MAX_QUEUES 4
222+
#define QETH_IQD_MIN_TXQ 2 /* One for ucast, one for mcast. */
223+
#define QETH_IQD_MCAST_TXQ 0
224+
#define QETH_IQD_MIN_UCAST_TXQ 1
222225
#define QETH_IN_BUF_SIZE_DEFAULT 65536
223226
#define QETH_IN_BUF_COUNT_DEFAULT 64
224227
#define QETH_IN_BUF_COUNT_HSDEFAULT 128
@@ -464,7 +467,6 @@ struct qeth_card_stats {
464467
u64 rx_errors;
465468
u64 rx_dropped;
466469
u64 rx_multicast;
467-
u64 tx_errors;
468470
};
469471

470472
struct qeth_out_q_stats {
@@ -479,6 +481,7 @@ struct qeth_out_q_stats {
479481
u64 skbs_linearized_fail;
480482
u64 tso_bytes;
481483
u64 packing_mode_switch;
484+
u64 stopped;
482485

483486
/* rtnl_link_stats64 */
484487
u64 tx_packets;
@@ -509,6 +512,11 @@ struct qeth_qdio_out_q {
509512
atomic_t set_pci_flags_count;
510513
};
511514

515+
static inline bool qeth_out_queue_is_full(struct qeth_qdio_out_q *queue)
516+
{
517+
return atomic_read(&queue->used_buffers) >= QDIO_MAX_BUFFERS_PER_Q;
518+
}
519+
512520
struct qeth_qdio_info {
513521
atomic_t state;
514522
/* input */
@@ -836,6 +844,15 @@ static inline bool qeth_netdev_is_registered(struct net_device *dev)
836844
return dev->netdev_ops != NULL;
837845
}
838846

847+
static inline u16 qeth_iqd_translate_txq(struct net_device *dev, u16 txq)
848+
{
849+
if (txq == QETH_IQD_MCAST_TXQ)
850+
return dev->num_tx_queues - 1;
851+
if (txq == dev->num_tx_queues - 1)
852+
return QETH_IQD_MCAST_TXQ;
853+
return txq;
854+
}
855+
839856
static inline void qeth_scrub_qdio_buffer(struct qdio_buffer *buf,
840857
unsigned int elements)
841858
{
@@ -931,18 +948,7 @@ static inline int qeth_send_simple_setassparms_v6(struct qeth_card *card,
931948
data, QETH_PROT_IPV6);
932949
}
933950

934-
int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
935-
int ipv);
936-
static inline struct qeth_qdio_out_q *qeth_get_tx_queue(struct qeth_card *card,
937-
struct sk_buff *skb,
938-
int ipv, int cast_type)
939-
{
940-
if (IS_IQD(card) && cast_type != RTN_UNICAST)
941-
return card->qdio.out_qs[card->qdio.no_out_queues - 1];
942-
if (!card->qdio.do_prio_queueing)
943-
return card->qdio.out_qs[card->qdio.default_out_queue];
944-
return card->qdio.out_qs[qeth_get_priority_queue(card, skb, ipv)];
945-
}
951+
int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb);
946952

947953
extern struct qeth_discipline qeth_l2_discipline;
948954
extern struct qeth_discipline qeth_l3_discipline;
@@ -988,7 +994,7 @@ void qeth_clear_ipacmd_list(struct qeth_card *);
988994
int qeth_qdio_clear_card(struct qeth_card *, int);
989995
void qeth_clear_working_pool_list(struct qeth_card *);
990996
void qeth_clear_cmd_buffers(struct qeth_channel *);
991-
void qeth_clear_qdio_buffers(struct qeth_card *);
997+
void qeth_drain_output_queues(struct qeth_card *card);
992998
void qeth_setadp_promisc_mode(struct qeth_card *);
993999
int qeth_setadpparms_change_macaddr(struct qeth_card *);
9941000
void qeth_tx_timeout(struct net_device *);
@@ -1023,6 +1029,8 @@ netdev_features_t qeth_features_check(struct sk_buff *skb,
10231029
struct net_device *dev,
10241030
netdev_features_t features);
10251031
void qeth_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats);
1032+
u16 qeth_iqd_select_queue(struct net_device *dev, struct sk_buff *skb,
1033+
u8 cast_type, struct net_device *sb_dev);
10261034
int qeth_open(struct net_device *dev);
10271035
int qeth_stop(struct net_device *dev);
10281036

0 commit comments

Comments
 (0)