s390/qeth: support SG for more device types
authorJulian Wiedmann <jwi@linux.vnet.ibm.com>
Fri, 9 Mar 2018 17:12:54 +0000 (18:12 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Mar 2018 18:10:04 +0000 (13:10 -0500)
NETIF_F_SG support is currently limited to OSA (and for L2 even OSD)
devices. Advertise it for some more device types (OSM, L2 OSX, z/VM OSA)
that share the same code paths. For now, keep it switched off by
default on these devices.

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c

index 1cd583b69eaa34d8fc071b260c5a2e9cc05aa279..ea607e5fb5dc12cc042745ddef0e1b7e4ffb9a48 100644 (file)
@@ -991,9 +991,16 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
                card->dev->features |= NETIF_F_VLAN_CHALLENGED;
        else
                card->dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
+
+       if (card->info.type != QETH_CARD_TYPE_OSN &&
+           card->info.type != QETH_CARD_TYPE_IQD) {
+               card->dev->priv_flags &= ~IFF_TX_SKB_SHARING;
+               card->dev->needed_headroom = sizeof(struct qeth_hdr);
+               card->dev->hw_features |= NETIF_F_SG;
+               card->dev->vlan_features |= NETIF_F_SG;
+       }
+
        if (card->info.type == QETH_CARD_TYPE_OSD && !card->info.guestlan) {
-               card->dev->hw_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 */
                if (qeth_is_supported(card, IPA_OUTBOUND_CHECKSUM)) {
@@ -1005,11 +1012,6 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
                        card->dev->vlan_features |= NETIF_F_RXCSUM;
                }
        }
-       if (card->info.type != QETH_CARD_TYPE_OSN &&
-           card->info.type != QETH_CARD_TYPE_IQD) {
-               card->dev->priv_flags &= ~IFF_TX_SKB_SHARING;
-               card->dev->needed_headroom = sizeof(struct qeth_hdr);
-       }
 
        card->info.broadcast_capable = 1;
        qeth_l2_request_initial_mac(card);
index e5f11cd64fece775eb2759628ed1692d037cd55e..e933a273d543d0e7017e860e9a10570a7416e5b0 100644 (file)
@@ -2785,14 +2785,16 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
                        if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD))
                                card->dev->dev_id = card->info.unique_id &
                                                         0xffff;
+
+                       card->dev->hw_features |= NETIF_F_SG;
+                       card->dev->vlan_features |= NETIF_F_SG;
+
                        if (!card->info.guestlan) {
-                               card->dev->hw_features = NETIF_F_SG |
-                                       NETIF_F_RXCSUM | NETIF_F_IP_CSUM |
-                                       NETIF_F_TSO;
-                               card->dev->vlan_features = NETIF_F_SG |
-                                       NETIF_F_RXCSUM | NETIF_F_IP_CSUM |
-                                       NETIF_F_TSO;
                                card->dev->features |= NETIF_F_SG;
+                               card->dev->hw_features |= NETIF_F_TSO |
+                                       NETIF_F_RXCSUM | NETIF_F_IP_CSUM;
+                               card->dev->vlan_features |= NETIF_F_TSO |
+                                       NETIF_F_RXCSUM | NETIF_F_IP_CSUM;
                        }
                }
        } else if (card->info.type == QETH_CARD_TYPE_IQD) {