From patchwork Wed Oct 23 13:39:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 61768 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F73E1C1CA; Wed, 23 Oct 2019 15:40:17 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 046471C1DB for ; Wed, 23 Oct 2019 15:40:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571838013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=deOg2MRc8VvOMYV5z/7d4Rfbm4/4tAfvjvqx+0raDvY=; b=PfsJJMzXwDQK4SZOqJBKeAOKCEwz2OBGjaot99eIsqgCedIQgJ7LwJgTbUuB2oQvA3H4ht aAKKscUQVfsVOsUQXUMLx5+ZSDQO8cpu5+VbU0GKtmvKcoIEU0ysYfNWn/XrOSZwNvLM6D NCHO4/XGwDdchTiEdH4+q+cw5RT6+S0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-104-FEhM6W8oOROxQIhf9-MgRQ-1; Wed, 23 Oct 2019 09:40:10 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B4E58107AD31; Wed, 23 Oct 2019 13:40:09 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-129.brq.redhat.com [10.40.204.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3F3060C80; Wed, 23 Oct 2019 13:40:08 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: olivier.matz@6wind.com, ferruh.yigit@intel.com Date: Wed, 23 Oct 2019 15:39:58 +0200 Message-Id: <1571838001-591-2-git-send-email-david.marchand@redhat.com> In-Reply-To: <1571838001-591-1-git-send-email-david.marchand@redhat.com> References: <1571820718-7021-1-git-send-email-david.marchand@redhat.com> <1571838001-591-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: FEhM6W8oOROxQIhf9-MgRQ-1 X-Mimecast-Spam-Score: 0 Subject: [dpdk-dev] [PATCH v2 1/4] doc: add note on prefixing ESP tail structure 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" Fixes: 7dde68cf0e13 ("net: add missing rte prefix for ESP tail") Signed-off-by: David Marchand --- doc/guides/rel_notes/release_19_11.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst index 40121b9..d63413b 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -162,6 +162,8 @@ API Changes Also, make sure to start the actual text at the margin. ========================================================= +* The network structure ``esp_tail`` has been prefixed by ``rte_``. + * ethdev: changed ``rte_eth_dev_infos_get`` return value from ``void`` to ``int`` to provide a way to report various error conditions. From patchwork Wed Oct 23 13:39:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 61769 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 860E11C217; Wed, 23 Oct 2019 15:40:21 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 84CCE1C1E4 for ; Wed, 23 Oct 2019 15:40:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571838015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AvNHgoFR7RrM3yoiE5csA0oa172XfhmjgufprosRAiY=; b=UfC1t32YIr8GJScXzo/7F9vFO/UIZVx8ovWfz9+4a5j8dPOQovp2jDdRQ0J7sdTtKlwcMh aPV0tZ/2igij6vEEKw+qqS0A4fGWQy9B5Qv2nrqrgHIiuMZjqGazILeZO1QHJwYwHfM1dg 37zmbPNgPDu2Rqdmmy1f/iVi6+5tfJM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-310-uAzk3DI6OxKTT7xg3vwJQg-1; Wed, 23 Oct 2019 09:40:12 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 641AA5ED; Wed, 23 Oct 2019 13:40:11 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-129.brq.redhat.com [10.40.204.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E78760F82; Wed, 23 Oct 2019 13:40:09 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: olivier.matz@6wind.com, ferruh.yigit@intel.com, stable@dpdk.org Date: Wed, 23 Oct 2019 15:39:59 +0200 Message-Id: <1571838001-591-3-git-send-email-david.marchand@redhat.com> In-Reply-To: <1571838001-591-1-git-send-email-david.marchand@redhat.com> References: <1571820718-7021-1-git-send-email-david.marchand@redhat.com> <1571838001-591-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: uAzk3DI6OxKTT7xg3vwJQg-1 X-Mimecast-Spam-Score: 0 Subject: [dpdk-dev] [PATCH v2 2/4] net: add missing rte prefix on PPPoE defines 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" Those two defines have been missed. Fixes: 35b2d13fd6fd ("net: add rte prefix to ether defines") Cc: stable@dpdk.org Signed-off-by: David Marchand --- Changelog since v1: - added missing update on release notes, --- doc/guides/rel_notes/release_19_11.rst | 2 ++ lib/librte_net/rte_ether.h | 4 ++-- lib/librte_pipeline/rte_table_action.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst index d63413b..e97d2cc 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -164,6 +164,8 @@ API Changes * The network structure ``esp_tail`` has been prefixed by ``rte_``. +* The network definitions of PPPoE ethertypes have been prefixed by ``RTE_``. + * ethdev: changed ``rte_eth_dev_infos_get`` return value from ``void`` to ``int`` to provide a way to report various error conditions. diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index aca56aa..29d80ab 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -302,8 +302,8 @@ struct rte_vxlan_hdr { #define RTE_ETHER_TYPE_RARP 0x8035 /**< Reverse Arp Protocol. */ #define RTE_ETHER_TYPE_VLAN 0x8100 /**< IEEE 802.1Q VLAN tagging. */ #define RTE_ETHER_TYPE_QINQ 0x88A8 /**< IEEE 802.1ad QinQ tagging. */ -#define ETHER_TYPE_PPPOE_DISCOVERY 0x8863 /**< PPPoE Discovery Stage. */ -#define ETHER_TYPE_PPPOE_SESSION 0x8864 /**< PPPoE Session Stage. */ +#define RTE_ETHER_TYPE_PPPOE_DISCOVERY 0x8863 /**< PPPoE Discovery Stage. */ +#define RTE_ETHER_TYPE_PPPOE_SESSION 0x8864 /**< PPPoE Session Stage. */ #define RTE_ETHER_TYPE_ETAG 0x893F /**< IEEE 802.1BR E-Tag. */ #define RTE_ETHER_TYPE_1588 0x88F7 /**< IEEE 802.1AS 1588 Precise Time Protocol. */ diff --git a/lib/librte_pipeline/rte_table_action.c b/lib/librte_pipeline/rte_table_action.c index 47d7efb..45dde71 100644 --- a/lib/librte_pipeline/rte_table_action.c +++ b/lib/librte_pipeline/rte_table_action.c @@ -696,7 +696,7 @@ encap_qinq_pppoe_apply(void *data, d->cvlan.vlan_tci = rte_htons(VLAN(p->qinq.cvlan.pcp, p->qinq.cvlan.dei, p->qinq.cvlan.vid)); - d->cvlan.eth_proto = rte_htons(ETHER_TYPE_PPPOE_SESSION); + d->cvlan.eth_proto = rte_htons(RTE_ETHER_TYPE_PPPOE_SESSION); /* PPPoE and PPP*/ d->pppoe_ppp.ver_type_code = rte_htons(0x1100); @@ -747,7 +747,7 @@ encap_pppoe_apply(void *data, /* Ethernet */ rte_ether_addr_copy(&p->pppoe.ether.da, &d->ether.d_addr); rte_ether_addr_copy(&p->pppoe.ether.sa, &d->ether.s_addr); - d->ether.ether_type = rte_htons(ETHER_TYPE_PPPOE_SESSION); + d->ether.ether_type = rte_htons(RTE_ETHER_TYPE_PPPOE_SESSION); /* PPPoE and PPP*/ d->pppoe_ppp.ver_type_code = rte_htons(0x1100); From patchwork Wed Oct 23 13:40:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 61771 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EDE5F1C1DA; Wed, 23 Oct 2019 15:40:28 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 1CB351C1AD for ; Wed, 23 Oct 2019 15:40:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571838018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vE7CyjMLivQFphUU6CP6OjEaqVRmj9YydCyHuLzr/UA=; b=Kr5NS81mMWRzccLixW0kMu+KgOrhXjAgpSIHSGyJUMIYB/V+JPWvzwxHnXMF06s6vnxx7v BjCl9FazmbB5bRHnN9iYqeqSWY6p1d+d0kN8mjBPxdXRYw/9Hog3UdOoaD0s0HqvoeJH95 +SAuhXNrGbe9wvjEBfmopeyKQWSXfy0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-1-mhiak2bjPVeQdnKXLkZ8IQ-1; Wed, 23 Oct 2019 09:40:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1440380183E; Wed, 23 Oct 2019 13:40:13 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-129.brq.redhat.com [10.40.204.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id C3B7E60BE1; Wed, 23 Oct 2019 13:40:11 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: olivier.matz@6wind.com, ferruh.yigit@intel.com, stable@dpdk.org Date: Wed, 23 Oct 2019 15:40:00 +0200 Message-Id: <1571838001-591-4-git-send-email-david.marchand@redhat.com> In-Reply-To: <1571838001-591-1-git-send-email-david.marchand@redhat.com> References: <1571820718-7021-1-git-send-email-david.marchand@redhat.com> <1571838001-591-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: mhiak2bjPVeQdnKXLkZ8IQ-1 X-Mimecast-Spam-Score: 0 Subject: [dpdk-dev] [PATCH v2 3/4] net: add rte prefix to MPLS structure 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" Add 'rte_' prefix to structures: - rename struct mpls_hdr as struct rte_mpls_hdr. Cc: stable@dpdk.org Signed-off-by: David Marchand --- Changelog since v1: - added missing update on release notes, --- doc/guides/rel_notes/release_19_11.rst | 2 ++ lib/librte_net/rte_mpls.h | 2 +- lib/librte_net/rte_net.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst index e97d2cc..e7752e5 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -166,6 +166,8 @@ API Changes * The network definitions of PPPoE ethertypes have been prefixed by ``RTE_``. +* The network structure for MPLS has been prefixed by ``rte_``. + * ethdev: changed ``rte_eth_dev_infos_get`` return value from ``void`` to ``int`` to provide a way to report various error conditions. diff --git a/lib/librte_net/rte_mpls.h b/lib/librte_net/rte_mpls.h index 11d26ba..32b6431 100644 --- a/lib/librte_net/rte_mpls.h +++ b/lib/librte_net/rte_mpls.h @@ -21,7 +21,7 @@ extern "C" { /** * MPLS header. */ -struct mpls_hdr { +struct rte_mpls_hdr { uint16_t tag_msb; /**< Label(msb). */ #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN uint8_t tag_lsb:4; /**< Label(lsb). */ diff --git a/lib/librte_net/rte_net.c b/lib/librte_net/rte_net.c index dfccbbf..6f45b13 100644 --- a/lib/librte_net/rte_net.c +++ b/lib/librte_net/rte_net.c @@ -278,8 +278,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, } else if ((proto == rte_cpu_to_be_16(RTE_ETHER_TYPE_MPLS)) || (proto == rte_cpu_to_be_16(RTE_ETHER_TYPE_MPLSM))) { unsigned int i; - const struct mpls_hdr *mh; - struct mpls_hdr mh_copy; + const struct rte_mpls_hdr *mh; + struct rte_mpls_hdr mh_copy; #define MAX_MPLS_HDR 5 for (i = 0; i < MAX_MPLS_HDR; i++) { From patchwork Wed Oct 23 13:40:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 61770 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 384AF1C223; Wed, 23 Oct 2019 15:40:24 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 329A21C1EB for ; Wed, 23 Oct 2019 15:40:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571838016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g+5B1UYFHIsxGkM8HrmuYQYCm8Azt/MEmJOfDJGBKwI=; b=RSQtHWe5PqX6bw8iSlyDeZXxRKwkqAS3nUkmA3dTrUT5gG0X30FIYaJc22Zd7DdzyVI16P 4DeiD+qcxJdfh8gvS4FjKCSgZiyLPFZCmIHMX8RPvNmmEgGxSqs2jxsZ2s1RnR4DA2qwo9 vmWCi5o/t1XOxsVfl9oAYjoxUdtpySw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-80-dKv-ipHbOWCrVt2s-aojew-1; Wed, 23 Oct 2019 09:40:15 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 84CCB107AD31; Wed, 23 Oct 2019 13:40:14 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-129.brq.redhat.com [10.40.204.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id 753A060BE1; Wed, 23 Oct 2019 13:40:13 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: olivier.matz@6wind.com, ferruh.yigit@intel.com Date: Wed, 23 Oct 2019 15:40:01 +0200 Message-Id: <1571838001-591-5-git-send-email-david.marchand@redhat.com> In-Reply-To: <1571838001-591-1-git-send-email-david.marchand@redhat.com> References: <1571820718-7021-1-git-send-email-david.marchand@redhat.com> <1571838001-591-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: dKv-ipHbOWCrVt2s-aojew-1 X-Mimecast-Spam-Score: 0 Subject: [dpdk-dev] [PATCH v2 4/4] net: hide internal CRC defines 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" No need to let those (non RTE_ prefixed) defines public. Hide them where we use them. Signed-off-by: David Marchand --- lib/librte_net/rte_net_crc.c | 6 ++++++ lib/librte_net/rte_net_crc.h | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/librte_net/rte_net_crc.c b/lib/librte_net/rte_net_crc.c index dca0830..9fd4794 100644 --- a/lib/librte_net/rte_net_crc.c +++ b/lib/librte_net/rte_net_crc.c @@ -22,6 +22,12 @@ #include #endif +/** CRC polynomials */ +#define CRC32_ETH_POLYNOMIAL 0x04c11db7UL +#define CRC16_CCITT_POLYNOMIAL 0x1021U + +#define CRC_LUT_SIZE 256 + /* crc tables */ static uint32_t crc32_eth_lut[CRC_LUT_SIZE]; static uint32_t crc16_ccitt_lut[CRC_LUT_SIZE]; diff --git a/lib/librte_net/rte_net_crc.h b/lib/librte_net/rte_net_crc.h index 8a86f29..16e85ca 100644 --- a/lib/librte_net/rte_net_crc.h +++ b/lib/librte_net/rte_net_crc.h @@ -11,12 +11,6 @@ extern "C" { #endif -/** CRC polynomials */ -#define CRC32_ETH_POLYNOMIAL 0x04c11db7UL -#define CRC16_CCITT_POLYNOMIAL 0x1021U - -#define CRC_LUT_SIZE 256 - /** CRC types */ enum rte_net_crc_type { RTE_NET_CRC16_CCITT = 0,