From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by dpdk.org (Postfix) with ESMTP id A00DC2F4F for ; Thu, 19 Jul 2018 08:18:46 +0200 (CEST) Received: by mail-oi0-f50.google.com with SMTP id k12-v6so13419268oiw.8 for ; Wed, 18 Jul 2018 23:18:46 -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=XcFv03EtSr5vUHB6zWyehZledK0T//gItunfR1udaRI=; b=aTo0m+ZcGPeO36aSKhMC2dxo7FRYoRnVrMrZuydBc3uwMbtWlPzwSsFjkDQmuCKSQ4 vLk+vJ2G4ObxsO6JNaX28OjTFxFsn7GwxfOeRx4HpOaGc+xL6eE/zJwuJolf7/RgjIAX fphtujI8yB+wqfqekkVMKHmq7gECS9Ay7g11XP3xahRMgmvc1yVuNmAZJFGk2KT7D+MV iYjolCHlYoMEd5QmVJeJVMEZJDaRI+tqnWm/ib2+YT3c6khYnSOJ/SnrtTtDPOjgQaJD JYqI7hY/vouhSf+tReslNcgWkY+h7+OdfrYFoK+LpUesebVJMWaaGstRYJ1rivVEBvMt /u4w== 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=XcFv03EtSr5vUHB6zWyehZledK0T//gItunfR1udaRI=; b=YdnTKLx41IoIkJJuGGD7YTJxxf86ApRfTJzS3QGDsjwGqUmgZZu4QBciQzkCX/5dAL 0e3MZZNUBxQs/MgFlbfcpB40TOeSkJPDKeiJO0YROixJi2jB64F1K0KGGC/JKDgW3eNm TT+Vtpa1BsK5L2AIzMJkjFfxYh9TJ/vXzZuH7M3FINn2mJk5wHwiEkqcyjgJ8V+WH4WD Oc1dnjkrSTecU9mkGhNNwZWzUb/pOngmdB69ZCv9eXMIHrZJ0F/VIBXpv3ARtqo0kQUd mfJxbECbS7udqPh2OlX1m3hT+EZr+paNu35VCI0E3/8EWV2uBqbdyin9dQkoVP6xzDDF pdjg== X-Gm-Message-State: AOUpUlGkFOYF2VPg4QZYhijOw61ZHSZNTqHvFQQmfmqkvN9Zkv3SjAVE 5vviVZScU/IHrzs/tboCvaAO0woqCvuWvp97twOLCw== X-Google-Smtp-Source: AAOMgpfHZ5dDY22mGOG2B2JdxRs1xcMGydkZ2SjS9LbQeF4l0pVI/lRWPgTg2bZGCkyTkQJ9Pk3wdRnxvIvUuQP8wiQ= X-Received: by 2002:aca:ceca:: with SMTP id e193-v6mr8979241oig.37.1531981125650; Wed, 18 Jul 2018 23:18:45 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:1584:0:0:0:0:0 with HTTP; Wed, 18 Jul 2018 23:18:45 -0700 (PDT) From: waqas ahmed Date: Thu, 19 Jul 2018 11:18:45 +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] Flow Director RAW filter: Not supported action!!! 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, 19 Jul 2018 06:18:47 -0000 Greetings, we are modifying dpdk sample *flow_filtering* app to extend its functionality to add Flow Director RAW filter. this filter is used to direct rtp traffic to specifc rx-queue. RAW filter is based on searching first 2-bytes of RTP header values in UDP payload. before this we have added two filters successfully to separate igmp and udp traffic on basis of their ip-protocol numbers 0x2 and 0x11 respectively. NIC in use: 82599ES 10g ================================================== OUTPUT of app: ---------------------------------------------------------------------------------------------------- EAL: Detected 8 lcore(s) EAL: Multi-process socket /var/run/.rte_unix EAL: Probing VFIO support... EAL: PCI device 0000:01:00.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:10c9 net_e1000_igb EAL: PCI device 0000:01:00.1 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:10c9 net_e1000_igb EAL: PCI device 0000:05:00.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:10fb net_ixgbe EAL: PCI device 0000:05:00.1 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:10fb net_ixgbe :: initializing port: 0 :: initializing port: 0 done *Flow can't be created 11 message: Not supported action.EAL: Error - exiting with code: 1 Cause: error in creating flow* ================================================== RAW filter function is given below ---------------------------------------------------------------------------------------------------- ..... // start of function struct rte_flow_attr attr; struct rte_flow_item pattern[5]; struct rte_flow_action action[5]; struct rte_flow *flow = NULL; struct rte_flow_action_queue queue = { .index = rx_q }; struct rte_flow_item_eth eth_spec; struct rte_flow_item_eth eth_mask; struct rte_flow_item_vlan vlan_spec; struct rte_flow_item_vlan vlan_mask; struct rte_flow_item_ipv4 ip_spec; struct rte_flow_item_ipv4 ip_mask; struct rte_flow_item_udp udp_spec; struct rte_flow_item_udp udp_mask; struct rte_flow_item_raw raw_spec; struct rte_flow_item_raw raw_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_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 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[1].type = RTE_FLOW_ITEM_TYPE_VLAN; pattern[1].spec = &vlan_spec; pattern[1].mask = &vlan_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 = 0x0; //dest_mask; ip_spec.hdr.src_addr = htonl(src_ip); ip_mask.hdr.src_addr = 0x0; //src_mask; ip_spec.hdr.next_proto_id = 0x11; ip_mask.hdr.next_proto_id = 0xff; pattern[2].type = RTE_FLOW_ITEM_TYPE_IPV4; pattern[2].spec = &ip_spec; pattern[2].mask = &ip_mask; memset(&udp_spec, 0, sizeof(struct rte_flow_item_udp)); memset(&udp_mask, 0, sizeof(struct rte_flow_item_udp)); pattern[2].type = RTE_FLOW_ITEM_TYPE_UDP; pattern[2].spec = &udp_spec; pattern[2].mask = &udp_mask; memset(&raw_spec, 0, sizeof(struct rte_flow_item_raw)); memset(&raw_mask, 0, sizeof(struct rte_flow_item_raw)); pattern[3].type = RTE_FLOW_ITEM_TYPE_RAW; pattern[3].spec = &raw_spec; pattern[3].mask = &raw_mask; raw_spec.relative = 1; raw_spec.search = 1; raw_spec.reserved = 0; raw_spec.offset = 10; raw_spec.length = 2; raw_spec.pattern[0] ='8'; raw_spec.pattern[1] ='0'; /* the final level must be always type end */ pattern[4].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; ======================================================= Thanks for reading & help is much appreciated Ahmed