From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua0-f173.google.com (mail-ua0-f173.google.com [209.85.217.173]) by dpdk.org (Postfix) with ESMTP id 67457325A for ; Mon, 18 Sep 2017 14:26:10 +0200 (CEST) Received: by mail-ua0-f173.google.com with SMTP id s15so192321uag.1 for ; Mon, 18 Sep 2017 05:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nm57meX1mnl0Uwl8yqkcdTq3v/RzfH0Ya+pa/SkuPgc=; b=KIHxJD63soykJoVAVaqM5pubLEKZ1tKkvi928ZKFInmlUz9gi43TMiwOu80L5X3PZW UPP8vXbakJYXyxbCFUPLT88qfgGB+1MjMHadGt6jZ2M0tkz6rKLQvRn2Y1ST+SFh1p5f Y8U6I8LrPZkABEQFySrKeEJa2ds8Lu+D+oVgAkcdRg/qcfZzinDfapzQHy4YNauYeZnr nQ6XuuDNomz6CSjg1RdWvK1BSPJUl5UihmmzLy859Cd2+TvyoP1E1ey0HdNOaP8Jipft B3cDCky75SJIE31NExbIFdM4Y8bs2IMykVI0HUSH09iyijNtetHn4V9p640E4kJ5I4Tz z2QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nm57meX1mnl0Uwl8yqkcdTq3v/RzfH0Ya+pa/SkuPgc=; b=QLCzNDmplPo24CvEdki3fxV8E7kk4nhWdr/9ujcXA/42LjiWFfh5v0TCFePykGCACi ltfTI8JFjHlXgxgmhlcYN2UOPl8cTLfxk2pvJbLc3oppwALccr8M7EtrfnhXtuMHM2fF QGQVn0bv3STTE48GvphG9VzEx2EOH43XGGO3vcfBfg5n9R3mKufPS4a607kANjDnxjy+ +CkkAPhJKCReGXagFXE9EB9bsHO+fJS2ELuKL+L63eB1YDupjcH00IxKoaF1hZxzOugA cvuuHkeTBZsVGk6FkY3lTQ7bf2EiMxbEtA6cHo9op5TTNbyi2eYcZVXySjCsRPebnHaG TlLw== X-Gm-Message-State: AHPjjUgSOjitAkSWW90axXbfEmGuq5B+rC4EIyFC6YwU/5NnI3T0GqXz /PgT6OZjior3az8HLn3DW/dxd2BJWJrfEAXUM3bPPw== X-Google-Smtp-Source: AOwi7QBzrHfL+LNAJ9YMybFYI6FJJeWwdkXCDK7Mebyo4+mDudwalllJs/XOL1vMOYPgMvL5qd5i9rVnburAQbvrMx0= X-Received: by 10.176.19.231 with SMTP id n36mr5504467uae.68.1505737569511; Mon, 18 Sep 2017 05:26:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.64.70 with HTTP; Mon, 18 Sep 2017 05:26:08 -0700 (PDT) In-Reply-To: References: From: george.dit@gmail.com Date: Mon, 18 Sep 2017 05:26:08 -0700 Message-ID: To: Shahaf Shuler Cc: "users@dpdk.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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 12:26:10 -0000 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. 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 On Thu, Sep 14, 2017 at 4:37 AM, wrote: > Hi Shahaf, > > Thanks for the information, I am looking into it :) > I had some compilation issues when trying to port rte_flow from DPDK 17.02 > into an external application but these issues go away if I use 17.08. > > Best regards, > Georgios > > On Thu, Sep 14, 2017 at 3:26 AM, Shahaf Shuler > wrote: > >> Hi Georgios, >> >> Wednesday, September 13, 2017 11:09 AM, Georgios Katsikas: >> > Hi all, >> > >> > I would like to implement a DPDK application that dumps a set of rules >> to a >> > Mellanox ConnectX-5 NIC and starts a number of threads (each on a >> > different >> > core) that receive the classified packets according to the rules. >> > The rules are of the form src IP X and dst IP Y --> Send to core Z. >> > >> > Is there such an application (or similar) in the source tree? >> >> You can use testpmd for that. Run in isolate mode and add rte_flow rules >> to direct IP packets to the specific queue that you want. >> >> > Does the Mellanox >> > NIC require any special treatment or is there a unified API to do this >> job >> > regardless of the NIC? >> >> There Is a unified API. look into rte_flow: >> http://dpdk.org/doc/guides/prog_guide/rte_flow.html >> >> > Which DPDK version do you propose? >> >> The latest one - v17.08 >> >> > >> > Thanks, >> > -- >> > Georgios Katsikas >> > Industrial Ph.D. Student >> > Network Intelligence Group >> > Decision, Networks, and Analytics (DNA) Lab RISE SICS >> > E-Mail: georgios.katsikas@ri.se >> > > > > -- > Georgios Katsikas > Industrial Ph.D. Student > Network Intelligence Group > Decision, Networks, and Analytics (DNA) Lab > RISE SICS > E-Mail: georgios.katsikas@ri.se > -- Georgios Katsikas Industrial Ph.D. Student Network Intelligence Group Decision, Networks, and Analytics (DNA) Lab RISE SICS E-Mail: georgios.katsikas@ri.se