From: David Miller <davem@davemloft.net>
To: salil.mehta@huawei.com
Cc: yisen.zhuang@huawei.com, mehta.salil.lnk@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linuxarm@huawei.com
Subject: Re: [PATCH net-next] net: hns: Fix to conditionally convey RX checksum flag to stack
Date: Mon, 28 Nov 2016 12:12:40 -0500 (EST) [thread overview]
Message-ID: <20161128.121240.1321057221950786765.davem@davemloft.net> (raw)
In-Reply-To: <20161125133240.1264224-1-salil.mehta@huawei.com>
From: Salil Mehta <salil.mehta@huawei.com>
Date: Fri, 25 Nov 2016 13:32:40 +0000
> @@ -778,6 +778,35 @@ int hns_ae_get_regs_len(struct hnae_handle *handle)
> return total_num;
> }
>
> +static bool hns_ae_is_l3l4_csum_err(struct hnae_handle *handle)
> +{
> + struct hns_ppe_cb *ppe_cb = hns_get_ppe_cb(handle);
> + u32 regval;
> + bool retval = false;
> +
> + /* read PPE_HIS_PRO_ERR register and check for the checksum errors */
> + regval = dsaf_read_dev(ppe_cb, PPE_HIS_PRO_ERR_REG);
> +
I don't see how a single register can properly provide error status for a ring
of pending received packets.
No matter how this register is implemented, it is either going to result in
packets erroneously being marked as having errors, or error status being
lost when multiple packets in a row have such errors.
For example, if you receive several packets in a row that have errors,
you'll read this register for the first one. If this read clears the error
status, which I am guessing it does, then you won't see the error status
for the next packet that had one of these errors as well.
If you don't have something which is provided on a per-packet basis
then you can't determine the error properly. Therefore you will just
have to always ignore the checksum if there is any error indicated in
the ring descriptor.
next prev parent reply other threads:[~2016-11-28 17:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-25 13:32 [PATCH net-next] net: hns: Fix to conditionally convey RX checksum flag to stack Salil Mehta
2016-11-28 17:12 ` David Miller [this message]
2016-11-29 9:13 ` Salil Mehta
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=20161128.121240.1321057221950786765.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mehta.salil.lnk@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=yisen.zhuang@huawei.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).