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 DDA28A0096 for ; Fri, 10 May 2019 15:44:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4CA705F0D; Fri, 10 May 2019 15:44:31 +0200 (CEST) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by dpdk.org (Postfix) with ESMTP id E99C15B2E for ; Fri, 10 May 2019 15:44:29 +0200 (CEST) Received: by mail-wr1-f52.google.com with SMTP id o4so8009572wra.3 for ; Fri, 10 May 2019 06:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=ayy0ofTjs8knTqwwPNMuVR5d+tu/n4e18Q1Tp/IIDoA=; b=gZw3Kuq/MxffywchhNloWOGfN5N5KlfzK7yF7kPDUXKMtUmEby8i5mD96BPgCeBMCN 2DmPduPYYPszPOHe7dzPK4NsuE78OdeGyrOOZ4T+8T+MUFt+bTMEIqGNt2xsp314cs1G guk3cXTnGXUp2MSPbvGQyYeNIPoHK6Dicnp6+1jMsFiZyys7vt+9Uokwq0zv0s2TlQdS +hc22OdZmBVMSI6DOMS6kdeL+/CZZUFCGh4w+uqW2Z+gMMohPOv2XLrSo4vQs1EiRpKu 3f20T8OkANu4Vzed6maGSquIBfy4FJmXLuWt62b0i9jOAnFOQBlX/o32Dis/HgOoNjYl rG6Q== 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; bh=ayy0ofTjs8knTqwwPNMuVR5d+tu/n4e18Q1Tp/IIDoA=; b=Toj7eaMlHKKMLeBs15z1guMF7dAbjLG8ydoXMf39108Oiv3TN0TdcUGcoUKHtQWRHz /7YEoJ8y7JkpefE+xJqG34b9PaKczw8U4hJYNLmdpvFaoq5lpB/4ABDr6OlmdMZfFKxR kN1W9W90ZA1cE9HA96c5z4Zsl8mtIHWlXNQqHr/qDxUl+2yCv+o4dvfVRWM6GY1cYbKZ ZNQzEbjYXTcVZHMAlzuCsU1LfZnaIUglutWqCXyqP/dWJ5VUbgfY2eLCHGBMsismRQOr fUTi+1t+oyZH0W5yG8HGktrfT4P6bIAGBLFQYfXM2VABtsOMB3ruogD4my9FaDw2IuMB YILQ== X-Gm-Message-State: APjAAAWfakUDvuBBYxD1pNrW15unPAl9HzDJcgN25S1gcj46pZxS8ULw FWYz7vf6R8ssg8Cf7Vd/aTYNsbcXHDYtFA== X-Google-Smtp-Source: APXvYqzAGhcO0d5n/ho8cOvVsWNx2RMwu67s8Ovl0hmKMfOIRQ35t6WBJUxZV6fGpDYnNPeCYfD+Sw== X-Received: by 2002:adf:f74a:: with SMTP id z10mr7350517wrp.291.1557495869743; Fri, 10 May 2019 06:44:29 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id a20sm12454833wrf.37.2019.05.10.06.44.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 May 2019 06:44:28 -0700 (PDT) Date: Fri, 10 May 2019 15:44:27 +0200 From: Adrien Mazarguil To: =?utf-8?B?5pu+5oe35oGp?= Cc: =?utf-8?B?5by15pWs5piK?= , users@dpdk.org Message-ID: <20190510134427.GG4284@6wind.com> References: <859A28C4-16C1-4397-9326-A3BEDB1AD73E@csie.io> <20190509123833.GF4284@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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" On Fri, May 10, 2019 at 02:38:56PM +0800, 曾懷恩 wrote: > Hi Adrien, thanks for reply and explanation > > I can understand the principle now. > > However, I try to merge your rewriting code to mine and the ICMP packets seem not to fit this rule. > > My ethernet card is Connectx-4 lx. Bad news then, you can't match ICMP using RAW pattern items with mlx5 yet. According to "git grep -l RTE_FLOW_ITEM_TYPE_RAW drivers/net" so far only e1000/igb, enic, i40e, ixgbe and softnic PMDs provide some form of support for RTE_FLOW_ITEM_RAW. > Can you give me some suggestion? Since RTE_FLOW_ITEM_TYPE_ICMP is neither supported by mlx5, how about directly matching the protocol field inside IPv4 headers? struct rte_flow_item_ipv4 item_ipv4[] = { { .hdr.next_proto_id = 0x01, }, { .hdr.next_proto_id = 0xff, }, }; struct rte_flow_pattern pattern[] = { { .type = RTE_FLOW_ITEM_TYPE_IPV4, .spec = &item_ipv4[0], .mask = &item_ipv4[1], }, { .type = RTE_FLOW_ITEM_TYPE_END, }, }; Should be all it takes to match ICMPv4 packets. Compared to the RAW approach, this one should also match ICMP traffic inside recognized VLAN, QinQ and tunnel types (e.g. VXLAN) at no extra cost. -- Adrien Mazarguil 6WIND