DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] librte_mbuf: modify the port initialization value
@ 2017-09-04  6:55 Zhiyong Yang
  2017-09-05  3:39 ` Stephen Hemminger
  2017-09-05  5:13 ` [dpdk-dev] [PATCH v2] librte_mbuf: modify " Zhiyong Yang
  0 siblings, 2 replies; 8+ messages in thread
From: Zhiyong Yang @ 2017-09-04  6:55 UTC (permalink / raw)
  To: dev; +Cc: thomas, ferruh.yigit, Zhiyong Yang

In order to support more than 256 virtual ports, the field "port" in
rte_mbuf has been increased to 16 bits. The initialization/reset
value of the field "port" should be changed from 0xff to 0xffff
accordingly.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 lib/librte_mbuf/rte_mbuf.c | 2 +-
 lib/librte_mbuf/rte_mbuf.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 26a62b8e1..2e80ed9b1 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -144,7 +144,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,
 	/* init some constant fields */
 	m->pool = mp;
 	m->nb_segs = 1;
-	m->port = 0xff;
+	m->port = 0xffff;
 	rte_mbuf_refcnt_set(m, 1);
 	m->next = NULL;
 }
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index eaed7eee0..cdc70aa83 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1095,7 +1095,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m)
 	m->vlan_tci = 0;
 	m->vlan_tci_outer = 0;
 	m->nb_segs = 1;
-	m->port = 0xff;
+	m->port = 0xffff;
 
 	m->ol_flags = 0;
 	m->packet_type = 0;
-- 
2.13.3

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

* Re: [dpdk-dev] [PATCH] librte_mbuf: modify the port initialization value
  2017-09-04  6:55 [dpdk-dev] [PATCH] librte_mbuf: modify the port initialization value Zhiyong Yang
@ 2017-09-05  3:39 ` Stephen Hemminger
  2017-09-05  4:28   ` Yang, Zhiyong
  2017-09-05  5:13 ` [dpdk-dev] [PATCH v2] librte_mbuf: modify " Zhiyong Yang
  1 sibling, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2017-09-05  3:39 UTC (permalink / raw)
  To: Zhiyong Yang; +Cc: dev, thomas, ferruh.yigit

On Mon,  4 Sep 2017 14:55:32 +0800
Zhiyong Yang <zhiyong.yang@intel.com> wrote:

> In order to support more than 256 virtual ports, the field "port" in
> rte_mbuf has been increased to 16 bits. The initialization/reset
> value of the field "port" should be changed from 0xff to 0xffff
> accordingly.
> 
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> ---
>  lib/librte_mbuf/rte_mbuf.c | 2 +-
>  lib/librte_mbuf/rte_mbuf.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
> index 26a62b8e1..2e80ed9b1 100644
> --- a/lib/librte_mbuf/rte_mbuf.c
> +++ b/lib/librte_mbuf/rte_mbuf.c
> @@ -144,7 +144,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,
>  	/* init some constant fields */
>  	m->pool = mp;
>  	m->nb_segs = 1;
> -	m->port = 0xff;
> +	m->port = 0xffff;
>  	rte_mbuf_refcnt_set(m, 1);
>  	m->next = NULL;
>  }
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index eaed7eee0..cdc70aa83 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -1095,7 +1095,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m)
>  	m->vlan_tci = 0;
>  	m->vlan_tci_outer = 0;
>  	m->nb_segs = 1;
> -	m->port = 0xff;
> +	m->port = 0xffff;
>  
>  	m->ol_flags = 0;
>  	m->packet_type = 0;

Maybe introduce MBUF_INVALID_PORT as a constant?

#define MBUF_INVALID_PORT  0xffff

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

* Re: [dpdk-dev] [PATCH] librte_mbuf: modify the port initialization value
  2017-09-05  3:39 ` Stephen Hemminger
