* [PATCH] e1000e: export some settings using ethtool private flags
@ 2010-02-27 8:23 Jeff Garzik
2010-03-25 17:16 ` Tantilov, Emil S
0 siblings, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2010-02-27 8:23 UTC (permalink / raw)
To: netdev
The ethtool private flags interface exists to get/set driver-specific
settings at runtime, in a flexible manner.
Use this facility to export a couple e1000e features, that were
previously only set at module initialization time.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
drivers/net/e1000e/ethtool.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index b33e3cb..4bda27f 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -112,6 +112,30 @@ static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
};
#define E1000_TEST_LEN ARRAY_SIZE(e1000_gstrings_test)
+enum e1000_pflags {
+ E1000_PF_SMART_POWERDOWN = (1 << 0),
+ E1000_PF_RO_NVM = (1 << 1),
+};
+
+#define E1000_N_PFLAGS ARRAY_SIZE(e1000_gstrings_pflags)
+static const char e1000_gstrings_pflags[][ETH_GSTRING_LEN] = {
+ "smart_power_down",
+ "read_only_nvm",
+};
+
+u32 e1000_get_priv_flags(struct net_device *netdev)
+{
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+ u32 ret = 0;
+
+ if (adapter->flags & FLAG_SMART_POWER_DOWN)
+ ret |= E1000_PF_SMART_POWERDOWN;
+ if (adapter->flags & FLAG_READ_ONLY_NVM)
+ ret |= E1000_PF_RO_NVM;
+
+ return ret;
+}
+
static int e1000_get_settings(struct net_device *netdev,
struct ethtool_cmd *ecmd)
{
@@ -1666,6 +1690,8 @@ static int e1000e_get_sset_count(struct net_device *netdev, int sset)
return E1000_TEST_LEN;
case ETH_SS_STATS:
return E1000_STATS_LEN;
+ case ETH_SS_PRIV_FLAGS:
+ return E1000_N_PFLAGS;
default:
return -EOPNOTSUPP;
}
@@ -2014,6 +2040,7 @@ static const struct ethtool_ops e1000_ethtool_ops = {
.set_coalesce = e1000_set_coalesce,
.get_flags = ethtool_op_get_flags,
.set_flags = ethtool_op_set_flags,
+ .get_priv_flags = e1000_get_priv_flags,
};
void e1000e_set_ethtool_ops(struct net_device *netdev)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH] e1000e: export some settings using ethtool private flags
2010-02-27 8:23 [PATCH] e1000e: export some settings using ethtool private flags Jeff Garzik
@ 2010-03-25 17:16 ` Tantilov, Emil S
2010-03-25 17:30 ` Jeff Garzik
0 siblings, 1 reply; 5+ messages in thread
From: Tantilov, Emil S @ 2010-03-25 17:16 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
Jeff Garzik wrote:
> The ethtool private flags interface exists to get/set driver-specific
> settings at runtime, in a flexible manner.
>
> Use this facility to export a couple e1000e features, that were
> previously only set at module initialization time.
>
> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
> ---
> drivers/net/e1000e/ethtool.c | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
Jeff,
What is the use case for the ethtool private flags? At least I don't see an option in ethtool that would make use of them.
Thanks,
Emil
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] e1000e: export some settings using ethtool private flags
2010-03-25 17:16 ` Tantilov, Emil S
@ 2010-03-25 17:30 ` Jeff Garzik
2010-03-25 17:33 ` Tantilov, Emil S
0 siblings, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2010-03-25 17:30 UTC (permalink / raw)
To: Tantilov, Emil S; +Cc: netdev
On 03/25/2010 01:16 PM, Tantilov, Emil S wrote:
> Jeff Garzik wrote:
>> The ethtool private flags interface exists to get/set driver-specific
>> settings at runtime, in a flexible manner.
>>
>> Use this facility to export a couple e1000e features, that were
>> previously only set at module initialization time.
>>
>> Signed-off-by: Jeff Garzik<jgarzik@redhat.com>
>> ---
>> drivers/net/e1000e/ethtool.c | 27 +++++++++++++++++++++++++++
>> 1 file changed, 27 insertions(+)
>
> Jeff,
>
> What is the use case for the ethtool private flags?
It is stated in the changelog above :) It enables feature setting at
setting, on an easy, per-network-interface basis, that were previously
only settable at module initialization (ie. load) time.
> At least I don't see an option in ethtool that would make use of them.
This is added in a separate patch, since the above patch is the first to
make use of the private-flags ethtool mechanism.
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] e1000e: export some settings using ethtool private flags
2010-03-25 17:30 ` Jeff Garzik
@ 2010-03-25 17:33 ` Tantilov, Emil S
2010-03-25 17:52 ` Laurent Chavey
0 siblings, 1 reply; 5+ messages in thread
From: Tantilov, Emil S @ 2010-03-25 17:33 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
Jeff Garzik wrote:
> On 03/25/2010 01:16 PM, Tantilov, Emil S wrote:
>> Jeff Garzik wrote:
>>> The ethtool private flags interface exists to get/set
>>> driver-specific settings at runtime, in a flexible manner.
>>>
>>> Use this facility to export a couple e1000e features, that were
>>> previously only set at module initialization time.
>>>
>>> Signed-off-by: Jeff Garzik<jgarzik@redhat.com>
>>> ---
>>> drivers/net/e1000e/ethtool.c | 27 +++++++++++++++++++++++++++
>>> 1 file changed, 27 insertions(+)
>>
>> Jeff,
>>
>> What is the use case for the ethtool private flags?
>
> It is stated in the changelog above :) It enables feature setting at
> setting, on an easy, per-network-interface basis, that were previously
> only settable at module initialization (ie. load) time.
>
>
>> At least I don't see an option in ethtool that would make use of
>> them.
>
> This is added in a separate patch, since the above patch is the first
> to make use of the private-flags ethtool mechanism.
Can you point me to it? It would really help me with testing.
Thanks,
Emil
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] e1000e: export some settings using ethtool private flags
2010-03-25 17:33 ` Tantilov, Emil S
@ 2010-03-25 17:52 ` Laurent Chavey
0 siblings, 0 replies; 5+ messages in thread
From: Laurent Chavey @ 2010-03-25 17:52 UTC (permalink / raw)
To: Tantilov, Emil S; +Cc: Jeff Garzik, netdev
http://lists.openwall.net/netdev/2007/08/10/114
On Thu, Mar 25, 2010 at 10:33 AM, Tantilov, Emil S
<emil.s.tantilov@intel.com> wrote:
> Jeff Garzik wrote:
>> On 03/25/2010 01:16 PM, Tantilov, Emil S wrote:
>>> Jeff Garzik wrote:
>>>> The ethtool private flags interface exists to get/set
>>>> driver-specific settings at runtime, in a flexible manner.
>>>>
>>>> Use this facility to export a couple e1000e features, that were
>>>> previously only set at module initialization time.
>>>>
>>>> Signed-off-by: Jeff Garzik<jgarzik@redhat.com>
>>>> ---
>>>> drivers/net/e1000e/ethtool.c | 27 +++++++++++++++++++++++++++
>>>> 1 file changed, 27 insertions(+)
>>>
>>> Jeff,
>>>
>>> What is the use case for the ethtool private flags?
>>
>> It is stated in the changelog above :) It enables feature setting at
>> setting, on an easy, per-network-interface basis, that were previously
>> only settable at module initialization (ie. load) time.
>>
>>
>>> At least I don't see an option in ethtool that would make use of
>>> them.
>>
>> This is added in a separate patch, since the above patch is the first
>> to make use of the private-flags ethtool mechanism.
>
> Can you point me to it? It would really help me with testing.
>
> Thanks,
> Emil
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-03-25 17:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-27 8:23 [PATCH] e1000e: export some settings using ethtool private flags Jeff Garzik
2010-03-25 17:16 ` Tantilov, Emil S
2010-03-25 17:30 ` Jeff Garzik
2010-03-25 17:33 ` Tantilov, Emil S
2010-03-25 17:52 ` Laurent Chavey
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.