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

Merge branch 's390-next'

Ursula Braun says:

====================
s390 network patches

here are some s390 related patches for net-next. Most important is
the skb_linearize af_iucv patch from Eugene solving traffic problems
in certain scenarios. The remaining patches are minor improvements.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 5241c2d7 476933ce
...@@ -9125,7 +9125,7 @@ F: drivers/s390/block/dasd* ...@@ -9125,7 +9125,7 @@ F: drivers/s390/block/dasd*
F: block/partitions/ibm.c F: block/partitions/ibm.c
S390 NETWORK DRIVERS S390 NETWORK DRIVERS
M: Ursula Braun <ursula.braun@de.ibm.com> M: Ursula Braun <ubraun@linux.vnet.ibm.com>
L: linux-s390@vger.kernel.org L: linux-s390@vger.kernel.org
W: http://www.ibm.com/developerworks/linux/linux390/ W: http://www.ibm.com/developerworks/linux/linux390/
S: Supported S: Supported
...@@ -9155,7 +9155,7 @@ S: Supported ...@@ -9155,7 +9155,7 @@ S: Supported
F: drivers/s390/scsi/zfcp_* F: drivers/s390/scsi/zfcp_*
S390 IUCV NETWORK LAYER S390 IUCV NETWORK LAYER
M: Ursula Braun <ursula.braun@de.ibm.com> M: Ursula Braun <ubraun@linux.vnet.ibm.com>
L: linux-s390@vger.kernel.org L: linux-s390@vger.kernel.org
W: http://www.ibm.com/developerworks/linux/linux390/ W: http://www.ibm.com/developerworks/linux/linux390/
S: Supported S: Supported
......
...@@ -1677,11 +1677,8 @@ static int ctcm_shutdown_device(struct ccwgroup_device *cgdev) ...@@ -1677,11 +1677,8 @@ static int ctcm_shutdown_device(struct ccwgroup_device *cgdev)
ccw_device_set_offline(cgdev->cdev[1]); ccw_device_set_offline(cgdev->cdev[1]);
ccw_device_set_offline(cgdev->cdev[0]); ccw_device_set_offline(cgdev->cdev[0]);
channel_remove(priv->channel[CTCM_READ]);
if (priv->channel[CTCM_READ]) channel_remove(priv->channel[CTCM_WRITE]);
channel_remove(priv->channel[CTCM_READ]);
if (priv->channel[CTCM_WRITE])
channel_remove(priv->channel[CTCM_WRITE]);
priv->channel[CTCM_READ] = priv->channel[CTCM_WRITE] = NULL; priv->channel[CTCM_READ] = priv->channel[CTCM_WRITE] = NULL;
return 0; return 0;
......
...@@ -981,6 +981,10 @@ int qeth_send_setassparms(struct qeth_card *, struct qeth_cmd_buffer *, __u16, ...@@ -981,6 +981,10 @@ int qeth_send_setassparms(struct qeth_card *, struct qeth_cmd_buffer *, __u16,
int (*reply_cb)(struct qeth_card *, int (*reply_cb)(struct qeth_card *,
struct qeth_reply *, unsigned long), struct qeth_reply *, unsigned long),
void *); void *);
struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *,
enum qeth_ipa_funcs,
__u16, __u16,
enum qeth_prot_versions);
int qeth_start_ipa_tx_checksum(struct qeth_card *); int qeth_start_ipa_tx_checksum(struct qeth_card *);
int qeth_set_rx_csum(struct qeth_card *, int); int qeth_set_rx_csum(struct qeth_card *, int);
......
...@@ -2684,8 +2684,6 @@ void qeth_print_status_message(struct qeth_card *card) ...@@ -2684,8 +2684,6 @@ void qeth_print_status_message(struct qeth_card *card)
sprintf(card->info.mcl_level, "%02x%02x", sprintf(card->info.mcl_level, "%02x%02x",
card->info.mcl_level[2], card->info.mcl_level[2],
card->info.mcl_level[3]); card->info.mcl_level[3]);
card->info.mcl_level[QETH_MCL_LENGTH] = 0;
break; break;
} }
/* fallthrough */ /* fallthrough */
...@@ -5297,10 +5295,10 @@ static int qeth_setassparms_cb(struct qeth_card *card, ...@@ -5297,10 +5295,10 @@ static int qeth_setassparms_cb(struct qeth_card *card,
return 0; return 0;
} }
static struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *card, struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *card,
enum qeth_ipa_funcs ipa_func, enum qeth_ipa_funcs ipa_func,
__u16 cmd_code, __u16 len, __u16 cmd_code, __u16 len,
enum qeth_prot_versions prot) enum qeth_prot_versions prot)
{ {
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd; struct qeth_ipa_cmd *cmd;
...@@ -5319,6 +5317,7 @@ static struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *card, ...@@ -5319,6 +5317,7 @@ static struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *card,
return iob; return iob;
} }
EXPORT_SYMBOL_GPL(qeth_get_setassparms_cmd);
int qeth_send_setassparms(struct qeth_card *card, int qeth_send_setassparms(struct qeth_card *card,
struct qeth_cmd_buffer *iob, __u16 len, long data, struct qeth_cmd_buffer *iob, __u16 len, long data,
......
...@@ -1126,6 +1126,7 @@ static int qeth_l2_setup_netdev(struct qeth_card *card) ...@@ -1126,6 +1126,7 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
qeth_l2_request_initial_mac(card); qeth_l2_request_initial_mac(card);
SET_NETDEV_DEV(card->dev, &card->gdev->dev); SET_NETDEV_DEV(card->dev, &card->gdev->dev);
netif_napi_add(card->dev, &card->napi, qeth_l2_poll, QETH_NAPI_WEIGHT); netif_napi_add(card->dev, &card->napi, qeth_l2_poll, QETH_NAPI_WEIGHT);
netif_carrier_off(card->dev);
return register_netdev(card->dev); return register_netdev(card->dev);
} }
......
...@@ -1043,28 +1043,6 @@ static int qeth_l3_default_setassparms_cb(struct qeth_card *card, ...@@ -1043,28 +1043,6 @@ static int qeth_l3_default_setassparms_cb(struct qeth_card *card,
return 0; return 0;
} }
static struct qeth_cmd_buffer *qeth_l3_get_setassparms_cmd(
struct qeth_card *card, enum qeth_ipa_funcs ipa_func, __u16 cmd_code,
__u16 len, enum qeth_prot_versions prot)
{
struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd;
QETH_CARD_TEXT(card, 4, "getasscm");
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SETASSPARMS, prot);
if (iob) {
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.setassparms.hdr.assist_no = ipa_func;
cmd->data.setassparms.hdr.length = 8 + len;
cmd->data.setassparms.hdr.command_code = cmd_code;
cmd->data.setassparms.hdr.return_code = 0;
cmd->data.setassparms.hdr.seq_no = 0;
}
return iob;
}
#ifdef CONFIG_QETH_IPV6 #ifdef CONFIG_QETH_IPV6
static int qeth_l3_send_simple_setassparms_ipv6(struct qeth_card *card, static int qeth_l3_send_simple_setassparms_ipv6(struct qeth_card *card,
enum qeth_ipa_funcs ipa_func, __u16 cmd_code) enum qeth_ipa_funcs ipa_func, __u16 cmd_code)
...@@ -1073,7 +1051,7 @@ static int qeth_l3_send_simple_setassparms_ipv6(struct qeth_card *card, ...@@ -1073,7 +1051,7 @@ static int qeth_l3_send_simple_setassparms_ipv6(struct qeth_card *card,
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
QETH_CARD_TEXT(card, 4, "simassp6"); QETH_CARD_TEXT(card, 4, "simassp6");
iob = qeth_l3_get_setassparms_cmd(card, ipa_func, cmd_code, iob = qeth_get_setassparms_cmd(card, ipa_func, cmd_code,
0, QETH_PROT_IPV6); 0, QETH_PROT_IPV6);
if (!iob) if (!iob)
return -ENOMEM; return -ENOMEM;
...@@ -2344,10 +2322,11 @@ static int qeth_l3_query_arp_cache_info(struct qeth_card *card, ...@@ -2344,10 +2322,11 @@ static int qeth_l3_query_arp_cache_info(struct qeth_card *card,
QETH_CARD_TEXT_(card, 3, "qarpipv%i", prot); QETH_CARD_TEXT_(card, 3, "qarpipv%i", prot);
iob = qeth_l3_get_setassparms_cmd(card, IPA_ARP_PROCESSING, iob = qeth_get_setassparms_cmd(card, IPA_ARP_PROCESSING,
IPA_CMD_ASS_ARP_QUERY_INFO, IPA_CMD_ASS_ARP_QUERY_INFO,
sizeof(struct qeth_arp_query_data) - sizeof(char), sizeof(struct qeth_arp_query_data)
prot); - sizeof(char),
prot);
if (!iob) if (!iob)
return -ENOMEM; return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
...@@ -2439,7 +2418,7 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card, ...@@ -2439,7 +2418,7 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
iob = qeth_l3_get_setassparms_cmd(card, IPA_ARP_PROCESSING, iob = qeth_get_setassparms_cmd(card, IPA_ARP_PROCESSING,
IPA_CMD_ASS_ARP_ADD_ENTRY, IPA_CMD_ASS_ARP_ADD_ENTRY,
sizeof(struct qeth_arp_cache_entry), sizeof(struct qeth_arp_cache_entry),
QETH_PROT_IPV4); QETH_PROT_IPV4);
...@@ -2480,7 +2459,7 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card, ...@@ -2480,7 +2459,7 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
memcpy(buf, entry, 12); memcpy(buf, entry, 12);
iob = qeth_l3_get_setassparms_cmd(card, IPA_ARP_PROCESSING, iob = qeth_get_setassparms_cmd(card, IPA_ARP_PROCESSING,
IPA_CMD_ASS_ARP_REMOVE_ENTRY, IPA_CMD_ASS_ARP_REMOVE_ENTRY,
12, 12,
QETH_PROT_IPV4); QETH_PROT_IPV4);
...@@ -2818,7 +2797,7 @@ static inline int qeth_l3_tso_elements(struct sk_buff *skb) ...@@ -2818,7 +2797,7 @@ static inline int qeth_l3_tso_elements(struct sk_buff *skb)
{ {
unsigned long tcpd = (unsigned long)tcp_hdr(skb) + unsigned long tcpd = (unsigned long)tcp_hdr(skb) +
tcp_hdr(skb)->doff * 4; tcp_hdr(skb)->doff * 4;
int tcpd_len = skb->len - (tcpd - (unsigned long)skb->data); int tcpd_len = skb_headlen(skb) - (tcpd - (unsigned long)skb->data);
int elements = PFN_UP(tcpd + tcpd_len - 1) - PFN_DOWN(tcpd); int elements = PFN_UP(tcpd + tcpd_len - 1) - PFN_DOWN(tcpd);
elements += qeth_get_elements_for_frags(skb); elements += qeth_get_elements_for_frags(skb);
...@@ -3220,6 +3199,7 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) ...@@ -3220,6 +3199,7 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
SET_NETDEV_DEV(card->dev, &card->gdev->dev); SET_NETDEV_DEV(card->dev, &card->gdev->dev);
netif_napi_add(card->dev, &card->napi, qeth_l3_poll, QETH_NAPI_WEIGHT); netif_napi_add(card->dev, &card->napi, qeth_l3_poll, QETH_NAPI_WEIGHT);
netif_carrier_off(card->dev);
return register_netdev(card->dev); return register_netdev(card->dev);
} }
......
...@@ -1031,7 +1031,7 @@ static int iucv_sock_sendmsg(struct socket *sock, struct msghdr *msg, ...@@ -1031,7 +1031,7 @@ static int iucv_sock_sendmsg(struct socket *sock, struct msghdr *msg,
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct iucv_sock *iucv = iucv_sk(sk); struct iucv_sock *iucv = iucv_sk(sk);
struct sk_buff *skb; struct sk_buff *skb;
struct iucv_message txmsg; struct iucv_message txmsg = {0};
struct cmsghdr *cmsg; struct cmsghdr *cmsg;
int cmsg_done; int cmsg_done;
long timeo; long timeo;
...@@ -2084,11 +2084,7 @@ static int afiucv_hs_callback_rx(struct sock *sk, struct sk_buff *skb) ...@@ -2084,11 +2084,7 @@ static int afiucv_hs_callback_rx(struct sock *sk, struct sk_buff *skb)
return NET_RX_SUCCESS; return NET_RX_SUCCESS;
} }
/* write stuff from iucv_msg to skb cb */ /* write stuff from iucv_msg to skb cb */
if (skb->len < sizeof(struct af_iucv_trans_hdr)) {
kfree_skb(skb);
return NET_RX_SUCCESS;
}
skb_pull(skb, sizeof(struct af_iucv_trans_hdr)); skb_pull(skb, sizeof(struct af_iucv_trans_hdr));
skb_reset_transport_header(skb); skb_reset_transport_header(skb);
skb_reset_network_header(skb); skb_reset_network_header(skb);
...@@ -2119,6 +2115,20 @@ static int afiucv_hs_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -2119,6 +2115,20 @@ static int afiucv_hs_rcv(struct sk_buff *skb, struct net_device *dev,
char nullstring[8]; char nullstring[8];
int err = 0; int err = 0;
if (skb->len < (ETH_HLEN + sizeof(struct af_iucv_trans_hdr))) {
WARN_ONCE(1, "AF_IUCV too short skb, len=%d, min=%d",
(int)skb->len,
(int)(ETH_HLEN + sizeof(struct af_iucv_trans_hdr)));
kfree_skb(skb);
return NET_RX_SUCCESS;
}
if (skb_headlen(skb) < (ETH_HLEN + sizeof(struct af_iucv_trans_hdr)))
if (skb_linearize(skb)) {
WARN_ONCE(1, "AF_IUCV skb_linearize failed, len=%d",
(int)skb->len);
kfree_skb(skb);
return NET_RX_SUCCESS;
}
skb_pull(skb, ETH_HLEN); skb_pull(skb, ETH_HLEN);
trans_hdr = (struct af_iucv_trans_hdr *)skb->data; trans_hdr = (struct af_iucv_trans_hdr *)skb->data;
EBCASC(trans_hdr->destAppName, sizeof(trans_hdr->destAppName)); EBCASC(trans_hdr->destAppName, sizeof(trans_hdr->destAppName));
......
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