Commit f3e72109 authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller

qede: Add support for ethtool private flags

Adds a getter for the interfaces private flags.
The only parameter currently supported is whether the interface is a
coupled function [required for supporting 100g].
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d4967cf3
...@@ -116,6 +116,15 @@ static const struct { ...@@ -116,6 +116,15 @@ static const struct {
#define QEDE_NUM_STATS ARRAY_SIZE(qede_stats_arr) #define QEDE_NUM_STATS ARRAY_SIZE(qede_stats_arr)
enum {
QEDE_PRI_FLAG_CMT,
QEDE_PRI_FLAG_LEN,
};
static const char qede_private_arr[QEDE_PRI_FLAG_LEN][ETH_GSTRING_LEN] = {
"Coupled-Function",
};
static void qede_get_strings_stats(struct qede_dev *edev, u8 *buf) static void qede_get_strings_stats(struct qede_dev *edev, u8 *buf)
{ {
int i, j, k; int i, j, k;
...@@ -139,6 +148,10 @@ static void qede_get_strings(struct net_device *dev, u32 stringset, u8 *buf) ...@@ -139,6 +148,10 @@ static void qede_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
case ETH_SS_STATS: case ETH_SS_STATS:
qede_get_strings_stats(edev, buf); qede_get_strings_stats(edev, buf);
break; break;
case ETH_SS_PRIV_FLAGS:
memcpy(buf, qede_private_arr,
ETH_GSTRING_LEN * QEDE_PRI_FLAG_LEN);
break;
default: default:
DP_VERBOSE(edev, QED_MSG_DEBUG, DP_VERBOSE(edev, QED_MSG_DEBUG,
"Unsupported stringset 0x%08x\n", stringset); "Unsupported stringset 0x%08x\n", stringset);
...@@ -177,6 +190,8 @@ static int qede_get_sset_count(struct net_device *dev, int stringset) ...@@ -177,6 +190,8 @@ static int qede_get_sset_count(struct net_device *dev, int stringset)
switch (stringset) { switch (stringset) {
case ETH_SS_STATS: case ETH_SS_STATS:
return num_stats + QEDE_NUM_RQSTATS; return num_stats + QEDE_NUM_RQSTATS;
case ETH_SS_PRIV_FLAGS:
return QEDE_PRI_FLAG_LEN;
default: default:
DP_VERBOSE(edev, QED_MSG_DEBUG, DP_VERBOSE(edev, QED_MSG_DEBUG,
...@@ -185,6 +200,13 @@ static int qede_get_sset_count(struct net_device *dev, int stringset) ...@@ -185,6 +200,13 @@ static int qede_get_sset_count(struct net_device *dev, int stringset)
} }
} }
static u32 qede_get_priv_flags(struct net_device *dev)
{
struct qede_dev *edev = netdev_priv(dev);
return (!!(edev->dev_info.common.num_hwfns > 1)) << QEDE_PRI_FLAG_CMT;
}
static int qede_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) static int qede_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{ {
struct qede_dev *edev = netdev_priv(dev); struct qede_dev *edev = netdev_priv(dev);
...@@ -814,6 +836,7 @@ static const struct ethtool_ops qede_ethtool_ops = { ...@@ -814,6 +836,7 @@ static const struct ethtool_ops qede_ethtool_ops = {
.get_strings = qede_get_strings, .get_strings = qede_get_strings,
.set_phys_id = qede_set_phys_id, .set_phys_id = qede_set_phys_id,
.get_ethtool_stats = qede_get_ethtool_stats, .get_ethtool_stats = qede_get_ethtool_stats,
.get_priv_flags = qede_get_priv_flags,
.get_sset_count = qede_get_sset_count, .get_sset_count = qede_get_sset_count,
.get_rxnfc = qede_get_rxnfc, .get_rxnfc = qede_get_rxnfc,
.set_rxnfc = qede_set_rxnfc, .set_rxnfc = qede_set_rxnfc,
......
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