From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by dpdk.org (Postfix) with ESMTP id B67474CA0 for ; Fri, 21 Sep 2018 21:20:40 +0200 (CEST) Received: by mail-lj1-f195.google.com with SMTP id p6-v6so12825659ljc.5 for ; Fri, 21 Sep 2018 12:20:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=+DdBYhNu+xxVuD6QmzvdC9sCxNyd1PF7SjO+EXL2vrU=; b=agvdDR/XgnVuoGQWyyHTDn3ZT8MFnxTrkBz7B4S/tAnkP2hf4Ia+S5LzxwhGJ3ZD0O 6qNtBfcbTT1nsYc/fEeft2Utjlf2Lj/Q5aQc04FSs4VpMCTSDQgbZObzXVic05814Rok N7zbpnCl5rRPV2iV/xEOKdiCjDqoMC9WIPMrQajjFSGKR7KoTxmv0NRz447NmtBlyPkr WJgtJpmi24KdwsVeomEl943/0SRkqNMxanPj/n9dbytffHmLV+YqNsiwXXuLrvlR974e F9WWMkZ+3oj0N72Qn7dSmx9o7GJQbyFG4lNTQnQnmUZ/o+prTCrzZx0ba8pVowNQOWUg P6Rw== 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=+DdBYhNu+xxVuD6QmzvdC9sCxNyd1PF7SjO+EXL2vrU=; b=pKlBwD9H3grB95I3jV1Ie7hwbxYAlqxtie6UMSj2zUZ4soXmsOPdFVNCWI3kXw3D83 YrRxwPZVz2ASiXgdPhglKwJBT9f7TZ558Z/Nty9U/zOL0n7oYUSAxU/LjlR77N/AdabI kWvCMLL6ViUaXrGdhn7rnI0u0xSE5cjBPgJFIMAIqwc5Vw9rOECDv0SOdh2kh27atwFv Oo96+M90wmQxPsrs8zkT7mSEAsVENKAOeYP1AEzpM7y8qPum1XoWCumstp1MPsaSfFMJ jzQzAlUqC5LRcA+xyZo0WJCZ4WAdTsdIvqDqDJwNl1GN+j2EliDiYhGyOX02hjvwKIVT 3KGg== X-Gm-Message-State: ABuFfohqYVmxnwUu00ovTx0U8xPPGmouGUSb4+/yAhPnPhHr6JHT4wWo u5tVHhPZtAr1Hd/KG6dZ+BT+BMsRFgs1GwHsiDGbKnq0 X-Google-Smtp-Source: ANB0VdawzBgDS1BywdJSPFZLVYqxCjBIYV8taXGlHWF/7e7tSP3/fF63/ZLOWOsX8BBanY7xIKpJy1wDuWTZjQlix38= X-Received: by 2002:a2e:658a:: with SMTP id e10-v6mr2955913ljf.99.1537557639602; Fri, 21 Sep 2018 12:20:39 -0700 (PDT) MIME-Version: 1.0 From: Arvind Narayanan Date: Fri, 21 Sep 2018 14:20:27 -0500 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 MARK action with Mellanox 100G Card to offload flow tagging to HW 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: Fri, 21 Sep 2018 19:20:40 -0000 Hi, I am trying to use rte_flow's MARK action to set hash.fdir.hi field with whatever I set via rte_flow action. I adapt the flow_filtering example and create another function which takes 3 actions. I have also checked out this blog post and my implementation is similar to theirs. I am able to create the flow without any error, however when I pass the packets, hash.fdir.hi field in rte_mbuf is not set nor is mb->ol_flags & PKT_RX_FDIR_ID set. Am I missing anything here? RTE_LOG(INFO, MM, "Index %d (%d.%d) found by HW\n", bufs[i]->hash.fdir.hi, bufs[i]->hash.fdir.hi >> 1, bufs[i]->hash.fdir.hi & 1); stdout: MM: Index -1 (2147483647.1) found by HW Dell R620 with Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz (6 cores) NIC: Mellanox ConnectX-5 EN 100G (MCX516A-CDAT) Only one socket is there. HT is disabled. isolcpus=1-5 DPDK 18.08 Ubuntu 16.04 LTS Driver MLNX_OFED_LINUX-4.4-2.0.7.0-ubuntu16.04-x86_64 was installed For more information, this is function I use to set the MARK field (or install the rte_flow rule). struct rte_flow * generate_ipv4_flow_tag(uint16_t port_id, uint16_t rx_q, uint32_t src_ip, uint32_t src_mask, uint32_t dest_ip, uint32_t dest_mask, uint32_t tag, struct rte_flow_error *error) { struct rte_flow_attr attr; struct rte_flow_item pattern[MAX_PATTERN_NUM]; struct rte_flow_action action[MAX_PATTERN_NUM]; struct rte_flow *flow = NULL; struct rte_flow_action_queue queue = { .index = rx_q }; struct rte_flow_action_mark mark = { .id = tag }; 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; int res; memset(pattern, 0, sizeof(pattern)); memset(action, 0, sizeof(action)); /* * set the rule attribute. * in this case only ingress packets will be checked. */ memset(&attr, 0, sizeof(struct rte_flow_attr)); 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_MARK; action[1].conf = &mark; action[2].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; eth_mask.type = 0; pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH; pattern[0].spec = ð_spec; pattern[0].mask = ð_mask; /* * 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)); ip_spec.hdr.dst_addr = htonl(dest_ip); ip_mask.hdr.dst_addr = dest_mask; ip_spec.hdr.src_addr = htonl(src_ip); ip_mask.hdr.src_addr = src_mask; pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV4; pattern[1].spec = &ip_spec; pattern[1].mask = &ip_mask; /* the final level must be always type end */ pattern[2].type = RTE_FLOW_ITEM_TYPE_END; res = rte_flow_validate(port_id, &attr, pattern, action, error); if (!res) flow = rte_flow_create(port_id, &attr, pattern, action, error); return flow; } Can anyone please help me with what I may be missing? Thanks, Arvind