From 0bdb080c70495ea4efbed7661b4fe6100bd5adde Mon Sep 17 00:00:00 2001 From: Dominik Sliwa Date: Thu, 21 Feb 2019 10:23:08 +0100 Subject: Revert "backports: Remove unused parts" This reverts commit ab3fd3b9a801a9faa2619e2e65207e736f859a6d. --- patches/0043-ndo_set_vf_rate/igb_set_vf_rate.patch | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 patches/0043-ndo_set_vf_rate/igb_set_vf_rate.patch (limited to 'patches/0043-ndo_set_vf_rate/igb_set_vf_rate.patch') diff --git a/patches/0043-ndo_set_vf_rate/igb_set_vf_rate.patch b/patches/0043-ndo_set_vf_rate/igb_set_vf_rate.patch new file mode 100644 index 00000000..5e086bff --- /dev/null +++ b/patches/0043-ndo_set_vf_rate/igb_set_vf_rate.patch @@ -0,0 +1,28 @@ +--- a/drivers/net/ethernet/intel/igb/igb_main.c ++++ b/drivers/net/ethernet/intel/igb/igb_main.c +@@ -8013,6 +8013,7 @@ static int igb_ndo_set_vf_bw(struct net_ + if (hw->mac.type != e1000_82576) + return -EOPNOTSUPP; + ++#if LINUX_VERSION_IS_GEQ(3,16,0) + if (min_tx_rate) + return -EINVAL; + +@@ -8026,7 +8027,17 @@ static int igb_ndo_set_vf_bw(struct net_ + adapter->vf_rate_link_speed = actual_link_speed; + adapter->vf_data[vf].tx_rate = (u16)max_tx_rate; + igb_set_vf_rate_limit(hw, vf, max_tx_rate, actual_link_speed); ++#else ++ actual_link_speed = igb_link_mbps(adapter->link_speed); ++ if ((vf >= adapter->vfs_allocated_count) || ++ (!(rd32(E1000_STATUS) & E1000_STATUS_LU)) || ++ (tx_rate < 0) || (tx_rate > actual_link_speed)) ++ return -EINVAL; + ++ adapter->vf_rate_link_speed = actual_link_speed; ++ adapter->vf_data[vf].tx_rate = (u16)tx_rate; ++ igb_set_vf_rate_limit(hw, vf, tx_rate, actual_link_speed); ++#endif /* LINUX_VERSION_IS_GEQ(3,16,0) */ + return 0; + } + -- cgit v1.2.3