* [Intel-wired-lan] [PATCH] ixgbevf: add spinlocks for MTU change calls
@ 2016-08-29 23:39 Emil Tantilov
2016-08-30 17:55 ` Bowers, AndrewX
0 siblings, 1 reply; 2+ messages in thread
From: Emil Tantilov @ 2016-08-29 23:39 UTC (permalink / raw)
To: intel-wired-lan
Protect set_rlpml with mailbox lock to make sure tha MTU configuration
is handled properly.
This change resolves an issue where set_rlpml can fail when the VF
interface is brought up:
ixgbevf 0000:03:1d.6: Failed to set MTU at 1500
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
---
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 4044608..7eaac32 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1810,8 +1810,10 @@ static void ixgbevf_configure_rx(struct ixgbevf_adapter *adapter)
if (hw->mac.type >= ixgbe_mac_X550_vf)
ixgbevf_setup_vfmrqc(adapter);
+ spin_lock_bh(&adapter->mbx_lock);
/* notify the PF of our intent to use this size of frame */
ret = hw->mac.ops.set_rlpml(hw, netdev->mtu + ETH_HLEN + ETH_FCS_LEN);
+ spin_unlock_bh(&adapter->mbx_lock);
if (ret)
dev_err(&adapter->pdev->dev,
"Failed to set MTU at %d\n", netdev->mtu);
@@ -3758,8 +3760,10 @@ static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu)
if ((new_mtu < 68) || (max_frame > max_possible_frame))
return -EINVAL;
+ spin_lock_bh(&adapter->mbx_lock);
/* notify the PF of our intent to use this size of frame */
ret = hw->mac.ops.set_rlpml(hw, max_frame);
+ spin_unlock_bh(&adapter->mbx_lock);
if (ret)
return -EINVAL;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Intel-wired-lan] [PATCH] ixgbevf: add spinlocks for MTU change calls
2016-08-29 23:39 [Intel-wired-lan] [PATCH] ixgbevf: add spinlocks for MTU change calls Emil Tantilov
@ 2016-08-30 17:55 ` Bowers, AndrewX
0 siblings, 0 replies; 2+ messages in thread
From: Bowers, AndrewX @ 2016-08-30 17:55 UTC (permalink / raw)
To: intel-wired-lan
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Emil Tantilov
> Sent: Monday, August 29, 2016 4:39 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH] ixgbevf: add spinlocks for MTU change
> calls
>
> Protect set_rlpml with mailbox lock to make sure tha MTU configuration is
> handled properly.
>
> This change resolves an issue where set_rlpml can fail when the VF interface
> is brought up:
> ixgbevf 0000:03:1d.6: Failed to set MTU at 1500
>
> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
> ---
> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 ++++
> 1 file changed, 4 insertions(+)
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-30 17:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-29 23:39 [Intel-wired-lan] [PATCH] ixgbevf: add spinlocks for MTU change calls Emil Tantilov
2016-08-30 17:55 ` Bowers, AndrewX
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox