From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 4CCCC569F for ; Fri, 23 Sep 2016 11:16:04 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id b130so18416681wmc.0 for ; Fri, 23 Sep 2016 02:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=FLbd0NnLEpmck9+QEEdeqsw1G9rbYohWp4GNKoqg5qg=; b=GANLmQYKBaMmpb617BYXc1UvCYgh/mwWK5Cck2KllRQHhIoO1NGMKv5LAWgikS1Mkh j69R7pVmnKcn7p7Z3qNvduxc7r+Z8k8zZePVMyT/9dHMvlr6MdLCtIOKqgKQ7SjzUUqu hR2YlwwXYOHZdbFXEBCZNQ+nB2XY/yI0GP1aBhLti8s6dOHAStkbU68JTtMq3N32A9Tf GiAtyWrpl7IpzPlHQwtohQs09lhXsPBYkzu9q7ohjVwduvljKAh5vANBC18LKdNM8zYy CFyaU5z3EG/RppfCm9V1YHR9hqkmhxlzEql8JrtY18WaQE0vJSHEwM2It+qO3r+mi1TG OAIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FLbd0NnLEpmck9+QEEdeqsw1G9rbYohWp4GNKoqg5qg=; b=bPWaLvfvvZ1qwyzxXIMoAqseRxPa3i1c9EFykgJIjEXljpDqnt4wy7EPxP23q6/4t1 FsxLbNjqjW4tjJh/T+tfHUxZEDYnIfdaPhYRvWiBIiWMDy7l8eGBJdf3kbdC+i8UOFPm oqJEdBHfTSN9OxNc2a2IJJXQrS2owc67jIr0PpMtgLi7frlipRZKILc8BJwbeFfttcX3 402EE6y8SZDnuknuWijprwisJLsMJbQsxhMOselr7hTrKOkHX2dog2AJJD6T2VjijQs3 f1JTBCdbHEinW5NEKRqIIpGucFXWQOuB/KjuBHvUzP7B/zpSfOxOawnhMQkvI89FUOAr 8zLQ== X-Gm-Message-State: AE9vXwOFdOq3x9M0wf24gNz5oPPrrTpeY0Wa7NqEMf4m6hpsyPt7kmNcIUW9/PmyBVzJwAbZ X-Received: by 10.194.2.51 with SMTP id 19mr6160595wjr.37.1474622164107; Fri, 23 Sep 2016 02:16:04 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id d192sm2093039wmd.18.2016.09.23.02.16.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Sep 2016 02:16:03 -0700 (PDT) Date: Fri, 23 Sep 2016 11:15:56 +0200 From: Adrien Mazarguil To: Nelio Laranjeiro Cc: dev@dpdk.org Message-ID: <20160923091556.GS17252@6wind.com> References: <42701f77fcdb03c88ea845071c0710797cfaa549.1473840791.git.nelio.laranjeiro@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42701f77fcdb03c88ea845071c0710797cfaa549.1473840791.git.nelio.laranjeiro@6wind.com> Subject: Re: [dpdk-dev] [PATCH] net/mlx5: return RSS hash result in mbuf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 09:16:04 -0000 On Wed, Sep 14, 2016 at 10:16:05AM +0200, Nelio Laranjeiro wrote: > Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil > --- > drivers/net/mlx5/mlx5_rxq.c | 1 + > drivers/net/mlx5/mlx5_rxtx.c | 6 +++++- > drivers/net/mlx5/mlx5_rxtx.h | 2 ++ > 3 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index f6f4315..65c264b 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -926,6 +926,7 @@ rxq_ctrl_setup(struct rte_eth_dev *dev, struct rxq_ctrl *rxq_ctrl, > .rxq = { > .elts_n = log2above(desc), > .mp = mp, > + .rss_hash = !!(priv->rxqs_n > 1), > }, > }; > struct ibv_exp_wq_attr mod; > diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c > index b91b644..17ae5e4 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.c > +++ b/drivers/net/mlx5/mlx5_rxtx.c > @@ -1338,12 +1338,16 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) > /* Update packet information. */ > pkt->packet_type = 0; > pkt->ol_flags = 0; > + if (rxq->rss_hash) { > + pkt->hash.rss = ntohl(cqe->rx_hash_res); > + pkt->ol_flags = PKT_RX_RSS_HASH; > + } > if (rxq->csum | rxq->csum_l2tun | rxq->vlan_strip | > rxq->crc_present) { > if (rxq->csum) { > pkt->packet_type = > rxq_cq_to_pkt_type(cqe); > - pkt->ol_flags = > + pkt->ol_flags |= > rxq_cq_to_ol_flags(rxq, cqe); > } > if (cqe->l4_hdr_type_etc & > diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h > index 9828aef..e813f38 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.h > +++ b/drivers/net/mlx5/mlx5_rxtx.h > @@ -113,6 +113,8 @@ struct rxq { > unsigned int cqe_n:4; /* Log 2 of CQ elements. */ > unsigned int elts_n:4; /* Log 2 of Mbufs. */ > unsigned int port_id:8; > + unsigned int rss_hash:1; /* RSS hash result is enabled. */ > + unsigned int :9; /* Remaining bits. */ > volatile uint32_t *rq_db; > volatile uint32_t *cq_db; > uint16_t rq_ci; > -- > 2.1.4 > -- Adrien Mazarguil 6WIND