Commit 849dbf09 authored by Sudarsana Reddy Kalluru's avatar Sudarsana Reddy Kalluru Committed by David S. Miller

qede: Add support for dumping the grc data.

This patch adds driver support for configuring grc dump config flags, and
dumping the grc data via ethtool get/set-dump interfaces.
Signed-off-by: default avatarSudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3b86bd07
...@@ -181,6 +181,7 @@ enum qede_flags_bit { ...@@ -181,6 +181,7 @@ enum qede_flags_bit {
enum qede_dump_cmd { enum qede_dump_cmd {
QEDE_DUMP_CMD_NONE = 0, QEDE_DUMP_CMD_NONE = 0,
QEDE_DUMP_CMD_NVM_CFG, QEDE_DUMP_CMD_NVM_CFG,
QEDE_DUMP_CMD_GRCDUMP,
QEDE_DUMP_CMD_MAX QEDE_DUMP_CMD_MAX
}; };
......
...@@ -2001,6 +2001,10 @@ static int qede_set_dump(struct net_device *dev, struct ethtool_dump *val) ...@@ -2001,6 +2001,10 @@ static int qede_set_dump(struct net_device *dev, struct ethtool_dump *val)
edev->dump_info.args[edev->dump_info.num_args] = val->flag; edev->dump_info.args[edev->dump_info.num_args] = val->flag;
edev->dump_info.num_args++; edev->dump_info.num_args++;
break; break;
case QEDE_DUMP_CMD_GRCDUMP:
rc = edev->ops->common->set_grc_config(edev->cdev,
val->flag, 1);
break;
default: default:
break; break;
} }
...@@ -2013,14 +2017,24 @@ static int qede_get_dump_flag(struct net_device *dev, ...@@ -2013,14 +2017,24 @@ static int qede_get_dump_flag(struct net_device *dev,
{ {
struct qede_dev *edev = netdev_priv(dev); struct qede_dev *edev = netdev_priv(dev);
if (!edev->ops || !edev->ops->common) {
DP_ERR(edev, "Edev ops not populated\n");
return -EINVAL;
}
dump->version = QEDE_DUMP_VERSION; dump->version = QEDE_DUMP_VERSION;
switch (edev->dump_info.cmd) { switch (edev->dump_info.cmd) {
case QEDE_DUMP_CMD_NVM_CFG: case QEDE_DUMP_CMD_NVM_CFG:
dump->flag = QEDE_DUMP_CMD_NVM_CFG; dump->flag = QEDE_DUMP_CMD_NVM_CFG;
dump->len = QEDE_DUMP_NVM_BUF_LEN; dump->len = QEDE_DUMP_NVM_BUF_LEN;
break; break;
default: case QEDE_DUMP_CMD_GRCDUMP:
dump->flag = QEDE_DUMP_CMD_GRCDUMP;
dump->len = edev->ops->common->dbg_all_data_size(edev->cdev);
break; break;
default:
DP_ERR(edev, "Invalid cmd = %d\n", edev->dump_info.cmd);
return -EINVAL;
} }
DP_VERBOSE(edev, QED_MSG_DEBUG, DP_VERBOSE(edev, QED_MSG_DEBUG,
...@@ -2033,7 +2047,14 @@ static int qede_get_dump_data(struct net_device *dev, ...@@ -2033,7 +2047,14 @@ static int qede_get_dump_data(struct net_device *dev,
struct ethtool_dump *dump, void *buf) struct ethtool_dump *dump, void *buf)
{ {
struct qede_dev *edev = netdev_priv(dev); struct qede_dev *edev = netdev_priv(dev);
int rc; int rc = 0;
if (!edev->ops || !edev->ops->common) {
DP_ERR(edev, "Edev ops not populated\n");
edev->dump_info.cmd = QEDE_DUMP_CMD_NONE;
edev->dump_info.num_args = 0;
return -EINVAL;
}
switch (edev->dump_info.cmd) { switch (edev->dump_info.cmd) {
case QEDE_DUMP_CMD_NVM_CFG: case QEDE_DUMP_CMD_NVM_CFG:
...@@ -2047,6 +2068,10 @@ static int qede_get_dump_data(struct net_device *dev, ...@@ -2047,6 +2068,10 @@ static int qede_get_dump_data(struct net_device *dev,
edev->dump_info.args[0], edev->dump_info.args[0],
edev->dump_info.args[1]); edev->dump_info.args[1]);
break; break;
case QEDE_DUMP_CMD_GRCDUMP:
memset(buf, 0, dump->len);
rc = edev->ops->common->dbg_all_data(edev->cdev, buf);
break;
default: default:
DP_ERR(edev, "Invalid cmd = %d\n", edev->dump_info.cmd); DP_ERR(edev, "Invalid cmd = %d\n", edev->dump_info.cmd);
rc = -EINVAL; rc = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment