From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by dpdk.org (Postfix) with ESMTP id 391F4234 for ; Sat, 28 Mar 2015 10:10:21 +0100 (CET) Received: by labe2 with SMTP id e2so86307212lab.3 for ; Sat, 28 Mar 2015 02:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=q979tCfornIj2WUhAbkrPaYlMJlXTGIEuW/PGqT/rC0=; b=uQSOpEeIG7ajt8+JUFedKk8glzRGx/0fpkpGLslVGh7S9vZ5WecJG0LlL1EyUXQ1O6 82neKZIn/OIqrTgqkcR0Cq3jbCm1iENej2Zf9WbUL4YFx4QknXEGoYjjVQHP9gD884jL QQ9zAN9fBctdgzAl2YibXDmy/hb3d6XJj0iZwnATFazaheoYrDoGyl4ChDUjytvDsTby dY07p5dKfKnooALa1heKNWhqNGytX+e52khKU+9iXnUNQgDFwTZLJENfB2vAnmxYTRFR +idexSCqpYqUopUfxubRVyP2+QEyICDIBV6zYEaQi2Z3IESdXN3fytGAHwKuj+7xjjhi AY+A== MIME-Version: 1.0 X-Received: by 10.152.163.67 with SMTP id yg3mr21057804lab.42.1427533820777; Sat, 28 Mar 2015 02:10:20 -0700 (PDT) Received: by 10.114.83.41 with HTTP; Sat, 28 Mar 2015 02:10:20 -0700 (PDT) In-Reply-To: <91758887-297B-40EF-A7C0-D2A463331C1F@mhcomputing.net> References: <4212375A-A998-48A6-A41E-599E9A35410B@mhcomputing.net> <4378294.bYFEcjd8Sh@xps13> <20150323212719.GB5502@mhcomputing.net> <91758887-297B-40EF-A7C0-D2A463331C1F@mhcomputing.net> Date: Sat, 28 Mar 2015 12:10:20 +0300 Message-ID: From: Vladimir Medvedkin To: Matthew Hall Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] Symmetric RSS Hashing, Part 2 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: Sat, 28 Mar 2015 09:10:21 -0000 Hi Matthew, I just verify RSS symmetric in my code, all works great. I have 82599 NIC and dpdk 1.7.0. Moreover, we can use not only 0x6d5a, but repeated random 2 bytes for 4 tuple, and repeated 4 bytes for 2 tuple in rss hash key. Bellow some code: uint8_t my_rss_key[40]; static const struct rte_eth_conf port_conf = { .rxmode = { .mq_mode = ETH_MQ_RX_RSS, .split_hdr_size = 0, .header_split = 0, /**< Header Split disabled */ .hw_ip_checksum = 0, /**< IP checksum offload disabled */ .hw_vlan_filter = 0, /**< VLAN filtering disabled */ .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ .hw_strip_crc = 0, /**< CRC stripped by hardware */ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, }, .rx_adv_conf.rss_conf = { .rss_key = my_rss_key, .rss_hf = ETH_RSS_IPV4|ETH_RSS_IPV4_TCP, }, }; ... int i; uint8_t a, b; a = rte_rand(); b = rte_rand(); for (i = 0; i < 40; i++) { switch( i & 0x1) { case 0: my_rss_key[i] = a; break; case 1: my_rss_key[i] = b; break; } } .... ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); ... static uint32_t softrss(uint32_t sip, uint32_t dip, uint16_t sp, uint16_t dp, int l4flag, uint32_t *rss_key) { uint32_t ret = 0; int i; for (i = 0; i < 32; i++) { if (sip & (1 << (31 - i))) { ret ^= (rte_cpu_to_be_32(*rss_key) << i)|(rte_cpu_to_be_32(*(rss_key + 1)) >> (32 - i)); } } rss_key++; for (i = 0; i < 32; i++) { if (dip & (1 << (31 - i))) { ret ^= (rte_cpu_to_be_32(*rss_key) << i)|(rte_cpu_to_be_32(*(rss_key + 1)) >> (32 - i)); } } rss_key++; if (l4flag == 1) { for (i = 0; i < 32; i++) { if (((sp<<16)|dp) & (1 << (31 - i))) { ret ^= (rte_cpu_to_be_32(*rss_key) << i)|(rte_cpu_to_be_32(*(rss_key + 1)) >> (32 - i)); } } } return ret; } ... uint32_t rss = softrss(rte_be_to_cpu_32(ipv4_hdr->src_addr), rte_be_to_cpu_32(ipv4_hdr->dst_addr), rte_be_to_cpu_16(tcp_hdr->src_port), rte_be_to_cpu_16(tcp_hdr->dst_port), 1, (uint32_t *)my_rss_key); printf("RSS %u \t\t softRSS %u\n",m->pkt.hash.rss, rss); By the way, maybe it will be usefull to add softrss function in DPDK? 2015-03-27 17:37 GMT+03:00 Matthew Hall : > On Mar 26, 2015, at 10:30 PM, Zhang, Helin wrote: > > Hi guys > > > > Did you guys talk about symmetric hash in software or in hardware? > > > > If about hardware, I have one comment. > > I40e supports symmetric hash by hardware, which was enabled in i40e PMD > recently. You can have a try. > > > > Regards, > > Helin > > Hello Helin, > > Very few of us have that hardware or driver yet. > > It's also quite costly if you're doing the open-source model like I am. > > Is there any way to get the symmetric mode to work for IGB or IXGBE? > > Matthew. > >