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

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 7344ba03 0cbff6d4
...@@ -987,6 +987,9 @@ struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *, ...@@ -987,6 +987,9 @@ struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *,
int qeth_set_features(struct net_device *, netdev_features_t); int qeth_set_features(struct net_device *, netdev_features_t);
void qeth_recover_features(struct net_device *dev); void qeth_recover_features(struct net_device *dev);
netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t); netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t);
netdev_features_t qeth_features_check(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features);
int qeth_vm_request_mac(struct qeth_card *card); int qeth_vm_request_mac(struct qeth_card *card);
int qeth_push_hdr(struct sk_buff *skb, struct qeth_hdr **hdr, unsigned int len); int qeth_push_hdr(struct sk_buff *skb, struct qeth_hdr **hdr, unsigned int len);
......
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
#include <linux/mii.h> #include <linux/mii.h>
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/if_vlan.h>
#include <linux/netdevice.h>
#include <linux/netdev_features.h>
#include <linux/skbuff.h>
#include <net/iucv/af_iucv.h> #include <net/iucv/af_iucv.h>
#include <net/dsfield.h> #include <net/dsfield.h>
...@@ -6438,6 +6443,32 @@ netdev_features_t qeth_fix_features(struct net_device *dev, ...@@ -6438,6 +6443,32 @@ netdev_features_t qeth_fix_features(struct net_device *dev,
} }
EXPORT_SYMBOL_GPL(qeth_fix_features); EXPORT_SYMBOL_GPL(qeth_fix_features);
netdev_features_t qeth_features_check(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features)
{
/* GSO segmentation builds skbs with
* a (small) linear part for the headers, and
* page frags for the data.
* Compared to a linear skb, the header-only part consumes an
* additional buffer element. This reduces buffer utilization, and
* hurts throughput. So compress small segments into one element.
*/
if (netif_needs_gso(skb, features)) {
/* match skb_segment(): */
unsigned int doffset = skb->data - skb_mac_header(skb);
unsigned int hsize = skb_shinfo(skb)->gso_size;
unsigned int hroom = skb_headroom(skb);
/* linearize only if resulting skb allocations are order-0: */
if (SKB_DATA_ALIGN(hroom + doffset + hsize) <= SKB_MAX_HEAD(0))
features &= ~NETIF_F_SG;
}
return vlan_features_check(skb, features);
}
EXPORT_SYMBOL_GPL(qeth_features_check);
static int __init qeth_core_init(void) static int __init qeth_core_init(void)
{ {
int rc; int rc;
......
...@@ -960,6 +960,7 @@ static const struct net_device_ops qeth_l2_netdev_ops = { ...@@ -960,6 +960,7 @@ static const struct net_device_ops qeth_l2_netdev_ops = {
.ndo_stop = qeth_l2_stop, .ndo_stop = qeth_l2_stop,
.ndo_get_stats = qeth_get_stats, .ndo_get_stats = qeth_get_stats,
.ndo_start_xmit = qeth_l2_hard_start_xmit, .ndo_start_xmit = qeth_l2_hard_start_xmit,
.ndo_features_check = qeth_features_check,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = qeth_l2_set_rx_mode, .ndo_set_rx_mode = qeth_l2_set_rx_mode,
.ndo_do_ioctl = qeth_do_ioctl, .ndo_do_ioctl = qeth_do_ioctl,
...@@ -1010,6 +1011,7 @@ static int qeth_l2_setup_netdev(struct qeth_card *card) ...@@ -1010,6 +1011,7 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
if (card->info.type == QETH_CARD_TYPE_OSD && !card->info.guestlan) { if (card->info.type == QETH_CARD_TYPE_OSD && !card->info.guestlan) {
card->dev->hw_features = NETIF_F_SG; card->dev->hw_features = NETIF_F_SG;
card->dev->vlan_features = NETIF_F_SG; card->dev->vlan_features = NETIF_F_SG;
card->dev->features |= NETIF_F_SG;
/* OSA 3S and earlier has no RX/TX support */ /* OSA 3S and earlier has no RX/TX support */
if (qeth_is_supported(card, IPA_OUTBOUND_CHECKSUM)) { if (qeth_is_supported(card, IPA_OUTBOUND_CHECKSUM)) {
card->dev->hw_features |= NETIF_F_IP_CSUM; card->dev->hw_features |= NETIF_F_IP_CSUM;
...@@ -1028,8 +1030,6 @@ static int qeth_l2_setup_netdev(struct qeth_card *card) ...@@ -1028,8 +1030,6 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
card->info.broadcast_capable = 1; card->info.broadcast_capable = 1;
qeth_l2_request_initial_mac(card); qeth_l2_request_initial_mac(card);
card->dev->gso_max_size = (QETH_MAX_BUFFER_ELEMENTS(card) - 1) *
PAGE_SIZE;
SET_NETDEV_DEV(card->dev, &card->gdev->dev); SET_NETDEV_DEV(card->dev, &card->gdev->dev);
netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT); netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT);
netif_carrier_off(card->dev); netif_carrier_off(card->dev);
......
...@@ -1376,6 +1376,7 @@ qeth_l3_add_mc_to_hash(struct qeth_card *card, struct in_device *in4_dev) ...@@ -1376,6 +1376,7 @@ qeth_l3_add_mc_to_hash(struct qeth_card *card, struct in_device *in4_dev)
tmp->u.a4.addr = be32_to_cpu(im4->multiaddr); tmp->u.a4.addr = be32_to_cpu(im4->multiaddr);
memcpy(tmp->mac, buf, sizeof(tmp->mac)); memcpy(tmp->mac, buf, sizeof(tmp->mac));
tmp->is_multicast = 1;
ipm = qeth_l3_ip_from_hash(card, tmp); ipm = qeth_l3_ip_from_hash(card, tmp);
if (ipm) { if (ipm) {
...@@ -2917,6 +2918,7 @@ static const struct net_device_ops qeth_l3_osa_netdev_ops = { ...@@ -2917,6 +2918,7 @@ static const struct net_device_ops qeth_l3_osa_netdev_ops = {
.ndo_stop = qeth_l3_stop, .ndo_stop = qeth_l3_stop,
.ndo_get_stats = qeth_get_stats, .ndo_get_stats = qeth_get_stats,
.ndo_start_xmit = qeth_l3_hard_start_xmit, .ndo_start_xmit = qeth_l3_hard_start_xmit,
.ndo_features_check = qeth_features_check,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = qeth_l3_set_multicast_list, .ndo_set_rx_mode = qeth_l3_set_multicast_list,
.ndo_do_ioctl = qeth_do_ioctl, .ndo_do_ioctl = qeth_do_ioctl,
...@@ -2957,6 +2959,7 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) ...@@ -2957,6 +2959,7 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
card->dev->vlan_features = NETIF_F_SG | card->dev->vlan_features = NETIF_F_SG |
NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_RXCSUM | NETIF_F_IP_CSUM |
NETIF_F_TSO; NETIF_F_TSO;
card->dev->features |= NETIF_F_SG;
} }
} }
} else if (card->info.type == QETH_CARD_TYPE_IQD) { } else if (card->info.type == QETH_CARD_TYPE_IQD) {
...@@ -2984,8 +2987,8 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) ...@@ -2984,8 +2987,8 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_FILTER; NETIF_F_HW_VLAN_CTAG_FILTER;
netif_keep_dst(card->dev); netif_keep_dst(card->dev);
card->dev->gso_max_size = (QETH_MAX_BUFFER_ELEMENTS(card) - 1) * netif_set_gso_max_size(card->dev, (QETH_MAX_BUFFER_ELEMENTS(card) - 1) *
PAGE_SIZE; PAGE_SIZE);
SET_NETDEV_DEV(card->dev, &card->gdev->dev); SET_NETDEV_DEV(card->dev, &card->gdev->dev);
netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT); netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT);
......
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