All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shreyas Bhatewara <sbhatewara@vmware.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: Amerigo Wang <amwang@redhat.com>
Subject: RE: [PATCH -next] vmxnet3: fail when try to setup unsupported features
Date: Mon, 28 Jun 2010 10:45:57 -0700	[thread overview]
Message-ID: <89E2752CFA8EC044846EB8499819134102BCC3C10A@EXCH-MBX-4.vmware.com> (raw)
In-Reply-To: <20100628112942.0c919746@dhcp-lab-109.englab.brq.redhat.com>

> -----Original Message-----
> From: Stanislaw Gruszka [mailto:sgruszka@redhat.com]
> Sent: Monday, June 28, 2010 2:30 AM
> To: netdev@vger.kernel.org
> Cc: Amerigo Wang; Shreyas Bhatewara
> Subject: [PATCH -next] vmxnet3: fail when try to setup unsupported
> features
> 
> Return EOPNOTSUPP in ethtool_ops->set_flags.
> 
> Fix coding style while at it.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  drivers/net/vmxnet3/vmxnet3_ethtool.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c
> b/drivers/net/vmxnet3/vmxnet3_ethtool.c
> index 3935c44..8a71a21 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
> @@ -276,16 +276,21 @@ vmxnet3_get_strings(struct net_device *netdev,
> u32 stringset, u8 *buf)
>  }
> 
>  static u32
> -vmxnet3_get_flags(struct net_device *netdev) {
> +vmxnet3_get_flags(struct net_device *netdev)
> +{
>  	return netdev->features;
>  }
> 
>  static int
> -vmxnet3_set_flags(struct net_device *netdev, u32 data) {
> +vmxnet3_set_flags(struct net_device *netdev, u32 data)
> +{
>  	struct vmxnet3_adapter *adapter = netdev_priv(netdev);
>  	u8 lro_requested = (data & ETH_FLAG_LRO) == 0 ? 0 : 1;
>  	u8 lro_present = (netdev->features & NETIF_F_LRO) == 0 ? 0 : 1;
> 
> +	if (data & ~ETH_FLAG_LRO)
> +		return -EOPNOTSUPP;
> +
>  	if (lro_requested ^ lro_present) {
>  		/* toggle the LRO feature*/
>  		netdev->features ^= NETIF_F_LRO;
> --
> 1.5.5.6


Does not make sense to me. Switching LRO on/off is supported from the driver, why should the function return -EOPNOTSUPP ?

->Shreyas

  reply	other threads:[~2010-06-28 17:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-28  9:29 [PATCH -next] vmxnet3: fail when try to setup unsupported features Stanislaw Gruszka
2010-06-28 17:45 ` Shreyas Bhatewara [this message]
2010-06-29  9:15   ` Stanislaw Gruszka
2010-06-29  7:55 ` David Miller

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=89E2752CFA8EC044846EB8499819134102BCC3C10A@EXCH-MBX-4.vmware.com \
    --to=sbhatewara@vmware.com \
    --cc=amwang@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sgruszka@redhat.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 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.