DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] net definitions fixes
@ 2019-10-23  8:51 David Marchand
  2019-10-23  8:51 ` [dpdk-dev] [PATCH 1/3] net: add missing rte prefix on PPPoE defines David Marchand
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: David Marchand @ 2019-10-23  8:51 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, ferruh.yigit

Small patchset with fixes after inspecting the librte_net.
I copied stable@dpdk.org in the 2nd patch for information only.


-- 
David Marchand

David Marchand (3):
  net: add missing rte prefix on PPPoE defines
  net: add rte prefix to MPLS structure
  net: hide internal CRC defines

 lib/librte_net/rte_ether.h             | 4 ++--
 lib/librte_net/rte_mpls.h              | 2 +-
 lib/librte_net/rte_net.c               | 4 ++--
 lib/librte_net/rte_net_crc.c           | 6 ++++++
 lib/librte_net/rte_net_crc.h           | 6 ------
 lib/librte_pipeline/rte_table_action.c | 4 ++--
 6 files changed, 13 insertions(+), 13 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH 1/3] net: add missing rte prefix on PPPoE defines
  2019-10-23  8:51 [dpdk-dev] [PATCH 0/3] net definitions fixes David Marchand
@ 2019-10-23  8:51 ` David Marchand
  2019-10-23  8:51 ` [dpdk-dev] [PATCH 2/3] net: add rte prefix to MPLS structure David Marchand
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: David Marchand @ 2019-10-23  8:51 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, ferruh.yigit, stable

Those two defines have been missed.

Fixes: 35b2d13fd6fd ("net: add rte prefix to ether defines")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_net/rte_ether.h             | 4 ++--
 lib/librte_pipeline/rte_table_action.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

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);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH 2/3] net: add rte prefix to MPLS structure
  2019-10-23  8:51 [dpdk-dev] [PATCH 0/3] net definitions fixes David Marchand
  2019-10-23  8:51 ` [dpdk-dev] [PATCH 1/3] net: add missing rte prefix on PPPoE defines David Marchand
@ 2019-10-23  8:51 ` David Marchand
  2019-10-23  8:51 ` [dpdk-dev] [PATCH 3/3] net: hide internal CRC defines David Marchand
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: David Marchand @ 2019-10-23  8:51 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, ferruh.yigit, stable

Add 'rte_' prefix to structures:
- rename struct mpls_hdr as struct rte_mpls_hdr.

Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_net/rte_mpls.h | 2 +-
 lib/librte_net/rte_net.c  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

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++) {
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH 3/3] net: hide internal CRC defines
  2019-10-23  8:51 [dpdk-dev] [PATCH 0/3] net definitions fixes David Marchand
  2019-10-23  8:51 ` [dpdk-dev] [PATCH 1/3] net: add missing rte prefix on PPPoE defines David Marchand
  2019-10-23  8:51 ` [dpdk-dev] [PATCH 2/3] net: add rte prefix to MPLS structure David Marchand
@ 2019-10-23  8:51 ` David Marchand
  2019-10-23 12:12 ` [dpdk-dev] [PATCH 0/3] net definitions fixes Ferruh Yigit
  2019-10-23 13:39 ` [dpdk-dev] [PATCH v2 0/4] " David Marchand
  4 siblings, 0 replies; 14+ messages in thread
From: David Marchand @ 2019-10-23  8:51 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, ferruh.yigit

No need to let those (non RTE_ prefixed) defines public.
Hide them where we use them.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 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 <net_crc_neon.h>
 #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,
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH 0/3] net definitions fixes
  2019-10-23  8:51 [dpdk-dev] [PATCH 0/3] net definitions fixes David Marchand
                   ` (2 preceding siblings ...)
  2019-10-23  8:51 ` [dpdk-dev] [PATCH 3/3] net: hide internal CRC defines David Marchand
@ 2019-10-23 12:12 ` Ferruh Yigit
  2019-10-23 12:57   ` David Marchand
  2019-10-23 13:39 ` [dpdk-dev] [PATCH v2 0/4] " David Marchand
  4 siblings, 1 reply; 14+ messages in thread
From: Ferruh Yigit @ 2019-10-23 12:12 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: olivier.matz

On 10/23/2019 9:51 AM, David Marchand wrote:
> Small patchset with fixes after inspecting the librte_net.
> I copied stable@dpdk.org in the 2nd patch for information only.
> 

Overall lgtm. And this release seems the one to make these changes, and we
already break the API for net library on this release BUT should we update the
ABIVER for net library?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH 0/3] net definitions fixes
  2019-10-23 12:12 ` [dpdk-dev] [PATCH 0/3] net definitions fixes Ferruh Yigit
@ 2019-10-23 12:57   ` David Marchand
  2019-10-23 13:00     ` David Marchand
  0 siblings, 1 reply; 14+ messages in thread
From: David Marchand @ 2019-10-23 12:57 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Olivier Matz

On Wed, Oct 23, 2019 at 2:12 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 10/23/2019 9:51 AM, David Marchand wrote:
> > Small patchset with fixes after inspecting the librte_net.
> > I copied stable@dpdk.org in the 2nd patch for information only.
> >
>
> Overall lgtm. And this release seems the one to make these changes, and we
> already break the API for net library on this release BUT should we update the
> ABIVER for net library?

This patchset breaks API by renaming structures/defines and remove
some constant defines.
ABI should be the same ?


-- 
David Marchand


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH 0/3] net definitions fixes
  2019-10-23 12:57   ` David Marchand
@ 2019-10-23 13:00     ` David Marchand
  2019-10-23 13:19       ` Ferruh Yigit
  0 siblings, 1 reply; 14+ messages in thread
From: David Marchand @ 2019-10-23 13:00 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Olivier Matz

On Wed, Oct 23, 2019 at 2:57 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Wed, Oct 23, 2019 at 2:12 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> >
> > On 10/23/2019 9:51 AM, David Marchand wrote:
> > > Small patchset with fixes after inspecting the librte_net.
> > > I copied stable@dpdk.org in the 2nd patch for information only.
> > >
> >
> > Overall lgtm. And this release seems the one to make these changes, and we
> > already break the API for net library on this release BUT should we update the
> > ABIVER for net library?
>
> This patchset breaks API by renaming structures/defines and remove
> some constant defines.
> ABI should be the same ?

But I suppose adding some words in the release notes can't be wrong.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH 0/3] net definitions fixes
  2019-10-23 13:00     ` David Marchand
@ 2019-10-23 13:19       ` Ferruh Yigit
  0 siblings, 0 replies; 14+ messages in thread
From: Ferruh Yigit @ 2019-10-23 13:19 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Olivier Matz

On 10/23/2019 2:00 PM, David Marchand wrote:
> On Wed, Oct 23, 2019 at 2:57 PM David Marchand
> <david.marchand@redhat.com> wrote:
>>
>> On Wed, Oct 23, 2019 at 2:12 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>>
>>> On 10/23/2019 9:51 AM, David Marchand wrote:
>>>> Small patchset with fixes after inspecting the librte_net.
>>>> I copied stable@dpdk.org in the 2nd patch for information only.
>>>>
>>>
>>> Overall lgtm. And this release seems the one to make these changes, and we
>>> already break the API for net library on this release BUT should we update the
>>> ABIVER for net library?
>>
>> This patchset breaks API by renaming structures/defines and remove
>> some constant defines.
>> ABI should be the same ?
> 
> But I suppose adding some words in the release notes can't be wrong.
> 

You are right, there is not point on increasing ABIVER since only API is
changing, +1 to document change in release notes. (also for previous rte_esp change)

Thanks,

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 0/4] net definitions fixes
  2019-10-23  8:51 [dpdk-dev] [PATCH 0/3] net definitions fixes David Marchand
                   ` (3 preceding siblings ...)
  2019-10-23 12:12 ` [dpdk-dev] [PATCH 0/3] net definitions fixes Ferruh Yigit
@ 2019-10-23 13:39 ` David Marchand
  2019-10-23 13:39   ` [dpdk-dev] [PATCH v2 1/4] doc: add note on prefixing ESP tail structure David Marchand
                     ` (4 more replies)
  4 siblings, 5 replies; 14+ messages in thread
From: David Marchand @ 2019-10-23 13:39 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, ferruh.yigit

Small patchset with fixes after inspecting the librte_net.
I copied stable@dpdk.org in the 2nd patch for information only.

Changelog since v1:
- added missing update on release notes,

-- 
David Marchand

David Marchand (4):
  doc: add note on prefixing ESP tail structure
  net: add missing rte prefix on PPPoE defines
  net: add rte prefix to MPLS structure
  net: hide internal CRC defines

 doc/guides/rel_notes/release_19_11.rst | 6 ++++++
 lib/librte_net/rte_ether.h             | 4 ++--
 lib/librte_net/rte_mpls.h              | 2 +-
 lib/librte_net/rte_net.c               | 4 ++--
 lib/librte_net/rte_net_crc.c           | 6 ++++++
 lib/librte_net/rte_net_crc.h           | 6 ------
 lib/librte_pipeline/rte_table_action.c | 4 ++--
 7 files changed, 19 insertions(+), 13 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 1/4] doc: add note on prefixing ESP tail structure
  2019-10-23 13:39 ` [dpdk-dev] [PATCH v2 0/4] " David Marchand
@ 2019-10-23 13:39   ` David Marchand
  2019-10-23 13:39   ` [dpdk-dev] [PATCH v2 2/4] net: add missing rte prefix on PPPoE defines David Marchand
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: David Marchand @ 2019-10-23 13:39 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, ferruh.yigit

