* [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08
@ 2017-08-09 21:47 Jeff Kirsher
2017-08-09 21:47 ` [net-next 01/12] igb: Fix error of RX network flow classification Jeff Kirsher
` (12 more replies)
0 siblings, 13 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene
This series contains updates to e1000e and igb/igbvf.
Gangfeng Huang fixes an issue with receive network flow classification,
where igb_nfc_filter_exit() was not being called in igb_down() which
would cause the filter tables to "fill up" if a user where to change
the adapter settings (such as speed) which requires a reset of the
adapter.
Cliff Spradlin fixes a timestamping issue, where igb was allowing requests
for hardware timestamping even if it was not configured for hardware
transmit timestamping.
Corinna Vinschen removes the error message that there was an "unexpected
SYS WRAP", when it is actually expected. So remove the message to not
confuse users.
Greg Edwards provides several patches for the mailbox interface between
the PF and VF drivers. Added a mailbox unlock method to be used to unlock
the PF/VF mailbox by the PF. Added a lock around the VF mailbox ops to
prevent the VF from sending another message while the PF is still
processing the previous message. Fixed a "scheduling while atomic" issue
by changing msleep() to mdelay().
Sasha adds support for the next LOM generations i219 (v8 & v9) which
will be available in the next Intel client platform IceLake.
John Linville adds support for a Broadcom PHY to the igb driver, since
there are designs out in the world which use the igb MAC and a third
party PHY. This allows the driver to load and function as expected on
these designs.
The following are changes since commit 53b948356554376ec6f89016376825d48bf396c3:
net: vrf: Add extack messages for newlink failures
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 1GbE
Cliff Spradlin (1):
igb: protect TX timestamping from API misuse
Corinna Vinschen (1):
igb: Remove incorrect "unexpected SYS WRAP" log message
Gangfeng Huang (1):
igb: Fix error of RX network flow classification
Greg Edwards (6):
igb: add argument names to mailbox op function declarations
igb: expose mailbox unlock method
igb: do not drop PF mailbox lock after read of VF message
igbvf: add lock around mailbox ops
igbvf: after mailbox write, wait for reply
igbvf: convert msleep to mdelay in atomic context
Gustavo A R Silva (1):
e1000e: add check on e1e_wphy() return value
John W Linville (1):
igb: support BCM54616 PHY
Sasha Neftin (1):
e1000e: Initial Support for IceLake
drivers/net/ethernet/intel/e1000e/hw.h | 4 ++
drivers/net/ethernet/intel/e1000e/ich8lan.c | 2 +
drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++
drivers/net/ethernet/intel/igb/e1000_82575.c | 6 +++
drivers/net/ethernet/intel/igb/e1000_defines.h | 1 +
drivers/net/ethernet/intel/igb/e1000_hw.h | 18 ++++----
drivers/net/ethernet/intel/igb/e1000_mbx.c | 57 +++++++++++++++++++++++---
drivers/net/ethernet/intel/igb/e1000_mbx.h | 14 ++++---
drivers/net/ethernet/intel/igb/igb_main.c | 23 +++++++----
drivers/net/ethernet/intel/igbvf/ethtool.c | 4 ++
drivers/net/ethernet/intel/igbvf/mbx.c | 4 ++
drivers/net/ethernet/intel/igbvf/netdev.c | 47 +++++++++++++++++++++
drivers/net/ethernet/intel/igbvf/vf.c | 12 ++++--
drivers/net/ethernet/intel/igbvf/vf.h | 1 +
14 files changed, 166 insertions(+), 31 deletions(-)
--
2.13.3
^ permalink raw reply [flat|nested] 21+ messages in thread
* [net-next 01/12] igb: Fix error of RX network flow classification
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-09 21:47 ` [net-next 02/12] igb: protect TX timestamping from API misuse Jeff Kirsher
` (11 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Gangfeng Huang, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Gangfeng Huang <gangfeng.huang@ni.com>
After add an ethertype filter, if user change the adapter speed several
times, the error "ethtool -N: etype filters are all used" is reported by
igb driver.
In older patch, function igb_nfc_filter_exit() and igb_nfc_filter_restore()
is not paried. igb_nfc_filter_restore() exist in igb_up(), but function
igb_nfc_filter_exit() is exist in __igb_close(). In the process of speed
changing, only igb_nfc_filter_restore() is called, it will take a position
of ethertype bitmap.
Reproduce steps:
Step 1: Add a etype filter by ethtool
$ethtool -N eth0 flow-type ether proto 0x88F8 action 1
Step 2: Change the adapter speed to 100M/full duplex
$ethtool -s eth0 speed 100 duplex full
Step 3: Change the adapter speed to 1000M/full duplex
ethtool -s eth0 speed 1000 duplex full
Repeat step2 and step3, then dmesg the system log, you can find the error
message, add new ethtype filter is also failed.
This fixing is move igb_nfc_filter_exit() from __igb_close() to igb_down()
to make igb_nfc_filter_restore()/igb_nfc_filter_exit() is paired.
Signed-off-by: Gangfeng Huang <gangfeng.huang@ni.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index ec62410b035a..6a63ea564a57 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1791,6 +1791,8 @@ void igb_down(struct igb_adapter *adapter)
wr32(E1000_RCTL, rctl & ~E1000_RCTL_EN);
/* flush and sleep below */
+ igb_nfc_filter_exit(adapter);
+
netif_carrier_off(netdev);
netif_tx_stop_all_queues(netdev);
@@ -3317,8 +3319,6 @@ static int __igb_close(struct net_device *netdev, bool suspending)
igb_down(adapter);
igb_free_irq(adapter);
- igb_nfc_filter_exit(adapter);
-
igb_free_all_tx_resources(adapter);
igb_free_all_rx_resources(adapter);
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [net-next 02/12] igb: protect TX timestamping from API misuse
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
2017-08-09 21:47 ` [net-next 01/12] igb: Fix error of RX network flow classification Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-09 21:47 ` [net-next 03/12] e1000e: add check on e1e_wphy() return value Jeff Kirsher
` (10 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Cliff Spradlin, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Cliff Spradlin <cspradlin@google.com>
HW timestamping can only be requested for a packet if the NIC is first
setup via ioctl(SIOCSHWTSTAMP). If this step was skipped, then the igb
driver still allowed TX packets to request HW timestamping. In this
situation, the _IGB_PTP_TX_IN_PROGRESS flag was set and would never
clear. This prevented any future HW timestamping requests to succeed.
Fix this by checking that the NIC is configured for HW TX timestamping
before accepting a HW TX timestamping request.
Signed-off-by: Cliff Spradlin <cspradlin@google.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 6a63ea564a57..5d0a75c1ba0c 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -5380,7 +5380,8 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb,
if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
struct igb_adapter *adapter = netdev_priv(tx_ring->netdev);
- if (!test_and_set_bit_lock(__IGB_PTP_TX_IN_PROGRESS,
+ if (adapter->tstamp_config.tx_type & HWTSTAMP_TX_ON &&
+ !test_and_set_bit_lock(__IGB_PTP_TX_IN_PROGRESS,
&adapter->state)) {
skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
tx_flags |= IGB_TX_FLAGS_TSTAMP;
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [net-next 03/12] e1000e: add check on e1e_wphy() return value
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
2017-08-09 21:47 ` [net-next 01/12] igb: Fix error of RX network flow classification Jeff Kirsher
2017-08-09 21:47 ` [net-next 02/12] igb: protect TX timestamping from API misuse Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-10 17:56 ` Joe Perches
2017-08-09 21:47 ` [net-next 04/12] igb: Remove incorrect "unexpected SYS WRAP" log message Jeff Kirsher
` (9 subsequent siblings)
12 siblings, 1 reply; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Gustavo A R Silva, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
From: Gustavo A R Silva <garsilva@embeddedor.com>
Check return value from call to e1e_wphy(). This value is being
checked during previous calls to function e1e_wphy() and it seems
a check was missing here.
Addresses-Coverity-ID: 1226905
Signed-off-by: Gustavo A R Silva <garsilva@embeddedor.com>
Reviewed-by: Ethan Zhao <ethan.zhao@oracle.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000e/ich8lan.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 68ea8b4555ab..d6d4ed7acf03 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -2437,6 +2437,8 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
if (hw->phy.revision < 2) {
e1000e_phy_sw_reset(hw);
ret_val = e1e_wphy(hw, MII_BMCR, 0x3140);
+ if (ret_val)
+ return ret_val;
}
}
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [net-next 04/12] igb: Remove incorrect "unexpected SYS WRAP" log message
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
` (2 preceding siblings ...)
2017-08-09 21:47 ` [net-next 03/12] e1000e: add check on e1e_wphy() return value Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-09 21:47 ` [net-next 05/12] igb: add argument names to mailbox op function declarations Jeff Kirsher
` (8 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Corinna Vinschen, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
From: Corinna Vinschen <vinschen@redhat.com>
TSAUXC.DisableSystime is never set, so SYSTIM runs into a SYS WRAP
every 1100 secs on 80580/i350/i354 (40 bit SYSTIM) and every 35000
secs on 80576 (45 bit SYSTIM).
This wrap event sets the TSICR.SysWrap bit unconditionally.
However, checking TSIM at interrupt time shows that this event does not
actually cause the interrupt. Rather, it's just bycatch while the
actual interrupt is caused by, for instance, TSICR.TXTS.
The conclusion is that the SYS WRAP is actually expected, so the
"unexpected SYS WRAP" message is entirely bogus and just helps to
confuse users. Drop it.
Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 5d0a75c1ba0c..1a99164d5d11 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -5746,8 +5746,6 @@ static void igb_tsync_interrupt(struct igb_adapter *adapter)
event.type = PTP_CLOCK_PPS;
if (adapter->ptp_caps.pps)
ptp_clock_event(adapter->ptp_clock, &event);
- else
- dev_err(&adapter->pdev->dev, "unexpected SYS WRAP");
ack |= TSINTR_SYS_WRAP;
}
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [net-next 05/12] igb: add argument names to mailbox op function declarations
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
` (3 preceding siblings ...)
2017-08-09 21:47 ` [net-next 04/12] igb: Remove incorrect "unexpected SYS WRAP" log message Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-09 21:47 ` [net-next 06/12] igb: expose mailbox unlock method Jeff Kirsher
` (7 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Greg Edwards, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Greg Edwards <gedwards@ddn.com>
Signed-off-by: Greg Edwards <gedwards@ddn.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_hw.h | 15 ++++++++-------
drivers/net/ethernet/intel/igb/e1000_mbx.h | 12 ++++++------
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/e1000_hw.h b/drivers/net/ethernet/intel/igb/e1000_hw.h
index 2fb2213cd562..fd7865a8d2e3 100644
--- a/drivers/net/ethernet/intel/igb/e1000_hw.h
+++ b/drivers/net/ethernet/intel/igb/e1000_hw.h
@@ -491,13 +491,14 @@ struct e1000_fc_info {
struct e1000_mbx_operations {
s32 (*init_params)(struct e1000_hw *hw);
- s32 (*read)(struct e1000_hw *, u32 *, u16, u16);
- s32 (*write)(struct e1000_hw *, u32 *, u16, u16);
- s32 (*read_posted)(struct e1000_hw *, u32 *, u16, u16);
- s32 (*write_posted)(struct e1000_hw *, u32 *, u16, u16);
- s32 (*check_for_msg)(struct e1000_hw *, u16);
- s32 (*check_for_ack)(struct e1000_hw *, u16);
- s32 (*check_for_rst)(struct e1000_hw *, u16);
+ s32 (*read)(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id);
+ s32 (*write)(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id);
+ s32 (*read_posted)(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id);
+ s32 (*write_posted)(struct e1000_hw *hw, u32 *msg, u16 size,
+ u16 mbx_id);
+ s32 (*check_for_msg)(struct e1000_hw *hw, u16 mbx_id);
+ s32 (*check_for_ack)(struct e1000_hw *hw, u16 mbx_id);
+ s32 (*check_for_rst)(struct e1000_hw *hw, u16 mbx_id);
};
struct e1000_mbx_stats {
diff --git a/drivers/net/ethernet/intel/igb/e1000_mbx.h b/drivers/net/ethernet/intel/igb/e1000_mbx.h
index 3e7fed73df15..73d90aeb48b2 100644
--- a/drivers/net/ethernet/intel/igb/e1000_mbx.h
+++ b/drivers/net/ethernet/intel/igb/e1000_mbx.h
@@ -67,11 +67,11 @@
#define E1000_PF_CONTROL_MSG 0x0100 /* PF control message */
-s32 igb_read_mbx(struct e1000_hw *, u32 *, u16, u16);
-s32 igb_write_mbx(struct e1000_hw *, u32 *, u16, u16);
-s32 igb_check_for_msg(struct e1000_hw *, u16);
-s32 igb_check_for_ack(struct e1000_hw *, u16);
-s32 igb_check_for_rst(struct e1000_hw *, u16);
-s32 igb_init_mbx_params_pf(struct e1000_hw *);
+s32 igb_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id);
+s32 igb_write_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id);
+s32 igb_check_for_msg(struct e1000_hw *hw, u16 mbx_id);
+s32 igb_check_for_ack(struct e1000_hw *hw, u16 mbx_id);
+s32 igb_check_for_rst(struct e1000_hw *hw, u16 mbx_id);
+s32 igb_init_mbx_params_pf(struct e1000_hw *hw);
#endif /* _E1000_MBX_H_ */
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [net-next 06/12] igb: expose mailbox unlock method
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
` (4 preceding siblings ...)
2017-08-09 21:47 ` [net-next 05/12] igb: add argument names to mailbox op function declarations Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-09 21:47 ` [net-next 07/12] igb: do not drop PF mailbox lock after read of VF message Jeff Kirsher
` (6 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Greg Edwards, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Greg Edwards <gedwards@ddn.com>
Add a mailbox unlock method to e1000_mbx_operations, which will be used
to unlock the PF/VF mailbox by the PF.
Signed-off-by: Greg Edwards <gedwards@ddn.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_hw.h | 1 +
drivers/net/ethernet/intel/igb/e1000_mbx.c | 39 ++++++++++++++++++++++++++++++
drivers/net/ethernet/intel/igb/e1000_mbx.h | 1 +
3 files changed, 41 insertions(+)
diff --git a/drivers/net/ethernet/intel/igb/e1000_hw.h b/drivers/net/ethernet/intel/igb/e1000_hw.h
index fd7865a8d2e3..6076f258a0a5 100644
--- a/drivers/net/ethernet/intel/igb/e1000_hw.h
+++ b/drivers/net/ethernet/intel/igb/e1000_hw.h
@@ -499,6 +499,7 @@ struct e1000_mbx_operations {
s32 (*check_for_msg)(struct e1000_hw *hw, u16 mbx_id);
s32 (*check_for_ack)(struct e1000_hw *hw, u16 mbx_id);
s32 (*check_for_rst)(struct e1000_hw *hw, u16 mbx_id);
+ s32 (*unlock)(struct e1000_hw *hw, u16 mbx_id);
};
struct e1000_mbx_stats {
diff --git a/drivers/net/ethernet/intel/igb/e1000_mbx.c b/drivers/net/ethernet/intel/igb/e1000_mbx.c
index 00e263f0c030..6aa44723507b 100644
--- a/drivers/net/ethernet/intel/igb/e1000_mbx.c
+++ b/drivers/net/ethernet/intel/igb/e1000_mbx.c
@@ -125,6 +125,24 @@ s32 igb_check_for_rst(struct e1000_hw *hw, u16 mbx_id)
}
/**
+ * igb_unlock_mbx - unlock the mailbox
+ * @hw: pointer to the HW structure
+ * @mbx_id: id of mailbox to check
+ *
+ * returns SUCCESS if the mailbox was unlocked or else ERR_MBX
+ **/
+s32 igb_unlock_mbx(struct e1000_hw *hw, u16 mbx_id)
+{
+ struct e1000_mbx_info *mbx = &hw->mbx;
+ s32 ret_val = -E1000_ERR_MBX;
+
+ if (mbx->ops.unlock)
+ ret_val = mbx->ops.unlock(hw, mbx_id);
+
+ return ret_val;
+}
+
+/**
* igb_poll_for_msg - Wait for message notification
* @hw: pointer to the HW structure
* @mbx_id: id of mailbox to write
@@ -341,6 +359,26 @@ static s32 igb_obtain_mbx_lock_pf(struct e1000_hw *hw, u16 vf_number)
}
/**
+ * igb_release_mbx_lock_pf - release mailbox lock
+ * @hw: pointer to the HW structure
+ * @vf_number: the VF index
+ *
+ * return SUCCESS if we released the mailbox lock
+ **/
+static s32 igb_release_mbx_lock_pf(struct e1000_hw *hw, u16 vf_number)
+{
+ u32 p2v_mailbox;
+
+ /* drop PF lock of mailbox, if set */
+ p2v_mailbox = rd32(E1000_P2VMAILBOX(vf_number));
+ if (p2v_mailbox & E1000_P2VMAILBOX_PFU)
+ wr32(E1000_P2VMAILBOX(vf_number),
+ p2v_mailbox & ~E1000_P2VMAILBOX_PFU);
+
+ return 0;
+}
+
+/**
* igb_write_mbx_pf - Places a message in the mailbox
* @hw: pointer to the HW structure
* @msg: The message buffer
@@ -437,6 +475,7 @@ s32 igb_init_mbx_params_pf(struct e1000_hw *hw)
mbx->ops.check_for_msg = igb_check_for_msg_pf;
mbx->ops.check_for_ack = igb_check_for_ack_pf;
mbx->ops.check_for_rst = igb_check_for_rst_pf;
+ mbx->ops.unlock = igb_release_mbx_lock_pf;
mbx->stats.msgs_tx = 0;
mbx->stats.msgs_rx = 0;
diff --git a/drivers/net/ethernet/intel/igb/e1000_mbx.h b/drivers/net/ethernet/intel/igb/e1000_mbx.h
index 73d90aeb48b2..a98c5dc60afd 100644
--- a/drivers/net/ethernet/intel/igb/e1000_mbx.h
+++ b/drivers/net/ethernet/intel/igb/e1000_mbx.h
@@ -72,6 +72,7 @@ s32 igb_write_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id);
s32 igb_check_for_msg(struct e1000_hw *hw, u16 mbx_id);
s32 igb_check_for_ack(struct e1000_hw *hw, u16 mbx_id);
s32 igb_check_for_rst(struct e1000_hw *hw, u16 mbx_id);
+s32 igb_unlock_mbx(struct e1000_hw *hw, u16 mbx_id);
s32 igb_init_mbx_params_pf(struct e1000_hw *hw);
#endif /* _E1000_MBX_H_ */
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [net-next 07/12] igb: do not drop PF mailbox lock after read of VF message
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
` (5 preceding siblings ...)
2017-08-09 21:47 ` [net-next 06/12] igb: expose mailbox unlock method Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-09 21:47 ` [net-next 08/12] e1000e: Initial Support for IceLake Jeff Kirsher
` (5 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Greg Edwards, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Greg Edwards <gedwards@ddn.com>
When the PF receives a mailbox message from the VF, it grabs the mailbox
lock, reads the VF message from the mailbox, ACKs the message and drops
the lock.
While the PF is performing the action for the VF message, nothing
prevents another VF message from being posted to the mailbox. The
current code handles this condition by just dropping any new VF messages
without processing them. This results in a mailbox timeout in the VM
for posted messages waiting for an ACK, and the VF is reset by the
igbvf_watchdog_task in the VM.
Given the right sequence of VF messages and mailbox timeouts, this
condition can go on ad infinitum.
Modify the PF mailbox read method to take an 'unlock' argument that
optionally leaves the mailbox locked by the PF after reading the VF
message. This ensures another VF message is not posted to the mailbox
until after the PF has completed processing the VF message and written
its reply.
Signed-off-by: Greg Edwards <gedwards@ddn.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_hw.h | 3 ++-
drivers/net/ethernet/intel/igb/e1000_mbx.c | 18 ++++++++++++------
drivers/net/ethernet/intel/igb/e1000_mbx.h | 3 ++-
drivers/net/ethernet/intel/igb/igb_main.c | 14 ++++++++++----
4 files changed, 26 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/e1000_hw.h b/drivers/net/ethernet/intel/igb/e1000_hw.h
index 6076f258a0a5..6ea9f702ba0f 100644
--- a/drivers/net/ethernet/intel/igb/e1000_hw.h
+++ b/drivers/net/ethernet/intel/igb/e1000_hw.h
@@ -491,7 +491,8 @@ struct e1000_fc_info {
struct e1000_mbx_operations {
s32 (*init_params)(struct e1000_hw *hw);
- s32 (*read)(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id);
+ s32 (*read)(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id,
+ bool unlock);
s32 (*write)(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id);
s32 (*read_posted)(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id);
s32 (*write_posted)(struct e1000_hw *hw, u32 *msg, u16 size,
diff --git a/drivers/net/ethernet/intel/igb/e1000_mbx.c b/drivers/net/ethernet/intel/igb/e1000_mbx.c
index 6aa44723507b..bffd58f7b2a1 100644
--- a/drivers/net/ethernet/intel/igb/e1000_mbx.c
+++ b/drivers/net/ethernet/intel/igb/e1000_mbx.c
@@ -32,7 +32,8 @@
*
* returns SUCCESS if it successfully read message from buffer
**/
-s32 igb_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
+s32 igb_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id,
+ bool unlock)
{
struct e1000_mbx_info *mbx = &hw->mbx;
s32 ret_val = -E1000_ERR_MBX;
@@ -42,7 +43,7 @@ s32 igb_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
size = mbx->size;
if (mbx->ops.read)
- ret_val = mbx->ops.read(hw, msg, size, mbx_id);
+ ret_val = mbx->ops.read(hw, msg, size, mbx_id, unlock);
return ret_val;
}
@@ -222,7 +223,7 @@ static s32 igb_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size,
ret_val = igb_poll_for_msg(hw, mbx_id);
if (!ret_val)
- ret_val = mbx->ops.read(hw, msg, size, mbx_id);
+ ret_val = mbx->ops.read(hw, msg, size, mbx_id, true);
out:
return ret_val;
}
@@ -423,13 +424,14 @@ static s32 igb_write_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size,
* @msg: The message buffer
* @size: Length of buffer
* @vf_number: the VF index
+ * @unlock: unlock the mailbox when done?
*
* This function copies a message from the mailbox buffer to the caller's
* memory buffer. The presumption is that the caller knows that there was
* a message due to a VF request so no polling for message is needed.
**/
static s32 igb_read_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size,
- u16 vf_number)
+ u16 vf_number, bool unlock)
{
s32 ret_val;
u16 i;
@@ -443,8 +445,12 @@ static s32 igb_read_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size,
for (i = 0; i < size; i++)
msg[i] = array_rd32(E1000_VMBMEM(vf_number), i);
- /* Acknowledge the message and release buffer */
- wr32(E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_ACK);
+ /* Acknowledge the message and release mailbox lock (or not) */
+ if (unlock)
+ wr32(E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_ACK);
+ else
+ wr32(E1000_P2VMAILBOX(vf_number),
+ E1000_P2VMAILBOX_ACK | E1000_P2VMAILBOX_PFU);
/* update stats */
hw->mbx.stats.msgs_rx++;
diff --git a/drivers/net/ethernet/intel/igb/e1000_mbx.h b/drivers/net/ethernet/intel/igb/e1000_mbx.h
index a98c5dc60afd..a62b08e1572e 100644
--- a/drivers/net/ethernet/intel/igb/e1000_mbx.h
+++ b/drivers/net/ethernet/intel/igb/e1000_mbx.h
@@ -67,7 +67,8 @@
#define E1000_PF_CONTROL_MSG 0x0100 /* PF control message */
-s32 igb_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id);
+s32 igb_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id,
+ bool unlock);
s32 igb_write_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id);
s32 igb_check_for_msg(struct e1000_hw *hw, u16 mbx_id);
s32 igb_check_for_ack(struct e1000_hw *hw, u16 mbx_id);
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 1a99164d5d11..fd4a46b03cc8 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -6675,32 +6675,33 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
struct vf_data_storage *vf_data = &adapter->vf_data[vf];
s32 retval;
- retval = igb_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf);
+ retval = igb_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf, false);
if (retval) {
/* if receive failed revoke VF CTS stats and restart init */
dev_err(&pdev->dev, "Error receiving message from VF\n");
vf_data->flags &= ~IGB_VF_FLAG_CTS;
if (!time_after(jiffies, vf_data->last_nack + (2 * HZ)))
- return;
+ goto unlock;
goto out;
}
/* this is a message we already processed, do nothing */
if (msgbuf[0] & (E1000_VT_MSGTYPE_ACK | E1000_VT_MSGTYPE_NACK))
- return;
+ goto unlock;
/* until the vf completes a reset it should not be
* allowed to start any configuration.
*/
if (msgbuf[0] == E1000_VF_RESET) {
+ /* unlocks mailbox */
igb_vf_reset_msg(adapter, vf);
return;
}
if (!(vf_data->flags & IGB_VF_FLAG_CTS)) {
if (!time_after(jiffies, vf_data->last_nack + (2 * HZ)))
- return;
+ goto unlock;
retval = -1;
goto out;
}
@@ -6741,7 +6742,12 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
else
msgbuf[0] |= E1000_VT_MSGTYPE_ACK;
+ /* unlocks mailbox */
igb_write_mbx(hw, msgbuf, 1, vf);
+ return;
+
+unlock:
+ igb_unlock_mbx(hw, vf);
}
static void igb_msg_task(struct igb_adapter *adapter)
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [net-next 08/12] e1000e: Initial Support for IceLake
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
` (6 preceding siblings ...)
2017-08-09 21:47 ` [net-next 07/12] igb: do not drop PF mailbox lock after read of VF message Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-09 21:47 ` [net-next 09/12] igbvf: add lock around mailbox ops Jeff Kirsher
` (4 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Sasha Neftin, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Sasha Neftin <sasha.neftin@intel.com>
i219 (8) and i219 (9) are the next LOM generations that will be available
on the next Intel Client platform (IceLake).
This patch provides the initial support for these devices
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Reviewed-by: Raanan Avargil <raanan.avargil@intel.com>
Reviewed-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000e/hw.h | 4 ++++
drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
index 66bd5060a65b..d803b1a12349 100644
--- a/drivers/net/ethernet/intel/e1000e/hw.h
+++ b/drivers/net/ethernet/intel/e1000e/hw.h
@@ -100,6 +100,10 @@ struct e1000_hw;
#define E1000_DEV_ID_PCH_CNP_I219_V6 0x15BE
#define E1000_DEV_ID_PCH_CNP_I219_LM7 0x15BB
#define E1000_DEV_ID_PCH_CNP_I219_V7 0x15BC
+#define E1000_DEV_ID_PCH_ICP_I219_LM8 0x15DF
+#define E1000_DEV_ID_PCH_ICP_I219_V8 0x15E0
+#define E1000_DEV_ID_PCH_ICP_I219_LM9 0x15E1
+#define E1000_DEV_ID_PCH_ICP_I219_V9 0x15E2
#define E1000_REVISION_4 4
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 2dcb5463d9b8..327dfe5bedc0 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -7544,6 +7544,10 @@ static const struct pci_device_id e1000_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CNP_I219_V6), board_pch_cnp },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CNP_I219_LM7), board_pch_cnp },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CNP_I219_V7), board_pch_cnp },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_LM8), board_pch_cnp },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_V8), board_pch_cnp },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_LM9), board_pch_cnp },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_V9), board_pch_cnp },
{ 0, 0, 0, 0, 0, 0, 0 } /* terminate list */
};
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [net-next 09/12] igbvf: add lock around mailbox ops
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
` (7 preceding siblings ...)
2017-08-09 21:47 ` [net-next 08/12] e1000e: Initial Support for IceLake Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-09 21:47 ` [net-next 10/12] igbvf: after mailbox write, wait for reply Jeff Kirsher
` (3 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Greg Edwards, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Greg Edwards <gedwards@ddn.com>
The PF driver assumes the VF will not send another mailbox message until
the PF has written its reply to the previous message. If the VF does,
that message will be silently dropped by the PF before it writes its
reply to the mailbox. This results in a VF mailbox timeout for posted
messages waiting for an ACK, and the VF is reset by the
igbvf_watchdog_task in the VM.
Add a lock around the VF mailbox ops to prevent the VF from sending
another message while the PF is still processing the previous one.
Signed-off-by: Greg Edwards <gedwards@ddn.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igbvf/ethtool.c | 4 +++
drivers/net/ethernet/intel/igbvf/mbx.c | 4 +++
drivers/net/ethernet/intel/igbvf/netdev.c | 47 ++++++++++++++++++++++++++++++
drivers/net/ethernet/intel/igbvf/vf.h | 1 +
4 files changed, 56 insertions(+)
diff --git a/drivers/net/ethernet/intel/igbvf/ethtool.c b/drivers/net/ethernet/intel/igbvf/ethtool.c
index 34faa113a8a0..a127688e83e6 100644
--- a/drivers/net/ethernet/intel/igbvf/ethtool.c
+++ b/drivers/net/ethernet/intel/igbvf/ethtool.c
@@ -296,8 +296,12 @@ static int igbvf_link_test(struct igbvf_adapter *adapter, u64 *data)
struct e1000_hw *hw = &adapter->hw;
*data = 0;
+ spin_lock_bh(&hw->mbx_lock);
+
hw->mac.ops.check_for_link(hw);
+ spin_unlock_bh(&hw->mbx_lock);
+
if (!(er32(STATUS) & E1000_STATUS_LU))
*data = 1;
diff --git a/drivers/net/ethernet/intel/igbvf/mbx.c b/drivers/net/ethernet/intel/igbvf/mbx.c
index 01752f44ace2..c9a441632e9f 100644
--- a/drivers/net/ethernet/intel/igbvf/mbx.c
+++ b/drivers/net/ethernet/intel/igbvf/mbx.c
@@ -264,6 +264,8 @@ static s32 e1000_write_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size)
s32 err;
u16 i;
+ WARN_ON_ONCE(!spin_is_locked(&hw->mbx_lock));
+
/* lock the mailbox to prevent pf/vf race condition */
err = e1000_obtain_mbx_lock_vf(hw);
if (err)
@@ -300,6 +302,8 @@ static s32 e1000_read_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size)
s32 err;
u16 i;
+ WARN_ON_ONCE(!spin_is_locked(&hw->mbx_lock));
+
/* lock the mailbox to prevent pf/vf race condition */
err = e1000_obtain_mbx_lock_vf(hw);
if (err)
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 1b9cbbe88f6f..1ed556911b14 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -1235,7 +1235,12 @@ static void igbvf_set_rlpml(struct igbvf_adapter *adapter)
struct e1000_hw *hw = &adapter->hw;
max_frame_size = adapter->max_frame_size + VLAN_TAG_SIZE;
+
+ spin_lock_bh(&hw->mbx_lock);
+
e1000_rlpml_set_vf(hw, max_frame_size);
+
+ spin_unlock_bh(&hw->mbx_lock);
}
static int igbvf_vlan_rx_add_vid(struct net_device *netdev,
@@ -1244,10 +1249,16 @@ static int igbvf_vlan_rx_add_vid(struct net_device *netdev,
struct igbvf_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
+ spin_lock_bh(&hw->mbx_lock);
+
if (hw->mac.ops.set_vfta(hw, vid, true)) {
dev_err(&adapter->pdev->dev, "Failed to add vlan id %d\n", vid);
+ spin_unlock_bh(&hw->mbx_lock);
return -EINVAL;
}
+
+ spin_unlock_bh(&hw->mbx_lock);
+
set_bit(vid, adapter->active_vlans);
return 0;
}
@@ -1258,11 +1269,17 @@ static int igbvf_vlan_rx_kill_vid(struct net_device *netdev,
struct igbvf_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
+ spin_lock_bh(&hw->mbx_lock);
+
if (hw->mac.ops.set_vfta(hw, vid, false)) {
dev_err(&adapter->pdev->dev,
"Failed to remove vlan id %d\n", vid);
+ spin_unlock_bh(&hw->mbx_lock);
return -EINVAL;
}
+
+ spin_unlock_bh(&hw->mbx_lock);
+
clear_bit(vid, adapter->active_vlans);
return 0;
}
@@ -1428,7 +1445,11 @@ static void igbvf_set_multi(struct net_device *netdev)
netdev_for_each_mc_addr(ha, netdev)
memcpy(mta_list + (i++ * ETH_ALEN), ha->addr, ETH_ALEN);
+ spin_lock_bh(&hw->mbx_lock);
+
hw->mac.ops.update_mc_addr_list(hw, mta_list, i, 0, 0);
+
+ spin_unlock_bh(&hw->mbx_lock);
kfree(mta_list);
}
@@ -1449,16 +1470,24 @@ static int igbvf_set_uni(struct net_device *netdev)
return -ENOSPC;
}
+ spin_lock_bh(&hw->mbx_lock);
+
/* Clear all unicast MAC filters */
hw->mac.ops.set_uc_addr(hw, E1000_VF_MAC_FILTER_CLR, NULL);
+ spin_unlock_bh(&hw->mbx_lock);
+
if (!netdev_uc_empty(netdev)) {
struct netdev_hw_addr *ha;
/* Add MAC filters one by one */
netdev_for_each_uc_addr(ha, netdev) {
+ spin_lock_bh(&hw->mbx_lock);
+
hw->mac.ops.set_uc_addr(hw, E1000_VF_MAC_FILTER_ADD,
ha->addr);
+
+ spin_unlock_bh(&hw->mbx_lock);
udelay(200);
}
}
@@ -1503,12 +1532,16 @@ static void igbvf_reset(struct igbvf_adapter *adapter)
struct net_device *netdev = adapter->netdev;
struct e1000_hw *hw = &adapter->hw;
+ spin_lock_bh(&hw->mbx_lock);
+
/* Allow time for pending master requests to run */
if (mac->ops.reset_hw(hw))
dev_err(&adapter->pdev->dev, "PF still resetting\n");
mac->ops.init_hw(hw);
+ spin_unlock_bh(&hw->mbx_lock);
+
if (is_valid_ether_addr(adapter->hw.mac.addr)) {
memcpy(netdev->dev_addr, adapter->hw.mac.addr,
netdev->addr_len);
@@ -1643,6 +1676,7 @@ static int igbvf_sw_init(struct igbvf_adapter *adapter)
igbvf_irq_disable(adapter);
spin_lock_init(&adapter->stats_lock);
+ spin_lock_init(&adapter->hw.mbx_lock);
set_bit(__IGBVF_DOWN, &adapter->state);
return 0;
@@ -1786,8 +1820,12 @@ static int igbvf_set_mac(struct net_device *netdev, void *p)
memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len);
+ spin_lock_bh(&hw->mbx_lock);
+
hw->mac.ops.rar_set(hw, hw->mac.addr, 0);
+ spin_unlock_bh(&hw->mbx_lock);
+
if (!ether_addr_equal(addr->sa_data, hw->mac.addr))
return -EADDRNOTAVAIL;
@@ -1858,7 +1896,12 @@ static bool igbvf_has_link(struct igbvf_adapter *adapter)
if (test_bit(__IGBVF_DOWN, &adapter->state))
return false;
+ spin_lock_bh(&hw->mbx_lock);
+
ret_val = hw->mac.ops.check_for_link(hw);
+
+ spin_unlock_bh(&hw->mbx_lock);
+
link_active = !hw->mac.get_link_status;
/* if check for link returns error we will need to reset */
@@ -2808,6 +2851,8 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->min_mtu = ETH_MIN_MTU;
netdev->max_mtu = MAX_STD_JUMBO_FRAME_SIZE;
+ spin_lock_bh(&hw->mbx_lock);
+
/*reset the controller to put the device in a known good state */
err = hw->mac.ops.reset_hw(hw);
if (err) {
@@ -2824,6 +2869,8 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->addr_len);
}
+ spin_unlock_bh(&hw->mbx_lock);
+
if (!is_valid_ether_addr(netdev->dev_addr)) {
dev_info(&pdev->dev, "Assigning random MAC address.\n");
eth_hw_addr_random(netdev);
diff --git a/drivers/net/ethernet/intel/igbvf/vf.h b/drivers/net/ethernet/intel/igbvf/vf.h
index 4cf78b0dec50..d213eefb6169 100644
--- a/drivers/net/ethernet/intel/igbvf/vf.h
+++ b/drivers/net/ethernet/intel/igbvf/vf.h
@@ -245,6 +245,7 @@ struct e1000_hw {
struct e1000_mac_info mac;
struct e1000_mbx_info mbx;
+ spinlock_t mbx_lock; /* serializes mailbox ops */
union {
struct e1000_dev_spec_vf vf;
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [net-next 10/12] igbvf: after mailbox write, wait for reply
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
` (8 preceding siblings ...)
2017-08-09 21:47 ` [net-next 09/12] igbvf: add lock around mailbox ops Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-09 21:47 ` [net-next 11/12] igbvf: convert msleep to mdelay in atomic context Jeff Kirsher
` (2 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Greg Edwards, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Greg Edwards <gedwards@ddn.com>
Two of the VF mailbox commands were not waiting for a reply from the PF,
which can result in a VF mailbox timeout in the VM for the next command.
Signed-off-by: Greg Edwards <gedwards@ddn.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igbvf/vf.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igbvf/vf.c b/drivers/net/ethernet/intel/igbvf/vf.c
index 528be116184e..1d3aa9adcaa8 100644
--- a/drivers/net/ethernet/intel/igbvf/vf.c
+++ b/drivers/net/ethernet/intel/igbvf/vf.c
@@ -230,6 +230,7 @@ static void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,
u16 *hash_list = (u16 *)&msgbuf[1];
u32 hash_value;
u32 cnt, i;
+ s32 ret_val;
/* Each entry in the list uses 1 16 bit word. We have 30
* 16 bit words available in our HW msg buffer (minus 1 for the
@@ -250,7 +251,9 @@ static void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,
mc_addr_list += ETH_ALEN;
}
- mbx->ops.write_posted(hw, msgbuf, E1000_VFMAILBOX_SIZE);
+ ret_val = mbx->ops.write_posted(hw, msgbuf, E1000_VFMAILBOX_SIZE);
+ if (!ret_val)
+ mbx->ops.read_posted(hw, msgbuf, 1);
}
/**
@@ -293,11 +296,14 @@ void e1000_rlpml_set_vf(struct e1000_hw *hw, u16 max_size)
{
struct e1000_mbx_info *mbx = &hw->mbx;
u32 msgbuf[2];
+ s32 ret_val;
msgbuf[0] = E1000_VF_SET_LPE;
msgbuf[1] = max_size;
- mbx->ops.write_posted(hw, msgbuf, 2);
+ ret_val = mbx->ops.write_posted(hw, msgbuf, 2);
+ if (!ret_val)
+ mbx->ops.read_posted(hw, msgbuf, 1);
}
/**
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [net-next 11/12] igbvf: convert msleep to mdelay in atomic context
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
` (9 preceding siblings ...)
2017-08-09 21:47 ` [net-next 10/12] igbvf: after mailbox write, wait for reply Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-14 10:17 ` David Laight
2017-08-09 21:47 ` [net-next 12/12] igb: support BCM54616 PHY Jeff Kirsher
2017-08-09 23:49 ` [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 David Miller
12 siblings, 1 reply; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: Greg Edwards, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Greg Edwards <gedwards@ddn.com>
This fixes a "scheduling while atomic" splat seen with
CONFIG_DEBUG_ATOMIC_SLEEP enabled.
Signed-off-by: Greg Edwards <gedwards@ddn.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igbvf/vf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igbvf/vf.c b/drivers/net/ethernet/intel/igbvf/vf.c
index 1d3aa9adcaa8..9577ccf4b26a 100644
--- a/drivers/net/ethernet/intel/igbvf/vf.c
+++ b/drivers/net/ethernet/intel/igbvf/vf.c
@@ -149,7 +149,7 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw)
msgbuf[0] = E1000_VF_RESET;
mbx->ops.write_posted(hw, msgbuf, 1);
- msleep(10);
+ mdelay(10);
/* set our "perm_addr" based on info provided by PF */
ret_val = mbx->ops.read_posted(hw, msgbuf, 3);
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [net-next 12/12] igb: support BCM54616 PHY
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
` (10 preceding siblings ...)
2017-08-09 21:47 ` [net-next 11/12] igbvf: convert msleep to mdelay in atomic context Jeff Kirsher
@ 2017-08-09 21:47 ` Jeff Kirsher
2017-08-09 23:49 ` [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 David Miller
12 siblings, 0 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-09 21:47 UTC (permalink / raw)
To: davem; +Cc: John W Linville, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
From: John W Linville <linville@tuxdriver.com>
The management port on an Edgecore AS7712-32 switch uses an igb MAC, but
it uses a BCM54616 PHY. Without a patch like this, loading the igb
module produces dmesg output like this:
[ 3.439125] igb: Copyright (c) 2007-2014 Intel Corporation.
[ 3.439866] igb: probe of 0000:00:14.0 failed with error -2
Signed-off-by: John W Linville <linville@tuxdriver.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_82575.c | 6 ++++++
drivers/net/ethernet/intel/igb/e1000_defines.h | 1 +
drivers/net/ethernet/intel/igb/e1000_hw.h | 1 +
3 files changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index 4a50870e0fa7..c37cc8bccf47 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -340,6 +340,9 @@ static s32 igb_init_phy_params_82575(struct e1000_hw *hw)
phy->ops.set_d3_lplu_state = igb_set_d3_lplu_state_82580;
phy->ops.force_speed_duplex = igb_phy_force_speed_duplex_m88;
break;
+ case BCM54616_E_PHY_ID:
+ phy->type = e1000_phy_bcm54616;
+ break;
default:
ret_val = -E1000_ERR_PHY;
goto out;
@@ -1659,6 +1662,9 @@ static s32 igb_setup_copper_link_82575(struct e1000_hw *hw)
case e1000_phy_82580:
ret_val = igb_copper_link_setup_82580(hw);
break;
+ case e1000_phy_bcm54616:
+ ret_val = 0;
+ break;
default:
ret_val = -E1000_ERR_PHY;
break;
diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h
index d8517779439b..1de82f247312 100644
--- a/drivers/net/ethernet/intel/igb/e1000_defines.h
+++ b/drivers/net/ethernet/intel/igb/e1000_defines.h
@@ -889,6 +889,7 @@
#define I210_I_PHY_ID 0x01410C00
#define M88E1543_E_PHY_ID 0x01410EA0
#define M88E1512_E_PHY_ID 0x01410DD0
+#define BCM54616_E_PHY_ID 0x03625D10
/* M88E1000 Specific Registers */
#define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Register */
diff --git a/drivers/net/ethernet/intel/igb/e1000_hw.h b/drivers/net/ethernet/intel/igb/e1000_hw.h
index 6ea9f702ba0f..6c9485ab4b57 100644
--- a/drivers/net/ethernet/intel/igb/e1000_hw.h
+++ b/drivers/net/ethernet/intel/igb/e1000_hw.h
@@ -128,6 +128,7 @@ enum e1000_phy_type {
e1000_phy_ife,
e1000_phy_82580,
e1000_phy_i210,
+ e1000_phy_bcm54616,
};
enum e1000_bus_type {
--
2.13.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
` (11 preceding siblings ...)
2017-08-09 21:47 ` [net-next 12/12] igb: support BCM54616 PHY Jeff Kirsher
@ 2017-08-09 23:49 ` David Miller
12 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2017-08-09 23:49 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 9 Aug 2017 14:47:34 -0700
> This series contains updates to e1000e and igb/igbvf.
...
> The following are changes since commit 53b948356554376ec6f89016376825d48bf396c3:
> net: vrf: Add extack messages for newlink failures
> and are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 1GbE
Pulled, thanks Jeff.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [net-next 03/12] e1000e: add check on e1e_wphy() return value
2017-08-09 21:47 ` [net-next 03/12] e1000e: add check on e1e_wphy() return value Jeff Kirsher
@ 2017-08-10 17:56 ` Joe Perches
2017-08-11 2:47 ` Gustavo A. R. Silva
0 siblings, 1 reply; 21+ messages in thread
From: Joe Perches @ 2017-08-10 17:56 UTC (permalink / raw)
To: Jeff Kirsher, davem
Cc: Gustavo A R Silva, netdev, nhorman, sassmann, jogreene
On Wed, 2017-08-09 at 14:47 -0700, Jeff Kirsher wrote:
> From: Gustavo A R Silva <garsilva@embeddedor.com>
>
> Check return value from call to e1e_wphy(). This value is being
> checked during previous calls to function e1e_wphy() and it seems
> a check was missing here.
The use of "it seems" here is less than compelling.
Perhaps the write of 0x3140 to MII_BMCR takes too long for
the return value used.
Many other uses of e1e_wphy.*MII_BMCR are also not checked.
For instance: the e100e/ethtool uses.
> diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
[]
> @@ -2437,6 +2437,8 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
> if (hw->phy.revision < 2) {
> e1000e_phy_sw_reset(hw);
> ret_val = e1e_wphy(hw, MII_BMCR, 0x3140);
> + if (ret_val)
> + return ret_val;
> }
> }
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [net-next 03/12] e1000e: add check on e1e_wphy() return value
2017-08-10 17:56 ` Joe Perches
@ 2017-08-11 2:47 ` Gustavo A. R. Silva
2017-08-11 2:53 ` Joe Perches
0 siblings, 1 reply; 21+ messages in thread
From: Gustavo A. R. Silva @ 2017-08-11 2:47 UTC (permalink / raw)
To: Joe Perches, Jeff Kirsher, davem; +Cc: netdev, nhorman, sassmann, jogreene
Hello everybody,
I'm a little confused. Is this patch causing any trouble?
On 08/10/2017 12:56 PM, Joe Perches wrote:
> On Wed, 2017-08-09 at 14:47 -0700, Jeff Kirsher wrote:
>> From: Gustavo A R Silva <garsilva@embeddedor.com>
>>
>> Check return value from call to e1e_wphy(). This value is being
>> checked during previous calls to function e1e_wphy() and it seems
>> a check was missing here.
>
> The use of "it seems" here is less than compelling.
>
This is one of the first patches I sent. Maybe I should have added a
note saying that this patch needed some testing, as I don't have the
hardware to test it.
> Perhaps the write of 0x3140 to MII_BMCR takes too long for
> the return value used.
>
> Many other uses of e1e_wphy.*MII_BMCR are also not checked.
>
> For instance: the e100e/ethtool uses.
>
>> diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
> []
>> @@ -2437,6 +2437,8 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
>> if (hw->phy.revision < 2) {
>> e1000e_phy_sw_reset(hw);
>> ret_val = e1e_wphy(hw, MII_BMCR, 0x3140);
>> + if (ret_val)
>> + return ret_val;
>> }
>> }
>>
Thanks
--
Gustavo A. R. Silva
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [net-next 03/12] e1000e: add check on e1e_wphy() return value
2017-08-11 2:47 ` Gustavo A. R. Silva
@ 2017-08-11 2:53 ` Joe Perches
2017-08-11 3:54 ` Jeff Kirsher
0 siblings, 1 reply; 21+ messages in thread
From: Joe Perches @ 2017-08-11 2:53 UTC (permalink / raw)
To: Gustavo A. R. Silva, Jeff Kirsher, davem
Cc: netdev, nhorman, sassmann, jogreene
On Thu, 2017-08-10 at 21:47 -0500, Gustavo A. R. Silva wrote:
> Hello everybody,
>
> I'm a little confused. Is this patch causing any trouble?
Not to me. I no longer have an e1000e.
Given the commit message, this just seemed to be a patch
that _might_ cause an issue if this code patch is actually
untested.
Compilation wise, it's obviously fine.
> On 08/10/2017 12:56 PM, Joe Perches wrote:
> > On Wed, 2017-08-09 at 14:47 -0700, Jeff Kirsher wrote:
> > > From: Gustavo A R Silva <garsilva@embeddedor.com>
> > >
> > > Check return value from call to e1e_wphy(). This value is being
> > > checked during previous calls to function e1e_wphy() and it seems
> > > a check was missing here.
> >
> > The use of "it seems" here is less than compelling.
> >
>
> This is one of the first patches I sent. Maybe I should have added a
> note saying that this patch needed some testing, as I don't have the
> hardware to test it.
>
> > Perhaps the write of 0x3140 to MII_BMCR takes too long for
> > the return value used.
> >
> > Many other uses of e1e_wphy.*MII_BMCR are also not checked.
> >
> > For instance: the e100e/ethtool uses.
> >
> > > diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
> >
> > []
> > > @@ -2437,6 +2437,8 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
> > > if (hw->phy.revision < 2) {
> > > e1000e_phy_sw_reset(hw);
> > > ret_val = e1e_wphy(hw, MII_BMCR, 0x3140);
> > > + if (ret_val)
> > > + return ret_val;
> > > }
> > > }
> > >
>
> Thanks
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [net-next 03/12] e1000e: add check on e1e_wphy() return value
2017-08-11 2:53 ` Joe Perches
@ 2017-08-11 3:54 ` Jeff Kirsher
0 siblings, 0 replies; 21+ messages in thread
From: Jeff Kirsher @ 2017-08-11 3:54 UTC (permalink / raw)
To: Joe Perches, Gustavo A. R. Silva, davem
Cc: netdev, nhorman, sassmann, jogreene
[-- Attachment #1: Type: text/plain, Size: 580 bytes --]
On Thu, 2017-08-10 at 19:53 -0700, Joe Perches wrote:
> On Thu, 2017-08-10 at 21:47 -0500, Gustavo A. R. Silva wrote:
> > Hello everybody,
> >
> > I'm a little confused. Is this patch causing any trouble?
>
> Not to me. I no longer have an e1000e.
>
> Given the commit message, this just seemed to be a patch
> that _might_ cause an issue if this code patch is actually
> untested.
>
> Compilation wise, it's obviously fine.
Fortunately, I have all patches submitted to me thoroughly tested. It
was a good catch, and we confirmed it does provide a valid fix.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [net-next 11/12] igbvf: convert msleep to mdelay in atomic context
2017-08-09 21:47 ` [net-next 11/12] igbvf: convert msleep to mdelay in atomic context Jeff Kirsher
@ 2017-08-14 10:17 ` David Laight
2017-08-15 19:32 ` Greg Edwards
0 siblings, 1 reply; 21+ messages in thread
From: David Laight @ 2017-08-14 10:17 UTC (permalink / raw)
To: 'Jeff Kirsher', davem@davemloft.net
Cc: Greg Edwards, netdev@vger.kernel.org, nhorman@redhat.com,
sassmann@redhat.com, jogreene@redhat.com
From: Jeff Kirsher
> Sent: 09 August 2017 22:48
> From: Greg Edwards <gedwards@ddn.com>
>
> This fixes a "scheduling while atomic" splat seen with
> CONFIG_DEBUG_ATOMIC_SLEEP enabled.
>
> Signed-off-by: Greg Edwards <gedwards@ddn.com>
> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> drivers/net/ethernet/intel/igbvf/vf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/igbvf/vf.c b/drivers/net/ethernet/intel/igbvf/vf.c
> index 1d3aa9adcaa8..9577ccf4b26a 100644
> --- a/drivers/net/ethernet/intel/igbvf/vf.c
> +++ b/drivers/net/ethernet/intel/igbvf/vf.c
> @@ -149,7 +149,7 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw)
> msgbuf[0] = E1000_VF_RESET;
> mbx->ops.write_posted(hw, msgbuf, 1);
>
> - msleep(10);
> + mdelay(10);
Spinning for 10ms seems somewhat sub-optimal
David
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [net-next 11/12] igbvf: convert msleep to mdelay in atomic context
2017-08-14 10:17 ` David Laight
@ 2017-08-15 19:32 ` Greg Edwards
2017-08-16 10:58 ` David Laight
0 siblings, 1 reply; 21+ messages in thread
From: Greg Edwards @ 2017-08-15 19:32 UTC (permalink / raw)
To: 'Jeff Kirsher', David Laight
Cc: davem@davemloft.net, netdev@vger.kernel.org, nhorman@redhat.com,
sassmann@redhat.com, jogreene@redhat.com
On Mon, Aug 14, 2017 at 10:17:31AM +0000, David Laight wrote:
> From: Jeff Kirsher
>> Sent: 09 August 2017 22:48
>> From: Greg Edwards <gedwards@ddn.com>
>>
>> This fixes a "scheduling while atomic" splat seen with
>> CONFIG_DEBUG_ATOMIC_SLEEP enabled.
>>
>> Signed-off-by: Greg Edwards <gedwards@ddn.com>
>> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>> ---
>> drivers/net/ethernet/intel/igbvf/vf.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igbvf/vf.c b/drivers/net/ethernet/intel/igbvf/vf.c
>> index 1d3aa9adcaa8..9577ccf4b26a 100644
>> --- a/drivers/net/ethernet/intel/igbvf/vf.c
>> +++ b/drivers/net/ethernet/intel/igbvf/vf.c
>> @@ -149,7 +149,7 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw)
>> msgbuf[0] = E1000_VF_RESET;
>> mbx->ops.write_posted(hw, msgbuf, 1);
>>
>> - msleep(10);
>> + mdelay(10);
>
> Spinning for 10ms seems somewhat sub-optimal
Jeff,
Do we even need this delay? The subsequent read_posted() will poll for
the PF's mailbox reply for up to 1s.
Greg
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [net-next 11/12] igbvf: convert msleep to mdelay in atomic context
2017-08-15 19:32 ` Greg Edwards
@ 2017-08-16 10:58 ` David Laight
0 siblings, 0 replies; 21+ messages in thread
From: David Laight @ 2017-08-16 10:58 UTC (permalink / raw)
To: 'Greg Edwards', 'Jeff Kirsher'
Cc: davem@davemloft.net, netdev@vger.kernel.org, nhorman@redhat.com,
sassmann@redhat.com, jogreene@redhat.com
From: Greg Edwards
> Sent: 15 August 2017 20:32
> On Mon, Aug 14, 2017 at 10:17:31AM +0000, David Laight wrote:
> > From: Jeff Kirsher
> >> Sent: 09 August 2017 22:48
> >> From: Greg Edwards <gedwards@ddn.com>
> >>
> >> This fixes a "scheduling while atomic" splat seen with
> >> CONFIG_DEBUG_ATOMIC_SLEEP enabled.
> >>
> >> Signed-off-by: Greg Edwards <gedwards@ddn.com>
> >> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
> >> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> >> ---
> >> drivers/net/ethernet/intel/igbvf/vf.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/net/ethernet/intel/igbvf/vf.c b/drivers/net/ethernet/intel/igbvf/vf.c
> >> index 1d3aa9adcaa8..9577ccf4b26a 100644
> >> --- a/drivers/net/ethernet/intel/igbvf/vf.c
> >> +++ b/drivers/net/ethernet/intel/igbvf/vf.c
> >> @@ -149,7 +149,7 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw)
> >> msgbuf[0] = E1000_VF_RESET;
> >> mbx->ops.write_posted(hw, msgbuf, 1);
> >>
> >> - msleep(10);
> >> + mdelay(10);
> >
> > Spinning for 10ms seems somewhat sub-optimal
>
> Jeff,
>
> Do we even need this delay? The subsequent read_posted() will poll for
> the PF's mailbox reply for up to 1s.
A 1 second loop?
Who is kidding who that this code is sensible.
If this code is ever executed and has to wait at all other interfaces
are likely to lose packets.
David
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2017-08-16 10:58 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-09 21:47 [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 Jeff Kirsher
2017-08-09 21:47 ` [net-next 01/12] igb: Fix error of RX network flow classification Jeff Kirsher
2017-08-09 21:47 ` [net-next 02/12] igb: protect TX timestamping from API misuse Jeff Kirsher
2017-08-09 21:47 ` [net-next 03/12] e1000e: add check on e1e_wphy() return value Jeff Kirsher
2017-08-10 17:56 ` Joe Perches
2017-08-11 2:47 ` Gustavo A. R. Silva
2017-08-11 2:53 ` Joe Perches
2017-08-11 3:54 ` Jeff Kirsher
2017-08-09 21:47 ` [net-next 04/12] igb: Remove incorrect "unexpected SYS WRAP" log message Jeff Kirsher
2017-08-09 21:47 ` [net-next 05/12] igb: add argument names to mailbox op function declarations Jeff Kirsher
2017-08-09 21:47 ` [net-next 06/12] igb: expose mailbox unlock method Jeff Kirsher
2017-08-09 21:47 ` [net-next 07/12] igb: do not drop PF mailbox lock after read of VF message Jeff Kirsher
2017-08-09 21:47 ` [net-next 08/12] e1000e: Initial Support for IceLake Jeff Kirsher
2017-08-09 21:47 ` [net-next 09/12] igbvf: add lock around mailbox ops Jeff Kirsher
2017-08-09 21:47 ` [net-next 10/12] igbvf: after mailbox write, wait for reply Jeff Kirsher
2017-08-09 21:47 ` [net-next 11/12] igbvf: convert msleep to mdelay in atomic context Jeff Kirsher
2017-08-14 10:17 ` David Laight
2017-08-15 19:32 ` Greg Edwards
2017-08-16 10:58 ` David Laight
2017-08-09 21:47 ` [net-next 12/12] igb: support BCM54616 PHY Jeff Kirsher
2017-08-09 23:49 ` [net-next 00/12][pull request] 1GbE Intel Wired LAN Driver Updates 2017-08-08 David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).