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 ED1A941C2D; Tue, 7 Feb 2023 12:14:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC40E42D5D; Tue, 7 Feb 2023 12:14:20 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id EA7B742D30 for ; Tue, 7 Feb 2023 12:14:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675768459; x=1707304459; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FoXThq6M2dHQRtHNuhWUJhgDz0yUTJ4E2chX6qA8UhU=; b=JPXj4eUCrzNydjMnFfsslA9qreHOKuBXDIOxy+1b2EFTM1HjiYTM1Xw6 qzOaMAcdXN70vZF8x3gpzWMqKl/VJVnjIawXZtExjEAq8SAhRe3NRoRyt iGRnFU/8MNFiFpHktB3I/Ku8jYWZ6lDSI5co2tO+c5+p0VK5c5KUKQo9J j5E41hDLreTc48ZjDW0asS3ZQWZQcFYlbPL0/urvbVbFclDlEDrGHYfk1 tmP1kokzU4W4DYHK/g8t0R8d5LMLheYk27a0+XwxkjF2Qa49llYqouhYL 4pWh+Hs3p5KLUYcF/Iad4aa4fNKJ/tJ+4ONi91elEQ3dB3gDhlqoA+cXU g==; X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="415699026" X-IronPort-AV: E=Sophos;i="5.97,278,1669104000"; d="scan'208";a="415699026" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2023 03:14:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="809486961" X-IronPort-AV: E=Sophos;i="5.97,278,1669104000"; d="scan'208";a="809486961" Received: from dpdk-mingxial-01.sh.intel.com ([10.67.119.167]) by fmsmga001.fm.intel.com with ESMTP; 07 Feb 2023 03:14:16 -0800 From: Mingxia Liu To: dev@dpdk.org, qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: Mingxia Liu Subject: [PATCH v6 4/6] common/idpf: add rss_offload hash in singleq rx Date: Tue, 7 Feb 2023 10:16:48 +0000 Message-Id: <20230207101650.2402452-5-mingxia.liu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230207101650.2402452-1-mingxia.liu@intel.com> References: <20230207100859.2401709-2-mingxia.liu@intel.com> <20230207101650.2402452-1-mingxia.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This patch add rss valid flag and hash value parsing of rx descriptor. Signed-off-by: Mingxia Liu --- drivers/common/idpf/idpf_common_rxtx.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/common/idpf/idpf_common_rxtx.c b/drivers/common/idpf/idpf_common_rxtx.c index 9303b51cce..d7e8df1895 100644 --- a/drivers/common/idpf/idpf_common_rxtx.c +++ b/drivers/common/idpf/idpf_common_rxtx.c @@ -1030,6 +1030,20 @@ idpf_update_rx_tail(struct idpf_rx_queue *rxq, uint16_t nb_hold, rxq->nb_rx_hold = nb_hold; } +static inline void +idpf_singleq_rx_rss_offload(struct rte_mbuf *mb, + volatile struct virtchnl2_rx_flex_desc_nic *rx_desc, + uint64_t *pkt_flags) +{ + uint16_t rx_status0 = rte_le_to_cpu_16(rx_desc->status_error0); + + if (rx_status0 & RTE_BIT32(VIRTCHNL2_RX_FLEX_DESC_STATUS0_RSS_VALID_S)) { + *pkt_flags |= RTE_MBUF_F_RX_RSS_HASH; + mb->hash.rss = rte_le_to_cpu_32(rx_desc->rss_hash); + } + +} + uint16_t idpf_dp_singleq_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) @@ -1118,6 +1132,7 @@ idpf_dp_singleq_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, rxm->port = rxq->port_id; rxm->ol_flags = 0; pkt_flags = idpf_rxd_to_pkt_flags(rx_status0); + idpf_singleq_rx_rss_offload(rxm, &rxd.flex_nic_wb, &pkt_flags); rxm->packet_type = ptype_tbl[(uint8_t)(rte_cpu_to_le_16(rxd.flex_nic_wb.ptype_flex_flags0) & VIRTCHNL2_RX_FLEX_DESC_PTYPE_M)]; @@ -1249,6 +1264,7 @@ idpf_dp_singleq_recv_scatter_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, first_seg->port = rxq->port_id; first_seg->ol_flags = 0; pkt_flags = idpf_rxd_to_pkt_flags(rx_status0); + idpf_singleq_rx_rss_offload(first_seg, &rxd.flex_nic_wb, &pkt_flags); first_seg->packet_type = ptype_tbl[(uint8_t)(rte_cpu_to_le_16(rxd.flex_nic_wb.ptype_flex_flags0) & VIRTCHNL2_RX_FLEX_DESC_PTYPE_M)]; -- 2.25.1