From: "Namburu, Chandu-babu" <chandu@amd.com>
To: "Modali, Bhagyada" <Bhagyada.Modali@amd.com>,
"Yigit, Ferruh" <Ferruh.Yigit@amd.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH v3 1/4] net/axgbe: fix scattered Rx
Date: Mon, 5 Sep 2022 05:00:57 +0000 [thread overview]
Message-ID: <MW2PR12MB2538F50A9BDF4D86A60B5B00C87F9@MW2PR12MB2538.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20220902084754.99884-1-bhagyada.modali@amd.com>
[Public]
Acked-by: Chandubabu Namburu <chandu@amd.com>
-----Original Message-----
From: Modali, Bhagyada <Bhagyada.Modali@amd.com>
Sent: Friday, September 2, 2022 2:18 PM
To: Namburu, Chandu-babu <chandu@amd.com>; Yigit, Ferruh <Ferruh.Yigit@amd.com>
Cc: dev@dpdk.org; stable@dpdk.org; Modali, Bhagyada <Bhagyada.Modali@amd.com>
Subject: [PATCH v3 1/4] net/axgbe: fix scattered Rx
Error check needs to be done only for last segment of Jumbo packet.
Freed first_seg and reset eop to 0 in error case
Fixes: 965b3127d425 ("net/axgbe: support scattered Rx")
Cc: stable@dpdk.org
Signed-off-by: Bhagyada Modali <bhagyada.modali@amd.com>
---
v2:
* removed the extra paranthesis
* initialised the variables
* updated the commit logs
---
drivers/net/axgbe/axgbe_rxtx.c | 35 +++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index f38bb64fab..89ed6fd74a 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -343,8 +343,8 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
uint64_t old_dirty = rxq->dirty;
struct rte_mbuf *first_seg = NULL;
struct rte_mbuf *mbuf, *tmbuf;
- unsigned int err, etlt;
- uint32_t error_status;
+ unsigned int err = 0, etlt;
+ uint32_t error_status = 0;
uint16_t idx, pidx, data_len = 0, pkt_len = 0;
uint64_t offloads;
@@ -381,19 +381,6 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
}
mbuf = rxq->sw_ring[idx];
- /* Check for any errors and free mbuf*/
- err = AXGMAC_GET_BITS_LE(desc->write.desc3,
- RX_NORMAL_DESC3, ES);
- error_status = 0;
- if (unlikely(err)) {
- error_status = desc->write.desc3 & AXGBE_ERR_STATUS;
- if ((error_status != AXGBE_L3_CSUM_ERR)
- && (error_status != AXGBE_L4_CSUM_ERR)) {
- rxq->errors++;
- rte_pktmbuf_free(mbuf);
- goto err_set;
- }
- }
rte_prefetch1(rte_pktmbuf_mtod(mbuf, void *));
if (!AXGMAC_GET_BITS_LE(desc->write.desc3,
@@ -406,6 +393,24 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue,
pkt_len = AXGMAC_GET_BITS_LE(desc->write.desc3,
RX_NORMAL_DESC3, PL);
data_len = pkt_len - rxq->crc_len;
+ /* Check for any errors and free mbuf*/
+ err = AXGMAC_GET_BITS_LE(desc->write.desc3,
+ RX_NORMAL_DESC3, ES);
+ error_status = 0;
+ if (unlikely(err)) {
+ error_status = desc->write.desc3 &
+ AXGBE_ERR_STATUS;
+ if (error_status != AXGBE_L3_CSUM_ERR &&
+ error_status != AXGBE_L4_CSUM_ERR) {
+ rxq->errors++;
+ rte_pktmbuf_free(mbuf);
+ rte_pktmbuf_free(first_seg);
+ first_seg = NULL;
+ eop = 0;
+ goto err_set;
+ }
+ }
+
}
if (first_seg != NULL) {
--
2.25.1
next prev parent reply other threads:[~2022-09-05 5:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 5:33 [PATCH 1/4] net/axgbe: fix scattered Rx function Bhagyada Modali
2022-09-01 5:33 ` [PATCH 2/4] " Bhagyada Modali
2022-09-01 5:33 ` [PATCH 3/4] " Bhagyada Modali
2022-09-01 5:33 ` [PATCH 4/4] " Bhagyada Modali
2022-09-01 12:49 ` [PATCH v2 1/4] net/axgbe: fix scattered Rx Bhagyada Modali
2022-09-01 12:49 ` [PATCH v2 2/4] net/axgbe: fix mbuf lengths in " Bhagyada Modali
2022-09-01 12:49 ` [PATCH v2 3/4] net/axgbe: fix length of each segment " Bhagyada Modali
2022-09-01 12:49 ` [PATCH v2 4/4] net/axgbe: fix checksum and RSS " Bhagyada Modali
2022-09-01 15:03 ` [PATCH v2 1/4] net/axgbe: fix " Ferruh Yigit
2022-09-02 8:47 ` [PATCH v3 " Bhagyada Modali
2022-09-02 8:47 ` [PATCH v3 2/4] net/axgbe: fix mbuf lengths in " Bhagyada Modali
2022-09-02 8:47 ` [PATCH v3 3/4] net/axgbe: fix length of each segment " Bhagyada Modali
2022-09-02 8:47 ` [PATCH v3 4/4] net/axgbe: fix checksum and RSS " Bhagyada Modali
2022-09-05 5:00 ` Namburu, Chandu-babu [this message]
2022-09-05 16:48 ` [PATCH v3 1/4] net/axgbe: fix " Ferruh Yigit
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=MW2PR12MB2538F50A9BDF4D86A60B5B00C87F9@MW2PR12MB2538.namprd12.prod.outlook.com \
--to=chandu@amd.com \
--cc=Bhagyada.Modali@amd.com \
--cc=Ferruh.Yigit@amd.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/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).