Skip to content

Commit d19efb7

Browse files
committed
Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2018-04-24 This series contains fixes to ixgbevf, igb and ice drivers. Colin Ian King fixes the return value on error for the new XDP support that went into ixgbevf for 4.17. Vinicius provides a fix for queue 0 for igb, which was not receiving all the credits it needed when QAV mode was enabled. Anirudh provides several fixes for the new ice driver, starting with properly initializing num_nodes_added to zero. Fixed up a code comment to better reflect what is really going on in the code. Fixed how to detect if an OICR interrupt has occurred to a more reliable method. Md Fahad fixes the ice driver to allocate the right amount of memory when reading and storing the devices MAC addresses. The device can have up to 2 MAC addresses (LAN and WoL), while WoL is currently not supported, we need to ensure it can be properly handled when support is added. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents f8d6203 + d6fef10 commit d19efb7

File tree

7 files changed

+37
-16
lines changed

7 files changed

+37
-16
lines changed

drivers/net/ethernet/intel/ice/ice_adminq_cmd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ struct ice_sw_rule_lg_act {
586586
#define ICE_LG_ACT_MIRROR_VSI_ID_S 3
587587
#define ICE_LG_ACT_MIRROR_VSI_ID_M (0x3FF << ICE_LG_ACT_MIRROR_VSI_ID_S)
588588

589-
/* Action type = 5 - Large Action */
589+
/* Action type = 5 - Generic Value */
590590
#define ICE_LG_ACT_GENERIC 0x5
591591
#define ICE_LG_ACT_GENERIC_VALUE_S 3
592592
#define ICE_LG_ACT_GENERIC_VALUE_M (0xFFFF << ICE_LG_ACT_GENERIC_VALUE_S)

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size,
7878
struct ice_aq_desc desc;
7979
enum ice_status status;
8080
u16 flags;
81+
u8 i;
8182

8283
cmd = &desc.params.mac_read;
8384

@@ -98,8 +99,16 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size,
9899
return ICE_ERR_CFG;
99100
}
100101

101-
ether_addr_copy(hw->port_info->mac.lan_addr, resp->mac_addr);
102-
ether_addr_copy(hw->port_info->mac.perm_addr, resp->mac_addr);
102+
/* A single port can report up to two (LAN and WoL) addresses */
103+
for (i = 0; i < cmd->num_addr; i++)
104+
if (resp[i].addr_type == ICE_AQC_MAN_MAC_ADDR_TYPE_LAN) {
105+
ether_addr_copy(hw->port_info->mac.lan_addr,
106+
resp[i].mac_addr);
107+
ether_addr_copy(hw->port_info->mac.perm_addr,
108+
resp[i].mac_addr);
109+
break;
110+
}
111+
103112
return 0;
104113
}
105114

@@ -464,9 +473,12 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
464473
if (status)
465474
goto err_unroll_sched;
466475

467-
/* Get port MAC information */
468-
mac_buf_len = sizeof(struct ice_aqc_manage_mac_read_resp);
469-
mac_buf = devm_kzalloc(ice_hw_to_dev(hw), mac_buf_len, GFP_KERNEL);
476+
/* Get MAC information */
477+
/* A single port can report up to two (LAN and WoL) addresses */
478+
mac_buf = devm_kcalloc(ice_hw_to_dev(hw), 2,
479+
sizeof(struct ice_aqc_manage_mac_read_resp),
480+
GFP_KERNEL);
481+
mac_buf_len = 2 * sizeof(struct ice_aqc_manage_mac_read_resp);
470482

471483
if (!mac_buf) {
472484
status = ICE_ERR_NO_MEMORY;

drivers/net/ethernet/intel/ice/ice_hw_autogen.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@
121121
#define PFINT_FW_CTL_CAUSE_ENA_S 30
122122
#define PFINT_FW_CTL_CAUSE_ENA_M BIT(PFINT_FW_CTL_CAUSE_ENA_S)
123123
#define PFINT_OICR 0x0016CA00
124-
#define PFINT_OICR_INTEVENT_S 0
125-
#define PFINT_OICR_INTEVENT_M BIT(PFINT_OICR_INTEVENT_S)
126124
#define PFINT_OICR_HLP_RDY_S 14
127125
#define PFINT_OICR_HLP_RDY_M BIT(PFINT_OICR_HLP_RDY_S)
128126
#define PFINT_OICR_CPM_RDY_S 15

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,9 +1722,6 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
17221722
oicr = rd32(hw, PFINT_OICR);
17231723
ena_mask = rd32(hw, PFINT_OICR_ENA);
17241724

1725-
if (!(oicr & PFINT_OICR_INTEVENT_M))
1726-
goto ena_intr;
1727-
17281725
if (oicr & PFINT_OICR_GRST_M) {
17291726
u32 reset;
17301727
/* we have a reset warning */
@@ -1782,7 +1779,6 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
17821779
}
17831780
ret = IRQ_HANDLED;
17841781

1785-
ena_intr:
17861782
/* re-enable interrupt causes that are not handled during this pass */
17871783
wr32(hw, PFINT_OICR_ENA, ena_mask);
17881784
if (!test_bit(__ICE_DOWN, pf->state)) {

drivers/net/ethernet/intel/ice/ice_sched.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,14 +751,14 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi,
751751
u16 num_added = 0;
752752
u32 temp;
753753

754+
*num_nodes_added = 0;
755+
754756
if (!num_nodes)
755757
return status;
756758

757759
if (!parent || layer < hw->sw_entry_point_layer)
758760
return ICE_ERR_PARAM;
759761

760-
*num_nodes_added = 0;
761-
762762
/* max children per node per layer */
763763
max_child_nodes =
764764
le16_to_cpu(hw->layer_info[parent->tx_sched_layer].max_children);

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,22 @@ static void igb_configure_cbs(struct igb_adapter *adapter, int queue,
17001700
WARN_ON(hw->mac.type != e1000_i210);
17011701
WARN_ON(queue < 0 || queue > 1);
17021702

1703-
if (enable) {
1703+
if (enable || queue == 0) {
1704+
/* i210 does not allow the queue 0 to be in the Strict
1705+
* Priority mode while the Qav mode is enabled, so,
1706+
* instead of disabling strict priority mode, we give
1707+
* queue 0 the maximum of credits possible.
1708+
*
1709+
* See section 8.12.19 of the i210 datasheet, "Note:
1710+
* Queue0 QueueMode must be set to 1b when
1711+
* TransmitMode is set to Qav."
1712+
*/
1713+
if (queue == 0 && !enable) {
1714+
/* max "linkspeed" idleslope in kbps */
1715+
idleslope = 1000000;
1716+
hicredit = ETH_FRAME_LEN;
1717+
}
1718+
17041719
set_tx_desc_fetch_prio(hw, queue, TX_QUEUE_PRIO_HIGH);
17051720
set_queue_mode(hw, queue, QUEUE_MODE_STREAM_RESERVATION);
17061721

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3420,7 +3420,7 @@ static int ixgbevf_setup_all_tx_resources(struct ixgbevf_adapter *adapter)
34203420
if (!err)
34213421
continue;
34223422
hw_dbg(&adapter->hw, "Allocation for XDP Queue %u failed\n", j);
3423-
break;
3423+
goto err_setup_tx;
34243424
}
34253425

34263426
return 0;

0 commit comments

Comments
 (0)