From: Alexander Duyck <alexander.duyck@gmail.com>
To: Tom Herbert <tom@herbertland.com>,
davem@davemloft.net, netdev@vger.kernel.org
Cc: kernel-team@fb.com, dwmw2@infradead.org, ogerlitz@mellanox.com
Subject: Re: [PATCH RFC 3/3] mlx4: Call skb_csum_offload_check to check offloadability
Date: Mon, 5 Oct 2015 21:03:30 -0700 [thread overview]
Message-ID: <56134812.3000303@gmail.com> (raw)
In-Reply-To: <1444088364-2839440-4-git-send-email-tom@herbertland.com>
On 10/05/2015 04:39 PM, Tom Herbert wrote:
> This provides an example of a driver calling the skb_csum_offload_check.
>
> Signed-off-by: Tom Herbert <tom@herbertland.com>
> ---
> drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 6 +++---
> drivers/net/ethernet/mellanox/mlx4/en_tx.c | 20 +++++++++++++++-----
> 2 files changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> index 4726122..f2ed8d0 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -2360,7 +2360,7 @@ out:
> }
>
> /* set offloads */
> - priv->dev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_RXCSUM |
> + priv->dev->hw_enc_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM |
> NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL;
> priv->dev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
> priv->dev->features |= NETIF_F_GSO_UDP_TUNNEL;
> @@ -2372,7 +2372,7 @@ static void mlx4_en_del_vxlan_offloads(struct work_struct *work)
> struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv,
> vxlan_del_task);
> /* unset offloads */
> - priv->dev->hw_enc_features &= ~(NETIF_F_IP_CSUM | NETIF_F_RXCSUM |
> + priv->dev->hw_enc_features &= ~(NETIF_F_HW_CSUM | NETIF_F_RXCSUM |
> NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL);
> priv->dev->hw_features &= ~NETIF_F_GSO_UDP_TUNNEL;
> priv->dev->features &= ~NETIF_F_GSO_UDP_TUNNEL;
> @@ -2943,7 +2943,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
> /*
> * Set driver features
> */
> - dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
> + dev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM;
> if (mdev->LSO_support)
> dev->hw_features |= NETIF_F_TSO | NETIF_F_TSO6;
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> index 494e776..f364ffd 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> @@ -702,6 +702,14 @@ static void mlx4_bf_copy(void __iomem *dst, const void *src,
> __iowrite64_copy(dst, src, bytecnt / 8);
> }
>
> +static const struct skb_csum_offl_spec csum_offl_spec = {
> + .ipv4_okay = 1,
> + .ipv6_okay = 1,
> + .encap_okay = 1,
> + .tcp_okay = 1,
> + .udp_okay = 1,
> +};
> +
The question I would have is if inner IPv6 checksum is supported by this
driver. The code before didn't seem to indicate it was, and after the
csum_offl_spec would seem to indicate it is. One of my concerns about a
change like this is that it is likely prone to introduce regressions as
features are going to be toggling due to interpretations of flags and
assumptions about what is good for the outer headers is good for the
inner ones.
next prev parent reply other threads:[~2015-10-06 4:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-05 23:39 [PATCH RFC 0/3] net: Add driver helper function to determine if checksum is offloadable Tom Herbert
2015-10-05 23:39 ` [PATCH RFC 1/3] net: Add skb_inner_transport_offset function Tom Herbert
2015-10-05 23:39 ` [PATCH RFC 2/3] net: Add driver helper function to determine checksum offloadability Tom Herbert
2015-10-06 3:52 ` Alexander Duyck
2015-10-06 16:31 ` Tom Herbert
2015-10-05 23:39 ` [PATCH RFC 3/3] mlx4: Call skb_csum_offload_check to check offloadability Tom Herbert
2015-10-06 4:03 ` Alexander Duyck [this message]
2015-10-06 16:22 ` Tom Herbert
2015-10-06 16:54 ` Alexander Duyck
2015-10-07 15:41 ` Or Gerlitz
2015-10-07 18:07 ` Tom Herbert
2015-10-08 21:39 ` Or Gerlitz
2015-10-06 10:51 ` [PATCH RFC 0/3] net: Add driver helper function to determine if checksum is offloadable David Woodhouse
2015-10-08 15:09 ` David Woodhouse
2015-10-08 15:48 ` Tom Herbert
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=56134812.3000303@gmail.com \
--to=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=dwmw2@infradead.org \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=tom@herbertland.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).