From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by dpdk.org (Postfix) with ESMTP id BDDD12B91 for ; Fri, 9 Jun 2017 15:38:58 +0200 (CEST) Received: by mail-wr0-f178.google.com with SMTP id v104so33516004wrb.0 for ; Fri, 09 Jun 2017 06:38:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=/mGonwkNxmfCGY74fGlfjHQERxBRBW3qJnChDKWDJQM=; b=jKvBKaTBgj2Mllk9ACJk1qZnWtdn7G2N7giQzUQE/uRjabokeOr+9OD30QQwjl7tO0 6PPxTHNdGC4gcE0vHOzDOXD7ncJoHDmNY+0vNLfLrFJq51mX9kb7mwPmewB3pcFS7N/7 6fJqG/NodFt8GqJAiGqVPJ5qOEtf+vkEzpleuGZ17Lwk2T4VEAFwzYeBFU4usxCE1rT/ pYF67qNNJo8RzQ5Nz6ueNb/z04mi5sEcwRI22cKWgqxAwxVxYm1o6gqIOvtU5mTaxA2o 5fCCYf2yfKKoOoJEVy7Bk19uS4rj/m/IGgwtMGx7UbG3GL6SpZsXurx47bd3vB9+Ii9j c/ug== 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:subject:message-id:mime-version :content-transfer-encoding; bh=/mGonwkNxmfCGY74fGlfjHQERxBRBW3qJnChDKWDJQM=; b=PfH+42kM/z6PFVCx8QUjtxve3dbcPmqRW+yIP9yF0722V+KTx2v75TLa5FdMuSAHSo FnR23qu5oScndd+qTdMbcjteS09/66WCbbAR7FfYAsfwOlVxQ0cODY9MBQu/rwZpXw9O n1fQFnRggR02kwJ/JD9pLJhjO+r+9s2iv0frhLwV9BJv5/d6Lb5E0az+jgXooyolUXzY 7IhHO+OH+gbVM+oXae66Km7HfCeGIT/DmgO+SB6vYKMhOn+6SwNNlvwPHaSli3PlgGnN E+PyZy6mRcmlrtdYblrqvyUoHAUDOP8UbdoAdN0oO8Hy/YStQdLGTl5BBSe5XFQQC4Rx b7vA== X-Gm-Message-State: AKS2vOyuZFEVTDQpnJozwTUDjZ5CWmB6j5EeL9J/8gSgE9eC32vw/pcd MdnlG5TVQquN8JmxR5I= X-Received: by 10.28.153.143 with SMTP id b137mr7625934wme.15.1497015537556; Fri, 09 Jun 2017 06:38:57 -0700 (PDT) Received: from platinum (2a01cb0c03c651000226b0fffeed02fc.ipv6.abo.wanadoo.fr. [2a01:cb0c:3c6:5100:226:b0ff:feed:2fc]) by smtp.gmail.com with ESMTPSA id y41sm1573698wrd.59.2017.06.09.06.38.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Jun 2017 06:38:57 -0700 (PDT) Date: Fri, 9 Jun 2017 15:38:55 +0200 From: Olivier Matz To: dev@dpdk.org Message-ID: <20170609153855.01ce0e67@platinum> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] about PKT_RX_VLAN_PKT mbuf flag 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: Fri, 09 Jun 2017 13:38:59 -0000 Hi, After a discussion on the ML [1][2], the commit b37b528d95 ("mbuf: add new Rx flags for stripped VLAN") [3] marked the mbuf flag PKT_RX_VLAN_PKT as deprecated, because its behavior was not consistent among drivers. It has been partially replaced by PKT_RX_VLAN_STRIPPED which is better defined. The flag was kept for 2 reasons: - let the applications and PMDs move to the new flag - let the ixgbe driver (maybe others?) implement a new way to do Rx vlan offload without vlan strip. A future work was planned to do the cleanup, but it was never done. Searching for this flag in the source shows that some PMDs still use the old flag although it is deprecated. We need to clean this up. I propose the following, which should not hurt apps or PMDs too much, knowing PKT_RX_VLAN_PKT is deprecated since 16.07: Replace all occurences of PKT_RX_VLAN_PKT by a new flag PKT_RX_VLAN_SAVED. The meaning of this new flag is: "the vlan tci is saved in mbuf metadata". When PKT_RX_VLAN_STRIPPED is present, PKT_RX_VLAN_SAVED is implied. About the RTE_PTYPE_L2_ETHER_VLAN packet type, and as described in rte_mbuf_ptype.h, "the packet type gives information about the data carried by the mbuf". It means that the packet type must not be set to RTE_PTYPE_L2_ETHER_VLAN if the vlan was stripped. Examples: - Ether/Vlan/IP packet is received vlan stripping is off the resulting mbuf data contains Ether/Vlan/IP PKT_RX_VLAN_SAVED may be set, in this case m->vlan_tci contains the id of the vlan ptype is set to RTE_PTYPE_L2_ETHER_VLAN if supported - Ether/Vlan/IP packet is received vlan stripping is on the resulting mbuf data contains Ether/IP PKT_RX_VLAN_STRIPPED is set and m->vlan_tci contains the id of the vlan which was stripped PKT_RX_VLAN_SAVED may be set, but anyway it is implied by PKT_RX_VLAN_STRIPPED ptype is set to RTE_PTYPE_L2_ETHER Comments are welcome. PKT_RX_VLAN_SAVED is probably not the best names, ideas are welcome. Olivier [1] http://dpdk.org/ml/archives/dev/2016-April/037837.html [2] http://dpdk.org/ml/archives/dev/2016-June/041068.html [3] http://dpdk.org/browse/dpdk/commit/?id=b37b528d957c