From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6D3645E66; Tue, 10 Dec 2024 08:08:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D877F4029B; Tue, 10 Dec 2024 08:08:08 +0100 (CET) Received: from zg8tmtyylji0my4xnjqumte4.icoremail.net (zg8tmtyylji0my4xnjqumte4.icoremail.net [162.243.164.118]) by mails.dpdk.org (Postfix) with ESMTP id 6136740264 for ; Tue, 10 Dec 2024 08:08:07 +0100 (CET) Received: from prodtpl.icoremail.net (unknown [10.12.1.20]) by hzbj-icmmx-7 (Coremail) with SMTP id AQAAfwDn7h7V6FdncJOpCg--.4201S2; Tue, 10 Dec 2024 15:08:05 +0800 (CST) Received: from localhost.localdomain (unknown [218.76.62.144]) by mail (Coremail) with SMTP id AQAAfwAnfXnU6Fdn2H1mAA--.1929S3; Tue, 10 Dec 2024 15:08:04 +0800 (CST) From: Wencheng Li 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 Message-Id: <1733814479-412155-1-git-send-email-liwencheng@phytium.com.cn> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1731310932-1743343-1-git-send-email-liwencheng@phytium.com.cn> References: <1731310932-1743343-1-git-send-email-liwencheng@phytium.com.cn> X-CM-TRANSID: AQAAfwAnfXnU6Fdn2H1mAA--.1929S3 X-CM-SenderInfo: polzv0xfkh0wo6sk53xlxphulrpou0/ Authentication-Results: hzbj-icmmx-7; spf=neutral smtp.mail=liwencheng @phytium.com.cn; X-Coremail-Antispam: 1Uk129KBjvJXoW7tryUWrW8ZFyfGF48JF4UXFb_yoW8tw4DpF 4rAryjgryDJF47Jw4fu3WrZas0gw1qgry09FyDCw13uFWfG3Z7ZFy8AFyqyryUKF47C39a yFs0g3Z8JFZ8AFUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj DUYxn0WfASr-VFAU7a7-sFnT9fnUUIcSsGvfJ3UbIYCTnIWIevJa73UjIFyTuYvj4RJUUU UUUUU X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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