aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-12-02 21:35:21 -0500
committerDavid S. Miller <davem@davemloft.net>2017-12-02 21:35:21 -0500
commitaf57b7fffaf74ff337e479abb19026d72065673b (patch)
tree14e2711455df8f47abeedf8692d8f4f0b3cdbe92
parent7344ba039f4fc5fb18be5618199827e246b0c697 (diff)
parent0cbff6d4546613330a1c5f139f5c368e4ce33ca1 (diff)
Merge branch 's390-qeth-fixes'
Julian Wiedmann says: ==================== s390/qeth: fixes 2017-12-01 please apply the following three fixes for 4.15. These should also go back to stable. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/s390/net/qeth_core.h3
-rw-r--r--drivers/s390/net/qeth_core_main.c31
-rw-r--r--drivers/s390/net/qeth_l2_main.c4
-rw-r--r--drivers/s390/net/qeth_l3_main.c7
4 files changed, 41 insertions, 4 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 9cd569ef43ec..15015a24f8ad 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -987,6 +987,9 @@ struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *,
987int qeth_set_features(struct net_device *, netdev_features_t); 987int qeth_set_features(struct net_device *, netdev_features_t);
988void qeth_recover_features(struct net_device *dev); 988void qeth_recover_features(struct net_device *dev);
989netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t); 989netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t);
990netdev_features_t qeth_features_check(struct sk_buff *skb,
991 struct net_device *dev,
992 netdev_features_t features);
990int qeth_vm_request_mac(struct qeth_card *card); 993int qeth_vm_request_mac(struct qeth_card *card);
991int qeth_push_hdr(struct sk_buff *skb, struct qeth_hdr **hdr, unsigned int len); 994int qeth_push_hdr(struct sk_buff *skb, struct qeth_hdr **hdr, unsigned int len);
992 995
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 49b9efeba1bd..d9b0e07d4fa7 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -19,6 +19,11 @@
19#include <linux/mii.h> 19#include <linux/mii.h>
20#include <linux/kthread.h> 20#include <linux/kthread.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/if_vlan.h>
23#include <linux/netdevice.h>
24#include <linux/netdev_features.h>
25#include <linux/skbuff.h>
26
22#include <net/iucv/af_iucv.h> 27#include <net/iucv/af_iucv.h>
23#include <net/dsfield.h> 28#include <net/dsfield.h>
24 29
@@ -6438,6 +6443,32 @@ netdev_features_t qeth_fix_features(struct net_device *dev,
6438} 6443}
6439EXPORT_SYMBOL_GPL(qeth_fix_features); 6444EXPORT_SYMBOL_GPL(qeth_fix_features);
6440 6445
6446netdev_features_t qeth_features_check(struct sk_buff *skb,
6447 struct net_device *dev,
6448 netdev_features_t features)
6449{
6450 /* GSO segmentation builds skbs with
6451 * a (small) linear part for the headers, and
6452 * page frags for the data.
6453 * Compared to a linear skb, the header-only part consumes an
6454 * additional buffer element. This reduces buffer utilization, and
6455 * hurts throughput. So compress small segments into one element.
6456 */
6457 if (netif_needs_gso(skb, features)) {
6458 /* match skb_segment(): */
6459 unsigned int doffset = skb->data - skb_mac_header(skb);
6460 unsigned int hsize = skb_shinfo(skb)->gso_size;
6461 unsigned int hroom = skb_headroom(skb);
6462
6463 /* linearize only if resulting skb allocations are order-0: */
6464 if (SKB_DATA_ALIGN(hroom + doffset + hsize) <= SKB_MAX_HEAD(0))
6465 features &= ~NETIF_F_SG;
6466 }
6467
6468 return vlan_features_check(skb, features);
6469}
6470EXPORT_SYMBOL_GPL(qeth_features_check);
6471
6441static int __init qeth_core_init(void) 6472static int __init qeth_core_init(void)
6442{ 6473{
6443 int rc; 6474 int rc;
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index d2537c09126d..f21c94810373 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -960,6 +960,7 @@ static const struct net_device_ops qeth_l2_netdev_ops = {
960 .ndo_stop = qeth_l2_stop, 960 .ndo_stop = qeth_l2_stop,
961 .ndo_get_stats = qeth_get_stats, 961 .ndo_get_stats = qeth_get_stats,
962 .ndo_start_xmit = qeth_l2_hard_start_xmit, 962 .ndo_start_xmit = qeth_l2_hard_start_xmit,
963 .ndo_features_check = qeth_features_check,
963 .ndo_validate_addr = eth_validate_addr, 964 .ndo_validate_addr = eth_validate_addr,
964 .ndo_set_rx_mode = qeth_l2_set_rx_mode, 965 .ndo_set_rx_mode = qeth_l2_set_rx_mode,
965 .ndo_do_ioctl = qeth_do_ioctl, 966 .ndo_do_ioctl = qeth_do_ioctl,
@@ -1010,6 +1011,7 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
1010 if (card->info.type == QETH_CARD_TYPE_OSD && !card->info.guestlan) { 1011 if (card->info.type == QETH_CARD_TYPE_OSD && !card->info.guestlan) {
1011 card->dev->hw_features = NETIF_F_SG; 1012 card->dev->hw_features = NETIF_F_SG;
1012 card->dev->vlan_features = NETIF_F_SG; 1013 card->dev->vlan_features = NETIF_F_SG;
1014 card->dev->features |= NETIF_F_SG;
1013 /* OSA 3S and earlier has no RX/TX support */ 1015 /* OSA 3S and earlier has no RX/TX support */
1014 if (qeth_is_supported(card, IPA_OUTBOUND_CHECKSUM)) { 1016 if (qeth_is_supported(card, IPA_OUTBOUND_CHECKSUM)) {
1015 card->dev->hw_features |= NETIF_F_IP_CSUM; 1017 card->dev->hw_features |= NETIF_F_IP_CSUM;
@@ -1028,8 +1030,6 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
1028 1030
1029 card->info.broadcast_capable = 1; 1031 card->info.broadcast_capable = 1;
1030 qeth_l2_request_initial_mac(card); 1032 qeth_l2_request_initial_mac(card);
1031 card->dev->gso_max_size = (QETH_MAX_BUFFER_ELEMENTS(card) - 1) *
1032 PAGE_SIZE;
1033 SET_NETDEV_DEV(card->dev, &card->gdev->dev); 1033 SET_NETDEV_DEV(card->dev, &card->gdev->dev);
1034 netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT); 1034 netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT);
1035 netif_carrier_off(card->dev); 1035 netif_carrier_off(card->dev);
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index aadd384316a3..2a25f20566d8 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1376,6 +1376,7 @@ qeth_l3_add_mc_to_hash(struct qeth_card *card, struct in_device *in4_dev)
1376 1376
1377 tmp->u.a4.addr = be32_to_cpu(im4->multiaddr); 1377 tmp->u.a4.addr = be32_to_cpu(im4->multiaddr);
1378 memcpy(tmp->mac, buf, sizeof(tmp->mac)); 1378 memcpy(tmp->mac, buf, sizeof(tmp->mac));
1379 tmp->is_multicast = 1;
1379 1380
1380 ipm = qeth_l3_ip_from_hash(card, tmp); 1381 ipm = qeth_l3_ip_from_hash(card, tmp);
1381 if (ipm) { 1382 if (ipm) {
@@ -2917,6 +2918,7 @@ static const struct net_device_ops qeth_l3_osa_netdev_ops = {
2917 .ndo_stop = qeth_l3_stop, 2918 .ndo_stop = qeth_l3_stop,
2918 .ndo_get_stats = qeth_get_stats, 2919 .ndo_get_stats = qeth_get_stats,
2919 .ndo_start_xmit = qeth_l3_hard_start_xmit, 2920 .ndo_start_xmit = qeth_l3_hard_start_xmit,
2921 .ndo_features_check = qeth_features_check,
2920 .ndo_validate_addr = eth_validate_addr, 2922 .ndo_validate_addr = eth_validate_addr,
2921 .ndo_set_rx_mode = qeth_l3_set_multicast_list, 2923 .ndo_set_rx_mode = qeth_l3_set_multicast_list,
2922 .ndo_do_ioctl = qeth_do_ioctl, 2924 .ndo_do_ioctl = qeth_do_ioctl,
@@ -2957,6 +2959,7 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
2957 card->dev->vlan_features = NETIF_F_SG | 2959 card->dev->vlan_features = NETIF_F_SG |
2958 NETIF_F_RXCSUM | NETIF_F_IP_CSUM | 2960 NETIF_F_RXCSUM | NETIF_F_IP_CSUM |
2959 NETIF_F_TSO; 2961 NETIF_F_TSO;
2962 card->dev->features |= NETIF_F_SG;
2960 } 2963 }
2961 } 2964 }
2962 } else if (card->info.type == QETH_CARD_TYPE_IQD) { 2965 } else if (card->info.type == QETH_CARD_TYPE_IQD) {
@@ -2984,8 +2987,8 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
2984 NETIF_F_HW_VLAN_CTAG_RX | 2987 NETIF_F_HW_VLAN_CTAG_RX |
2985 NETIF_F_HW_VLAN_CTAG_FILTER; 2988 NETIF_F_HW_VLAN_CTAG_FILTER;
2986 netif_keep_dst(card->dev); 2989 netif_keep_dst(card->dev);
2987 card->dev->gso_max_size = (QETH_MAX_BUFFER_ELEMENTS(card) - 1) * 2990 netif_set_gso_max_size(card->dev, (QETH_MAX_BUFFER_ELEMENTS(card) - 1) *
2988 PAGE_SIZE; 2991 PAGE_SIZE);
2989 2992
2990 SET_NETDEV_DEV(card->dev, &card->gdev->dev); 2993 SET_NETDEV_DEV(card->dev, &card->gdev->dev);
2991 netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT); 2994 netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT);