From: Wencheng Li <liwencheng@phytium.com.cn>
To: stephen@networkplumber.org
Cc: dev@dpdk.org, liwencheng@phytium.com.cn
Subject: [PATCH v3 4/6] net/macb: zero ol_flags in each recv function
Date: Tue, 10 Dec 2024 07:07:59 +0000 [thread overview]
Message-ID: <1733814479-412155-1-git-send-email-liwencheng@phytium.com.cn> (raw)
In-Reply-To: <1731310932-1743343-1-git-send-email-liwencheng@phytium.com.cn>
Because macb driver does not support hardware offload, ol_flags
field of mbuf structure needs to be zeroed in recv function.
Fixes: 97fd6a929cf8 ("net/macb: add new driver")
Cc: liwencheng@phytium.com.cn
Signed-off-by: Wencheng Li <liwencheng@phytium.com.cn>
---
drivers/net/macb/macb_rxtx.c | 2 ++
drivers/net/macb/macb_rxtx_vec_neon.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/drivers/net/macb/macb_rxtx.c b/drivers/net/macb/macb_rxtx.c
index fa36a1e..d381e77 100644
--- a/drivers/net/macb/macb_rxtx.c
+++ b/drivers/net/macb/macb_rxtx.c
@@ -235,6 +235,7 @@ uint16_t eth_macb_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
rxm->pkt_len = len;
rxm->data_len = len;
rxm->port = rxq->port_id;
+ rxm->ol_flags = 0;
eth_hdr = rte_pktmbuf_mtod(rxm, struct rte_ether_hdr *);
ether_type = eth_hdr->ether_type;
@@ -459,6 +460,7 @@ uint16_t eth_macb_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
}
first_seg->port = rxq->port_id;
+ first_seg->ol_flags = 0;
/*
* Store the mbuf address into the next entry of the array
* of returned packets.
diff --git a/drivers/net/macb/macb_rxtx_vec_neon.c b/drivers/net/macb/macb_rxtx_vec_neon.c
index 3888d5d..8734d44 100644
--- a/drivers/net/macb/macb_rxtx_vec_neon.c
+++ b/drivers/net/macb/macb_rxtx_vec_neon.c
@@ -133,6 +133,14 @@ static inline void macb_pkts_to_port_v(struct rte_mbuf **rx_pkts, uint16_t port_
rx_pkts[3]->port = port_id;
}
+static inline void macb_desc_to_olflags_v(struct rte_mbuf **rx_pkts)
+{
+ rx_pkts[0]->ol_flags = 0;
+ rx_pkts[1]->ol_flags = 0;
+ rx_pkts[2]->ol_flags = 0;
+ rx_pkts[3]->ol_flags = 0;
+}
+
static inline void macb_free_rx_pkts(struct macb_rx_queue *rxq,
struct rte_mbuf **rx_pkts, int pos, uint16_t count)
{
@@ -289,6 +297,8 @@ static uint16_t macb_recv_raw_pkts_vec(struct macb_rx_queue *rxq,
/* C.2 get 4 pkts RX_USED value */
staterr = vzipq_u8(sterr_tmp1.val[0], sterr_tmp2.val[0]).val[0];
+ macb_desc_to_olflags_v(&rx_pkts[pos]);
+
/* C.3 expand RX_USED bit to saturate UINT8 */
staterr = vshlq_n_u8(staterr, MACB_UINT8_BIT - 1);
staterr = vreinterpretq_u8_s8(vshrq_n_s8(vreinterpretq_s8_u8(staterr),
--
2.7.4
next prev parent reply other threads:[~2024-12-10 7:08 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 10:07 [PATCH v1 1/2] net/macb: add new driver liwencheng
2024-11-01 10:07 ` [PATCH v1 2/2] /usertools/dpdk-devbind:add the binding and unbinding of platform device liwencheng
2024-11-05 8:43 ` [PATCH v2 3/3] usertools/dpdk-devbind: add platform device bind/unbind liwencheng
2024-11-06 3:34 ` [PATCH v2 3/3] usertools/dpdk-devbind: add bind/unbind for platform device liwencheng
2024-11-11 7:43 ` liwencheng
2024-12-03 8:15 ` [PATCH][v2, " Wencheng Li
2024-11-06 3:55 ` [PATCH v1 2/2] /usertools/dpdk-devbind:add the binding and unbinding of " Stephen Hemminger
2024-11-12 1:08 ` liwencheng
2024-11-01 16:13 ` [PATCH v1 1/2] net/macb: add new driver Stephen Hemminger
2024-11-01 17:42 ` Stephen Hemminger
2024-11-02 5:43 ` Stephen Hemminger
2024-11-05 8:41 ` [PATCH v2 1/3] " liwencheng
2024-11-05 8:41 ` [PATCH v2 2/3] net/macb: add NEON vectorized Rx/Tx liwencheng
2024-11-06 3:33 ` liwencheng
2024-11-11 7:42 ` liwencheng
2024-12-06 8:08 ` [PATCH v3 " Wencheng Li
2024-12-10 7:05 ` [PATCH v3 2/6] " Wencheng Li
2024-12-10 7:07 ` [PATCH v3 3/6] net/macb: fix logic error in macb_rxq_rearm function Wencheng Li
2024-11-06 3:32 ` [PATCH v2 1/3] net/macb: add new driver liwencheng
2024-11-11 7:42 ` liwencheng
2024-12-06 8:06 ` [PATCH v3 " Wencheng Li
2024-12-10 7:04 ` [PATCH v3 1/6] " Wencheng Li
2024-12-10 7:07 ` Wencheng Li [this message]
2024-12-10 7:08 ` [PATCH v3 5/6] net/macb: fix tab errors in meson.build file Wencheng Li
2024-12-10 19:46 ` Stephen Hemminger
2024-12-02 20:31 ` [PATCH v2 1/3] net/macb: add new driver Stephen Hemminger
2024-11-22 17:55 ` Stephen Hemminger
2024-11-22 20:38 ` Stephen Hemminger
2024-11-22 20:44 ` Stephen Hemminger
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=1733814479-412155-1-git-send-email-liwencheng@phytium.com.cn \
--to=liwencheng@phytium.com.cn \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.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).