From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 77498A0096 for ; Thu, 9 May 2019 05:51:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0FA7637B7; Thu, 9 May 2019 05:51:24 +0200 (CEST) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id 3F7F02C2B for ; Thu, 9 May 2019 05:51:22 +0200 (CEST) Received: by mail-pg1-f194.google.com with SMTP id j26so471710pgl.5 for ; Wed, 08 May 2019 20:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=csie-io.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=yTMxKYLXAcE4aembzC5aUwKva1PwpqbwO94fCVrkF2c=; b=GVa/Dx7HcYhTi02lmz1v3+ZQEGkiTI3Kae4m9H9bHvDPGz+RtVGo3B94RyRLo0my32 m/mCsyiRousBUuckDoQxnE4z5h4RCXmbVCKrJzGYGQ7XKuVSBmk6qH8SbDLXcmj9CbHv 7GjXoadMpKLTLoHUmBnedVHUVT1EodHbathYixyukCrj2L9dfQBvjHdgrkpUj8xAKjdl ASO99wcTRficup/Ly36uQ4xxGXwlhIJfN2JphyQsXHOSrJ3ESyaWW5snJsuAbsEglur1 MFVE5lE82kZ//E+PW2fUo0jNqxStZD1nV/RPxriXz3kWS7HraEw0FuOjWhDnNmFHVeYS 1YCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=yTMxKYLXAcE4aembzC5aUwKva1PwpqbwO94fCVrkF2c=; b=O8BSrMLL0wkY0G2MEmbJ1OQwtaEaQ2NI902nUPGohRIRzIhMENO2vezTWGKvgItwAy g4dfhv3/AqMBvMK72dqBlb1jHhC4m3Ei377iJZun1TncdhAOYGJfZ05BB7mvjNmCoGs0 9bV/f9wa51nUwHuNr0mZtryZKdQan6gNA+1TUBurAhqGm01rHi2LKSq5HqyBD0rdx3Bo Gh2wsaZrg5/FKSoKkWRwwM9HAKvpwSb70P2BGo2YAwCAv7FA0J15LnvQYs0AWjW2Cb1O 6Gho1Y6Eq00QYqglvgQJ7BMvvDqz7Q8qPYOloVumscyW5xE6RsCDEn+/ECHHNF9PRI6r fgeg== X-Gm-Message-State: APjAAAVhvILUWL85Lx17bnpGyp6mSgWJgFVItCXpDGmGsLgWLKimSV2k wNd5/rVWauh5XhAhseMB90F4xg== X-Google-Smtp-Source: APXvYqyNXyicg5PW8BXBZrFtOIG6jJ/u32P/X5VHW5XwIkQuQJIdXNLe58MdGfIgyWho3SHtsxUIpQ== X-Received: by 2002:a62:d5c9:: with SMTP id d192mr1932457pfg.109.1557373881497; Wed, 08 May 2019 20:51:21 -0700 (PDT) Received: from 2001-b400-e3de-a3cb-a8a3-d6d2-f469-8b9e.emome-ip6.hinet.net (2001-b400-e3de-a3cb-a8a3-d6d2-f469-8b9e.emome-ip6.hinet.net. [2001:b400:e3de:a3cb:a8a3:d6d2:f469:8b9e]) by smtp.gmail.com with ESMTPSA id n64sm1029684pfb.38.2019.05.08.20.51.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 May 2019 20:51:20 -0700 (PDT) From: =?utf-8?B?5pu+5oe35oGp?= Message-Id: <859A28C4-16C1-4397-9326-A3BEDB1AD73E@csie.io> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Date: Thu, 9 May 2019 11:51:14 +0800 In-Reply-To: Cc: users@dpdk.org To: =?utf-8?B?5by15pWs5piK?= References: X-Mailer: Apple Mail (2.3445.104.8) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] Flow director struct rte_flow_item_raw guild 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: , Errors-To: users-bounces@dpdk.org Sender: "users" Hi, =E6=95=AC=E6=98=8A, Sorry for my question is not clear. My question is, should I declare a variable to store the bytes I want to = filter and just assign it to the pattern element? Therefore, will the result of init flow filter be like=20 struct rte_flow_item_raw raw_spec, raw_mask;=20 uint8_t spec[12] =3D = {0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01};=20 uint8_t mask[12] =3D = {0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff}; *(uint32_t *)&raw_spec =3D 0x40000000; raw_spec.offset =3D 12; raw_spec.limit =3D 12; raw_spec.length =3D 24; raw_spec.pattern =3D spec; raw_mask.pattern =3D mask; pattern[0].type =3D RTE_FLOW_ITEM_TYPE_RAW; pattern[0].spec =3D &raw_spec; pattern[0].mask =3D &raw_mask; if i want to filter out icmp packet? thanks a lot. Best Regards, > =E5=BC=B5=E6=95=AC=E6=98=8A =E6=96=BC 2019=E5=B9=B45=E6=9C= =889=E6=97=A5 =E4=B8=8A=E5=8D=8810:10 =E5=AF=AB=E9=81=93=EF=BC=9A >=20 > Hi =E6=87=B7=E6=81=A9, >=20 > On the second line of the detailed description of the struct reference = , it says > "Matches a byte string of a given length at a given offset." >=20 > I think pattern is the byte string to look for. >=20 > Regards, > Frank >=20 > On Thu, May 9, 2019 at 10:01 AM =E6=9B=BE=E6=87=B7=E6=81=A9 = > wrote: >=20 > Hi,=20 >=20 > I have a few questions about structure rte_flow_item_raw. >=20 > In DPDK API doc, it shows there are some below elements in this = structure >=20 > uint32_t relative:1 > uint32_t search:1 > uint32_t reserved:30 > int32_t offset > uint16_t limit > uint16_t length > const uint8_t * pattern >=20 > Now I can understand the relative and search elements are used to = determine search type. >=20 > The offset element is used to set the start search point in packet. >=20 > The limit element is used to set the end search point in packet. >=20 > However, I can=E2=80=99t understand what the pattern element is used = to? >=20 > What kind of pointer should I assign to the pattern element? >=20 > Besides, in other rte_flow_item_* structures, there are clearly = elements to let user to set contents and masks. >=20 > How do I do in the structure rte_flow_item_raw? >=20 > Thanks a lot, >=20 > Best Regards, >=20 >=20 >=20 > --=20 > =E5=BC=B5=E6=95=AC=E6=98=8A Frank Chang > Email: frank@csie.io > https://frankchang.me >=20 > High Speed Network Lab > National Chiao Tung University