diff options
author | David S. Miller <davem@davemloft.net> | 2015-04-15 17:29:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-15 17:29:00 -0400 |
commit | 6b9107d6a10b69cc0a675447bde9383dff8a1d4f (patch) | |
tree | ce579f705e65eebb447204c3e8c3166ade049ed1 /drivers/net/ethernet/intel/i40e/i40e_common.c | |
parent | 074975d0374333f656c48487aa046a21a9b9d7a1 (diff) | |
parent | 2aea6dcb7864e174dada15728c43c5330637d424 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says:
====================
Intel Wired LAN Driver Updates 2015-04-14
This series contains updates to i40e and i40evf.
Mitch provides a fix for i40e, where VFs were gone and the associated
VSI's had been removed and the rings were not stopped, which in some
circumstances cased memory corruption or DMAR errors. So stop all the
rings associated with each VF before releasing its resources. Also
cleaned up a poorly indented piece of code. Fixes VF link state, where
VF devices were assuming link is up unless told otherwise, which means
that VFs instantiated on a PF with no link, would report the wrong state.
Anjali adds support to add Flow director Sideband rules for a VF from it's
PF. Fixes a recently discovered hardware issue, where after a VFLR
hardware might be indicating to us a reset completion little too early, so
wait another 10 msec for cache to be cleaned up.
Jesse enables the user to dump the internal hardware state for better
debugging by allowing a bash script to acquire information about the
internal hardware state. The data output to the kernel log is collected
by the script and can then be sent to Intel. Also fixed a possible
failure path to allocate memory that was found by smatch. Cleaned up
unused local variables.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e/i40e_common.c')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_common.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index d596f6624025..0bae22da014d 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c | |||
@@ -2397,6 +2397,7 @@ i40e_aq_erase_nvm_exit: | |||
2397 | #define I40E_DEV_FUNC_CAP_LED 0x61 | 2397 | #define I40E_DEV_FUNC_CAP_LED 0x61 |
2398 | #define I40E_DEV_FUNC_CAP_SDP 0x62 | 2398 | #define I40E_DEV_FUNC_CAP_SDP 0x62 |
2399 | #define I40E_DEV_FUNC_CAP_MDIO 0x63 | 2399 | #define I40E_DEV_FUNC_CAP_MDIO 0x63 |
2400 | #define I40E_DEV_FUNC_CAP_WR_CSR_PROT 0x64 | ||
2400 | 2401 | ||
2401 | /** | 2402 | /** |
2402 | * i40e_parse_discover_capabilities | 2403 | * i40e_parse_discover_capabilities |
@@ -2541,11 +2542,18 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff, | |||
2541 | p->fd_filters_guaranteed = number; | 2542 | p->fd_filters_guaranteed = number; |
2542 | p->fd_filters_best_effort = logical_id; | 2543 | p->fd_filters_best_effort = logical_id; |
2543 | break; | 2544 | break; |
2545 | case I40E_DEV_FUNC_CAP_WR_CSR_PROT: | ||
2546 | p->wr_csr_prot = (u64)number; | ||
2547 | p->wr_csr_prot |= (u64)logical_id << 32; | ||
2548 | break; | ||
2544 | default: | 2549 | default: |
2545 | break; | 2550 | break; |
2546 | } | 2551 | } |
2547 | } | 2552 | } |
2548 | 2553 | ||
2554 | if (p->fcoe) | ||
2555 | i40e_debug(hw, I40E_DEBUG_ALL, "device is FCoE capable\n"); | ||
2556 | |||
2549 | /* Software override ensuring FCoE is disabled if npar or mfp | 2557 | /* Software override ensuring FCoE is disabled if npar or mfp |
2550 | * mode because it is not supported in these modes. | 2558 | * mode because it is not supported in these modes. |
2551 | */ | 2559 | */ |
@@ -3503,6 +3511,63 @@ void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status) | |||
3503 | } | 3511 | } |
3504 | 3512 | ||
3505 | /** | 3513 | /** |
3514 | * i40e_aq_debug_dump | ||
3515 | * @hw: pointer to the hardware structure | ||
3516 | * @cluster_id: specific cluster to dump | ||
3517 | * @table_id: table id within cluster | ||
3518 | * @start_index: index of line in the block to read | ||
3519 | * @buff_size: dump buffer size | ||
3520 | * @buff: dump buffer | ||
3521 | * @ret_buff_size: actual buffer size returned | ||
3522 | * @ret_next_table: next block to read | ||
3523 | * @ret_next_index: next index to read | ||
3524 | * | ||
3525 | * Dump internal FW/HW data for debug purposes. | ||
3526 | * | ||
3527 | **/ | ||
3528 | i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, | ||
3529 | u8 table_id, u32 start_index, u16 buff_size, | ||
3530 | void *buff, u16 *ret_buff_size, | ||
3531 | u8 *ret_next_table, u32 *ret_next_index, | ||
3532 | struct i40e_asq_cmd_details *cmd_details) | ||
3533 | { | ||
3534 | struct i40e_aq_desc desc; | ||
3535 | struct i40e_aqc_debug_dump_internals *cmd = | ||
3536 | (struct i40e_aqc_debug_dump_internals *)&desc.params.raw; | ||
3537 | struct i40e_aqc_debug_dump_internals *resp = | ||
3538 | (struct i40e_aqc_debug_dump_internals *)&desc.params.raw; | ||
3539 | i40e_status status; | ||
3540 | |||
3541 | if (buff_size == 0 || !buff) | ||
3542 | return I40E_ERR_PARAM; | ||
3543 | |||
3544 | i40e_fill_default_direct_cmd_desc(&desc, | ||
3545 | i40e_aqc_opc_debug_dump_internals); | ||
3546 | /* Indirect Command */ | ||
3547 | desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_BUF); | ||
3548 | if (buff_size > I40E_AQ_LARGE_BUF) | ||
3549 | desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_LB); | ||
3550 | |||
3551 | cmd->cluster_id = cluster_id; | ||
3552 | cmd->table_id = table_id; | ||
3553 | cmd->idx = cpu_to_le32(start_index); | ||
3554 | |||
3555 | desc.datalen = cpu_to_le16(buff_size); | ||
3556 | |||
3557 | status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); | ||
3558 | if (!status) { | ||
3559 | if (ret_buff_size) | ||
3560 | *ret_buff_size = le16_to_cpu(desc.datalen); | ||
3561 | if (ret_next_table) | ||
3562 | *ret_next_table = resp->table_id; | ||
3563 | if (ret_next_index) | ||
3564 | *ret_next_index = le32_to_cpu(resp->idx); | ||
3565 | } | ||
3566 | |||
3567 | return status; | ||
3568 | } | ||
3569 | |||
3570 | /** | ||
3506 | * i40e_read_bw_from_alt_ram | 3571 | * i40e_read_bw_from_alt_ram |
3507 | * @hw: pointer to the hardware structure | 3572 | * @hw: pointer to the hardware structure |
3508 | * @max_bw: pointer for max_bw read | 3573 | * @max_bw: pointer for max_bw read |