netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mahesh Bandewar <maheshb@google.com>
To: "Michał Mirosław" <mirqus@gmail.com>
Cc: e1000-devel <e1000-devel@lists.sourceforge.net>,
	netdev <netdev@vger.kernel.org>,
	Tom Herbert <therbert@google.com>,
	David Miller <davem@davemloft.net>
Subject: Re: [PATCHv1] e1000e: Allow ethtool to enable/disable loopback.
Date: Wed, 11 May 2011 16:11:21 -0700	[thread overview]
Message-ID: <BANLkTimfF4EJ_B=Y-ssjkzmtG123P+HMTA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikXbL2arWSYW1aPV02C8dDdHTUG6Q@mail.gmail.com>

On Wed, May 11, 2011 at 12:15 PM, Michał Mirosław <mirqus@gmail.com> wrote:
> 2011/5/11 Mahesh Bandewar <maheshb@google.com>:
>> This patch adds e1000_set_features() to handle loopback mode. When loopback
>> is enabled, it enables internal-MAC loopback.
>
> Please wait for this driver's conversion to hw_features. One comment
> below, though.
>
This is not intrusive so should not create problems when that happens.

> [...]
>> --- a/drivers/net/e1000e/netdev.c
>> +++ b/drivers/net/e1000e/netdev.c
> [...]
>> +static int e1000_set_features(struct net_device *dev, u32 features)
>> +{
>> +       u32 changed = dev->features ^ features;
>> +
>> +       if ((changed & NETIF_F_LOOPBACK) && netif_running(dev))
>> +               e1000_set_loopback(dev, features);
>> +
>> +       return 0;
>> +}
> [...]
>
> If e1000_set_loopback() fails, this should set dev->features to passed
> features (but keeping NETIF_F_LOOPBACK unchanged in dev->features) to
> keep the state consistent.
>
set_features() can return the return code of set_loopback() instead of
0; this way the consistency will be maintained.

Thanks,
--mahesh..

> Best Regards,
> Michał Mirosław
>

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

  reply	other threads:[~2011-05-11 23:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11 19:03 [PATCHv1] e1000e: Allow ethtool to enable/disable loopback Mahesh Bandewar
2011-05-11 19:15 ` Michał Mirosław
2011-05-11 23:11   ` Mahesh Bandewar [this message]
2011-05-12  4:45     ` David Miller
2011-05-12  5:50     ` Michał Mirosław
2011-05-12 21:41       ` Mahesh Bandewar
2011-05-13  7:49         ` Michał Mirosław

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTimfF4EJ_B=Y-ssjkzmtG123P+HMTA@mail.gmail.com' \
    --to=maheshb@google.com \
    --cc=davem@davemloft.net \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=mirqus@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).