From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 9F4228019 for ; Wed, 14 Sep 2016 10:16:28 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id 1so15287716wmz.1 for ; Wed, 14 Sep 2016 01:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=X1HtJNtsg2xbrsrEe4FMJuk/zUD6AiaNgJ03QQkh6kE=; b=orGCZV8ESlf5yVgGdvAx02XKu3fbpTK91w9Qk23awzRPWNX+DBNbwnNBXvODfMhSBG sEiISvygEWUSSzfFl3XjV0KRZOkBhcxryZb9eNFF1xoWwsHku6u58flzu7BKf5e6EYFW qYXGTgz/qMmZj1jxKcIIN81gfJwQ1bQTxqSc+VKRk6xs24m97gKYe/naJhEE2Qu+HId2 UobTIUJLiHadYacb161/E9+p05MoKuEgyYmHc/u0oOwJoivGCTz745kqdJsGvRy3lviu hNb31U2ZDjBj6pCmStPNbMepHWO+RaEtJ8v7vKnORsn+72YafggwgtRgvQsChyz0sh43 c2mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=X1HtJNtsg2xbrsrEe4FMJuk/zUD6AiaNgJ03QQkh6kE=; b=iuijlS65MabMXK9dZ4mlCl7Za8cq6EKhFvX16ZnBCdFn7nvOjhvsx2QBMBPo0G53jY qzjIjP2y33Tk9uTlpJkTBkbkN5yeGWBgvzkPtCqHRXzcbAqGiT00hvIDTxij3+lUIn+j mL+Qn9KBjkwoUVW8Sl65LmUO30jnxozrWHqIbNSV2Q+we+Eo+PePMQVen0K01wxny7f4 aadljmGb8cHR0ijJ/tFMeXIPz6nS+HBoS3QUSh/9jy9WmWnmGeY0L6pzAd4KZVahdVqN S61sPGdHZD1aP/aOVMagDYTsA5rrkVdkuF61q/xYjZlAdWr3v7mU66IhHTYAbvxaM/TJ thoQ== X-Gm-Message-State: AE9vXwNCYw0j3AsDt/6ijMa3awiuPlfwQh3rtUNOXv4TB513zAhQqHZWqJ/eAnpaijO9shkO X-Received: by 10.28.43.129 with SMTP id r123mr1658598wmr.1.1473840988267; Wed, 14 Sep 2016 01:16:28 -0700 (PDT) Received: from ping.vm.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id a1sm2847500wju.41.2016.09.14.01.16.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Sep 2016 01:16:27 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Adrien Mazarguil Date: Wed, 14 Sep 2016 10:16:05 +0200 Message-Id: <42701f77fcdb03c88ea845071c0710797cfaa549.1473840791.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [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: Wed, 14 Sep 2016 08:16:29 -0000 Signed-off-by: Nelio Laranjeiro --- 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