summaryrefslogtreecommitdiff
path: root/patches/0043-ndo_set_vf_rate/igb_set_vf_rate.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/0043-ndo_set_vf_rate/igb_set_vf_rate.patch')
-rw-r--r--patches/0043-ndo_set_vf_rate/igb_set_vf_rate.patch28
1 files changed, 28 insertions, 0 deletions
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..6dea4e1e
--- /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_CODE >= KERNEL_VERSION(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_CODE >= KERNEL_VERSION(3,16,0) */
+ return 0;
+ }
+