From bb5ab541942eaee4c5e175a4667df38cfc7da371 Mon Sep 17 00:00:00 2001 From: Julian Wiedmann Date: Thu, 1 Oct 2020 19:11:30 +0200 Subject: [PATCH 1/7] s390/qeth: keep track of wanted TX queues When re-initializing a device, we can hit a situation where qeth_osa_set_output_queues() detects that it supports more or less HW TX queues than before. Right now we adjust dev->real_num_tx_queues from right there, but 1. it's getting more & more complicated to cover all cases, and 2. we can't re-enable the actually expected number of TX queues later because we lost the needed information. So keep track of the wanted TX queues (on initial setup, and whenever its changed via .set_channels), and later use that information when re-enabling the netdevice. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller --- drivers/s390/net/qeth_core.h | 11 ++++- drivers/s390/net/qeth_core_main.c | 70 +++++++++++++------------------ drivers/s390/net/qeth_ethtool.c | 8 +++- drivers/s390/net/qeth_l2_main.c | 14 ++++--- drivers/s390/net/qeth_l3_main.c | 12 ++++-- 5 files changed, 61 insertions(+), 54 deletions(-) diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index f321eabefbe467..f1c9a694873e4c 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -538,7 +538,7 @@ struct qeth_qdio_info { int in_buf_size; /* output */ - int no_out_queues; + unsigned int no_out_queues; struct qeth_qdio_out_q *out_qs[QETH_MAX_OUT_QUEUES]; struct qdio_outbuf_state *out_bufstates; @@ -788,6 +788,7 @@ struct qeth_switch_info { struct qeth_priv { unsigned int rx_copybreak; + unsigned int tx_wanted_queues; u32 brport_hw_features; u32 brport_features; }; @@ -873,6 +874,13 @@ struct qeth_trap_id { /*some helper functions*/ #define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "") +static inline unsigned int qeth_tx_actual_queues(struct qeth_card *card) +{ + struct qeth_priv *priv = netdev_priv(card->dev); + + return min(priv->tx_wanted_queues, card->qdio.no_out_queues); +} + static inline u16 qeth_iqd_translate_txq(struct net_device *dev, u16 txq) { if (txq == QETH_IQD_MCAST_TXQ) @@ -1087,7 +1095,6 @@ void qeth_dbf_longtext(debug_info_t *id, int level, char *text, ...); int qeth_configure_cq(struct qeth_card *, enum qeth_cq); int qeth_hw_trap(struct qeth_card *, enum qeth_diags_trap_action); int qeth_setassparms_cb(struct qeth_card *, struct qeth_reply *, unsigned long); -int qeth_setup_netdev(struct qeth_card *card); int qeth_set_features(struct net_device *, netdev_features_t); void qeth_enable_hw_features(struct net_device *dev); netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t); diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index fc2c3db9259f51..b61078b27562b8 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -1511,23 +1511,12 @@ static void qeth_drain_output_queues(struct qeth_card *card) } } -static int qeth_osa_set_output_queues(struct qeth_card *card, bool single) +static void qeth_osa_set_output_queues(struct qeth_card *card, bool single) { unsigned int max = single ? 1 : card->dev->num_tx_queues; - unsigned int count; - int rc; - - count = IS_VM_NIC(card) ? min(max, card->dev->real_num_tx_queues) : max; - - rtnl_lock(); - rc = netif_set_real_num_tx_queues(card->dev, count); - rtnl_unlock(); - - if (rc) - return rc; if (card->qdio.no_out_queues == max) - return 0; + return; if (atomic_read(&card->qdio.state) != QETH_QDIO_UNINITIALIZED) qeth_free_qdio_queues(card); @@ -1536,14 +1525,12 @@ static int qeth_osa_set_output_queues(struct qeth_card *card, bool single) dev_info(&card->gdev->dev, "Priority Queueing not supported\n"); card->qdio.no_out_queues = max; - return 0; } static int qeth_update_from_chp_desc(struct qeth_card *card) { struct ccw_device *ccwdev; struct channel_path_desc_fmt0 *chp_dsc; - int rc = 0; QETH_CARD_TEXT(card, 2, "chp_desc"); @@ -1556,12 +1543,12 @@ static int qeth_update_from_chp_desc(struct qeth_card *card) if (IS_OSD(card) || IS_OSX(card)) /* CHPP field bit 6 == 1 -> single queue */ - rc = qeth_osa_set_output_queues(card, chp_dsc->chpp & 0x02); + qeth_osa_set_output_queues(card, chp_dsc->chpp & 0x02); kfree(chp_dsc); QETH_CARD_TEXT_(card, 2, "nr:%x", card->qdio.no_out_queues); QETH_CARD_TEXT_(card, 2, "lvl:%02x", card->info.func_level); - return rc; + return 0; } static void qeth_init_qdio_info(struct qeth_card *card) @@ -5316,6 +5303,20 @@ static int qeth_set_online(struct qeth_card *card) qeth_print_status_message(card); + if (card->dev->reg_state != NETREG_REGISTERED) { + struct qeth_priv *priv = netdev_priv(card->dev); + + if (IS_IQD(card)) + priv->tx_wanted_queues = QETH_IQD_MIN_TXQ; + else if (IS_VM_NIC(card)) + priv->tx_wanted_queues = 1; + else + priv->tx_wanted_queues = card->dev->num_tx_queues; + + /* no need for locking / error handling at this early stage: */ + qeth_set_real_num_tx_queues(card, qeth_tx_actual_queues(card)); + } + rc = card->discipline->set_online(card, carrier_ok); if (rc) goto err_online; @@ -6250,8 +6251,16 @@ static struct net_device *qeth_alloc_netdev(struct qeth_card *card) SET_NETDEV_DEV(dev, &card->gdev->dev); netif_carrier_off(dev); - dev->ethtool_ops = IS_OSN(card) ? &qeth_osn_ethtool_ops : - &qeth_ethtool_ops; + if (IS_OSN(card)) { + dev->ethtool_ops = &qeth_osn_ethtool_ops; + } else { + dev->ethtool_ops = &qeth_ethtool_ops; + dev->priv_flags &= ~IFF_TX_SKB_SHARING; + dev->hw_features |= NETIF_F_SG; + dev->vlan_features |= NETIF_F_SG; + if (IS_IQD(card)) + dev->features |= NETIF_F_SG; + } return dev; } @@ -6267,28 +6276,6 @@ struct net_device *qeth_clone_netdev(struct net_device *orig) return clone; } -int qeth_setup_netdev(struct qeth_card *card) -{ - struct net_device *dev = card->dev; - unsigned int num_tx_queues; - - dev->priv_flags &= ~IFF_TX_SKB_SHARING; - dev->hw_features |= NETIF_F_SG; - dev->vlan_features |= NETIF_F_SG; - - if (IS_IQD(card)) { - dev->features |= NETIF_F_SG; - num_tx_queues = QETH_IQD_MIN_TXQ; - } else if (IS_VM_NIC(card)) { - num_tx_queues = 1; - } else { - num_tx_queues = dev->real_num_tx_queues; - } - - return qeth_set_real_num_tx_queues(card, num_tx_queues); -} -EXPORT_SYMBOL_GPL(qeth_setup_netdev); - static int qeth_core_probe_device(struct ccwgroup_device *gdev) { struct qeth_card *card; @@ -6959,6 +6946,7 @@ int qeth_set_real_num_tx_queues(struct qeth_card *card, unsigned int count) return rc; } +EXPORT_SYMBOL_GPL(qeth_set_real_num_tx_queues); u16 qeth_iqd_select_queue(struct net_device *dev, struct sk_buff *skb, u8 cast_type, struct net_device *sb_dev) diff --git a/drivers/s390/net/qeth_ethtool.c b/drivers/s390/net/qeth_ethtool.c index f870c5322bfe74..bc3ea0efb58b3f 100644 --- a/drivers/s390/net/qeth_ethtool.c +++ b/drivers/s390/net/qeth_ethtool.c @@ -211,7 +211,9 @@ static void qeth_get_channels(struct net_device *dev, static int qeth_set_channels(struct net_device *dev, struct ethtool_channels *channels) { + struct qeth_priv *priv = netdev_priv(dev); struct qeth_card *card = dev->ml_priv; + int rc; if (channels->rx_count == 0 || channels->tx_count == 0) return -EINVAL; @@ -234,7 +236,11 @@ static int qeth_set_channels(struct net_device *dev, return -EOPNOTSUPP; } - return qeth_set_real_num_tx_queues(card, channels->tx_count); + rc = qeth_set_real_num_tx_queues(card, channels->tx_count); + if (!rc) + priv->tx_wanted_queues = channels->tx_count; + + return rc; } static int qeth_get_ts_info(struct net_device *dev, diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 1852d0a3c10a6e..290389fc7e793e 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -894,18 +894,12 @@ static const struct net_device_ops qeth_osn_netdev_ops = { static int qeth_l2_setup_netdev(struct qeth_card *card) { - int rc; - if (IS_OSN(card)) { card->dev->netdev_ops = &qeth_osn_netdev_ops; card->dev->flags |= IFF_NOARP; goto add_napi; } - rc = qeth_setup_netdev(card); - if (rc) - return rc; - card->dev->needed_headroom = sizeof(struct qeth_hdr); card->dev->netdev_ops = &qeth_l2_netdev_ops; card->dev->priv_flags |= IFF_UNICAST_FLT; @@ -2274,6 +2268,13 @@ static int qeth_l2_set_online(struct qeth_card *card, bool carrier_ok) netif_carrier_on(dev); } else { rtnl_lock(); + rc = qeth_set_real_num_tx_queues(card, + qeth_tx_actual_queues(card)); + if (rc) { + rtnl_unlock(); + goto err_set_queues; + } + if (carrier_ok) netif_carrier_on(dev); else @@ -2291,6 +2292,7 @@ static int qeth_l2_set_online(struct qeth_card *card, bool carrier_ok) } return 0; +err_set_queues: err_setup: qeth_set_allowed_threads(card, 0, 1); card->state = CARD_STATE_DOWN; diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index a6f8878b55c6a9..ea5f25857aff10 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -1875,10 +1875,6 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) unsigned int headroom; int rc; - rc = qeth_setup_netdev(card); - if (rc) - return rc; - if (IS_OSD(card) || IS_OSX(card)) { card->dev->netdev_ops = &qeth_l3_osa_netdev_ops; @@ -2022,6 +2018,13 @@ static int qeth_l3_set_online(struct qeth_card *card, bool carrier_ok) netif_carrier_on(dev); } else { rtnl_lock(); + rc = qeth_set_real_num_tx_queues(card, + qeth_tx_actual_queues(card)); + if (rc) { + rtnl_unlock(); + goto err_set_queues; + } + if (carrier_ok) netif_carrier_on(dev); else @@ -2038,6 +2041,7 @@ static int qeth_l3_set_online(struct qeth_card *card, bool carrier_ok) } return 0; +err_set_queues: err_setup: qeth_set_allowed_threads(card, 0, 1); card->state = CARD_STATE_DOWN; From 72d5e8504e3b2b83a94403b0bbe3070b70538bb9 Mon Sep 17 00:00:00 2001 From: Julian Wiedmann Date: Thu, 1 Oct 2020 19:11:31 +0200 Subject: [PATCH 2/7] s390/qeth: de-magic the QIB parm area Use a proper struct, and only program the QIB extensions for devices where they are supported. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller --- drivers/s390/net/qeth_core.h | 11 ++++++ drivers/s390/net/qeth_core_main.c | 65 ++++++++++++++----------------- 2 files changed, 41 insertions(+), 35 deletions(-) diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index f1c9a694873e4c..1e1e7104dade21 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -278,6 +278,17 @@ struct qeth_hdr { } hdr; } __attribute__ ((packed)); +struct qeth_qib_parms { + char pcit_magic[4]; + u32 pcit_a; + u32 pcit_b; + u32 pcit_c; + char blkt_magic[4]; + u32 blkt_total; + u32 blkt_inter_packet; + u32 blkt_inter_packet_jumbo; +}; + /*TCP Segmentation Offload header*/ struct qeth_hdr_ext_tso { __u16 hdr_tot_len; diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index b61078b27562b8..81f02a70680e15 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -2743,30 +2743,26 @@ static void qeth_free_qdio_queues(struct qeth_card *card) } } -static void qeth_create_qib_param_field(struct qeth_card *card, - char *param_field) -{ - - param_field[0] = _ascebc['P']; - param_field[1] = _ascebc['C']; - param_field[2] = _ascebc['I']; - param_field[3] = _ascebc['T']; - *((unsigned int *) (¶m_field[4])) = QETH_PCI_THRESHOLD_A(card); - *((unsigned int *) (¶m_field[8])) = QETH_PCI_THRESHOLD_B(card); - *((unsigned int *) (¶m_field[12])) = QETH_PCI_TIMER_VALUE(card); -} - -static void qeth_create_qib_param_field_blkt(struct qeth_card *card, - char *param_field) -{ - param_field[16] = _ascebc['B']; - param_field[17] = _ascebc['L']; - param_field[18] = _ascebc['K']; - param_field[19] = _ascebc['T']; - *((unsigned int *) (¶m_field[20])) = card->info.blkt.time_total; - *((unsigned int *) (¶m_field[24])) = card->info.blkt.inter_packet; - *((unsigned int *) (¶m_field[28])) = - card->info.blkt.inter_packet_jumbo; +static void qeth_fill_qib_parms(struct qeth_card *card, + struct qeth_qib_parms *parms) +{ + parms->pcit_magic[0] = 'P'; + parms->pcit_magic[1] = 'C'; + parms->pcit_magic[2] = 'I'; + parms->pcit_magic[3] = 'T'; + ASCEBC(parms->pcit_magic, sizeof(parms->pcit_magic)); + parms->pcit_a = QETH_PCI_THRESHOLD_A(card); + parms->pcit_b = QETH_PCI_THRESHOLD_B(card); + parms->pcit_c = QETH_PCI_TIMER_VALUE(card); + + parms->blkt_magic[0] = 'B'; + parms->blkt_magic[1] = 'L'; + parms->blkt_magic[2] = 'K'; + parms->blkt_magic[3] = 'T'; + ASCEBC(parms->blkt_magic, sizeof(parms->blkt_magic)); + parms->blkt_total = card->info.blkt.time_total; + parms->blkt_inter_packet = card->info.blkt.inter_packet; + parms->blkt_inter_packet_jumbo = card->info.blkt.inter_packet_jumbo; } static int qeth_qdio_activate(struct qeth_card *card) @@ -5022,21 +5018,20 @@ static int qeth_qdio_establish(struct qeth_card *card) { struct qdio_buffer **out_sbal_ptrs[QETH_MAX_OUT_QUEUES]; struct qdio_buffer **in_sbal_ptrs[QETH_MAX_IN_QUEUES]; + struct qeth_qib_parms *qib_parms = NULL; struct qdio_initialize init_data; - char *qib_param_field; unsigned int i; int rc = 0; QETH_CARD_TEXT(card, 2, "qdioest"); - qib_param_field = kzalloc(sizeof_field(struct qib, parm), GFP_KERNEL); - if (!qib_param_field) { - rc = -ENOMEM; - goto out_free_nothing; - } + if (!IS_IQD(card) && !IS_VM_NIC(card)) { + qib_parms = kzalloc(sizeof_field(struct qib, parm), GFP_KERNEL); + if (!qib_parms) + return -ENOMEM; - qeth_create_qib_param_field(card, qib_param_field); - qeth_create_qib_param_field_blkt(card, qib_param_field); + qeth_fill_qib_parms(card, qib_parms); + } in_sbal_ptrs[0] = card->qdio.in_q->qdio_bufs; if (card->options.cq == QETH_CQ_ENABLED) @@ -5049,7 +5044,7 @@ static int qeth_qdio_establish(struct qeth_card *card) init_data.q_format = IS_IQD(card) ? QDIO_IQDIO_QFMT : QDIO_QETH_QFMT; init_data.qib_param_field_format = 0; - init_data.qib_param_field = qib_param_field; + init_data.qib_param_field = (void *)qib_parms; init_data.no_input_qs = card->qdio.no_in_queues; init_data.no_output_qs = card->qdio.no_out_queues; init_data.input_handler = qeth_qdio_input_handler; @@ -5086,9 +5081,9 @@ static int qeth_qdio_establish(struct qeth_card *card) default: break; } + out: - kfree(qib_param_field); -out_free_nothing: + kfree(qib_parms); return rc; } From 949bbf4d2db873a6c229a43d816d9f8152b31704 Mon Sep 17 00:00:00 2001 From: Julian Wiedmann Date: Thu, 1 Oct 2020 19:11:32 +0200 Subject: [PATCH 3/7] s390/qeth: allow configuration of TX queues for OSA devices For OSA devices that are _not_ configured in prio-queue mode, give users the option of selecting the number of active TX queues. This requires setting up the HW queues with a reasonable default QoS value in the QIB's PQUE parm area. As with the other device types, we bring up the device with a minimal number of TX queues for compatibility reasons. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller --- drivers/s390/net/qeth_core.h | 18 +++++++++++++++++ drivers/s390/net/qeth_core_main.c | 32 ++++++++++++++++++++----------- drivers/s390/net/qeth_core_sys.c | 4 +++- drivers/s390/net/qeth_ethtool.c | 8 ++++---- drivers/s390/net/qeth_l2_main.c | 5 +++-- drivers/s390/net/qeth_l3_main.c | 6 ++++-- 6 files changed, 53 insertions(+), 20 deletions(-) diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index 1e1e7104dade21..707a1634f6215a 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -278,6 +278,10 @@ struct qeth_hdr { } hdr; } __attribute__ ((packed)); +#define QETH_QIB_PQUE_ORDER_RR 0 +#define QETH_QIB_PQUE_UNITS_SBAL 2 +#define QETH_QIB_PQUE_PRIO_DEFAULT 4 + struct qeth_qib_parms { char pcit_magic[4]; u32 pcit_a; @@ -287,6 +291,11 @@ struct qeth_qib_parms { u32 blkt_total; u32 blkt_inter_packet; u32 blkt_inter_packet_jumbo; + char pque_magic[4]; + u8 pque_order; + u8 pque_units; + u16 reserved; + u32 pque_priority[4]; }; /*TCP Segmentation Offload header*/ @@ -492,6 +501,7 @@ struct qeth_qdio_out_q { struct qdio_outbuf_state *bufstates; /* convenience pointer */ struct qeth_out_q_stats stats; spinlock_t lock; + unsigned int priority; u8 next_buf_to_fill; u8 max_elements; u8 queue_no; @@ -885,10 +895,18 @@ struct qeth_trap_id { /*some helper functions*/ #define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "") +static inline bool qeth_uses_tx_prio_queueing(struct qeth_card *card) +{ + return card->qdio.do_prio_queueing != QETH_NO_PRIO_QUEUEING; +} + static inline unsigned int qeth_tx_actual_queues(struct qeth_card *card) { struct qeth_priv *priv = netdev_priv(card->dev); + if (qeth_uses_tx_prio_queueing(card)) + return min(card->dev->num_tx_queues, card->qdio.no_out_queues); + return min(priv->tx_wanted_queues, card->qdio.no_out_queues); } diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 81f02a70680e15..9e9c229e2780c9 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -2683,6 +2683,7 @@ static int qeth_alloc_qdio_queues(struct qeth_card *card) timer_setup(&queue->timer, qeth_tx_completion_timer, 0); queue->coalesce_usecs = QETH_TX_COALESCE_USECS; queue->max_coalesced_frames = QETH_TX_MAX_COALESCED_FRAMES; + queue->priority = QETH_QIB_PQUE_PRIO_DEFAULT; /* give outbound qeth_qdio_buffers their qdio_buffers */ for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) { @@ -2746,6 +2747,9 @@ static void qeth_free_qdio_queues(struct qeth_card *card) static void qeth_fill_qib_parms(struct qeth_card *card, struct qeth_qib_parms *parms) { + struct qeth_qdio_out_q *queue; + unsigned int i; + parms->pcit_magic[0] = 'P'; parms->pcit_magic[1] = 'C'; parms->pcit_magic[2] = 'I'; @@ -2763,6 +2767,21 @@ static void qeth_fill_qib_parms(struct qeth_card *card, parms->blkt_total = card->info.blkt.time_total; parms->blkt_inter_packet = card->info.blkt.inter_packet; parms->blkt_inter_packet_jumbo = card->info.blkt.inter_packet_jumbo; + + /* Prio-queueing implicitly uses the default priorities: */ + if (qeth_uses_tx_prio_queueing(card) || card->qdio.no_out_queues == 1) + return; + + parms->pque_magic[0] = 'P'; + parms->pque_magic[1] = 'Q'; + parms->pque_magic[2] = 'U'; + parms->pque_magic[3] = 'E'; + ASCEBC(parms->pque_magic, sizeof(parms->pque_magic)); + parms->pque_order = QETH_QIB_PQUE_ORDER_RR; + parms->pque_units = QETH_QIB_PQUE_UNITS_SBAL; + + qeth_for_each_output_queue(card, queue, i) + parms->pque_priority[i] = queue->priority; } static int qeth_qdio_activate(struct qeth_card *card) @@ -5298,19 +5317,9 @@ static int qeth_set_online(struct qeth_card *card) qeth_print_status_message(card); - if (card->dev->reg_state != NETREG_REGISTERED) { - struct qeth_priv *priv = netdev_priv(card->dev); - - if (IS_IQD(card)) - priv->tx_wanted_queues = QETH_IQD_MIN_TXQ; - else if (IS_VM_NIC(card)) - priv->tx_wanted_queues = 1; - else - priv->tx_wanted_queues = card->dev->num_tx_queues; - + if (card->dev->reg_state != NETREG_REGISTERED) /* no need for locking / error handling at this early stage: */ qeth_set_real_num_tx_queues(card, qeth_tx_actual_queues(card)); - } rc = card->discipline->set_online(card, carrier_ok); if (rc) @@ -6236,6 +6245,7 @@ static struct net_device *qeth_alloc_netdev(struct qeth_card *card) priv = netdev_priv(dev); priv->rx_copybreak = QETH_RX_COPYBREAK; + priv->tx_wanted_queues = IS_IQD(card) ? QETH_IQD_MIN_TXQ : 1; dev->ml_priv = card; dev->watchdog_timeo = QETH_TX_TIMEOUT; diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c index 74c70364edc110..7cc5649dfffe88 100644 --- a/drivers/s390/net/qeth_core_sys.c +++ b/drivers/s390/net/qeth_core_sys.c @@ -164,9 +164,11 @@ static ssize_t qeth_dev_prioqing_show(struct device *dev, return sprintf(buf, "%s\n", "by skb-priority"); case QETH_PRIO_Q_ING_VLAN: return sprintf(buf, "%s\n", "by VLAN headers"); - default: + case QETH_PRIO_Q_ING_FIXED: return sprintf(buf, "always queue %i\n", card->qdio.default_out_queue); + default: + return sprintf(buf, "disabled\n"); } } diff --git a/drivers/s390/net/qeth_ethtool.c b/drivers/s390/net/qeth_ethtool.c index bc3ea0efb58b3f..b5caa723326ea4 100644 --- a/drivers/s390/net/qeth_ethtool.c +++ b/drivers/s390/net/qeth_ethtool.c @@ -220,6 +220,10 @@ static int qeth_set_channels(struct net_device *dev, if (channels->tx_count > card->qdio.no_out_queues) return -EINVAL; + /* Prio-queueing needs all TX queues: */ + if (qeth_uses_tx_prio_queueing(card)) + return -EPERM; + if (IS_IQD(card)) { if (channels->tx_count < QETH_IQD_MIN_TXQ) return -EINVAL; @@ -230,10 +234,6 @@ static int qeth_set_channels(struct net_device *dev, if (netif_running(dev) && channels->tx_count < dev->real_num_tx_queues) return -EPERM; - } else { - /* OSA still uses the legacy prio-queue mechanism: */ - if (!IS_VM_NIC(card)) - return -EOPNOTSUPP; } rc = qeth_set_real_num_tx_queues(card, channels->tx_count); diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 290389fc7e793e..c0ceeddd154975 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -571,9 +571,10 @@ static u16 qeth_l2_select_queue(struct net_device *dev, struct sk_buff *skb, return qeth_iqd_select_queue(dev, skb, qeth_get_ether_cast_type(skb), sb_dev); + if (qeth_uses_tx_prio_queueing(card)) + return qeth_get_priority_queue(card, skb); - return IS_VM_NIC(card) ? netdev_pick_tx(dev, skb, sb_dev) : - qeth_get_priority_queue(card, skb); + return netdev_pick_tx(dev, skb, sb_dev); } static void qeth_l2_set_rx_mode(struct net_device *dev) diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index ea5f25857aff10..803ccbcf3511ba 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -1831,8 +1831,10 @@ static u16 qeth_l3_osa_select_queue(struct net_device *dev, struct sk_buff *skb, { struct qeth_card *card = dev->ml_priv; - return IS_VM_NIC(card) ? netdev_pick_tx(dev, skb, sb_dev) : - qeth_get_priority_queue(card, skb); + if (qeth_uses_tx_prio_queueing(card)) + return qeth_get_priority_queue(card, skb); + + return netdev_pick_tx(dev, skb, sb_dev); } static const struct net_device_ops qeth_l3_netdev_ops = { From 50144f675363c368400eedd52c6680163b3260eb Mon Sep 17 00:00:00 2001 From: Julian Wiedmann Date: Thu, 1 Oct 2020 19:11:33 +0200 Subject: [PATCH 4/7] s390/qeth: constify the disciplines The discipline struct is a fixed group of function pointers. So declare the L2 and L3 disciplines as constant. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller --- drivers/s390/net/qeth_core.h | 6 +++--- drivers/s390/net/qeth_l2_main.c | 2 +- drivers/s390/net/qeth_l3_main.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index 707a1634f6215a..e5f47a823a111f 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -858,7 +858,7 @@ struct qeth_card { struct qeth_qdio_info qdio; int read_or_write_problem; struct qeth_osn_info osn_info; - struct qeth_discipline *discipline; + const struct qeth_discipline *discipline; atomic_t force_alloc_skb; struct service_level qeth_service_level; struct qdio_ssqd_desc ssqd; @@ -1051,8 +1051,8 @@ static inline int qeth_send_simple_setassparms_v6(struct qeth_card *card, int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb); -extern struct qeth_discipline qeth_l2_discipline; -extern struct qeth_discipline qeth_l3_discipline; +extern const struct qeth_discipline qeth_l2_discipline; +extern const struct qeth_discipline qeth_l3_discipline; extern const struct ethtool_ops qeth_ethtool_ops; extern const struct ethtool_ops qeth_osn_ethtool_ops; extern const struct attribute_group *qeth_generic_attr_groups[]; diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index c0ceeddd154975..2e9d3fea60e647 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -2340,7 +2340,7 @@ static int qeth_l2_control_event(struct qeth_card *card, } } -struct qeth_discipline qeth_l2_discipline = { +const struct qeth_discipline qeth_l2_discipline = { .devtype = &qeth_l2_devtype, .setup = qeth_l2_probe_device, .remove = qeth_l2_remove_device, diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 803ccbcf3511ba..4db7ded88fc8ee 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -2073,7 +2073,7 @@ static int qeth_l3_control_event(struct qeth_card *card, return 1; } -struct qeth_discipline qeth_l3_discipline = { +const struct qeth_discipline qeth_l3_discipline = { .devtype = &qeth_l3_devtype, .setup = qeth_l3_probe_device, .remove = qeth_l3_remove_device, From 84c91482eec419726ab6743d97816084a3e815cc Mon Sep 17 00:00:00 2001 From: Julian Wiedmann Date: Thu, 1 Oct 2020 19:11:34 +0200 Subject: [PATCH 5/7] s390/qeth: use netdev_name() Replace our custom version of netdev_name(). Once we started to allocate the netdev at probe time with commit d3d1b205e89f ("s390/qeth: allocate netdevice early"), this stopped working as intended anyway. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller --- drivers/s390/net/qeth_core.h | 3 -- drivers/s390/net/qeth_core_main.c | 6 ++-- drivers/s390/net/qeth_core_sys.c | 2 +- drivers/s390/net/qeth_l2_main.c | 2 +- drivers/s390/net/qeth_l3_main.c | 58 ++++++++++++++++--------------- 5 files changed, 35 insertions(+), 36 deletions(-) diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index e5f47a823a111f..39d17ea2eb78fb 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -892,9 +892,6 @@ struct qeth_trap_id { __u16 devno; } __packed; -/*some helper functions*/ -#define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "") - static inline bool qeth_uses_tx_prio_queueing(struct qeth_card *card) { return card->qdio.do_prio_queueing != QETH_NO_PRIO_QUEUEING; diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 9e9c229e2780c9..5fd614278f30a8 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -915,12 +915,12 @@ static struct qeth_ipa_cmd *qeth_check_ipa_data(struct qeth_card *card, if (cmd->hdr.return_code == IPA_RC_VEPA_TO_VEB_TRANSITION) { dev_err(&card->gdev->dev, "Interface %s is down because the adjacent port is no longer in reflective relay mode\n", - QETH_CARD_IFNAME(card)); + netdev_name(card->dev)); schedule_work(&card->close_dev_work); } else { dev_warn(&card->gdev->dev, "The link for interface %s on CHPID 0x%X failed\n", - QETH_CARD_IFNAME(card), card->info.chpid); + netdev_name(card->dev), card->info.chpid); qeth_issue_ipa_msg(cmd, cmd->hdr.return_code, card); netif_carrier_off(card->dev); } @@ -928,7 +928,7 @@ static struct qeth_ipa_cmd *qeth_check_ipa_data(struct qeth_card *card, case IPA_CMD_STARTLAN: dev_info(&card->gdev->dev, "The link for %s on CHPID 0x%X has been restored\n", - QETH_CARD_IFNAME(card), card->info.chpid); + netdev_name(card->dev), card->info.chpid); if (card->info.hwtrap) card->info.hwtrap = 2; qeth_schedule_recovery(card); diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c index 7cc5649dfffe88..4441b3393eafea 100644 --- a/drivers/s390/net/qeth_core_sys.c +++ b/drivers/s390/net/qeth_core_sys.c @@ -52,7 +52,7 @@ static ssize_t qeth_dev_if_name_show(struct device *dev, { struct qeth_card *card = dev_get_drvdata(dev); - return sprintf(buf, "%s\n", QETH_CARD_IFNAME(card)); + return sprintf(buf, "%s\n", netdev_name(card->dev)); } static DEVICE_ATTR(if_name, 0444, qeth_dev_if_name_show, NULL); diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 2e9d3fea60e647..a88d0a01e9a5c3 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -1372,7 +1372,7 @@ static void qeth_addr_change_event_worker(struct work_struct *work) dev_info(&data->card->gdev->dev, "Address change notification stopped on %s (%s)\n", - data->card->dev->name, + netdev_name(card->dev), (data->ac_event.lost_event_mask == 0x01) ? "Overflow" : (data->ac_event.lost_event_mask == 0x02) diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 4db7ded88fc8ee..e7244aa4d1910a 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -706,16 +706,16 @@ static int qeth_l3_start_ipa_arp_processing(struct qeth_card *card) if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { dev_info(&card->gdev->dev, - "ARP processing not supported on %s!\n", - QETH_CARD_IFNAME(card)); + "ARP processing not supported on %s!\n", + netdev_name(card->dev)); return 0; } rc = qeth_send_simple_setassparms(card, IPA_ARP_PROCESSING, IPA_CMD_ASS_START, NULL); if (rc) { dev_warn(&card->gdev->dev, - "Starting ARP processing support for %s failed\n", - QETH_CARD_IFNAME(card)); + "Starting ARP processing support for %s failed\n", + netdev_name(card->dev)); } return rc; } @@ -728,8 +728,8 @@ static int qeth_l3_start_ipa_source_mac(struct qeth_card *card) if (!qeth_is_supported(card, IPA_SOURCE_MAC)) { dev_info(&card->gdev->dev, - "Inbound source MAC-address not supported on %s\n", - QETH_CARD_IFNAME(card)); + "Inbound source MAC-address not supported on %s\n", + netdev_name(card->dev)); return -EOPNOTSUPP; } @@ -737,8 +737,8 @@ static int qeth_l3_start_ipa_source_mac(struct qeth_card *card) IPA_CMD_ASS_START, NULL); if (rc) dev_warn(&card->gdev->dev, - "Starting source MAC-address support for %s failed\n", - QETH_CARD_IFNAME(card)); + "Starting source MAC-address support for %s failed\n", + netdev_name(card->dev)); return rc; } @@ -750,7 +750,7 @@ static int qeth_l3_start_ipa_vlan(struct qeth_card *card) if (!qeth_is_supported(card, IPA_FULL_VLAN)) { dev_info(&card->gdev->dev, - "VLAN not supported on %s\n", QETH_CARD_IFNAME(card)); + "VLAN not supported on %s\n", netdev_name(card->dev)); return -EOPNOTSUPP; } @@ -758,8 +758,8 @@ static int qeth_l3_start_ipa_vlan(struct qeth_card *card) IPA_CMD_ASS_START, NULL); if (rc) { dev_warn(&card->gdev->dev, - "Starting VLAN support for %s failed\n", - QETH_CARD_IFNAME(card)); + "Starting VLAN support for %s failed\n", + netdev_name(card->dev)); } else { dev_info(&card->gdev->dev, "VLAN enabled\n"); } @@ -774,8 +774,8 @@ static int qeth_l3_start_ipa_multicast(struct qeth_card *card) if (!qeth_is_supported(card, IPA_MULTICASTING)) { dev_info(&card->gdev->dev, - "Multicast not supported on %s\n", - QETH_CARD_IFNAME(card)); + "Multicast not supported on %s\n", + netdev_name(card->dev)); return -EOPNOTSUPP; } @@ -783,8 +783,8 @@ static int qeth_l3_start_ipa_multicast(struct qeth_card *card) IPA_CMD_ASS_START, NULL); if (rc) { dev_warn(&card->gdev->dev, - "Starting multicast support for %s failed\n", - QETH_CARD_IFNAME(card)); + "Starting multicast support for %s failed\n", + netdev_name(card->dev)); } else { dev_info(&card->gdev->dev, "Multicast enabled\n"); card->dev->flags |= IFF_MULTICAST; @@ -807,7 +807,7 @@ static int qeth_l3_softsetup_ipv6(struct qeth_card *card) if (rc) { dev_err(&card->gdev->dev, "Activating IPv6 support for %s failed\n", - QETH_CARD_IFNAME(card)); + netdev_name(card->dev)); return rc; } rc = qeth_send_simple_setassparms_v6(card, IPA_IPV6, IPA_CMD_ASS_START, @@ -815,15 +815,15 @@ static int qeth_l3_softsetup_ipv6(struct qeth_card *card) if (rc) { dev_err(&card->gdev->dev, "Activating IPv6 support for %s failed\n", - QETH_CARD_IFNAME(card)); + netdev_name(card->dev)); return rc; } rc = qeth_send_simple_setassparms_v6(card, IPA_PASSTHRU, IPA_CMD_ASS_START, NULL); if (rc) { dev_warn(&card->gdev->dev, - "Enabling the passthrough mode for %s failed\n", - QETH_CARD_IFNAME(card)); + "Enabling the passthrough mode for %s failed\n", + netdev_name(card->dev)); return rc; } out: @@ -837,7 +837,7 @@ static int qeth_l3_start_ipa_ipv6(struct qeth_card *card) if (!qeth_is_supported(card, IPA_IPV6)) { dev_info(&card->gdev->dev, - "IPv6 not supported on %s\n", QETH_CARD_IFNAME(card)); + "IPv6 not supported on %s\n", netdev_name(card->dev)); return 0; } return qeth_l3_softsetup_ipv6(card); @@ -852,16 +852,17 @@ static int qeth_l3_start_ipa_broadcast(struct qeth_card *card) card->info.broadcast_capable = 0; if (!qeth_is_supported(card, IPA_FILTERING)) { dev_info(&card->gdev->dev, - "Broadcast not supported on %s\n", - QETH_CARD_IFNAME(card)); + "Broadcast not supported on %s\n", + netdev_name(card->dev)); rc = -EOPNOTSUPP; goto out; } rc = qeth_send_simple_setassparms(card, IPA_FILTERING, IPA_CMD_ASS_START, NULL); if (rc) { - dev_warn(&card->gdev->dev, "Enabling broadcast filtering for " - "%s failed\n", QETH_CARD_IFNAME(card)); + dev_warn(&card->gdev->dev, + "Enabling broadcast filtering for %s failed\n", + netdev_name(card->dev)); goto out; } @@ -869,8 +870,8 @@ static int qeth_l3_start_ipa_broadcast(struct qeth_card *card) IPA_CMD_ASS_CONFIGURE, &filter_data); if (rc) { dev_warn(&card->gdev->dev, - "Setting up broadcast filtering for %s failed\n", - QETH_CARD_IFNAME(card)); + "Setting up broadcast filtering for %s failed\n", + netdev_name(card->dev)); goto out; } card->info.broadcast_capable = QETH_BROADCAST_WITH_ECHO; @@ -878,8 +879,9 @@ static int qeth_l3_start_ipa_broadcast(struct qeth_card *card) rc = qeth_send_simple_setassparms(card, IPA_FILTERING, IPA_CMD_ASS_ENABLE, &filter_data); if (rc) { - dev_warn(&card->gdev->dev, "Setting up broadcast echo " - "filtering for %s failed\n", QETH_CARD_IFNAME(card)); + dev_warn(&card->gdev->dev, + "Setting up broadcast echo filtering for %s failed\n", + netdev_name(card->dev)); goto out; } card->info.broadcast_capable = QETH_BROADCAST_WITHOUT_ECHO; From 378ac80d7f4909cd0a1cce706356d0dfbee08621 Mon Sep 17 00:00:00 2001 From: Julian Wiedmann Date: Thu, 1 Oct 2020 19:11:35 +0200 Subject: [PATCH 6/7] s390/qeth: static checker cleanups - Add/delete some blanks, white spaces and braces. - Fix misindentations. - Adjust a deprecated header include, and htons() conversion. - Remove extra 'return' statements. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller --- drivers/s390/net/qeth_core.h | 7 ++++--- drivers/s390/net/qeth_core_main.c | 18 +++++++++--------- drivers/s390/net/qeth_l2_main.c | 5 ++--- drivers/s390/net/qeth_l3_main.c | 7 +++---- drivers/s390/net/qeth_l3_sys.c | 8 ++++---- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index 39d17ea2eb78fb..f73b4756ed5e62 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -177,8 +177,8 @@ struct qeth_vnicc_info { /** * some more defs */ -#define QETH_TX_TIMEOUT 100 * HZ -#define QETH_RCD_TIMEOUT 60 * HZ +#define QETH_TX_TIMEOUT (100 * HZ) +#define QETH_RCD_TIMEOUT (60 * HZ) #define QETH_RECLAIM_WORK_TIME HZ #define QETH_MAX_PORTNO 15 @@ -1069,7 +1069,8 @@ extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS]; struct net_device *qeth_clone_netdev(struct net_device *orig); struct qeth_card *qeth_get_card_by_busid(char *bus_id); -void qeth_set_allowed_threads(struct qeth_card *, unsigned long , int); +void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads, + int clear_start_mask); int qeth_threads_running(struct qeth_card *, unsigned long); int qeth_set_offline(struct qeth_card *card, bool resetting); diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 5fd614278f30a8..93c9b30ab17a4a 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -35,7 +36,6 @@ #include #include -#include #include #include #include @@ -209,9 +209,8 @@ static void qeth_clear_working_pool_list(struct qeth_card *card) QETH_CARD_TEXT(card, 5, "clwrklst"); list_for_each_entry_safe(pool_entry, tmp, - &card->qdio.in_buf_pool.entry_list, list){ - list_del(&pool_entry->list); - } + &card->qdio.in_buf_pool.entry_list, list) + list_del(&pool_entry->list); for (i = 0; i < ARRAY_SIZE(queue->bufs); i++) queue->bufs[i].pool_entry = NULL; @@ -481,6 +480,7 @@ static void qeth_cleanup_handled_pending(struct qeth_qdio_out_q *q, int bidx, atomic_read(&c->state) == QETH_QDIO_BUF_HANDLED_DELAYED) { struct qeth_qdio_out_buffer *f = c; + QETH_CARD_TEXT(f->q->card, 5, "fp"); QETH_CARD_TEXT_(f->q->card, 5, "%lx", (long) f); /* release here to avoid interleaving between @@ -507,7 +507,6 @@ static void qeth_cleanup_handled_pending(struct qeth_qdio_out_q *q, int bidx, } } - static void qeth_qdio_handle_aob(struct qeth_card *card, unsigned long phys_aob_addr) { @@ -884,6 +883,7 @@ static void qeth_issue_ipa_msg(struct qeth_ipa_cmd *cmd, int rc, { const char *ipa_name; int com = cmd->hdr.command; + ipa_name = qeth_get_ipa_cmd_name(com); if (rc) @@ -1253,7 +1253,7 @@ static int qeth_get_problem(struct qeth_card *card, struct ccw_device *cdev, return 0; } QETH_CARD_TEXT(card, 2, "DGENCHK"); - return -EIO; + return -EIO; } return 0; } @@ -1600,7 +1600,7 @@ static void qeth_start_kernel_thread(struct work_struct *work) struct task_struct *ts; struct qeth_card *card = container_of(work, struct qeth_card, kernel_thread_starter); - QETH_CARD_TEXT(card , 2, "strthrd"); + QETH_CARD_TEXT(card, 2, "strthrd"); if (card->read.state != CH_STATE_UP && card->write.state != CH_STATE_UP) @@ -3416,7 +3416,6 @@ static void qeth_get_trap_id(struct qeth_card *card, struct qeth_trap_id *tid) memcpy(tid->vmname, info322->vm[0].name, sizeof(tid->vmname)); } free_page(info); - return; } static int qeth_hw_trap_cb(struct qeth_card *card, @@ -4998,7 +4997,6 @@ static void qeth_determine_capabilities(struct qeth_card *card) card->options.cq = QETH_CQ_NOTAVAILABLE; } - out_offline: if (ddev_offline == 1) qeth_stop_channel(channel); @@ -6050,6 +6048,7 @@ EXPORT_SYMBOL_GPL(qeth_send_simple_setassparms_prot); static void qeth_unregister_dbf_views(void) { int x; + for (x = 0; x < QETH_DBF_INFOS; x++) { debug_unregister(qeth_dbf[x].id); qeth_dbf[x].id = NULL; @@ -6413,6 +6412,7 @@ static int qeth_core_set_offline(struct ccwgroup_device *gdev) static void qeth_core_shutdown(struct ccwgroup_device *gdev) { struct qeth_card *card = dev_get_drvdata(&gdev->dev); + qeth_set_allowed_threads(card, 0, 1); if ((gdev->state == CCWGROUP_ONLINE) && card->info.hwtrap) qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index a88d0a01e9a5c3..28f6dda957363d 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -183,7 +183,7 @@ static void qeth_l2_fill_header(struct qeth_qdio_out_q *queue, /* VSWITCH relies on the VLAN * information to be present in * the QDIO header */ - if (veth->h_vlan_proto == __constant_htons(ETH_P_8021Q)) { + if (veth->h_vlan_proto == htons(ETH_P_8021Q)) { hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_VLAN; hdr->hdr.l2.vlan_id = ntohs(veth->h_vlan_TCI); } @@ -877,7 +877,7 @@ static const struct net_device_ops qeth_l2_netdev_ops = { .ndo_set_mac_address = qeth_l2_set_mac_address, .ndo_vlan_rx_add_vid = qeth_l2_vlan_rx_add_vid, .ndo_vlan_rx_kill_vid = qeth_l2_vlan_rx_kill_vid, - .ndo_tx_timeout = qeth_tx_timeout, + .ndo_tx_timeout = qeth_tx_timeout, .ndo_fix_features = qeth_fix_features, .ndo_set_features = qeth_set_features, .ndo_bridge_getlink = qeth_l2_bridge_getlink, @@ -1125,7 +1125,6 @@ void qeth_osn_deregister(struct net_device *dev) QETH_CARD_TEXT(card, 2, "osndereg"); card->osn_info.assist_cb = NULL; card->osn_info.data_cb = NULL; - return; } EXPORT_SYMBOL(qeth_osn_deregister); #endif diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index e7244aa4d1910a..b1c1d2510d55bf 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -97,7 +97,7 @@ static bool qeth_l3_is_addr_covered_by_ipato(struct qeth_card *card, return false; qeth_l3_convert_addr_to_bits((u8 *) &addr->u, addr_bits, - (addr->proto == QETH_PROT_IPV4)? 4:16); + (addr->proto == QETH_PROT_IPV4) ? 4 : 16); list_for_each_entry(ipatoe, &card->ipato.entries, entry) { if (addr->proto != ipatoe->proto) continue; @@ -540,7 +540,7 @@ int qeth_l3_add_ipato_entry(struct qeth_card *card, if (ipatoe->proto != new->proto) continue; if (!memcmp(ipatoe->addr, new->addr, - (ipatoe->proto == QETH_PROT_IPV4)? 4:16) && + (ipatoe->proto == QETH_PROT_IPV4) ? 4 : 16) && (ipatoe->mask_bits == new->mask_bits)) { rc = -EEXIST; break; @@ -572,7 +572,7 @@ int qeth_l3_del_ipato_entry(struct qeth_card *card, if (ipatoe->proto != proto) continue; if (!memcmp(ipatoe->addr, addr, - (proto == QETH_PROT_IPV4)? 4:16) && + (proto == QETH_PROT_IPV4) ? 4 : 16) && (ipatoe->mask_bits == mask_bits)) { list_del(&ipatoe->entry); qeth_l3_update_ipato(card); @@ -2139,7 +2139,6 @@ static struct qeth_card *qeth_l3_get_card_from_dev(struct net_device *dev) static int qeth_l3_ip_event(struct notifier_block *this, unsigned long event, void *ptr) { - struct in_ifaddr *ifa = (struct in_ifaddr *)ptr; struct net_device *dev = ifa->ifa_dev->dev; struct qeth_ipaddr addr; diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c index 351763ae9b9cdc..997fbb7006a7cb 100644 --- a/drivers/s390/net/qeth_l3_sys.c +++ b/drivers/s390/net/qeth_l3_sys.c @@ -285,7 +285,7 @@ static ssize_t qeth_l3_dev_ipato_enable_show(struct device *dev, { struct qeth_card *card = dev_get_drvdata(dev); - return sprintf(buf, "%i\n", card->ipato.enabled? 1:0); + return sprintf(buf, "%u\n", card->ipato.enabled ? 1 : 0); } static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev, @@ -330,7 +330,7 @@ static ssize_t qeth_l3_dev_ipato_invert4_show(struct device *dev, { struct qeth_card *card = dev_get_drvdata(dev); - return sprintf(buf, "%i\n", card->ipato.invert4? 1:0); + return sprintf(buf, "%u\n", card->ipato.invert4 ? 1 : 0); } static ssize_t qeth_l3_dev_ipato_invert4_store(struct device *dev, @@ -450,7 +450,7 @@ static ssize_t qeth_l3_dev_ipato_add_store(const char *buf, size_t count, return -ENOMEM; ipatoe->proto = proto; - memcpy(ipatoe->addr, addr, (proto == QETH_PROT_IPV4)? 4:16); + memcpy(ipatoe->addr, addr, (proto == QETH_PROT_IPV4) ? 4 : 16); ipatoe->mask_bits = mask_bits; rc = qeth_l3_add_ipato_entry(card, ipatoe); @@ -501,7 +501,7 @@ static ssize_t qeth_l3_dev_ipato_invert6_show(struct device *dev, { struct qeth_card *card = dev_get_drvdata(dev); - return sprintf(buf, "%i\n", card->ipato.invert6? 1:0); + return sprintf(buf, "%u\n", card->ipato.invert6 ? 1 : 0); } static ssize_t qeth_l3_dev_ipato_invert6_store(struct device *dev, From 5506745537e716abb8170e375f3ed9d6c57db2ce Mon Sep 17 00:00:00 2001 From: Vasily Gorbik Date: Thu, 1 Oct 2020 19:11:36 +0200 Subject: [PATCH 7/7] s390/ctcm: remove orphaned function declarations drivers/s390/net/ctcm_fsms.h: fsm_action_nop - only declaration left after commit 04885948b101 ("ctc: removal of the old ctc driver") drivers/s390/net/ctcm_mpc.h: ctcmpc_open - only declaration left after commit 293d984f0e36 ("ctcm: infrastructure for replaced ctc driver") Reviewed-by: Julian Wiedmann Signed-off-by: Vasily Gorbik Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller --- drivers/s390/net/ctcm_fsms.h | 1 - drivers/s390/net/ctcm_mpc.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/s390/net/ctcm_fsms.h b/drivers/s390/net/ctcm_fsms.h index 225737295cb472..d98c486724d4a6 100644 --- a/drivers/s390/net/ctcm_fsms.h +++ b/drivers/s390/net/ctcm_fsms.h @@ -159,7 +159,6 @@ extern const char *ctc_ch_state_names[]; void ctcm_ccw_check_rc(struct channel *ch, int rc, char *msg); void ctcm_purge_skb_queue(struct sk_buff_head *q); -void fsm_action_nop(fsm_instance *fi, int event, void *arg); /* * ----- non-static actions for ctcm channel statemachine ----- diff --git a/drivers/s390/net/ctcm_mpc.h b/drivers/s390/net/ctcm_mpc.h index 441d7b211f0f92..da41b26f76d1d9 100644 --- a/drivers/s390/net/ctcm_mpc.h +++ b/drivers/s390/net/ctcm_mpc.h @@ -228,7 +228,6 @@ static inline void ctcmpc_dump32(char *buf, int len) ctcmpc_dumpit(buf, 32); } -int ctcmpc_open(struct net_device *); void ctcm_ccw_check_rc(struct channel *, int, char *); void mpc_group_ready(unsigned long adev); void mpc_channel_action(struct channel *ch, int direction, int action);