From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpcmd0756.aruba.it (smtpcmd0756.aruba.it [62.149.156.56]) by dpdk.org (Postfix) with ESMTP id 66B095F0D for ; Tue, 2 Oct 2018 19:19:18 +0200 (CEST) Received: from LANZUISI-NBK ([93.146.250.201]) by smtpcmd07.ad.aruba.it with bizsmtp id ihKG1y0084MU9Ql01hKHZe; Tue, 02 Oct 2018 19:19:18 +0200 Received: from [172.16.17.68] by LANZUISI-NBK (PGP Universal service); Tue, 02 Oct 2018 19:19:19 +0100 X-PGP-Universal: processed; by LANZUISI-NBK on Tue, 02 Oct 2018 19:19:19 +0100 To: "dev@dpdk.org" From: Matteo Lanzuisi Message-ID: <384bb9db-1023-65f7-6d18-f1311db9228a@resi.it> Date: Tue, 2 Oct 2018 19:19:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: it DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aruba.it; s=a1; t=1538500758; bh=9rLAPhvQPnd3R06I87AZFwxwOxRBk1ds1tckpSAcJrg=; h=To:From:Subject:Date:MIME-Version:Content-Type; b=lykFEt0TrnH6KT6HNIVO/VORY/qO2ICRz/uSTu9TefCo8Z9If+XrCGulokENyI2ic ZNzePI78houaCPgiTvNeEN2zFkZs8i6o7CuK+HQXqLuUIGtxn9/GZ70xpJ5q3ea3nd ydyZcv1dREg+JUiJhzKRNbYrZdCfcroM3HxIp4pBMiuRxRZCBDa7tguczRQOezHYPD 82gGkqiKkc1/TmSQJBSKt9Mvwf2E0t+8XTiGALXEPCgvDifygK+6oUMzef++93wHpq KaipcLsJGQvRlUf+lEUK6LLxeFetSeDci5HBydROveXvh3fqAZZHt8ib6wWTIMzUAU KEeofJnwBX79w== Subject: [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: Tue, 02 Oct 2018 17:19:18 -0000 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