[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJ3xEMg4Nhd1B4iO20=Xt=Z9jeYJVbVnXdgz5Q1w0KQ+9kVYRQ@mail.gmail.com>
Date: Sun, 9 Nov 2014 10:24:41 +0200
From: Or Gerlitz <gerlitz.or@...il.com>
To: Amir Vadai <amirv@...lanox.com>, Ido Shamay <idos@...lanox.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Linux Netdev List <netdev@...r.kernel.org>,
Matan Barak <matanb@...lanox.com>,
Saeed Mahameed <saeedm@...lanox.com>,
Shani Michaeli <shanim@...lanox.com>,
Jerry Chu <hkchu@...gle.com>
Subject: Re: [PATCH V2 net-next 2/2] net/mlx4_en: Extend checksum offloading
by CHECKSUM COMPLETE
On Fri, Nov 7, 2014 at 10:40 AM, Ido Shamay <idos@....mellanox.co.il> wrote:
> 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.
Thanks Ido, I'll fix that.
Amir, I saw the little noise you just reported on too but didn't want
to re-spin V1 just for that, thanks for catching this up.
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists