From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by dpdk.org (Postfix) with ESMTP id AD2A01B2E6 for ; Tue, 3 Oct 2017 10:56:59 +0200 (CEST) Received: by mail-oi0-f53.google.com with SMTP id v9so987810oif.13 for ; Tue, 03 Oct 2017 01:56:59 -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=KvoUmjNj9FcR2xY/P/inFgEAd1bcUlda9apQmwPgdSE=; b=pd29/KKf4VMI1ctAdL02TZknmsYN4SXpZb864kRmsKD8euHaqeRVoCvoy+lX76Fbkk htB1tKXZFOCCCjZD7R+u2GkaW1X4v3lfS1cdjuvcrXmXTYTAo1qA0uv4TJokpgnkRY2M JofWGKVVGAMiqzxGaRbc28GanGikN17T9nnVzuR+GCX8JcgD6Zrzk0ohwEqWZDrMehpB KEOtpFER/xswdkI8cCcZZZr8BMYTUEsopYlJq8DhE0EiFIOslz4u62NqK3UJnrmRLzGE lHmj4CBDiJHfMwINbVaByzoKGHrx8upVc7z/a8fF3j52Uz5Y3H6SlHdAVj3NgZY9FfP3 lTnA== 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=KvoUmjNj9FcR2xY/P/inFgEAd1bcUlda9apQmwPgdSE=; b=qjifMZZpgjUjzI4FpZr1OO+wO59sa1SXxWEG5h5I1EOGgForcmHda8oOBvG6W3Qxoc 7Gilkn7a0tY9eOXMK1njsXwqhgRtt4IH6L0vGgKJBnBcSAbKXHXGj6GyxAGWxgsL59Ua Xk/rauG0Ttwmwok1CUD148qpn0TqgzKtFM+1S1tNlsUG5wfbcL8r5e7+fCI/3pNXmSCk NF008gwf84BZE94afUzDLQ58LdByhk6Wt/DCuqSYS+FHAYMGPk4xkiVZwVCkptjYzHHT jiA87E5m50oGumwTp19UmxGedGnu4LNnTbjJ+P/JxJKTAUS2fgz1/BFXTurxjssXJiVJ U53A== X-Gm-Message-State: AMCzsaWaBBhZU7b/+3p9VjaavbvYS80WxlVZqepdVBeG8+OGWcjknL5G 0npQwpVpaOMjPmACmexz2BpRywazMJ22GFO7u3o= X-Google-Smtp-Source: AOwi7QCZey18lL0R4PkPgyEPHYppnG4i/UJXxaq/9SWDvvVLJl65FMr8GmOxkZJLEytjixUuMo44QiHvTL5T6nvq5Mw= X-Received: by 10.202.79.75 with SMTP id d72mr8738331oib.117.1507021018978; Tue, 03 Oct 2017 01:56:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.83.193 with HTTP; Tue, 3 Oct 2017 01:56:58 -0700 (PDT) In-Reply-To: <20171002122737.GK3871@6wind.com> References: <1506565054-67690-1-git-send-email-beilei.xing@intel.com> <1506662342-18966-1-git-send-email-beilei.xing@intel.com> <1506662342-18966-5-git-send-email-beilei.xing@intel.com> <94479800C636CB44BD422CB454846E0132038E26@SHSMSX101.ccr.corp.intel.com> <20171002122737.GK3871@6wind.com> From: Sean Harte Date: Tue, 3 Oct 2017 09:56:58 +0100 Message-ID: To: Adrien Mazarguil Cc: "Xing, Beilei" , "Wu, Jingjing" , "Chilikin, Andrey" , "dev@dpdk.org" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v6 4/8] ethdev: add GTP items to support flow API 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: , X-List-Received-Date: Tue, 03 Oct 2017 08:57:00 -0000 On 2 October 2017 at 13:27, Adrien Mazarguil wrote: > On Fri, Sep 29, 2017 at 10:29:55AM +0100, Sean Harte wrote: >> On 29 September 2017 at 09:54, Xing, Beilei wrote: > >> >> > /** >> >> > + * RTE_FLOW_ITEM_TYPE_GTP. >> >> > + * >> >> > + * Matches a GTPv1 header. >> >> > + */ >> >> > +struct rte_flow_item_gtp { >> >> > + /** >> >> > + * Version (3b), protocol type (1b), reserved (1b), >> >> > + * Extension header flag (1b), >> >> > + * Sequence number flag (1b), >> >> > + * N-PDU number flag (1b). >> >> > + */ >> >> > + uint8_t v_pt_rsv_flags; >> >> > + uint8_t msg_type; /**< Message type. */ >> >> > + rte_be16_t msg_len; /**< Message length. */ >> >> > + rte_be32_t teid; /**< Tunnel endpoint identifier. */ }; >> >> >> >> In future, you might add support for GTPv2 (which is used since LTE). >> >> Maybe this structure should have v1 in its name to avoid confusion? >> > >> > I considered it before. But I think we can modify it when we support GTPv2 in future, and keep concise 'GTP' currently:) since I have described it matches v1 header. >> > >> >> You could rename v_pt_rsv_flags to version_flags to avoid some future >> code changes to support GTPv2. There's still the issue that not all >> GTPv2 messages have a TEID though. > > Although they have the same size, the header of these two protocols > obviously differs. My suggestion would be to go with a separate GTPv2 > pattern item using its own dedicated structure instead. > > -- > Adrien Mazarguil > 6WIND The 1st four bytes are the same (flags in first byte have different meanings, but the bits indicating the version are in the same location). After that, different fields in each version are optional, and the headers have variable size. A single structure could be used if the first field is renamed to something like "version_flags", and then check that the teid field in item->mask is not set if ((version_flags >> 5 == 2) && ((version_flags >> 4) & 1) == 1). If there's going to be two structures, it would be good to put v1 and v2 in the names, in my opinion.