From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it1-f177.google.com (mail-it1-f177.google.com [209.85.166.177]) by dpdk.org (Postfix) with ESMTP id 1B84A1B434 for ; Thu, 22 Nov 2018 14:59:16 +0100 (CET) Received: by mail-it1-f177.google.com with SMTP id a205-v6so14219555itd.4 for ; Thu, 22 Nov 2018 05:59:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=druidsoftware.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=vbFG9vU0dv0hjqSnoBZUNsNxPGeDk3v5m6X+Q3pbaZY=; b=Rjr0XMqY6JAhf1zu0JW04ig6vFFvzdZ7sRa9s8b0dgdeJjhPazIcK+bMqmAV/uY2Gh Q8luPzBXKQVZnw9CwcnfFlJNPMbtRoUr7641I5M7B+vV+kaDtO0rxISg2mJ6FQzz3lmY 8Zd/A7shfKvljHkdIL3AllhQO3yZ/pmsk7gXfiUBfk4IGWTJfTrQPeyjP28buUFTYz7Q RFeNYjKUHKI6jbOF4Ahu08DCth6xE30hRL6dHQ4CxAiysHhcDWcEAa9iixXGI2kW8Hzf BDk2RDQDQrIjSoPsI49LigTiwK7ZvliV7g0yOWm++ITsem+gv6Bb/slY1HCmBvpxp2c7 HdwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=vbFG9vU0dv0hjqSnoBZUNsNxPGeDk3v5m6X+Q3pbaZY=; b=EgBqOqFR3ZZqht2EQUri0GYb8QYqqO3UdE7ZQ9QPonaDdB5Gi6P7eiQCIkiOUyQ0fC Enb0wH4AFUkD987DqCOh4PoGGqlGK+ooYw/DccTvFmmGH3N3r8Ad+NLDpVGxsRSk5+qv oC50vcfHEFyCs7Pdpu/An0CMcmHG3oHrqs7CGhQxy4UmCG6ITGkgpfWIsDvyT2EQ39Ly SUF+iFQgRRRREmpXnfzkFHF1KIIDPCHc0AwL4oqtkYL6T3En+L8mQ8ah2WdaDdMqDiQ7 WoCktcLOfvrWJ0rxHZGD8PGkYGXOQLOfejbR/5lOi0OXFHgXvtC8RXg3ZOSFIuNkVpIM oY2Q== X-Gm-Message-State: AA+aEWZaz7Ric6FwyzRkfejv6udz8BKB7VXrEp0OAo1IrvX2uOf+R8ym br8GjC+MaCoPoqL2pSBphQlszfyEWNU9SGdrIIWTU6LTAdSE0A== X-Google-Smtp-Source: AJdET5fFfnqdaf88PTKD0e3a2HYcsWpYD5DKS38y3BFRP/lzSw9MueCtCGTeCdmn6rFdttyFXAENSehqRxPY1eIVchM= X-Received: by 2002:a05:660c:385:: with SMTP id x5mr8475085itj.64.1542895155133; Thu, 22 Nov 2018 05:59:15 -0800 (PST) MIME-Version: 1.0 From: Olivier Deme Date: Thu, 22 Nov 2018 13:59:04 +0000 Message-ID: To: users@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] rte_flow not working with XL710 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 13:59:16 -0000 Hi, I have a DPDK using 2lcores for packet switching. I have configured 2 RX queues on a single port. Each thread calls rte_eth_rx_burst to receive packets on its own RX queue. So thread 0 calls rte_eth_rx_burst on RX queue 0, and thread 1 calls rte_eth_rx_burst on RX queue 1. I then try to force packets with a particular destination IPv4 to be directed to queue 1. However, no matter what I try, these packets (along with any other) are always received on queue 0, resulting on the first lcore being busy, and the second lcore being idle. I am using the XL710 NIC. Here is the code that tries to setup the rte_flow to force the above IP traffic to queue 1: /* In this code, thread_nbr = 1 and filters->dst_ipv4 is set to a specific IP address */ struct rte_flow* flow; struct rte_flow_attr attr; struct rte_flow_item pattern[4]; struct rte_flow_action action[4]; struct rte_flow_action_queue queue = { .index = thread_nbr }; // struct rte_flow_item_eth eth_spec; // struct rte_flow_item_eth eth_mask; struct rte_flow_item_ipv4 ip_spec; struct rte_flow_item_ipv4 ip_mask; // struct rte_flow_item_vlan vlan_spec; // struct rte_flow_item_vlan vlan_mask; int pattern_count = 0; struct rte_flow_error error; memset(&attr, 0, sizeof(attr)); memset(pattern, 0, sizeof(pattern)); memset(action, 0, sizeof(action)); attr.ingress = 1; /* * create the action sequence. * one action only, move packet to queue */ action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE; action[0].conf = &queue; action[1].type = RTE_FLOW_ACTION_TYPE_END; /* * set the first level of the pattern (eth). * since in this example we just want to get the * ipv4 we set this level to allow all. */ memset(ð_spec, 0, sizeof(struct rte_flow_item_eth)); memset(ð_mask, 0, sizeof(struct rte_flow_item_eth)); eth_spec.type = 0; pattern[pattern_count].type = RTE_FLOW_ITEM_TYPE_ETH; pattern[pattern_count].spec = ð_spec; pattern[pattern_count].mask = ð_mask; ++pattern_count; /* * setting the second level of the pattern (vlan). * since in this example we just want to get the * ipv4 we also set this level to allow all. */ memset(&vlan_spec, 0, sizeof(struct rte_flow_item_vlan)); memset(&vlan_mask, 0, sizeof(struct rte_flow_item_vlan)); pattern[pattern_count].type = RTE_FLOW_ITEM_TYPE_VLAN; pattern[pattern_count].spec = &vlan_spec; pattern[pattern_count].mask = &vlan_mask; ++pattern_count; /* * setting the third level of the pattern (ip). * in this example this is the level we care about * so we set it according to the parameters. */ memset(&ip_spec, 0, sizeof(struct rte_flow_item_ipv4)); memset(&ip_mask, 0, sizeof(struct rte_flow_item_ipv4)); if (filters->dst_ipv4) { ip_spec.hdr.dst_addr = htonl(filters->dst_ipv4); ip_mask.hdr.dst_addr = 0xFFFFFFFF; pattern[pattern_count].type = RTE_FLOW_ITEM_TYPE_IPV4; pattern[pattern_count].spec = &ip_spec; pattern[pattern_count].mask = &ip_mask; ++pattern_count; } /* the final level must be always type end */ pattern[pattern_count].type = RTE_FLOW_ITEM_TYPE_END; if (rte_flow_validate(port->port_id, &attr, pattern, action, &error) != 0) { return NULL; } if ((flow = rte_flow_create(port->port_id, &attr, pattern, action, &error)) == NULL) { return NULL; } return flow; The above code runs successfully, however I keep receiving the targeted packets on queue 0, instead of queue 1. Is there a problem with this code? Many thanks for your help!