From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f181.google.com (mail-wr0-f181.google.com [209.85.128.181]) by dpdk.org (Postfix) with ESMTP id A2883237 for ; Mon, 18 Sep 2017 15:20:07 +0200 (CEST) Received: by mail-wr0-f181.google.com with SMTP id l39so451302wrl.12 for ; Mon, 18 Sep 2017 06:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=c3QtyDBTKsnDHjInKjZKTxPvuUZEoNYHURqZQzxkZ2Y=; b=z5Gvx0tFccNRYhIg3hKbqB+SnwO3v7jz8FlyXQ16T8OgX9UBxZduFGU/n6xfH5MfLQ Q7o4pLED8+sQDe0w+DDnxDvBi4Yr5tJ6qW7+AUpxHmV9PZxN/sWq369iWuf3h8Er6kRl U93qnnlJAkWlt9kYfSXuCXtWPMSvgUp1GC64xygpnbexj48qu7j0PrCcz+GDyZGtmrDS jnTeEF3pmskiGrK4f4MQwAkEjwHopdpxl5ofLxUElPW6uKkYJiDj4DC9pA77ZG4e7kfT KZijLbkrBgnNaphUUUQwJPwCNWqeQU/EkVoTmb4c4DpAJojN5ivP7TjdiO/QJdr2FJmx /dDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=c3QtyDBTKsnDHjInKjZKTxPvuUZEoNYHURqZQzxkZ2Y=; b=nZ1g7SviR4IaCYgohutyGHzGyRW0iL7PfJQsmhTXmu56OXC52IhF7/N8AOgN6oiAhm 0YEd9k+5bDjXYqhTuopNVrVHSNdCLYN8kZy9yfyb3Qarl37sN7wJxNvRf2P7i3wVc184 q0FXqwoW0hZ4s9TGX64ySwvkz/9fJcmXbkSEmt9vWAM1IDpBkoUaHIt0gQvd3UxhOu7i irkO77CkqCfEyyqMDtsFOTdek3JosuBG+mdiQeBsggwoBbJFoNXzTl5Ux/hszSNmG7z4 kJ/Ct6VI0BDfmEasd2dZWvycwL/l+7QjIPYdEBltzgHOust42OpklpuN7p1ZMC1kjqBD nsoQ== X-Gm-Message-State: AHPjjUjSsd3ProYqWluwszHoKmh7xcGu70tfW+4zkziJ82MnEMav1/Ub hn7E3IFcnkn+EJNk X-Google-Smtp-Source: ADKCNb4Je0huCXsUtbUdONlWmnwHJjYFokYYeJVZqh31TTYQyXkj9hNH2cm/C457Gko9l0RoAX39tg== X-Received: by 10.223.134.23 with SMTP id 23mr28252118wrv.93.1505740807305; Mon, 18 Sep 2017 06:20:07 -0700 (PDT) Received: from shalom (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id x5sm6622838wre.18.2017.09.18.06.20.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Sep 2017 06:20:06 -0700 (PDT) Date: Mon, 18 Sep 2017 15:20:56 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: george.dit@gmail.com Cc: Shahaf Shuler , "users@dpdk.org" Message-ID: <20170918132054.twz6ba3xnhubhpc4@shalom> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-users] DPDK application that sends rules to the NIC 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: Mon, 18 Sep 2017 13:20:07 -0000 Hi Georgios, On Mon, Sep 18, 2017 at 05:26:08AM -0700, george.dit@gmail.com wrote: > Dear all, > > I am implementing my own DPDK application to program a Mellanox NIC (mlx5 > driver) but I have some issues. > Specifically I compose a simple rule that matches only the Ethernet > header's type field using value 800 (Ethernet frames that encapsulate IPv4 > packets). > Then I compose an action RTE_FLOW_ACTION_TYPE_QUEUE which redirects the > matched packets to queue index 0. > > Using test-pmd, this rule is: "flow create 0 ingress pattern eth type is > 800 / end actions queue index 0 / end" and I get a "Flow rule #0 created" > message. > In my application I compose the same rule using: > > PATTERNS > > struct rte_flow_item_eth flow_item_eth_type_ipv4 = { > .dst = { > .addr_bytes = { 0 } > }, > .src = { > .addr_bytes = { 0 } > }, > .type = RTE_BE16(ETHER_TYPE_IPv4) // from rte_ether.h > }; > > struct rte_flow_item_eth flow_item_eth_mask_type_ipv4 = { > .dst = { > .addr_bytes = { 0 } > }, > .src = { > .addr_bytes = { 0 } > }, > .type = 0xFFFF > // match only the 'type' filed > }; > > struct rte_flow_item patterns[] = { > { > .type = RTE_FLOW_ITEM_TYPE_ETH, > .spec = &flow_item_eth_type_ipv4, > .last = NULL, > .mask = &flow_item_eth_mask_type_ipv4, > }, > { > .type = RTE_FLOW_ITEM_TYPE_END, > .spec = NULL, > .last = NULL, > .mask = NULL, > } > }; > > ACTIONS > > struct rte_flow_action_queue queue_conf; > queue_conf.index = 0; > > struct rte_flow_action actions[] = > { > { > .type = RTE_FLOW_ACTION_TYPE_QUEUE, > .conf = &queue_conf > }, > { > .type = RTE_FLOW_ACTION_TYPE_END, > .conf = NULL > } > }; > > PROBLEM > > When I pass this rule to rte_flow_validate(...) it is successfully > validated, but rte_flow_create() crashes although it get the very same > arguments. Can you explain a little more what do you mean by "crash" ? > If I replace my Mellanox NIC with an Intel 82599 (using DPDK's ixgbe > driver), then the validate function returns error: "Caught error type 9 > (specific pattern item): Not supported by L2 tunnel filter". > The error reported by the Intel driver is weird because there is no > tunneling. > > I guess some value assignments require strict format and are sensitive > (e.g., big/little endian) so I would really appreciate your help. > > Thanks in advance and best regards, > Georgios With so few informations it is not easy to help, from the code above I don't see anything wrong. To help can you answer the following points: - which version of DPDK are you using, - which version of MLNX_OFED, - Is it possible to share your snippet of code (just the pattern/action allocation) ? Regards, -- Nélio Laranjeiro 6WIND