@ 2017-09-05  4:28   ` Yang, Zhiyong
  0 siblings, 0 replies; 8+ messages in thread
From: Yang, Zhiyong @ 2017-09-05  4:28 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, thomas, Yigit, Ferruh

Hi, Stephen:

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Tuesday, September 5, 2017 11:40 AM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>
> Cc: dev@dpdk.org; thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] librte_mbuf: modify the port initialization value
> 
> > @@ -144,7 +144,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,
> >  	/* init some constant fields */
> >  	m->pool = mp;
> >  	m->nb_segs = 1;
> > -	m->port = 0xff;
> > +	m->port = 0xffff;
> >  	rte_mbuf_refcnt_set(m, 1);
> >  	m->next = NULL;
> >  }
> > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> > index eaed7eee0..cdc70aa83 100644
> > --- a/lib/librte_mbuf/rte_mbuf.h
> > +++ b/lib/librte_mbuf/rte_mbuf.h
> > @@ -1095,7 +1095,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf
> *m)
> >  	m->vlan_tci = 0;
> >  	m->vlan_tci_outer = 0;
> >  	m->nb_segs = 1;
> > -	m->port = 0xff;
> > +	m->port = 0xffff;
> >
> >  	m->ol_flags = 0;
> >  	m->packet_type = 0;
> 
> Maybe introduce MBUF_INVALID_PORT as a constant?
> 
> #define MBUF_INVALID_PORT  0xffff

Make sense.  Thanks for your suggestion.

Thanks
Zhiyong

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

* [dpdk-dev] [PATCH v2] librte_mbuf: modify port initialization value
  2017-09-04  6:55 [dpdk-dev] [PATCH] librte_mbuf: modify the port initialization value Zhiyong Yang
  2017-09-05  3:39 ` Stephen Hemminger
@ 2017-09-05  5:13 ` Zhiyong Yang
  2017-09-05  5:20   ` Zhang, Helin
  2017-09-05  7:28   ` Thomas Monjalon
  1 sibling, 2 replies; 8+ messages in thread
From: Zhiyong Yang @ 2017-09-05  5:13 UTC (permalink / raw)
  To: dev; +Cc: thomas, ferruh.yigit, stephen, Zhiyong Yang

In order to support more than 256 virtual ports, the field "port"
in rte_mbuf has been increased to 16 bits. The initialization/reset
value of the field "port" should be changed from 0xff to 0xffff
accordingly.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---

Changes in V2:
Introduce MBUF_INVALID_PORT as a constant.

 lib/librte_mbuf/rte_mbuf.c | 2 +-
 lib/librte_mbuf/rte_mbuf.h | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 26a62b8e1..bcf4e2fcf 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -144,7 +144,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,
 	/* init some constant fields */
 	m->pool = mp;
 	m->nb_segs = 1;
-	m->port = 0xff;
+	m->port = MBUF_INVALID_PORT;
 	rte_mbuf_refcnt_set(m, 1);
 	m->next = NULL;
 }
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index eaed7eee0..e32038a73 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1087,6 +1087,8 @@ static inline void rte_pktmbuf_reset_headroom(struct rte_mbuf *m)
  * @param m
  *   The packet mbuf to be resetted.
  */
+#define MBUF_INVALID_PORT 0xffff
+
 static inline void rte_pktmbuf_reset(struct rte_mbuf *m)
 {
 	m->next = NULL;
@@ -1095,7 +1097,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m)
 	m->vlan_tci = 0;
 	m->vlan_tci_outer = 0;
 	m->nb_segs = 1;
-	m->port = 0xff;
+	m->port = MBUF_INVALID_PORT;
 
 	m->ol_flags = 0;
 	m->packet_type = 0;
-- 
2.13.3

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

* Re: [dpdk-dev] [PATCH v2] librte_mbuf: modify port initialization value
  2017-09-05  5:13 ` [dpdk-dev] [PATCH v2] librte_mbuf: modify " Zhiyong Yang
