Commit 7b419e65 authored by David S. Miller's avatar David S. Miller

Merge branch 's390-net-next'

Julian Wiedmann says:

===================
s390/net: updates 2020-10-01

Patches 1-3 enable qeth to also support the .set_channels() ethtool
callback for OSA devices. This completes support for the full range
of device types.

The other patches are just the usual mix of cleanups.
(Even one for ctcm!)
===================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 14c914fc 55067455
......@@ -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 -----
......
......@@ -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);
......
......@@ -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
......@@ -278,6 +278,26 @@ 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;
u32 pcit_b;
u32 pcit_c;
char blkt_magic[4];
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*/
struct qeth_hdr_ext_tso {
__u16 hdr_tot_len;
......@@ -481,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;
......@@ -538,7 +559,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 +809,7 @@ struct qeth_switch_info {
struct qeth_priv {
unsigned int rx_copybreak;
unsigned int tx_wanted_queues;
u32 brport_hw_features;
u32 brport_features;
};
......@@ -836,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;
......@@ -870,8 +892,20 @@ 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;
}
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);
}
static inline u16 qeth_iqd_translate_txq(struct net_device *dev, u16 txq)
{
......@@ -1014,8 +1048,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[];
......@@ -1035,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);
......@@ -1087,7 +1122,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);
......
This diff is collapsed.
......@@ -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);
......@@ -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");
}
}
......
......@@ -211,13 +211,19 @@ 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;
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;
......@@ -228,13 +234,13 @@ 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;
}
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,
......
......@@ -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);
}
......@@ -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)
......@@ -894,18 +895,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;
......@@ -1130,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
......@@ -1377,7 +1371,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)
......@@ -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;
......@@ -2337,7 +2339,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,
......
......@@ -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);
......@@ -707,7 +707,7 @@ 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));
netdev_name(card->dev));
return 0;
}
rc = qeth_send_simple_setassparms(card, IPA_ARP_PROCESSING,
......@@ -715,7 +715,7 @@ static int qeth_l3_start_ipa_arp_processing(struct qeth_card *card)
if (rc) {
dev_warn(&card->gdev->dev,
"Starting ARP processing support for %s failed\n",
QETH_CARD_IFNAME(card));
netdev_name(card->dev));
}
return rc;
}
......@@ -729,7 +729,7 @@ 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));
netdev_name(card->dev));
return -EOPNOTSUPP;
}
......@@ -738,7 +738,7 @@ static int qeth_l3_start_ipa_source_mac(struct qeth_card *card)
if (rc)
dev_warn(&card->gdev->dev,
"Starting source MAC-address support for %s failed\n",
QETH_CARD_IFNAME(card));
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;
}
......@@ -759,7 +759,7 @@ static int qeth_l3_start_ipa_vlan(struct qeth_card *card)
if (rc) {
dev_warn(&card->gdev->dev,
"Starting VLAN support for %s failed\n",
QETH_CARD_IFNAME(card));
netdev_name(card->dev));
} else {
dev_info(&card->gdev->dev, "VLAN enabled\n");
}
......@@ -775,7 +775,7 @@ 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));
netdev_name(card->dev));
return -EOPNOTSUPP;
}
......@@ -784,7 +784,7 @@ static int qeth_l3_start_ipa_multicast(struct qeth_card *card)
if (rc) {
dev_warn(&card->gdev->dev,
"Starting multicast support for %s failed\n",
QETH_CARD_IFNAME(card));
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,7 +815,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_PASSTHRU,
......@@ -823,7 +823,7 @@ static int qeth_l3_softsetup_ipv6(struct qeth_card *card)
if (rc) {
dev_warn(&card->gdev->dev,
"Enabling the passthrough mode for %s failed\n",
QETH_CARD_IFNAME(card));
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);
......@@ -853,15 +853,16 @@ static int qeth_l3_start_ipa_broadcast(struct qeth_card *card)
if (!qeth_is_supported(card, IPA_FILTERING)) {
dev_info(&card->gdev->dev,
"Broadcast not supported on %s\n",
QETH_CARD_IFNAME(card));
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;
}
......@@ -870,7 +871,7 @@ static int qeth_l3_start_ipa_broadcast(struct qeth_card *card)
if (rc) {
dev_warn(&card->gdev->dev,
"Setting up broadcast filtering for %s failed\n",
QETH_CARD_IFNAME(card));
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;
......@@ -1831,8 +1833,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 = {
......@@ -1875,10 +1879,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 +2022,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 +2045,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;
......@@ -2067,7 +2075,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,
......@@ -2131,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;
......
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment