From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9794CC5B57D for ; Fri, 5 Jul 2019 08:58:41 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 2F934218BA for ; Fri, 5 Jul 2019 08:58:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=6wind.com header.i=@6wind.com header.b="MY/2laS2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F934218BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=6wind.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1E1091B9D5; Fri, 5 Jul 2019 10:58:40 +0200 (CEST) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id A4A3A1B96B for ; Fri, 5 Jul 2019 10:58:38 +0200 (CEST) Received: by mail-wm1-f65.google.com with SMTP id x15so8027388wmj.3 for ; Fri, 05 Jul 2019 01:58:38 -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:in-reply-to; bh=rFJpmCU5EMVeFuDN1byXjQZg4DTHVkrK0wBVLQaGidU=; b=MY/2laS2AN5yeuqnDzQpNzVW2qiE0ujUo6jc+hs17qmobmwdoBAEyRRUv7bZv0LUEb etrnwRcYn80LCTY+X2NloaXAoORoVAklsdeAP+3AsQKHa311LUwgDu+p4SwEPD+VRfVh E/ZZD1DUVwp27FAQLm3itw61piNJt39V5wnIKUVohOU44hFFnIECIietmMv7VoAi39/r UowkzxLekZ4q/YKN79jZ0VPCWKtOYX3jzmK0mPHcvKGTLNUKWCXgIFlpc9AUO/gc6P2e 52WHkgKMFUN3wqHCwFrR4/a8R6nw6/1UfRg7UIhIoVeENLa6MEfmRGhbHGSu70OsMhYY nuNA== 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:in-reply-to; bh=rFJpmCU5EMVeFuDN1byXjQZg4DTHVkrK0wBVLQaGidU=; b=CrW50TI39NyjQwZ6z4y8v+nxYznGCaAqXHUDElNxjI21RuZacdoYZw117xtdGCbqJX 7tuuaKzYXKqzv87kbmAJzPGOFQacyGGgPL58iR9DvQaw0G+YV+Mmk38Ud87m3HzhRUfg R2YA7Gz/zxQ0r5jb8kbSVWmPMZwHyKRchBBQrhXlgy+8oTQjuy21WH6dQ4l3bXF7b/io qhJvweqCfqjqhNvMH+meX/DBK1xGuvaqZpQVfNYkQ0mhub/MmoGKOXRuPB1u67mxYYj+ 2C1d5cQovfv8f5IpjR9evfDlXgF/c6w/bx79ilqRxS77a1layjuy27eE6qSDpGqAg5R1 B4JA== X-Gm-Message-State: APjAAAWFj55WaxrjCJxz2Brk0/HT8PhEW7Ru1sWFdPBYLMmN1Iwlbjie PjpwyrErL8zyNHQBDlys6Rpz2Q== X-Google-Smtp-Source: APXvYqzPHEf3ySgi/k0EnFLUeNZp2ChcC5eAUiGMc/7ABPlcbhoOseCx1RL38I4NFTSG+OVpWJpg4w== X-Received: by 2002:a1c:60c3:: with SMTP id u186mr2443113wmb.79.1562317117264; Fri, 05 Jul 2019 01:58:37 -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 w14sm7384805wrt.51.2019.07.05.01.58.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 01:58:36 -0700 (PDT) Date: Fri, 5 Jul 2019 10:58:35 +0200 From: Adrien Mazarguil To: Xiaoyu Min Cc: orika@mellanox.com, viacheslavo@mellanox.com, Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic , dev@dpdk.org Message-ID: <20190705085835.GQ4512@6wind.com> References: <20190624154018.128379-1-jackmin@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v6 4/4] app/testpmd: match GRE's key and present bits X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jul 05, 2019 at 10:14:45AM +0800, Xiaoyu Min wrote: > support matching on GRE key and present bits (C,K,S) > > example testpmd command could be: > testpmd>flow create 0 ingress group 1 pattern eth / ipv4 / > gre / gre_key value is 0x12345678 / end > actions rss queues 1 0 end / mark id 196 / end > > Which will match GRE packet with k present bit set and key value is > 0x12345678. > > Acked-by: Ori Kam > Signed-off-by: Xiaoyu Min A few more nits below. [...] > @@ -1898,6 +1915,50 @@ static const struct token token_list[] = { > .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gre, > protocol)), > }, > + [ITEM_GRE_C_RSVD0_VER] = { > + .name = "c_rsvd0_ver", > + .help = "GRE's first word (bit0 - bit15)", Help strings on existing fields should ideally be the same as their counterparts in rte_flow.h (shortened if necessary, not starting with a cap and not ending "."), in this case for instance: .help = "checksum (1b), undefined (1b), key bit (1b)," " sequence number (1b), reserved 0 (9b)," " version (3b)", > + .next = NEXT(item_gre, NEXT_ENTRY(UNSIGNED), item_param), > + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gre, > + c_rsvd0_ver)), > + }, > + [ITEM_GRE_C_BIT] = { > + .name = "c_bit", > + .help = "GRE's C present bit", A bit odd, here's a suggestion: "checksum bit (C)". > + .next = NEXT(item_gre, NEXT_ENTRY(BOOLEAN), item_param), > + .args = ARGS(ARGS_ENTRY_MASK_HTON(struct rte_flow_item_gre, > + c_rsvd0_ver, > + "\x80\x00\x00\x00")), > + }, > + [ITEM_GRE_S_BIT] = { > + .name = "s_bit", > + .help = "GRE's S present bit", Ditto: "sequence number bit (S)" > + .next = NEXT(item_gre, NEXT_ENTRY(BOOLEAN), item_param), > + .args = ARGS(ARGS_ENTRY_MASK_HTON(struct rte_flow_item_gre, > + c_rsvd0_ver, > + "\x10\x00\x00\x00")), > + }, > + [ITEM_GRE_K_BIT] = { > + .name = "k_bit", > + .help = "GRE's K present bit", Ditto: "key bit (K)" > + .next = NEXT(item_gre, NEXT_ENTRY(BOOLEAN), item_param), > + .args = ARGS(ARGS_ENTRY_MASK_HTON(struct rte_flow_item_gre, > + c_rsvd0_ver, > + "\x20\x00\x00\x00")), > + }, > + [ITEM_GRE_KEY] = { > + .name = "gre_key", > + .help = "match GRE Key", Nit: no caps for "Key" => "match GRE key" > + .priv = PRIV_ITEM(GRE_KEY, sizeof(rte_be32_t)), > + .next = NEXT(item_gre_key), > + .call = parse_vc, > + }, > + [ITEM_GRE_KEY_VALUE] = { > + .name = "value", > + .help = "GRE key value", No need to repeat "GRE" here since it's already in GRE context: "key value" > + .next = NEXT(item_gre_key, NEXT_ENTRY(UNSIGNED), item_param), > + .args = ARGS(ARG_ENTRY_HTON(rte_be32_t)), > + }, Also ITEM_GRE_KEY and ITEM_GRE_KEY_VALUE should come after ITEM_META_DATA to keep the same order as everywhere else. Then assuming all the suggested changes are made: Acked-by: Adrien Mazarguil Note I did not look at mlx5 patches, please make sure someone has reviewed them. Thanks. -- Adrien Mazarguil 6WIND