From: "Michał Mirosław" <mirqus@gmail.com>
To: Shan Wei <shanwei@cn.fujitsu.com>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
rusty@rustcorp.com.au, "Michael S. Tsirkin" <mst@redhat.com>,
Eric Dumazet <eric.dumazet@gmail.com>,
krkumar2@in.ibm.com, Ben Hutchings <bhutchings@solarflare.com>
Subject: Re: [PATCH net-next 2/2 V3] net: driver: use NETIF_F_GSO_SOFTWARE masks directly
Date: Wed, 11 May 2011 12:07:26 +0200 [thread overview]
Message-ID: <BANLkTikCfj5=0UXH1hu4BfXcwoSnqRbVXg@mail.gmail.com> (raw)
In-Reply-To: <4DCA2BEB.4000308@cn.fujitsu.com>
2011/5/11 Shan Wei <shanwei@cn.fujitsu.com>:
> For loopback device can support any offload, so directly using
> NETIF_F_GSO_SOFTWARE offload mask is enough safe.
> And as Michał Mirosław suggested, add NETIF_F_HIGHDMA to hw_features.
>
>
> For virtio_net driver, safely using NETIF_F_GSO_SOFTWARE offload mask for bit operation.
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> ---
> drivers/net/loopback.c | 16 +++++-----------
> drivers/net/virtio_net.c | 3 ++-
> 2 files changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
> index 4ce9e5f..e6cccec 100644
> --- a/drivers/net/loopback.c
> +++ b/drivers/net/loopback.c
> @@ -165,17 +165,11 @@ static void loopback_setup(struct net_device *dev)
> dev->type = ARPHRD_LOOPBACK; /* 0x0001*/
> dev->flags = IFF_LOOPBACK;
> dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
> - dev->hw_features = NETIF_F_ALL_TSO | NETIF_F_UFO;
> - dev->features = NETIF_F_SG | NETIF_F_FRAGLIST
> - | NETIF_F_ALL_TSO
> - | NETIF_F_UFO
> - | NETIF_F_NO_CSUM
> - | NETIF_F_RXCSUM
> - | NETIF_F_HIGHDMA
> - | NETIF_F_LLTX
> - | NETIF_F_NETNS_LOCAL
> - | NETIF_F_VLAN_CHALLENGED
> - | NETIF_F_LOOPBACK;
> + dev->hw_features = NETIF_F_GSO_SOFTWARE | NETIF_F_HIGHDMA;
> + dev->features = dev->hw_features | NETIF_F_SG
> + | NETIF_F_FRAGLIST | NETIF_F_NO_CSUM | NETIF_F_RXCSUM
> + | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL
> + | NETIF_F_VLAN_CHALLENGED | NETIF_F_LOOPBACK;
> dev->ethtool_ops = &loopback_ethtool_ops;
> dev->header_ops = ð_header_ops;
> dev->netdev_ops = &loopback_ops;
[...]
Looks ok. For loopback, more features are actually changeable - only
last 4 are really forced here.
Best Regards,
Michał Mirosław
parent reply other threads:[~2011-05-11 16:57 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <4DCA2BEB.4000308@cn.fujitsu.com>]
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='BANLkTikCfj5=0UXH1hu4BfXcwoSnqRbVXg@mail.gmail.com' \
--to=mirqus@gmail.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=krkumar2@in.ibm.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=shanwei@cn.fujitsu.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).