Home Home > GIT Browse > SLE15-SP1-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-06-21 18:21:48 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-06-21 18:21:48 +0200
commita759aeae9e8f32fba498f5fcf93b53c5b4b2c5e0 (patch)
tree39678c20d21fcf6eff0ac8919f212984bd3ef130
parentaa0aabb3877c140d32f53a4f0b272361119ea8fc (diff)
ibmveth: Update ethtool settings to reflect virtual properties
(bsc#1136157, LTC#177197).
-rw-r--r--patches.suse/ibmveth-Update-ethtool-settings-to-reflect-virtual-p.patch162
-rw-r--r--series.conf1
2 files changed, 163 insertions, 0 deletions
diff --git a/patches.suse/ibmveth-Update-ethtool-settings-to-reflect-virtual-p.patch b/patches.suse/ibmveth-Update-ethtool-settings-to-reflect-virtual-p.patch
new file mode 100644
index 0000000000..6327bb002a
--- /dev/null
+++ b/patches.suse/ibmveth-Update-ethtool-settings-to-reflect-virtual-p.patch
@@ -0,0 +1,162 @@
+From 3417314b96d0a872057942f928e08a35460f0153 Mon Sep 17 00:00:00 2001
+From: Thomas Falcon <tlfalcon@linux.ibm.com>
+Date: Fri, 3 May 2019 09:28:33 -0500
+Subject: [PATCH net-next] ibmveth: Update ethtool settings to reflect virtual
+ properties
+
+References: bsc#1136157, LTC#177197
+Patch-mainline: no, tbd
+
+As a paravirtual ethernet adapter, the current hardcoded ethtool
+link settings no longer reflect the actual capable speed of the
+interface. There is no way for the virtual adapter to determine
+the true speed, duplex, and other backing hardware specifications
+at this time.
+
+To avoid confusion, initially define them as unknown or other.
+Finally allow the user to alter speed and duplex settings to match
+the capabilities of underlying hardware and to allow some features
+that rely on certain ethtool reporting, such as LACP. This is based
+on the implementation in virtio_net.
+
+Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ drivers/net/ethernet/ibm/ibmveth.c | 83 ++++++++++++++++++++++++++++----------
+ drivers/net/ethernet/ibm/ibmveth.h | 3 ++
+ 2 files changed, 64 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
+index d654c234aaf7..77af9c2c0571 100644
+--- a/drivers/net/ethernet/ibm/ibmveth.c
++++ b/drivers/net/ethernet/ibm/ibmveth.c
+@@ -712,31 +712,68 @@ static int ibmveth_close(struct net_device *netdev)
+ return 0;
+ }
+
+-static int netdev_get_link_ksettings(struct net_device *dev,
+- struct ethtool_link_ksettings *cmd)
++static bool
++ibmveth_validate_ethtool_cmd(const struct ethtool_link_ksettings *cmd)
+ {
+- u32 supported, advertising;
+-
+- supported = (SUPPORTED_1000baseT_Full | SUPPORTED_Autoneg |
+- SUPPORTED_FIBRE);
+- advertising = (ADVERTISED_1000baseT_Full | ADVERTISED_Autoneg |
+- ADVERTISED_FIBRE);
+- cmd->base.speed = SPEED_1000;
+- cmd->base.duplex = DUPLEX_FULL;
+- cmd->base.port = PORT_FIBRE;
+- cmd->base.phy_address = 0;
+- cmd->base.autoneg = AUTONEG_ENABLE;
+-
+- ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
+- supported);
+- ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
+- advertising);
++ struct ethtool_link_ksettings diff1 = *cmd;
++ struct ethtool_link_ksettings diff2 = {};
++
++ diff2.base.port = PORT_OTHER;
++ diff1.base.speed = 0;
++ diff1.base.duplex = 0;
++ diff1.base.cmd = 0;
++ diff1.base.link_mode_masks_nwords = 0;
++ ethtool_link_ksettings_zero_link_mode(&diff1, advertising);
++
++ return !memcmp(&diff1.base, &diff2.base, sizeof(diff1.base)) &&
++ bitmap_empty(diff1.link_modes.supported,
++ __ETHTOOL_LINK_MODE_MASK_NBITS) &&
++ bitmap_empty(diff1.link_modes.advertising,
++ __ETHTOOL_LINK_MODE_MASK_NBITS) &&
++ bitmap_empty(diff1.link_modes.lp_advertising,
++ __ETHTOOL_LINK_MODE_MASK_NBITS);
++}
++
++static int ibmveth_set_link_ksettings(struct net_device *dev,
++ const struct ethtool_link_ksettings *cmd)
++{
++ struct ibmveth_adapter *adapter = netdev_priv(dev);
++ u32 speed;
++ u8 duplex;
++
++ speed = cmd->base.speed;
++ duplex = cmd->base.duplex;
++ /* don't allow custom speed and duplex */
++ if (!ethtool_validate_speed(speed) ||
++ !ethtool_validate_duplex(duplex) ||
++ !ibmveth_validate_ethtool_cmd(cmd))
++ return -EINVAL;
++ adapter->speed = speed;
++ adapter->duplex = duplex;
+
+ return 0;
+ }
+
+-static void netdev_get_drvinfo(struct net_device *dev,
+- struct ethtool_drvinfo *info)
++static int ibmveth_get_link_ksettings(struct net_device *dev,
++ struct ethtool_link_ksettings *cmd)
++{
++ struct ibmveth_adapter *adapter = netdev_priv(dev);
++
++ cmd->base.speed = adapter->speed;
++ cmd->base.duplex = adapter->duplex;
++ cmd->base.port = PORT_OTHER;
++
++ return 0;
++}
++
++static void ibmveth_init_link_settings(struct ibmveth_adapter *adapter)
++{
++ adapter->duplex = DUPLEX_UNKNOWN;
++ adapter->speed = SPEED_UNKNOWN;
++}
++
++static void ibmveth_get_drvinfo(struct net_device *dev,
++ struct ethtool_drvinfo *info)
+ {
+ strlcpy(info->driver, ibmveth_driver_name, sizeof(info->driver));
+ strlcpy(info->version, ibmveth_driver_version, sizeof(info->version));
+@@ -965,12 +1002,13 @@ static void ibmveth_get_ethtool_stats(struct net_device *dev,
+ }
+
+ static const struct ethtool_ops netdev_ethtool_ops = {
+- .get_drvinfo = netdev_get_drvinfo,
++ .get_drvinfo = ibmveth_get_drvinfo,
+ .get_link = ethtool_op_get_link,
+ .get_strings = ibmveth_get_strings,
+ .get_sset_count = ibmveth_get_sset_count,
+ .get_ethtool_stats = ibmveth_get_ethtool_stats,
+- .get_link_ksettings = netdev_get_link_ksettings,
++ .get_link_ksettings = ibmveth_get_link_ksettings,
++ .set_link_ksettings = ibmveth_set_link_ksettings
+ };
+
+ static int ibmveth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+@@ -1647,6 +1685,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)
+ adapter->netdev = netdev;
+ adapter->mcastFilterSize = *mcastFilterSize_p;
+ adapter->pool_config = 0;
++ ibmveth_init_link_settings(adapter);
+
+ netif_napi_add(netdev, &adapter->napi, ibmveth_poll, 16);
+
+diff --git a/drivers/net/ethernet/ibm/ibmveth.h b/drivers/net/ethernet/ibm/ibmveth.h
+index 4e9bf3421f4f..db96c8812d18 100644
+--- a/drivers/net/ethernet/ibm/ibmveth.h
++++ b/drivers/net/ethernet/ibm/ibmveth.h
+@@ -162,6 +162,9 @@ struct ibmveth_adapter {
+ u64 tx_send_failed;
+ u64 tx_large_packets;
+ u64 rx_large_packets;
++ /* Ethtool settings */
++ u8 duplex;
++ u32 speed;
+ };
+
+ /*
+--
+2.12.3
+
diff --git a/series.conf b/series.conf
index 364b77f39c..5c5a21d1f6 100644
--- a/series.conf
+++ b/series.conf
@@ -23049,6 +23049,7 @@
########################################################
patches.suse/qed-bump-drivers-to-version-8.10.10.55.patch
patches.suse/bsc1084332-0003-lan78xx-Enable-LEDs-and-auto-negotiation.patch
+ patches.suse/ibmveth-Update-ethtool-settings-to-reflect-virtual-p.patch
patches.kabi/ip-drop-IPSTATS_MIB_REASM_OVERLAPS.patch
patches.fixes/irda-Fix-memory-leak-caused-by-repeated-binds-of-ird.patch
patches.fixes/irda-Only-insert-new-objects-into-the-global-databas.patch