From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 72B71A0542; Wed, 26 Oct 2022 10:45:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63B6640A7F; Wed, 26 Oct 2022 10:45:23 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 41D05400D6 for ; Wed, 26 Oct 2022 10:45:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666773921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+AUzbpijjoxqT9WlVCg1yirbg05C/6w0kvsXMWM8hGk=; b=CXATGurj48VP1Ij3493wnMH1WOTLi+BkOMqufqA5ywcXdMp70wk7jozSbLpauCUPzx0Yil g26z325Mdyfl7B/xxwgNWWbVVkZaXwnSGCgnWDE4M9mQeKS4UxtDaQM6hM/oPZ3Zl8eFdP 03Yx4EOfWHwcfTuySzf/SF53u5zuni4= Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-64-qpIpZ_1mOrKLDYx_Ze0TWA-1; Wed, 26 Oct 2022 04:45:16 -0400 X-MC-Unique: qpIpZ_1mOrKLDYx_Ze0TWA-1 Received: by mail-pj1-f69.google.com with SMTP id n9-20020a17090a2bc900b0021010dca313so5671128pje.7 for ; Wed, 26 Oct 2022 01:45:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+AUzbpijjoxqT9WlVCg1yirbg05C/6w0kvsXMWM8hGk=; b=tJ9mL9yZRh+WuBQcRnFeIRN8VcoK9eVaJzFYybab53//JorCbZQ/lrY7JwVSsKzJaU 1XxtdD5Afr3uPvFrE2Nqpmo9BV8R4fsO/et7kQbdec05P+tamuxDECaVFwOTjriNJ4DX dJR0+2fyTSAAyrrIe/YElGc/pVRBYspyxbzyFHIQ/AgY3f8cpDHOMl1mu3r2dWcoJE0z Kj0WzwdLjAwo262OGSAGIF3Go8RXr9I5c6eAmkc/qRMkD7vNpt1rStEWRHl2W12xFksV rQgEwLAIogI05KzBUV8GMbXi0pGQmki/a2MdQQ3YCGQNhtWPPZM116IeZJvxu9wVjbuQ vVxw== X-Gm-Message-State: ACrzQf3/mv+P99OAT356TZVXMcb/7HfFa57lzDtUFKKeJz8hmaRaXhEc q2JVKCkJ2TTvNasit445xL7y0mpduD5x6fpjDmRsQ+A2qqhpy53lr0eBYGKnPZwbUSuW6HMSUE2 PhpoqXqB6wTyp8eX55Ng= X-Received: by 2002:a17:902:7786:b0:178:48c0:a083 with SMTP id o6-20020a170902778600b0017848c0a083mr43596635pll.125.1666773915226; Wed, 26 Oct 2022 01:45:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6UmlvHbtqTL1zJejEpfgELaz/3hkGDWoIm+ro//bbw6WcE2y3Nll9lc7YuWfOM7JpPYYZDk4DI/gl3KCU9m3A= X-Received: by 2002:a17:902:7786:b0:178:48c0:a083 with SMTP id o6-20020a170902778600b0017848c0a083mr43596606pll.125.1666773914972; Wed, 26 Oct 2022 01:45:14 -0700 (PDT) MIME-Version: 1.0 References: <20221025214410.715864-1-thomas@monjalon.net> <20221025214410.715864-5-thomas@monjalon.net> In-Reply-To: <20221025214410.715864-5-thomas@monjalon.net> From: David Marchand Date: Wed, 26 Oct 2022 10:45:03 +0200 Message-ID: Subject: Re: [PATCH 4/8] ethdev: use GRE protocol struct for flow matching To: Thomas Monjalon Cc: dev@dpdk.org, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru, Wisam Jaddo , Ori Kam , Aman Singh , Yuying Zhang , Ajit Khaparde , Somnath Kotur , Hemant Agrawal , Sachin Saxena , Matan Azrad , Viacheslav Ovsiienko X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Oct 25, 2022 at 11:45 PM Thomas Monjalon wrote: > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h > index 6045a352ae..fd9be56e31 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -1069,19 +1069,29 @@ static const struct rte_flow_item_mpls rte_flow_item_mpls_mask = { > * > * Matches a GRE header. > */ > +RTE_STD_C11 > struct rte_flow_item_gre { > - /** > - * Checksum (1b), reserved 0 (12b), version (3b). > - * Refer to RFC 2784. > - */ > - rte_be16_t c_rsvd0_ver; > - rte_be16_t protocol; /**< Protocol type. */ > + union { > + struct { > + /* > + * These are old fields kept for compatibility. > + * Please prefer hdr field below. > + */ > + /** > + * Checksum (1b), reserved 0 (12b), version (3b). > + * Refer to RFC 2784. > + */ > + rte_be16_t c_rsvd0_ver; > + rte_be16_t protocol; /**< Protocol type. */ > + }; > + struct rte_gre_hdr hdr; /**< GRE header definition. */ > + }; > }; > > /** Default mask for RTE_FLOW_ITEM_TYPE_GRE. */ > #ifndef __cplusplus > static const struct rte_flow_item_gre rte_flow_item_gre_mask = { > - .protocol = RTE_BE16(0xffff), > + .hdr.proto = RTE_BE16(UINT16_MAX), The proto field in struct rte_gre_hdr from lib/net lacks endianness annotation. This triggers a sparse warning (from OVS dpdk-latest build): /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:1095:22: error: incorrect type in initializer (different base types) /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:1095:22: expected unsigned short [usertype] proto /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h:1095:22: got restricted ovs_be16 [usertype] -- David Marchand