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 DF8F7A0524; Thu, 6 May 2021 16:27:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 077934116F; Thu, 6 May 2021 16:26:05 +0200 (CEST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mails.dpdk.org (Postfix) with ESMTP id 9F1DE4111F for ; Thu, 6 May 2021 16:26:01 +0200 (CEST) Received: by mail-lf1-f50.google.com with SMTP id z13so8100631lft.1 for ; Thu, 06 May 2021 07:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CCn/jybjwpSYdpjlPdx2Ac4wk64prMVI0wGVgKgb4uo=; b=TDpEMKs+KeiwJdUYZz//gGdsWKmCrGeVm+dPFy/xm+wkO64YYS01DgcqpeFXPr7Jc3 lQ6TOSPHWY0FWQEh42pByRBuF7NJHlTu2eWO3NPxwcl9NCcGgtF1su/EomViO1stctVv H94UkDm529CX+x0XZgR0W3J0HUlQYT9uaaIzkXsCl0DAOuhxr79ZlE8Fzq/47UnAc/y9 tYHmA4cIZOWIefIz+yzj0XNwp+xDTgd/Jc8OkJ2T5fdSUlN5haGauUKzAxEmuTmYDDnW gObLOCuz2bpwtECLNHrptVOQR/Qn/zEgTPqH8zvCiloKiM3Yd9xx4wuR9QfjUa7XVOaT UXig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CCn/jybjwpSYdpjlPdx2Ac4wk64prMVI0wGVgKgb4uo=; b=UoLCaxi1aKXkIo2odveXHfbcyCJ+sYUV67z4pF59B0pJZ/+/7zKZLnKj9yf4VgylAt 7uyoZlc6QUp+1xOWn/eRhBmY6uPt9w2hEoyEkMZu7PQKBLyPwbv5IUyB1V1FoZr/O8s/ hUof7Tqgod5kuKSvmIoLs3elsLf39Rxwgzg4lcA7946dDL9OkT9e5pvP5ewYiYrIzdc0 wAEKJMmIpA7WHOChtDkREDBT8Nf4neQV+PK2iYaja/yepNxfyMtYj+2TYEkxwKxHCD88 pSHC3UWqG1Lr86Y6TnkubYHZ/QCHiG02N2NNxe1YexBAvVyLE+2Kzqmre0D/KYXjkcyD 4u2Q== X-Gm-Message-State: AOAM531ES/6KOlwiyu644BE24UFCPw9w7h0sUOt2o382xhQVPZ7kmTCp f7H4Rh4VvsHio3ZWiESPwvf44AXvXimUOtYT X-Google-Smtp-Source: ABdhPJw68CxTnDwsPf9m4wqJgBmwR+pLfTZUVdmfIN+TC3zj3rkQppRTJl3A/rfZP7RQBPfT+0oi+g== X-Received: by 2002:ac2:4857:: with SMTP id 23mr3189510lfy.541.1620311160948; Thu, 06 May 2021 07:26:00 -0700 (PDT) Received: from DESKTOP-U5LNN3J.localdomain (89-79-189-199.dynamic.chello.pl. [89.79.189.199]) by smtp.gmail.com with ESMTPSA id b40sm892908ljr.101.2021.05.06.07.25.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 07:26:00 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: ndagan@amazon.com, gtzalik@amazon.com, igorch@amazon.com, upstream@semihalf.com, Michal Krawczyk , stable@dpdk.org, Amit Bernstein Date: Thu, 6 May 2021 16:25:18 +0200 Message-Id: <20210506142526.28245-15-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210506142526.28245-1-mk@semihalf.com> References: <20210505073348.6394-1-mk@semihalf.com> <20210506142526.28245-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 14/22] net/ena: indicate Rx RSS hash presence 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 Sender: "dev" To make it possible to the app to determine if the hash was calculated for the packet or not, the PKT_RX_RSS_HASH should be set in the mbuf's ol_flags. As the PMD wasn't setting that, the application couldn't check if there is a hash in a proper way. The hash is valid only if it's UDP or TCP and the IP packet wasn't fragmented. Fixes: e5df9f33db00 ("net/ena: fix passing RSS hash to mbuf") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk Reviewed-by: Igor Chauskin Reviewed-by: Amit Bernstein --- drivers/net/ena/ena_ethdev.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 6092288239..5d107775f4 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -51,6 +51,8 @@ #define ENA_MIN_RING_DESC 128 +#define ENA_PTYPE_HAS_HASH (RTE_PTYPE_L4_TCP | RTE_PTYPE_L4_UDP) + enum ethtool_stringset { ETH_SS_TEST = 0, ETH_SS_STATS, @@ -314,6 +316,11 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf, else ol_flags |= PKT_RX_L4_CKSUM_GOOD; + if (likely((packet_type & ENA_PTYPE_HAS_HASH) && !ena_rx_ctx->frag)) { + ol_flags |= PKT_RX_RSS_HASH; + mbuf->hash.rss = ena_rx_ctx->hash; + } + mbuf->ol_flags = ol_flags; mbuf->packet_type = packet_type; } @@ -2245,8 +2252,6 @@ static uint16_t eth_ena_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, ++rx_ring->rx_stats.bad_csum; } - mbuf->hash.rss = ena_rx_ctx.hash; - rx_pkts[completed] = mbuf; rx_ring->rx_stats.bytes += mbuf->pkt_len; } -- 2.25.1