Fixes: 7dde68cf0e13 ("net: add missing rte prefix for ESP tail")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 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.
 
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 2/4] net: add missing rte prefix on PPPoE defines
  2019-10-23 13:39 ` [dpdk-dev] [PATCH v2 0/4] " David Marchand
  2019-10-23 13:39   ` [dpdk-dev] [PATCH v2 1/4] doc: add note on prefixing ESP tail structure David Marchand
@ 2019-10-23 13:39   ` David Marchand
  2019-10-23 13:40   ` [dpdk-dev] [PATCH v2 3/4] net: add rte prefix to MPLS structure David Marchand
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: David Marchand @ 2019-10-23 13:39 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, ferruh.yigit, stable

Those two defines have been missed.

Fixes: 35b2d13fd6fd ("net: add rte prefix to ether defines")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
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);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 3/4] net: add rte prefix to MPLS structure
  2019-10-23 13:39 ` [dpdk-dev] [PATCH v2 0/4] " David Marchand
  2019-10-23 13:39   ` [dpdk-dev] [PATCH v2 1/4] doc: add note on prefixing ESP tail structure David Marchand
  2019-10-23 13:39   ` [dpdk-dev] [PATCH v2 2/4] net: add missing rte prefix on PPPoE defines David Marchand
@ 2019-10-23 13:40   ` David Marchand
  2019-10-23 13:40   ` [dpdk-dev] [PATCH v2 4/4] net: hide internal CRC defines David Marchand
  2019-10-23 20:03   ` [dpdk-dev] [PATCH v2 0/4] net definitions fixes Ferruh Yigit
  4 siblings, 0 replies; 14+ messages in thread
From: David Marchand @ 2019-10-23 13:40 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, ferruh.yigit, stable

Add 'rte_' prefix to structures:
- rename struct mpls_hdr as struct rte_mpls_hdr.

Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
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++) {
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH v2 4/4] net: hide internal CRC defines
  2019-10-23 13:39 ` [dpdk-dev] [PATCH v2 0/4] " David Marchand
                     ` (2 preceding siblings ...)
  2019-10-23 13:40   ` [dpdk-dev] [PATCH v2 3/4] net: add rte prefix to MPLS structure David Marchand
@ 2019-10-23 13:40   ` David Marchand
  2019-10-23 20:03   ` [dpdk-dev] [PATCH v2 0/4] net definitions fixes Ferruh Yigit
  4 siblings, 0 replies; 14+ messages in thread
From: David Marchand @ 2019-10-23 13:40 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, ferruh.yigit

No need to let those (non RTE_ prefixed) defines public.
Hide them where we use them.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 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 <net_crc_neon.h>
 #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,
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/4] net definitions fixes
  2019-10-23 13:39 ` [dpdk-dev] [PATCH v2 0/4] " David Marchand
                     ` (3 preceding siblings ...)
  2019-10-23 13:40   ` [dpdk-dev] [PATCH v2 4/4] net: hide internal CRC defines David Marchand
@ 2019-10-23 20:03   ` Ferruh Yigit
  4 siblings, 0 replies; 14+ messages in thread
From: Ferruh Yigit @ 2019-10-23 20:03 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: olivier.matz

On 10/23/2019 2:39 PM, David Marchand wrote:
> Small patchset with fixes after inspecting the librte_net.
> I copied stable@dpdk.org in the 2nd patch for information only.
> 

For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Series applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-10-23 20:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-23  8:51 [dpdk-dev] [PATCH 0/3] net definitions fixes David Marchand
2019-10-23  8:51 ` [dpdk-dev] [PATCH 1/3] net: add missing rte prefix on PPPoE defines David Marchand
2019-10-23  8:51 ` [dpdk-dev] [PATCH 2/3] net: add rte prefix to MPLS structure David Marchand
2019-10-23  8:51 ` [dpdk-dev] [PATCH 3/3] net: hide internal CRC defines David Marchand
2019-10-23 12:12 ` [dpdk-dev] [PATCH 0/3] net definitions fixes Ferruh Yigit
2019-10-23 12:57   ` David Marchand
2019-10-23 13:00     ` David Marchand
2019-10-23 13:19       ` Ferruh Yigit
2019-10-23 13:39 ` [dpdk-dev] [PATCH v2 0/4] " David Marchand
2019-10-23 13:39   ` [dpdk-dev] [PATCH v2 1/4] doc: add note on prefixing ESP tail structure David Marchand
2019-10-23 13:39   ` [dpdk-dev] [PATCH v2 2/4] net: add missing rte prefix on PPPoE defines David Marchand
2019-10-23 13:40   ` [dpdk-dev] [PATCH v2 3/4] net: add rte prefix to MPLS structure David Marchand
2019-10-23 13:40   ` [dpdk-dev] [PATCH v2 4/4] net: hide internal CRC defines David Marchand
2019-10-23 20:03   ` [dpdk-dev] [PATCH v2 0/4] net definitions fixes Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).