-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sudarsana Reddy Kalluru says: ==================== qed/qede: ethtool selftests support. This series adds the driver support for following selftests: 1. Register test 2. Memory test 3. Clock test 4. Interrupt test 5. Internal loopback test Patch (1) adds the qed driver infrastructure for selftests. Patches (2) and (3) add qede driver support for ethtool selftests. Please consider applying this series to "net-next". ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Showing
13 changed files
with
598 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
obj-$(CONFIG_QED) := qed.o | ||
|
||
qed-y := qed_cxt.o qed_dev.o qed_hw.o qed_init_fw_funcs.o qed_init_ops.o \ | ||
qed_int.o qed_main.o qed_mcp.o qed_sp_commands.o qed_spq.o qed_l2.o | ||
qed_int.o qed_main.o qed_mcp.o qed_sp_commands.o qed_spq.o qed_l2.o \ | ||
qed_selftest.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#include "qed.h" | ||
#include "qed_dev_api.h" | ||
#include "qed_mcp.h" | ||
#include "qed_sp.h" | ||
|
||
int qed_selftest_memory(struct qed_dev *cdev) | ||
{ | ||
int rc = 0, i; | ||
|
||
for_each_hwfn(cdev, i) { | ||
rc = qed_sp_heartbeat_ramrod(&cdev->hwfns[i]); | ||
if (rc) | ||
return rc; | ||
} | ||
|
||
return rc; | ||
} | ||
|
||
int qed_selftest_interrupt(struct qed_dev *cdev) | ||
{ | ||
int rc = 0, i; | ||
|
||
for_each_hwfn(cdev, i) { | ||
rc = qed_sp_heartbeat_ramrod(&cdev->hwfns[i]); | ||
if (rc) | ||
return rc; | ||
} | ||
|
||
return rc; | ||
} | ||
|
||
int qed_selftest_register(struct qed_dev *cdev) | ||
{ | ||
struct qed_hwfn *p_hwfn; | ||
struct qed_ptt *p_ptt; | ||
int rc = 0, i; | ||
|
||
/* although performed by MCP, this test is per engine */ | ||
for_each_hwfn(cdev, i) { | ||
p_hwfn = &cdev->hwfns[i]; | ||
p_ptt = qed_ptt_acquire(p_hwfn); | ||
if (!p_ptt) { | ||
DP_ERR(p_hwfn, "failed to acquire ptt\n"); | ||
return -EBUSY; | ||
} | ||
rc = qed_mcp_bist_register_test(p_hwfn, p_ptt); | ||
qed_ptt_release(p_hwfn, p_ptt); | ||
if (rc) | ||
break; | ||
} | ||
|
||
return rc; | ||
} | ||
|
||
int qed_selftest_clock(struct qed_dev *cdev) | ||
{ | ||
struct qed_hwfn *p_hwfn; | ||
struct qed_ptt *p_ptt; | ||
int rc = 0, i; | ||
|
||
/* although performed by MCP, this test is per engine */ | ||
for_each_hwfn(cdev, i) { | ||
p_hwfn = &cdev->hwfns[i]; | ||
p_ptt = qed_ptt_acquire(p_hwfn); | ||
if (!p_ptt) { | ||
DP_ERR(p_hwfn, "failed to acquire ptt\n"); | ||
return -EBUSY; | ||
} | ||
rc = qed_mcp_bist_clock_test(p_hwfn, p_ptt); | ||
qed_ptt_release(p_hwfn, p_ptt); | ||
if (rc) | ||
break; | ||
} | ||
|
||
return rc; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef _QED_SELFTEST_API_H | ||
#define _QED_SELFTEST_API_H | ||
#include <linux/types.h> | ||
|
||
/** | ||
* @brief qed_selftest_memory - Perform memory test | ||
* | ||
* @param cdev | ||
* | ||
* @return int | ||
*/ | ||
int qed_selftest_memory(struct qed_dev *cdev); | ||
|
||
/** | ||
* @brief qed_selftest_interrupt - Perform interrupt test | ||
* | ||
* @param cdev | ||
* | ||
* @return int | ||
*/ | ||
int qed_selftest_interrupt(struct qed_dev *cdev); | ||
|
||
/** | ||
* @brief qed_selftest_register - Perform register test | ||
* | ||
* @param cdev | ||
* | ||
* @return int | ||
*/ | ||
int qed_selftest_register(struct qed_dev *cdev); | ||
|
||
/** | ||
* @brief qed_selftest_clock - Perform clock test | ||
* | ||
* @param cdev | ||
* | ||
* @return int | ||
*/ | ||
int qed_selftest_clock(struct qed_dev *cdev); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.