@ 2017-09-05  5:20   ` Zhang, Helin
  2017-09-06  0:42     ` Yang, Zhiyong
  2017-09-05  7:28   ` Thomas Monjalon
  1 sibling, 1 reply; 8+ messages in thread
From: Zhang, Helin @ 2017-09-05  5:20 UTC (permalink / raw)
  To: Yang, Zhiyong; +Cc: dev


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang
> Sent: Tuesday, September 5, 2017 1:13 PM
> To: dev@dpdk.org
> Cc: thomas@monjalon.net; Yigit, Ferruh; stephen@networkplumber.org; Yang,
> Zhiyong
> Subject: [dpdk-dev] [PATCH v2] librte_mbuf: modify port initialization value
> 
> In order to support more than 256 virtual ports, the field "port"
> in rte_mbuf has been increased to 16 bits. The initialization/reset value of the
> field "port" should be changed from 0xff to 0xffff accordingly.
> 
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> ---
> 
> Changes in V2:
> Introduce MBUF_INVALID_PORT as a constant.
> 
>  lib/librte_mbuf/rte_mbuf.c | 2 +-
>  lib/librte_mbuf/rte_mbuf.h | 4 +++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index
> 26a62b8e1..bcf4e2fcf 100644
> --- a/lib/librte_mbuf/rte_mbuf.c
> +++ b/lib/librte_mbuf/rte_mbuf.c
> @@ -144,7 +144,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,
>  	/* init some constant fields */
>  	m->pool = mp;
>  	m->nb_segs = 1;
> -	m->port = 0xff;
> +	m->port = MBUF_INVALID_PORT;
>  	rte_mbuf_refcnt_set(m, 1);
>  	m->next = NULL;
>  }
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index
> eaed7eee0..e32038a73 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -1087,6 +1087,8 @@ static inline void
> rte_pktmbuf_reset_headroom(struct rte_mbuf *m)
>   * @param m
>   *   The packet mbuf to be resetted.
>   */
> +#define MBUF_INVALID_PORT 0xffff
Replaced with below, or use UINT16_MAX directly?
#define MBUF_INVALID_PORT UINT16_MAX

> +
>  static inline void rte_pktmbuf_reset(struct rte_mbuf *m)  {
>  	m->next = NULL;
> @@ -1095,7 +1097,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf
> *m)
>  	m->vlan_tci = 0;
>  	m->vlan_tci_outer = 0;
>  	m->nb_segs = 1;
> -	m->port = 0xff;
> +	m->port = MBUF_INVALID_PORT;
> 
>  	m->ol_flags = 0;
>  	m->packet_type = 0;
> --
> 2.13.3

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

* Re: [dpdk-dev] [PATCH v2] librte_mbuf: modify port initialization value
  2017-09-05  5:13 ` [dpdk-dev] [PATCH v2] librte_mbuf: modify " Zhiyong Yang
  2017-09-05  5:20   ` Zhang, Helin
@ 2017-09-05  7:28   ` Thomas Monjalon
  2017-09-05 12:30     ` Yang, Zhiyong
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2017-09-05  7:28 UTC (permalink / raw)
  To: Zhiyong Yang; +Cc: dev, ferruh.yigit, stephen

05/09/2017 07:13, Zhiyong Yang:
> In order to support more than 256 virtual ports, the field "port"
> in rte_mbuf has been increased to 16 bits. The initialization/reset
> value of the field "port" should be changed from 0xff to 0xffff
> accordingly.

This patch should be merged with the range increase.

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

* Re: [dpdk-dev] [PATCH v2] librte_mbuf: modify port initialization value
  2017-09-05  7:28   ` Thomas Monjalon
@ 2017-09-05 12:30     ` Yang, Zhiyong
  0 siblings, 0 replies; 8+ messages in thread
From: Yang, Zhiyong @ 2017-09-05 12:30 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Yigit, Ferruh, stephen

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Tuesday, September 5, 2017 3:28 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>;
> stephen@networkplumber.org
> Subject: Re: [PATCH v2] librte_mbuf: modify port initialization value
> 
> 05/09/2017 07:13, Zhiyong Yang:
> > In order to support more than 256 virtual ports, the field "port"
> > in rte_mbuf has been increased to 16 bits. The initialization/reset
> > value of the field "port" should be changed from 0xff to 0xffff
> > accordingly.
> 
> This patch should be merged with the range increase.

Ok. it will be merged with range increase patchset.
thanks
Zhiyong

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

* Re: [dpdk-dev] [PATCH v2] librte_mbuf: modify port initialization value
  2017-09-05  5:20   ` Zhang, Helin
@ 2017-09-06  0:42     ` Yang, Zhiyong
  0 siblings, 0 replies; 8+ messages in thread
From: Yang, Zhiyong @ 2017-09-06  0:42 UTC (permalink / raw)
  To: Zhang, Helin; +Cc: dev

Hi, helin:

> > +#define MBUF_INVALID_PORT 0xffff
> Replaced with below, or use UINT16_MAX directly?
> #define MBUF_INVALID_PORT UINT16_MAX

I prefer  #define MBUF_INVALID_PORT UINT16_MAX

Thanks 
Zhiyong

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

end of thread, other threads:[~2017-09-06  0:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-04  6:55 [dpdk-dev] [PATCH] librte_mbuf: modify the port initialization value Zhiyong Yang
2017-09-05  3:39 ` Stephen Hemminger
2017-09-05  4:28   ` Yang, Zhiyong
2017-09-05  5:13 ` [dpdk-dev] [PATCH v2] librte_mbuf: modify " Zhiyong Yang
2017-09-05  5:20   ` Zhang, Helin
2017-09-06  0:42     ` Yang, Zhiyong
2017-09-05  7:28   ` Thomas Monjalon
2017-09-05 12:30     ` Yang, Zhiyong

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).