aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2015-04-07 19:45:37 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-04-14 23:14:58 -0400
commit3169c323cf9dc3b00b0a6a3d434968832daa4147 (patch)
tree8ba0454e838ff0bb313deca853594195f4f24504 /drivers/net/ethernet/intel
parentf18ae1009276b604ff5776b41af981f25db52240 (diff)
i40e: enable user dump of internal hardware state
This is a feature to enable better debugging of user reported issues 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. This is a critical debugging feature for helping us interpret and reproduce complex customer setups. Change-ID: Ie8b3ab09086d6870a709015f51ada05af10b41bb Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_common.c57
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_debugfs.c45
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_prototype.h5
3 files changed, 107 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 44dc4b1f418c..ce522d76811d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -3506,6 +3506,63 @@ void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status)
3506} 3506}
3507 3507
3508/** 3508/**
3509 * i40e_aq_debug_dump
3510 * @hw: pointer to the hardware structure
3511 * @cluster_id: specific cluster to dump
3512 * @table_id: table id within cluster
3513 * @start_index: index of line in the block to read
3514 * @buff_size: dump buffer size
3515 * @buff: dump buffer
3516 * @ret_buff_size: actual buffer size returned
3517 * @ret_next_table: next block to read
3518 * @ret_next_index: next index to read
3519 *
3520 * Dump internal FW/HW data for debug purposes.
3521 *
3522 **/
3523i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,
3524 u8 table_id, u32 start_index, u16 buff_size,
3525 void *buff, u16 *ret_buff_size,
3526 u8 *ret_next_table, u32 *ret_next_index,
3527 struct i40e_asq_cmd_details *cmd_details)
3528{
3529 struct i40e_aq_desc desc;
3530 struct i40e_aqc_debug_dump_internals *cmd =
3531 (struct i40e_aqc_debug_dump_internals *)&desc.params.raw;
3532 struct i40e_aqc_debug_dump_internals *resp =
3533 (struct i40e_aqc_debug_dump_internals *)&desc.params.raw;
3534 i40e_status status;
3535
3536 if (buff_size == 0 || !buff)
3537 return I40E_ERR_PARAM;
3538
3539 i40e_fill_default_direct_cmd_desc(&desc,
3540 i40e_aqc_opc_debug_dump_internals);
3541 /* Indirect Command */
3542 desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_BUF);
3543 if (buff_size > I40E_AQ_LARGE_BUF)
3544 desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_LB);
3545
3546 cmd->cluster_id = cluster_id;
3547 cmd->table_id = table_id;
3548 cmd->idx = cpu_to_le32(start_index);
3549
3550 desc.datalen = cpu_to_le16(buff_size);
3551
3552 status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details);
3553 if (!status) {
3554 if (ret_buff_size)
3555 *ret_buff_size = le16_to_cpu(desc.datalen);
3556 if (ret_next_table)
3557 *ret_next_table = resp->table_id;
3558 if (ret_next_index)
3559 *ret_next_index = le32_to_cpu(resp->idx);
3560 }
3561
3562 return status;
3563}
3564
3565/**
3509 * i40e_read_bw_from_alt_ram 3566 * i40e_read_bw_from_alt_ram
3510 * @hw: pointer to the hardware structure 3567 * @hw: pointer to the hardware structure
3511 * @max_bw: pointer for max_bw read 3568 * @max_bw: pointer for max_bw read
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index daa88263af66..34170eabca7d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -1388,6 +1388,50 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
1388 r_cfg->app[i].selector, 1388 r_cfg->app[i].selector,
1389 r_cfg->app[i].protocolid); 1389 r_cfg->app[i].protocolid);
1390 } 1390 }
1391 } else if (strncmp(&cmd_buf[5], "debug fwdata", 12) == 0) {
1392 int cluster_id, table_id;
1393 int index, ret;
1394 u16 buff_len = 4096;
1395 u32 next_index;
1396 u8 next_table;
1397 u8 *buff;
1398 u16 rlen;
1399
1400 cnt = sscanf(&cmd_buf[18], "%i %i %i",
1401 &cluster_id, &table_id, &index);
1402 if (cnt != 3) {
1403 dev_info(&pf->pdev->dev,
1404 "dump debug fwdata <cluster_id> <table_id> <index>\n");
1405 goto command_write_done;
1406 }
1407
1408 dev_info(&pf->pdev->dev,
1409 "AQ debug dump fwdata params %x %x %x %x\n",
1410 cluster_id, table_id, index, buff_len);
1411 buff = kzalloc(buff_len, GFP_KERNEL);
1412 if (!buff)
1413 goto command_write_done;
1414
1415 ret = i40e_aq_debug_dump(&pf->hw, cluster_id, table_id,
1416 index, buff_len, buff, &rlen,
1417 &next_table, &next_index,
1418 NULL);
1419 if (ret) {
1420 dev_info(&pf->pdev->dev,
1421 "debug dump fwdata AQ Failed %d 0x%x\n",
1422 ret, pf->hw.aq.asq_last_status);
1423 kfree(buff);
1424 buff = NULL;
1425 goto command_write_done;
1426 }
1427 dev_info(&pf->pdev->dev,
1428 "AQ debug dump fwdata rlen=0x%x next_table=0x%x next_index=0x%x\n",
1429 rlen, next_table, next_index);
1430 print_hex_dump(KERN_INFO, "AQ buffer WB: ",
1431 DUMP_PREFIX_OFFSET, 16, 1,
1432 buff, rlen, true);
1433 kfree(buff);
1434 buff = NULL;
1391 } else { 1435 } else {
1392 dev_info(&pf->pdev->dev, 1436 dev_info(&pf->pdev->dev,
1393 "dump desc tx <vsi_seid> <ring_id> [<desc_n>], dump desc rx <vsi_seid> <ring_id> [<desc_n>],\n"); 1437 "dump desc tx <vsi_seid> <ring_id> [<desc_n>], dump desc rx <vsi_seid> <ring_id> [<desc_n>],\n");
@@ -1903,6 +1947,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
1903 dev_info(&pf->pdev->dev, " dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n"); 1947 dev_info(&pf->pdev->dev, " dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n");
1904 dev_info(&pf->pdev->dev, " dump desc aq\n"); 1948 dev_info(&pf->pdev->dev, " dump desc aq\n");
1905 dev_info(&pf->pdev->dev, " dump reset stats\n"); 1949 dev_info(&pf->pdev->dev, " dump reset stats\n");
1950 dev_info(&pf->pdev->dev, " dump debug fwdata <cluster_id> <table_id> <index>\n");
1906 dev_info(&pf->pdev->dev, " msg_enable [level]\n"); 1951 dev_info(&pf->pdev->dev, " msg_enable [level]\n");
1907 dev_info(&pf->pdev->dev, " read <reg>\n"); 1952 dev_info(&pf->pdev->dev, " read <reg>\n");
1908 dev_info(&pf->pdev->dev, " write <reg> <value>\n"); 1953 dev_info(&pf->pdev->dev, " write <reg> <value>\n");
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index fea0d37ecc72..7b34f1e660ea 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -303,4 +303,9 @@ i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
303 u16 vsi_seid, u16 queue, bool is_add, 303 u16 vsi_seid, u16 queue, bool is_add,
304 struct i40e_control_filter_stats *stats, 304 struct i40e_control_filter_stats *stats,
305 struct i40e_asq_cmd_details *cmd_details); 305 struct i40e_asq_cmd_details *cmd_details);
306i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,
307 u8 table_id, u32 start_index, u16 buff_size,
308 void *buff, u16 *ret_buff_size,
309 u8 *ret_next_table, u32 *ret_next_index,
310 struct i40e_asq_cmd_details *cmd_details);
306#endif /* _I40E_PROTOTYPE_H_ */ 311#endif /* _I40E_PROTOTYPE_H_ */