From: Ido Shamay <idos@dev•mellanox.co.il>
To: Or Gerlitz <ogerlitz@mellanox•com>,
"David S. Miller" <davem@davemloft•net>
Cc: netdev@vger•kernel.org, Matan Barak <matanb@mellanox•com>,
Amir Vadai <amirv@mellanox•com>,
Saeed Mahameed <saeedm@mellanox•com>,
Shani Michaeli <shanim@mellanox•com>,
Ido Shamay <idos@mellanox•com>, Jerry Chu <hkchu@google•com>
Subject: Re: [PATCH V2 net-next 2/2] net/mlx4_en: Extend checksum offloading by CHECKSUM COMPLETE
Date: Fri, 07 Nov 2014 10:40:34 +0200 [thread overview]
Message-ID: <545C8582.4070408@dev.mellanox.co.il> (raw)
In-Reply-To: <1415291324-22069-3-git-send-email-ogerlitz@mellanox.com>
On 11/6/2014 6:28 PM, Or Gerlitz wrote:
> if (likely(dev->features & NETIF_F_RXCSUM)) {
> - if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) &&
> - (cqe->checksum == cpu_to_be16(0xffff))) {
> - ring->csum_ok++;
> - ip_summed = CHECKSUM_UNNECESSARY;
> + if (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_TCP |
> + MLX4_CQE_STATUS_UDP)) {
> + if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) &&
> + cqe->checksum == cpu_to_be16(0xffff)) {
> + ip_summed = CHECKSUM_UNNECESSARY;
> + ring->csum_ok++;
> + } else {
> + ip_summed = CHECKSUM_NONE;
> + ring->csum_none++;
> + }
> } else {
> - ip_summed = CHECKSUM_NONE;
> - ring->csum_none++;
> + if (priv->flags & MLX4_EN_FLAG_RX_CSUM_NON_TCP_UDP &&
> + (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPV4 |
> + MLX4_CQE_STATUS_IPV6))) {
> + ip_summed = CHECKSUM_COMPLETE;
> + ring->csum_complete++;
> + } else {
> + ip_summed = CHECKSUM_NONE;
> + ring->csum_none++;
> + }
> }
> } else {
> ip_summed = CHECKSUM_NONE;
> @@ -776,6 +874,14 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
> if (!nr)
> goto next;
>
> + if (ip_summed == CHECKSUM_COMPLETE) {
> + va = skb_frag_address(skb_shinfo(gro_skb)->frags);
> + if (check_csum(cqe, gro_skb, va, ring->hwtstamp_rx_filter)) {
> + ip_summed = CHECKSUM_NONE;
> + ring->csum_none++;
When check_csum returns non zero value, then ring->csum_complete counter
was already incremented, and now we are incrementing ring->csum_none
(for the same packet), so need to --ring->csum_complete.
next prev parent reply other threads:[~2014-11-07 8:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 16:28 [PATCH V2 net-next 0/2] Add CHECKSUM_COMPLETE support Or Gerlitz
2014-11-06 16:28 ` [PATCH V2 net-next 1/2] net/mlx4_en: Extend usage of napi_gro_frags Or Gerlitz
2014-11-06 16:28 ` [PATCH V2 net-next 2/2] net/mlx4_en: Extend checksum offloading by CHECKSUM COMPLETE Or Gerlitz
2014-11-07 8:40 ` Ido Shamay [this message]
2014-11-09 8:24 ` Or Gerlitz
2014-11-09 8:14 ` Amir Vadai
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=545C8582.4070408@dev.mellanox.co.il \
--to=idos@dev$(echo .)mellanox.co.il \
--cc=amirv@mellanox$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=hkchu@google$(echo .)com \
--cc=idos@mellanox$(echo .)com \
--cc=matanb@mellanox$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=ogerlitz@mellanox$(echo .)com \
--cc=saeedm@mellanox$(echo .)com \
--cc=shanim@mellanox$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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