From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpcmd02101.aruba.it (smtpcmd02101.aruba.it [62.149.158.101]) by dpdk.org (Postfix) with ESMTP id 54DB41B108 for ; Thu, 4 Oct 2018 11:35:28 +0200 (CEST) Received: from LANZUISI-NBK ([93.146.250.201]) by smtpcmd02.ad.aruba.it with bizsmtp id jMbS1y00C4MU9Ql01MbTbo; Thu, 04 Oct 2018 11:35:28 +0200 Received: from [172.16.17.68] by LANZUISI-NBK (PGP Universal service); Thu, 04 Oct 2018 11:35:28 +0100 X-PGP-Universal: processed; by LANZUISI-NBK on Thu, 04 Oct 2018 11:35:28 +0100 From: Matteo Lanzuisi To: "dev@dpdk.org" References: <384bb9db-1023-65f7-6d18-f1311db9228a@resi.it> Message-ID: <1c169b0f-2090-d9a0-c3f8-e7e496c2a6e9@resi.it> Date: Thu, 4 Oct 2018 11:35:25 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <384bb9db-1023-65f7-6d18-f1311db9228a@resi.it> Content-Language: it DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aruba.it; s=a1; t=1538645728; bh=QX/tRZv+5NxP9zDYKk32pDravDswGJ77ad3r5XIKZKY=; h=Subject:From:To:Date:MIME-Version:Content-Type; b=k1T2LzxdanOhfsWAI9Xcw1TEctDcr7Ha2SmTK+Wu07bKHgd/urm7ZEN1O1EtRwIpf WzkW51tWITR/iDwLHOj/F/1S2ctt3/8AHIenYrTFgiIgPYVzjZHAVgl04Bcv2X0j2h utEZC7uyoDErtytNG9GQr/0aheNrfjSJsY1K9l7uJ3Ivf3BKK4q8zX7hf87i/duwk1 ejLuZddYiZerGYHUj/SiivJZYK90pT9vDI+2dleObbyBaePSgONE1K3uGE578LtHpP 6TMbCLkjhEG0BaNpTKhHoFpR0BC4TaZfAgOSnxBBE36ZreaD6jx9DLOYbu3fkKfFM7 hx2BNEh7Z8o3A== Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] Symmetry for TCP packets on X710 Intel X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Oct 2018 09:35:28 -0000 Hi all, an update: solved the problem, the fact is that i40e wants an hashkey with size 52, while I was using a 40 bytes hashkey. Two questions: - is there a warning on rte_eth_dev_configure function about using a correct hashkey len (maybe in debug mode for i40e)? Because I used it with an hashkey of 40 bytes (as in the code below) and no warning/no error is returned, while if I use rte_eth_dev_rss_hash_update with an hashkey with size 40 it returns me error 22. I am using 18.02.2, so I wonder if this is already done in the 18.11 or can be done in the future... ; - when I correctly set the 52 bytes hashkey via the rte_eth_dev_configure function and then want to print it using rte_eth_dev_rss_hash_conf_get, it returns a wrong hashkey (probably the one set just before the one I set), but looking at the packets on the different lcores the result is correct, so the hashkey has been correctly set by the rte_eth_dev_configure function. Is this a bug or something known about registers of X710? Matteo Il 02/10/2018 19:19, Matteo Lanzuisi ha scritto: > Hi all, > > I got a huge problem: I found that using normal hashing and > configuration on X710 hardware is not sufficient, so I followed some > threads and read the code inside the testpmd application to configure > a symmetric hashing for IP src / IP dst on TCP packets so that all > packets in a flow are sent to the same lcore. > > This is not working (printing mbuf.hash.rss gives different values for > different directions) and I cannot understand why. > > I am using dpdk 18.02.2 on RedHat 7.5. > > The code I'm using (just the part needed by this thread) is: > > // haskey passed to i40e > static uint8_t hashkey[40] = {0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, > 0x6D, 0x5A, >                               0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, > 0x6D, 0x5A, >                               0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, > 0x6D, 0x5A, >                               0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, > 0x6D, 0x5A, >                               0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, > 0x6D, 0x5A}; > > struct rte_eth_hash_filter_info     info; > unsigned int ftype, idx, offset; > > // my port configuration > struct rte_eth_conf port_conf = { >     .rxmode = >     { >         .mq_mode = ETH_MQ_RX_RSS, >         .enable_scatter = 1 >     } > }; > > const uint16_t rx_rings = 8, tx_rings = 1; > const uint16_t rx_ring_size = 2048; > const uint16_t tx_ring_size = 512; > > port_conf.rx_adv_conf.rss_conf.rss_key = hashkey; > port_conf.rx_adv_conf.rss_conf.rss_key_len = 40; > port_conf.rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IPV4 | > ETH_RSS_FRAG_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP | > ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV4_SCTP | > ETH_RSS_NONFRAG_IPV4_OTHER | ETH_RSS_IPV6 | ETH_RSS_FRAG_IPV6 | > ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_NONFRAG_IPV6_UDP | > ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_NONFRAG_IPV6_OTHER; > > if ((retval = rte_eth_dev_configure(port_num, rx_rings, tx_rings, > &port_conf)) != 0) >     return retval; > > for (q = 0; q < rx_rings; q++) > { >     retval = rte_eth_rx_queue_setup(port_num, q, rx_ring_size, >         rte_eth_dev_socket_id(port_num), NULL, pkt_mbuf_pool[q]); >     if (retval < 0) return retval; > } > printf("rx... %hu rings...", rx_rings); > for (q = 0; q < tx_rings; q++) > { >     retval = rte_eth_tx_queue_setup(port_num, q, tx_ring_size, >         rte_eth_dev_socket_id(port_num), NULL); >     if (retval < 0) return retval; > } > printf("tx...  %hu rings...", tx_rings); > > // we need ports in promiscuous mode > > rte_eth_promiscuous_enable(port_num); > > if ((retval = rte_eth_dev_set_mtu(port_num, 9000)) != 0) > { >     printf("MTU not set for port %hhu... %d\n", port_num, ritorno); > } > else > { >     printf("MTU set for port %hhu\n", port_num); > } > > // specific commands for X710 > // select per ipv4 tcp - src ipv4 > memset(&info, 0, sizeof (info)); > info.info_type = RTE_ETH_HASH_FILTER_INPUT_SET_SELECT; > info.info.input_set_conf.flow_type = RTE_ETH_FLOW_NONFRAG_IPV4_TCP; > info.info.input_set_conf.field[0] = RTE_ETH_INPUT_SET_L3_SRC_IP4; > info.info.input_set_conf.inset_size = 1; > info.info.input_set_conf.op = RTE_ETH_INPUT_SET_SELECT; > ritorno = rte_eth_dev_filter_ctrl(port_num, RTE_ETH_FILTER_HASH, > RTE_ETH_FILTER_SET, &info); > if (ritorno < 0) > { >     printf("Failure: set select ipv4 tcp (src ipv4) for port %hhu\n", > port_num); > } > > // add per ipv4 tcp - dst ipv4 > memset(&info, 0, sizeof (info)); > info.info_type = RTE_ETH_HASH_FILTER_INPUT_SET_SELECT; > info.info.input_set_conf.flow_type = RTE_ETH_FLOW_NONFRAG_IPV4_TCP; > info.info.input_set_conf.field[0] = RTE_ETH_INPUT_SET_L3_DST_IP4; > info.info.input_set_conf.inset_size = 1; > info.info.input_set_conf.op = RTE_ETH_INPUT_SET_ADD; > ritorno = rte_eth_dev_filter_ctrl(port_num, RTE_ETH_FILTER_HASH, > RTE_ETH_FILTER_SET, &info); > if (ritorno < 0) > { >     printf("Failure: set add ipv4 tcp (dst ipv4) for port %hhu\n", > port_num); > } > > // hash global config ipv4 tcp > memset(&info, 0, sizeof (info)); > info.info_type = RTE_ETH_HASH_FILTER_GLOBAL_CONFIG; > info.info.global_conf.hash_func = RTE_ETH_HASH_FUNCTION_DEFAULT; > ftype = RTE_ETH_FLOW_NONFRAG_IPV4_TCP; > idx = ftype / UINT64_BIT; > offset = ftype % UINT64_BIT; > info.info.global_conf.valid_bit_mask[idx] |= (1ULL << offset); > info.info.global_conf.sym_hash_enable_mask[idx] |= (1ULL << offset); > ritorno = rte_eth_dev_filter_ctrl(port_num, RTE_ETH_FILTER_HASH, > RTE_ETH_FILTER_SET, &info); > if (ritorno < 0) > { >     printf("Cannot set global hash configurations for port %hhu proto > ipv4 tcp\n", port_num); > } > > retval = rte_eth_dev_start(port_num); > if (retval < 0) return retval; > > Even turning on rx debug for i40e doesn't help. > > can anyone help me? > > Thank you > > Matteo > > >