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 BE411A0C41; Tue, 11 May 2021 08:47:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E4614115F; Tue, 11 May 2021 08:46:34 +0200 (CEST) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by mails.dpdk.org (Postfix) with ESMTP id 689B14003E for ; Tue, 11 May 2021 08:46:29 +0200 (CEST) Received: by mail-lj1-f174.google.com with SMTP id y9so23789011ljn.6 for ; Mon, 10 May 2021 23:46:29 -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=HU9l+3uNdV5SIRC8MoZiQGNy8s2234T1R11FXkSGrww=; b=AfZkK8+zIWscRW+OtXRZt7iE3PKrcO1mp5/HkW/zOEDbzpxDB8FYT9Ory+Wb9KR1kr JeFBP+6PWWWyBAIayyKXqirKFrsu+na/GR+0ZIHGXrOpQ8zml36KhTnMfHuhAKoPeLnP ycwHpNFSn6BduoA+Z4xIQANJpXlovmmhQPeTUpeW0rveNZtjUBSZJyK7oLvSgS1h/X8f Xb1caOeDC/WGme3a5+Nm/OwOUzWyCcIusbeFe6dXG05BN78x33NRgEvaXpyISxdQZThn I+Cd6UoHVe63AIJuoudthleDEdf9Yn9fG3C1zsHI8CeQ5bKo4sENUfoQe/nx2g3ylsyU ETpw== 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=HU9l+3uNdV5SIRC8MoZiQGNy8s2234T1R11FXkSGrww=; b=cIHBIMzNigLbse3kmPmPqf43rNjXPJdlN96XJj5MrfDtj7wg7m1w+PltEPakhhwqDK jouszPL1fV9BqOd1v17tvOobWpjk4QGMWfiZdsL/2Zo00kAqhDrZgnlZUNdR0POTOiR3 cV8MPI0hxnEL4izWkuej+LzfI7EqwiN3MtVfudiSirl3OxwXIsaNggrqJjuDf3TjSxlE bynpUuMy5cYw4mSbtpjaq0A+kOnETsdjgHz0OSI94kP1tKz4ZZQOKbb6Vt8hyn0rH6qP T6GuMuyn/Eu73+BGlV26h2pLv+efOYA5SXQY0knjzOVr5yqYGxVtcZBPtVVC2mt+5cSQ /zkw== X-Gm-Message-State: AOAM531IsAvGWyHmW+agQ1RlRUxjFA0CT/oY2F4d8h6hKQumBBSpe7FG ONGrvnSAsv60ajUuKfX0joeDzQ== X-Google-Smtp-Source: ABdhPJw15/PfucEbUsiXFmTLizWol1588AFm8N0uaSYowSLr2ssgpvmh9MoB/EtW71TPQ7LzPWM35Q== X-Received: by 2002:a2e:161a:: with SMTP id w26mr23118370ljd.436.1620715589106; Mon, 10 May 2021 23:46:29 -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 v20sm2496776lfd.92.2021.05.10.23.46.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 23:46:28 -0700 (PDT) From: Michal Krawczyk To: ferruh.yigit@intel.com Cc: dev@dpdk.org, ndagan@amazon.com, gtzalik@amazon.com, igorch@amazon.com, upstream@semihalf.com, Michal Krawczyk , stable@dpdk.org, Amit Bernstein Date: Tue, 11 May 2021 08:45:48 +0200 Message-Id: <20210511064554.10656-14-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210511064554.10656-1-mk@semihalf.com> References: <87e65a42-4ae5-1a81-8f8e-74759fc14999@intel.com> <20210511064554.10656-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 13/19] 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 --- v4: * Add release notes. * Always announce DEV_RX_OFFLOAD_RSS_HASH if RSS is enabled. doc/guides/rel_notes/release_21_05.rst | 1 + drivers/net/ena/ena_ethdev.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst index 755d5fcd32..389a7a05ac 100644 --- a/doc/guides/rel_notes/release_21_05.rst +++ b/doc/guides/rel_notes/release_21_05.rst @@ -210,6 +210,7 @@ New Features * Changed memcpy mapping to the dpdk-optimized version. * Updated ena_com (HAL) to the latest version. * Fixed bugs when requesting large LLQ headers using the devargs. + * Added indication of the RSS hash presence in the mbuf. * **Added support of multiple data-units in cryptodev API.** diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 6092288239..9a43ab50fe 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; } @@ -1960,6 +1967,9 @@ static int ena_dev_configure(struct rte_eth_dev *dev) adapter->state = ENA_ADAPTER_STATE_CONFIG; + if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) + dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH; + adapter->tx_selected_offloads = dev->data->dev_conf.txmode.offloads; adapter->rx_selected_offloads = dev->data->dev_conf.rxmode.offloads; return 0; @@ -2245,8 +2255,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