Commit be64e397 authored by David S. Miller's avatar David S. Miller

Merge branch 's390-qeth-next'

Julian Wiedmann says:

====================
s390/qeth: updates 2020-02-27

please apply the following patch series for qeth to netdev's net-next
tree.

This adds support for ETHTOOL_RX_COPYBREAK, along with small cleanups
and fine-tuning.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 22339f2f 562cf773
...@@ -189,6 +189,8 @@ struct qeth_vnicc_info { ...@@ -189,6 +189,8 @@ struct qeth_vnicc_info {
#define QETH_IQD_MIN_TXQ 2 /* One for ucast, one for mcast. */ #define QETH_IQD_MIN_TXQ 2 /* One for ucast, one for mcast. */
#define QETH_IQD_MCAST_TXQ 0 #define QETH_IQD_MCAST_TXQ 0
#define QETH_IQD_MIN_UCAST_TXQ 1 #define QETH_IQD_MIN_UCAST_TXQ 1
#define QETH_RX_COPYBREAK (PAGE_SIZE >> 1)
#define QETH_IN_BUF_SIZE_DEFAULT 65536 #define QETH_IN_BUF_SIZE_DEFAULT 65536
#define QETH_IN_BUF_COUNT_DEFAULT 64 #define QETH_IN_BUF_COUNT_DEFAULT 64
#define QETH_IN_BUF_COUNT_HSDEFAULT 128 #define QETH_IN_BUF_COUNT_HSDEFAULT 128
...@@ -219,9 +221,6 @@ struct qeth_vnicc_info { ...@@ -219,9 +221,6 @@ struct qeth_vnicc_info {
#define QETH_HIGH_WATERMARK_PACK 5 #define QETH_HIGH_WATERMARK_PACK 5
#define QETH_WATERMARK_PACK_FUZZ 1 #define QETH_WATERMARK_PACK_FUZZ 1
/* large receive scatter gather copy break */
#define QETH_RX_SG_CB (PAGE_SIZE >> 1)
struct qeth_hdr_layer3 { struct qeth_hdr_layer3 {
__u8 id; __u8 id;
__u8 flags; __u8 flags;
...@@ -711,7 +710,6 @@ struct qeth_card_options { ...@@ -711,7 +710,6 @@ struct qeth_card_options {
struct qeth_vnicc_info vnicc; /* VNICC options */ struct qeth_vnicc_info vnicc; /* VNICC options */
int fake_broadcast; int fake_broadcast;
enum qeth_discipline_id layer; enum qeth_discipline_id layer;
int rx_sg_cb;
enum qeth_ipa_isolation_modes isolation; enum qeth_ipa_isolation_modes isolation;
enum qeth_ipa_isolation_modes prev_isolation; enum qeth_ipa_isolation_modes prev_isolation;
int sniffer; int sniffer;
...@@ -770,6 +768,10 @@ struct qeth_switch_info { ...@@ -770,6 +768,10 @@ struct qeth_switch_info {
__u32 settings; __u32 settings;
}; };
struct qeth_priv {
unsigned int rx_copybreak;
};
#define QETH_NAPI_WEIGHT NAPI_POLL_WEIGHT #define QETH_NAPI_WEIGHT NAPI_POLL_WEIGHT
struct qeth_card { struct qeth_card {
......
...@@ -742,7 +742,7 @@ static void qeth_issue_next_read_cb(struct qeth_card *card, ...@@ -742,7 +742,7 @@ static void qeth_issue_next_read_cb(struct qeth_card *card,
/* fall through */ /* fall through */
default: default:
qeth_clear_ipacmd_list(card); qeth_clear_ipacmd_list(card);
goto out; goto err_idx;
} }
cmd = __ipa_reply(iob); cmd = __ipa_reply(iob);
...@@ -795,8 +795,9 @@ static void qeth_issue_next_read_cb(struct qeth_card *card, ...@@ -795,8 +795,9 @@ static void qeth_issue_next_read_cb(struct qeth_card *card,
memcpy(&card->seqno.pdu_hdr_ack, memcpy(&card->seqno.pdu_hdr_ack,
QETH_PDU_HEADER_SEQ_NO(iob->data), QETH_PDU_HEADER_SEQ_NO(iob->data),
QETH_SEQ_NO_LENGTH); QETH_SEQ_NO_LENGTH);
qeth_put_cmd(iob);
__qeth_issue_next_read(card); __qeth_issue_next_read(card);
err_idx:
qeth_put_cmd(iob);
} }
static int qeth_set_thread_start_bit(struct qeth_card *card, static int qeth_set_thread_start_bit(struct qeth_card *card,
...@@ -1256,7 +1257,6 @@ static void qeth_set_initial_options(struct qeth_card *card) ...@@ -1256,7 +1257,6 @@ static void qeth_set_initial_options(struct qeth_card *card)
{ {
card->options.route4.type = NO_ROUTER; card->options.route4.type = NO_ROUTER;
card->options.route6.type = NO_ROUTER; card->options.route6.type = NO_ROUTER;
card->options.rx_sg_cb = QETH_RX_SG_CB;
card->options.isolation = ISOLATION_MODE_NONE; card->options.isolation = ISOLATION_MODE_NONE;
card->options.cq = QETH_CQ_DISABLED; card->options.cq = QETH_CQ_DISABLED;
card->options.layer = QETH_DISCIPLINE_UNDETERMINED; card->options.layer = QETH_DISCIPLINE_UNDETERMINED;
...@@ -1624,17 +1624,16 @@ static void qeth_set_blkt_defaults(struct qeth_card *card) ...@@ -1624,17 +1624,16 @@ static void qeth_set_blkt_defaults(struct qeth_card *card)
} }
} }
static void qeth_init_tokens(struct qeth_card *card) static void qeth_idx_init(struct qeth_card *card)
{ {
memset(&card->seqno, 0, sizeof(card->seqno));
card->token.issuer_rm_w = 0x00010103UL; card->token.issuer_rm_w = 0x00010103UL;
card->token.cm_filter_w = 0x00010108UL; card->token.cm_filter_w = 0x00010108UL;
card->token.cm_connection_w = 0x0001010aUL; card->token.cm_connection_w = 0x0001010aUL;
card->token.ulp_filter_w = 0x0001010bUL; card->token.ulp_filter_w = 0x0001010bUL;
card->token.ulp_connection_w = 0x0001010dUL; card->token.ulp_connection_w = 0x0001010dUL;
}
static void qeth_init_func_level(struct qeth_card *card)
{
switch (card->info.type) { switch (card->info.type) {
case QETH_CARD_TYPE_IQD: case QETH_CARD_TYPE_IQD:
card->info.func_level = QETH_IDX_FUNC_LEVEL_IQD; card->info.func_level = QETH_IDX_FUNC_LEVEL_IQD;
...@@ -3405,7 +3404,6 @@ static void qeth_qdio_start_poll(struct ccw_device *ccwdev, int queue, ...@@ -3405,7 +3404,6 @@ static void qeth_qdio_start_poll(struct ccw_device *ccwdev, int queue,
{ {
struct qeth_card *card = (struct qeth_card *)card_ptr; struct qeth_card *card = (struct qeth_card *)card_ptr;
if (card->dev->flags & IFF_UP)
napi_schedule_irqoff(&card->napi); napi_schedule_irqoff(&card->napi);
} }
...@@ -4952,9 +4950,9 @@ int qeth_core_hardsetup_card(struct qeth_card *card, bool *carrier_ok) ...@@ -4952,9 +4950,9 @@ int qeth_core_hardsetup_card(struct qeth_card *card, bool *carrier_ok)
else else
goto retry; goto retry;
} }
qeth_determine_capabilities(card); qeth_determine_capabilities(card);
qeth_init_tokens(card); qeth_idx_init(card);
qeth_init_func_level(card);
rc = qeth_idx_activate_read_channel(card); rc = qeth_idx_activate_read_channel(card);
if (rc == -EINTR) { if (rc == -EINTR) {
...@@ -5269,6 +5267,7 @@ static int qeth_extract_skb(struct qeth_card *card, ...@@ -5269,6 +5267,7 @@ static int qeth_extract_skb(struct qeth_card *card,
int *__offset) int *__offset)
{ {
struct qdio_buffer_element *element = *__element; struct qdio_buffer_element *element = *__element;
struct qeth_priv *priv = netdev_priv(card->dev);
struct qdio_buffer *buffer = qethbuffer->buffer; struct qdio_buffer *buffer = qethbuffer->buffer;
struct napi_struct *napi = &card->napi; struct napi_struct *napi = &card->napi;
unsigned int linear_len = 0; unsigned int linear_len = 0;
...@@ -5344,7 +5343,7 @@ static int qeth_extract_skb(struct qeth_card *card, ...@@ -5344,7 +5343,7 @@ static int qeth_extract_skb(struct qeth_card *card,
} }
use_rx_sg = (card->options.cq == QETH_CQ_ENABLED) || use_rx_sg = (card->options.cq == QETH_CQ_ENABLED) ||
(skb_len > card->options.rx_sg_cb && (skb_len > READ_ONCE(priv->rx_copybreak) &&
!atomic_read(&card->force_alloc_skb) && !atomic_read(&card->force_alloc_skb) &&
!IS_OSN(card)); !IS_OSN(card));
...@@ -5893,25 +5892,30 @@ static void qeth_clear_dbf_list(void) ...@@ -5893,25 +5892,30 @@ static void qeth_clear_dbf_list(void)
static struct net_device *qeth_alloc_netdev(struct qeth_card *card) static struct net_device *qeth_alloc_netdev(struct qeth_card *card)
{ {
struct net_device *dev; struct net_device *dev;
struct qeth_priv *priv;
switch (card->info.type) { switch (card->info.type) {
case QETH_CARD_TYPE_IQD: case QETH_CARD_TYPE_IQD:
dev = alloc_netdev_mqs(0, "hsi%d", NET_NAME_UNKNOWN, dev = alloc_netdev_mqs(sizeof(*priv), "hsi%d", NET_NAME_UNKNOWN,
ether_setup, QETH_MAX_QUEUES, 1); ether_setup, QETH_MAX_QUEUES, 1);
break; break;
case QETH_CARD_TYPE_OSM: case QETH_CARD_TYPE_OSM:
dev = alloc_etherdev(0); dev = alloc_etherdev(sizeof(*priv));
break; break;
case QETH_CARD_TYPE_OSN: case QETH_CARD_TYPE_OSN:
dev = alloc_netdev(0, "osn%d", NET_NAME_UNKNOWN, ether_setup); dev = alloc_netdev(sizeof(*priv), "osn%d", NET_NAME_UNKNOWN,
ether_setup);
break; break;
default: default:
dev = alloc_etherdev_mqs(0, QETH_MAX_QUEUES, 1); dev = alloc_etherdev_mqs(sizeof(*priv), QETH_MAX_QUEUES, 1);
} }
if (!dev) if (!dev)
return NULL; return NULL;
priv = netdev_priv(dev);
priv->rx_copybreak = QETH_RX_COPYBREAK;
dev->ml_priv = card; dev->ml_priv = card;
dev->watchdog_timeo = QETH_TX_TIMEOUT; dev->watchdog_timeo = QETH_TX_TIMEOUT;
dev->min_mtu = IS_OSN(card) ? 64 : 576; dev->min_mtu = IS_OSN(card) ? 64 : 576;
......
...@@ -93,10 +93,6 @@ enum qeth_link_types { ...@@ -93,10 +93,6 @@ enum qeth_link_types {
QETH_LINK_TYPE_LANE = 0x88, QETH_LINK_TYPE_LANE = 0x88,
}; };
/*
* Routing stuff
*/
#define RESET_ROUTING_FLAG 0x10 /* indicate that routing type shall be set */
enum qeth_routing_types { enum qeth_routing_types {
/* TODO: set to bit flag used in IPA Command */ /* TODO: set to bit flag used in IPA Command */
NO_ROUTER = 0, NO_ROUTER = 0,
...@@ -427,7 +423,6 @@ struct qeth_ipacmd_setassparms { ...@@ -427,7 +423,6 @@ struct qeth_ipacmd_setassparms {
struct qeth_arp_cache_entry arp_entry; struct qeth_arp_cache_entry arp_entry;
struct qeth_arp_query_data query_arp; struct qeth_arp_query_data query_arp;
struct qeth_tso_start_data tso; struct qeth_tso_start_data tso;
__u8 ip[16];
} data; } data;
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -550,8 +545,9 @@ struct qeth_ipacmd_setadpparms { ...@@ -550,8 +545,9 @@ struct qeth_ipacmd_setadpparms {
/* CREATE_ADDR IPA Command: ***********************************************/ /* CREATE_ADDR IPA Command: ***********************************************/
struct qeth_create_destroy_address { struct qeth_create_destroy_address {
__u8 unique_id[8]; u8 mac_addr[ETH_ALEN];
} __attribute__ ((packed)); u16 uid;
};
/* SET DIAGNOSTIC ASSIST IPA Command: *************************************/ /* SET DIAGNOSTIC ASSIST IPA Command: *************************************/
......
...@@ -175,6 +175,35 @@ static void qeth_get_channels(struct net_device *dev, ...@@ -175,6 +175,35 @@ static void qeth_get_channels(struct net_device *dev,
channels->combined_count = 0; channels->combined_count = 0;
} }
static int qeth_get_tunable(struct net_device *dev,
const struct ethtool_tunable *tuna, void *data)
{
struct qeth_priv *priv = netdev_priv(dev);
switch (tuna->id) {
case ETHTOOL_RX_COPYBREAK:
*(u32 *)data = priv->rx_copybreak;
return 0;
default:
return -EOPNOTSUPP;
}
}
static int qeth_set_tunable(struct net_device *dev,
const struct ethtool_tunable *tuna,
const void *data)
{
struct qeth_priv *priv = netdev_priv(dev);
switch (tuna->id) {
case ETHTOOL_RX_COPYBREAK:
WRITE_ONCE(priv->rx_copybreak, *(u32 *)data);
return 0;
default:
return -EOPNOTSUPP;
}
}
/* Helper function to fill 'advertising' and 'supported' which are the same. */ /* Helper function to fill 'advertising' and 'supported' which are the same. */
/* Autoneg and full-duplex are supported and advertised unconditionally. */ /* Autoneg and full-duplex are supported and advertised unconditionally. */
/* Always advertise and support all speeds up to specified, and only one */ /* Always advertise and support all speeds up to specified, and only one */
...@@ -381,6 +410,8 @@ const struct ethtool_ops qeth_ethtool_ops = { ...@@ -381,6 +410,8 @@ const struct ethtool_ops qeth_ethtool_ops = {
.get_sset_count = qeth_get_sset_count, .get_sset_count = qeth_get_sset_count,
.get_drvinfo = qeth_get_drvinfo, .get_drvinfo = qeth_get_drvinfo,
.get_channels = qeth_get_channels, .get_channels = qeth_get_channels,
.get_tunable = qeth_get_tunable,
.set_tunable = qeth_set_tunable,
.get_link_ksettings = qeth_get_link_ksettings, .get_link_ksettings = qeth_get_link_ksettings,
}; };
......
...@@ -920,9 +920,11 @@ static int qeth_l3_iqd_read_initial_mac_cb(struct qeth_card *card, ...@@ -920,9 +920,11 @@ static int qeth_l3_iqd_read_initial_mac_cb(struct qeth_card *card,
if (cmd->hdr.return_code) if (cmd->hdr.return_code)
return -EIO; return -EIO;
if (!is_valid_ether_addr(cmd->data.create_destroy_addr.mac_addr))
return -EADDRNOTAVAIL;
ether_addr_copy(card->dev->dev_addr, ether_addr_copy(card->dev->dev_addr,
cmd->data.create_destroy_addr.unique_id); cmd->data.create_destroy_addr.mac_addr);
return 0; return 0;
} }
...@@ -930,7 +932,6 @@ static int qeth_l3_iqd_read_initial_mac(struct qeth_card *card) ...@@ -930,7 +932,6 @@ static int qeth_l3_iqd_read_initial_mac(struct qeth_card *card)
{ {
int rc = 0; int rc = 0;
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd;
QETH_CARD_TEXT(card, 2, "hsrmac"); QETH_CARD_TEXT(card, 2, "hsrmac");
...@@ -938,9 +939,6 @@ static int qeth_l3_iqd_read_initial_mac(struct qeth_card *card) ...@@ -938,9 +939,6 @@ static int qeth_l3_iqd_read_initial_mac(struct qeth_card *card)
IPA_DATA_SIZEOF(create_destroy_addr)); IPA_DATA_SIZEOF(create_destroy_addr));
if (!iob) if (!iob)
return -ENOMEM; return -ENOMEM;
cmd = __ipa_cmd(iob);
*((__u16 *) &cmd->data.create_destroy_addr.unique_id[6]) =
card->info.unique_id;
rc = qeth_send_ipa_cmd(card, iob, qeth_l3_iqd_read_initial_mac_cb, rc = qeth_send_ipa_cmd(card, iob, qeth_l3_iqd_read_initial_mac_cb,
NULL); NULL);
...@@ -953,8 +951,7 @@ static int qeth_l3_get_unique_id_cb(struct qeth_card *card, ...@@ -953,8 +951,7 @@ static int qeth_l3_get_unique_id_cb(struct qeth_card *card,
struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data; struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data;
if (cmd->hdr.return_code == 0) { if (cmd->hdr.return_code == 0) {
card->info.unique_id = *((__u16 *) card->info.unique_id = cmd->data.create_destroy_addr.uid;
&cmd->data.create_destroy_addr.unique_id[6]);
return 0; return 0;
} }
...@@ -968,7 +965,6 @@ static int qeth_l3_get_unique_id(struct qeth_card *card) ...@@ -968,7 +965,6 @@ static int qeth_l3_get_unique_id(struct qeth_card *card)
{ {
int rc = 0; int rc = 0;
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd;
QETH_CARD_TEXT(card, 2, "guniqeid"); QETH_CARD_TEXT(card, 2, "guniqeid");
...@@ -982,10 +978,8 @@ static int qeth_l3_get_unique_id(struct qeth_card *card) ...@@ -982,10 +978,8 @@ static int qeth_l3_get_unique_id(struct qeth_card *card)
IPA_DATA_SIZEOF(create_destroy_addr)); IPA_DATA_SIZEOF(create_destroy_addr));
if (!iob) if (!iob)
return -ENOMEM; return -ENOMEM;
cmd = __ipa_cmd(iob);
*((__u16 *) &cmd->data.create_destroy_addr.unique_id[6]) =
card->info.unique_id;
__ipa_cmd(iob)->data.create_destroy_addr.uid = card->info.unique_id;
rc = qeth_send_ipa_cmd(card, iob, qeth_l3_get_unique_id_cb, NULL); rc = qeth_send_ipa_cmd(card, iob, qeth_l3_get_unique_id_cb, NULL);
return rc; return rc;
} }
......
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