public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Or Gerlitz <ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org>
Cc: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 1/2] ib/ipoib: allow disabling/enabling TSO through ethtool
Date: Thu, 4 Mar 2010 15:40:18 +0200	[thread overview]
Message-ID: <20100304134018.GA17107@mtldesk030.lab.mtl.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1003041516300.2755-aDiYczhfhVLdX2U7gxhm1tBPR1lH4CV8@public.gmane.org>

On Thu, Mar 04, 2010 at 03:16:52PM +0200, Or Gerlitz wrote:
> 
> +static int ipoib_set_tso(struct net_device *dev, u32 data)
> +{
> +	struct ipoib_dev_priv *priv = netdev_priv(dev);
> +
> +	if (data) {
> +		if (!test_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags) &&
> +			(dev->features & NETIF_F_SG) &&
> +				(priv->hca_caps & IB_DEVICE_UD_TSO))
> +			dev->features |= NETIF_F_TSO;
> +		else {
> +			ipoib_warn(priv, "can't set TSO on\n");
> +			return -EOPNOTSUPP;
> +		}
> +	} else
> +		dev->features &= ~NETIF_F_TSO;
> +	return 0;
> +}
> +

I believe dev->features should be protected by rtnl lock.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-03-04 13:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04 13:16 [PATCH 1/2] ib/ipoib: allow disabling/enabling TSO through ethtool Or Gerlitz
     [not found] ` <Pine.LNX.4.64.1003041516300.2755-aDiYczhfhVLdX2U7gxhm1tBPR1lH4CV8@public.gmane.org>
2010-03-04 13:40   ` Eli Cohen [this message]
     [not found]     ` <20100304134018.GA17107-8YAHvHwT2UEvbXDkjdHOrw/a8Rv0c6iv@public.gmane.org>
2010-03-04 14:42       ` Or Gerlitz
2010-03-04 15:13       ` Or Gerlitz

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=20100304134018.GA17107@mtldesk030.lab.mtl.com \
    --to=eli-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org \
    --cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    /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