[dpdk-dev,17/17] mbuf: remove old packet type bit masks for ol_flags

Message ID 1422501365-12643-18-git-send-email-helin.zhang@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Zhang, Helin Jan. 29, 2015, 3:16 a.m. UTC
To unify packet types among all PMDs, bit masks and relevant macros
of packet type for ol_flags are replaced by unified packet type and
relevant macros.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_mbuf/rte_mbuf.c |  6 ------
 lib/librte_mbuf/rte_mbuf.h | 10 ++--------
 2 files changed, 2 insertions(+), 14 deletions(-)
  

Comments

Olivier Matz Jan. 30, 2015, 1:37 p.m. UTC | #1
Hi Helin,

On 01/29/2015 04:16 AM, Helin Zhang wrote:
> To unify packet types among all PMDs, bit masks and relevant macros
> of packet type for ol_flags are replaced by unified packet type and
> relevant macros.
> 
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> ---
>  lib/librte_mbuf/rte_mbuf.c |  6 ------
>  lib/librte_mbuf/rte_mbuf.h | 10 ++--------
>  2 files changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
> index 1b14e02..8050ccf 100644
> --- a/lib/librte_mbuf/rte_mbuf.c
> +++ b/lib/librte_mbuf/rte_mbuf.c
> @@ -215,14 +215,8 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask)
>  	/* case PKT_RX_HBUF_OVERFLOW: return "PKT_RX_HBUF_OVERFLOW"; */
>  	/* case PKT_RX_RECIP_ERR: return "PKT_RX_RECIP_ERR"; */
>  	/* case PKT_RX_MAC_ERR: return "PKT_RX_MAC_ERR"; */
> -	case PKT_RX_IPV4_HDR: return "PKT_RX_IPV4_HDR";
> -	case PKT_RX_IPV4_HDR_EXT: return "PKT_RX_IPV4_HDR_EXT";
> -	case PKT_RX_IPV6_HDR: return "PKT_RX_IPV6_HDR";
> -	case PKT_RX_IPV6_HDR_EXT: return "PKT_RX_IPV6_HDR_EXT";
>  	case PKT_RX_IEEE1588_PTP: return "PKT_RX_IEEE1588_PTP";
>  	case PKT_RX_IEEE1588_TMST: return "PKT_RX_IEEE1588_TMST";
> -	case PKT_RX_TUNNEL_IPV4_HDR: return "PKT_RX_TUNNEL_IPV4_HDR";
> -	case PKT_RX_TUNNEL_IPV6_HDR: return "PKT_RX_TUNNEL_IPV6_HDR";

I see you are not removing IEEE1588. Is there a reason why it is not
handled as a packet_type?

> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index 94ae344..5df0d61 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -90,16 +90,10 @@ extern "C" {
>  #define PKT_RX_HBUF_OVERFLOW (0ULL << 0)  /**< Header buffer overflow. */
>  #define PKT_RX_RECIP_ERR     (0ULL << 0)  /**< Hardware processing error. */
>  #define PKT_RX_MAC_ERR       (0ULL << 0)  /**< MAC error. */
> -#define PKT_RX_IPV4_HDR      (1ULL << 5)  /**< RX packet with IPv4 header. */
> -#define PKT_RX_IPV4_HDR_EXT  (1ULL << 6)  /**< RX packet with extended IPv4 header. */
> -#define PKT_RX_IPV6_HDR      (1ULL << 7)  /**< RX packet with IPv6 header. */
> -#define PKT_RX_IPV6_HDR_EXT  (1ULL << 8)  /**< RX packet with extended IPv6 header. */
>  #define PKT_RX_IEEE1588_PTP  (1ULL << 9)  /**< RX IEEE1588 L2 Ethernet PT Packet. */
>  #define PKT_RX_IEEE1588_TMST (1ULL << 10) /**< RX IEEE1588 L2/L4 timestamped packet.*/
> -#define PKT_RX_TUNNEL_IPV4_HDR (1ULL << 11) /**< RX tunnel packet with IPv4 header.*/
> -#define PKT_RX_TUNNEL_IPV6_HDR (1ULL << 12) /**< RX tunnel packet with IPv6 header. */
> -#define PKT_RX_FDIR_ID       (1ULL << 13) /**< FD id reported if FDIR match. */
> -#define PKT_RX_FDIR_FLX      (1ULL << 14) /**< Flexible bytes reported if FDIR match. */
> +#define PKT_RX_FDIR_ID       (1ULL << 11) /**< FD id reported if FDIR match. */
> +#define PKT_RX_FDIR_FLX      (1ULL << 12) /**< Flexible bytes reported if FDIR match. */

It looks like but numbers are not contiguous anymore (there is a hole
between 5 and 8).

Regards,
Olivier
  
Zhang, Helin Feb. 2, 2015, 1:53 a.m. UTC | #2
Hi Olivier

> -----Original Message-----
> From: Olivier MATZ [mailto:olivier.matz@6wind.com]
> Sent: Friday, January 30, 2015 9:37 PM
> To: Zhang, Helin; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 17/17] mbuf: remove old packet type bit masks
> for ol_flags
> 
> Hi Helin,
> 
> On 01/29/2015 04:16 AM, Helin Zhang wrote:
> > To unify packet types among all PMDs, bit masks and relevant macros of
> > packet type for ol_flags are replaced by unified packet type and
> > relevant macros.
> >
> > Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> > ---
> >  lib/librte_mbuf/rte_mbuf.c |  6 ------  lib/librte_mbuf/rte_mbuf.h |
> > 10 ++--------
> >  2 files changed, 2 insertions(+), 14 deletions(-)
> >
> > diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
> > index 1b14e02..8050ccf 100644
> > --- a/lib/librte_mbuf/rte_mbuf.c
> > +++ b/lib/librte_mbuf/rte_mbuf.c
> > @@ -215,14 +215,8 @@ const char *rte_get_rx_ol_flag_name(uint64_t
> mask)
> >  	/* case PKT_RX_HBUF_OVERFLOW: return "PKT_RX_HBUF_OVERFLOW";
> */
> >  	/* case PKT_RX_RECIP_ERR: return "PKT_RX_RECIP_ERR"; */
> >  	/* case PKT_RX_MAC_ERR: return "PKT_RX_MAC_ERR"; */
> > -	case PKT_RX_IPV4_HDR: return "PKT_RX_IPV4_HDR";
> > -	case PKT_RX_IPV4_HDR_EXT: return "PKT_RX_IPV4_HDR_EXT";
> > -	case PKT_RX_IPV6_HDR: return "PKT_RX_IPV6_HDR";
> > -	case PKT_RX_IPV6_HDR_EXT: return "PKT_RX_IPV6_HDR_EXT";
> >  	case PKT_RX_IEEE1588_PTP: return "PKT_RX_IEEE1588_PTP";
> >  	case PKT_RX_IEEE1588_TMST: return "PKT_RX_IEEE1588_TMST";
> > -	case PKT_RX_TUNNEL_IPV4_HDR: return "PKT_RX_TUNNEL_IPV4_HDR";
> > -	case PKT_RX_TUNNEL_IPV6_HDR: return "PKT_RX_TUNNEL_IPV6_HDR";
> 
> I see you are not removing IEEE1588. Is there a reason why it is not handled as
> a packet_type?
Ieee1588 is not a part of information reported by hardware in packet type.
Yes, your idea on this is worth being taken into account.

> 
> > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> > index 94ae344..5df0d61 100644
> > --- a/lib/librte_mbuf/rte_mbuf.h
> > +++ b/lib/librte_mbuf/rte_mbuf.h
> > @@ -90,16 +90,10 @@ extern "C" {
> >  #define PKT_RX_HBUF_OVERFLOW (0ULL << 0)  /**< Header buffer
> overflow. */
> >  #define PKT_RX_RECIP_ERR     (0ULL << 0)  /**< Hardware processing
> error. */
> >  #define PKT_RX_MAC_ERR       (0ULL << 0)  /**< MAC error. */
> > -#define PKT_RX_IPV4_HDR      (1ULL << 5)  /**< RX packet with IPv4
> header. */
> > -#define PKT_RX_IPV4_HDR_EXT  (1ULL << 6)  /**< RX packet with
> extended IPv4 header. */
> > -#define PKT_RX_IPV6_HDR      (1ULL << 7)  /**< RX packet with IPv6
> header. */
> > -#define PKT_RX_IPV6_HDR_EXT  (1ULL << 8)  /**< RX packet with
> > extended IPv6 header. */  #define PKT_RX_IEEE1588_PTP  (1ULL << 9)
> > /**< RX IEEE1588 L2 Ethernet PT Packet. */  #define
> > PKT_RX_IEEE1588_TMST (1ULL << 10) /**< RX IEEE1588 L2/L4 timestamped
> > packet.*/ -#define PKT_RX_TUNNEL_IPV4_HDR (1ULL << 11) /**< RX tunnel
> packet with IPv4 header.*/ -#define PKT_RX_TUNNEL_IPV6_HDR (1ULL << 12)
> /**< RX tunnel packet with IPv6 header. */
> > -#define PKT_RX_FDIR_ID       (1ULL << 13) /**< FD id reported if FDIR
> match. */
> > -#define PKT_RX_FDIR_FLX      (1ULL << 14) /**< Flexible bytes reported if
> FDIR match. */
> > +#define PKT_RX_FDIR_ID       (1ULL << 11) /**< FD id reported if FDIR
> match. */
> > +#define PKT_RX_FDIR_FLX      (1ULL << 12) /**< Flexible bytes reported if
> FDIR match. */
> 
> It looks like but numbers are not contiguous anymore (there is a hole between
> 5 and 8).
Initially I don't want to move the following values up, as I am not sure if it may
affect other features.
I'd prefer to keep that hole as reserved. What's the opinion from you guys?
Thanks for the good comments!

> 
> Regards,
> Olivier
  
Olivier Matz Feb. 2, 2015, 11:22 a.m. UTC | #3
Hi Helin,

On 02/02/2015 02:53 AM, Zhang, Helin wrote:
>> */
>>>  	/* case PKT_RX_RECIP_ERR: return "PKT_RX_RECIP_ERR"; */
>>>  	/* case PKT_RX_MAC_ERR: return "PKT_RX_MAC_ERR"; */
>>> -	case PKT_RX_IPV4_HDR: return "PKT_RX_IPV4_HDR";
>>> -	case PKT_RX_IPV4_HDR_EXT: return "PKT_RX_IPV4_HDR_EXT";
>>> -	case PKT_RX_IPV6_HDR: return "PKT_RX_IPV6_HDR";
>>> -	case PKT_RX_IPV6_HDR_EXT: return "PKT_RX_IPV6_HDR_EXT";
>>>  	case PKT_RX_IEEE1588_PTP: return "PKT_RX_IEEE1588_PTP";
>>>  	case PKT_RX_IEEE1588_TMST: return "PKT_RX_IEEE1588_TMST";
>>> -	case PKT_RX_TUNNEL_IPV4_HDR: return "PKT_RX_TUNNEL_IPV4_HDR";
>>> -	case PKT_RX_TUNNEL_IPV6_HDR: return "PKT_RX_TUNNEL_IPV6_HDR";
>>
>> I see you are not removing IEEE1588. Is there a reason why it is not handled as
>> a packet_type?
> Ieee1588 is not a part of information reported by hardware in packet type.
> Yes, your idea on this is worth being taken into account.

This would indeed be more coherent. In this case, I think it would
require to add a l2_type in the packet_type info.


>>> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
>>> index 94ae344..5df0d61 100644
>>> --- a/lib/librte_mbuf/rte_mbuf.h
>>> +++ b/lib/librte_mbuf/rte_mbuf.h
>>> @@ -90,16 +90,10 @@ extern "C" {
>>>  #define PKT_RX_HBUF_OVERFLOW (0ULL << 0)  /**< Header buffer
>> overflow. */
>>>  #define PKT_RX_RECIP_ERR     (0ULL << 0)  /**< Hardware processing
>> error. */
>>>  #define PKT_RX_MAC_ERR       (0ULL << 0)  /**< MAC error. */
>>> -#define PKT_RX_IPV4_HDR      (1ULL << 5)  /**< RX packet with IPv4
>> header. */
>>> -#define PKT_RX_IPV4_HDR_EXT  (1ULL << 6)  /**< RX packet with
>> extended IPv4 header. */
>>> -#define PKT_RX_IPV6_HDR      (1ULL << 7)  /**< RX packet with IPv6
>> header. */
>>> -#define PKT_RX_IPV6_HDR_EXT  (1ULL << 8)  /**< RX packet with
>>> extended IPv6 header. */  #define PKT_RX_IEEE1588_PTP  (1ULL << 9)
>>> /**< RX IEEE1588 L2 Ethernet PT Packet. */  #define
>>> PKT_RX_IEEE1588_TMST (1ULL << 10) /**< RX IEEE1588 L2/L4 timestamped
>>> packet.*/ -#define PKT_RX_TUNNEL_IPV4_HDR (1ULL << 11) /**< RX tunnel
>> packet with IPv4 header.*/ -#define PKT_RX_TUNNEL_IPV6_HDR (1ULL << 12)
>> /**< RX tunnel packet with IPv6 header. */
>>> -#define PKT_RX_FDIR_ID       (1ULL << 13) /**< FD id reported if FDIR
>> match. */
>>> -#define PKT_RX_FDIR_FLX      (1ULL << 14) /**< Flexible bytes reported if
>> FDIR match. */
>>> +#define PKT_RX_FDIR_ID       (1ULL << 11) /**< FD id reported if FDIR
>> match. */
>>> +#define PKT_RX_FDIR_FLX      (1ULL << 12) /**< Flexible bytes reported if
>> FDIR match. */
>>
>> It looks like but numbers are not contiguous anymore (there is a hole between
>> 5 and 8).
> Initially I don't want to move the following values up, as I am not sure if it may
> affect other features.
> I'd prefer to keep that hole as reserved. What's the opinion from you guys?
> Thanks for the good comments!

I think changing the flags bit value to keep ordering is not a problem.

Regards,
Olivier
  

Patch

diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 1b14e02..8050ccf 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -215,14 +215,8 @@  const char *rte_get_rx_ol_flag_name(uint64_t mask)
 	/* case PKT_RX_HBUF_OVERFLOW: return "PKT_RX_HBUF_OVERFLOW"; */
 	/* case PKT_RX_RECIP_ERR: return "PKT_RX_RECIP_ERR"; */
 	/* case PKT_RX_MAC_ERR: return "PKT_RX_MAC_ERR"; */
-	case PKT_RX_IPV4_HDR: return "PKT_RX_IPV4_HDR";
-	case PKT_RX_IPV4_HDR_EXT: return "PKT_RX_IPV4_HDR_EXT";
-	case PKT_RX_IPV6_HDR: return "PKT_RX_IPV6_HDR";
-	case PKT_RX_IPV6_HDR_EXT: return "PKT_RX_IPV6_HDR_EXT";
 	case PKT_RX_IEEE1588_PTP: return "PKT_RX_IEEE1588_PTP";
 	case PKT_RX_IEEE1588_TMST: return "PKT_RX_IEEE1588_TMST";
-	case PKT_RX_TUNNEL_IPV4_HDR: return "PKT_RX_TUNNEL_IPV4_HDR";
-	case PKT_RX_TUNNEL_IPV6_HDR: return "PKT_RX_TUNNEL_IPV6_HDR";
 	default: return NULL;
 	}
 }
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 94ae344..5df0d61 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -90,16 +90,10 @@  extern "C" {
 #define PKT_RX_HBUF_OVERFLOW (0ULL << 0)  /**< Header buffer overflow. */
 #define PKT_RX_RECIP_ERR     (0ULL << 0)  /**< Hardware processing error. */
 #define PKT_RX_MAC_ERR       (0ULL << 0)  /**< MAC error. */
-#define PKT_RX_IPV4_HDR      (1ULL << 5)  /**< RX packet with IPv4 header. */
-#define PKT_RX_IPV4_HDR_EXT  (1ULL << 6)  /**< RX packet with extended IPv4 header. */
-#define PKT_RX_IPV6_HDR      (1ULL << 7)  /**< RX packet with IPv6 header. */
-#define PKT_RX_IPV6_HDR_EXT  (1ULL << 8)  /**< RX packet with extended IPv6 header. */
 #define PKT_RX_IEEE1588_PTP  (1ULL << 9)  /**< RX IEEE1588 L2 Ethernet PT Packet. */
 #define PKT_RX_IEEE1588_TMST (1ULL << 10) /**< RX IEEE1588 L2/L4 timestamped packet.*/
-#define PKT_RX_TUNNEL_IPV4_HDR (1ULL << 11) /**< RX tunnel packet with IPv4 header.*/
-#define PKT_RX_TUNNEL_IPV6_HDR (1ULL << 12) /**< RX tunnel packet with IPv6 header. */
-#define PKT_RX_FDIR_ID       (1ULL << 13) /**< FD id reported if FDIR match. */
-#define PKT_RX_FDIR_FLX      (1ULL << 14) /**< Flexible bytes reported if FDIR match. */
+#define PKT_RX_FDIR_ID       (1ULL << 11) /**< FD id reported if FDIR match. */
+#define PKT_RX_FDIR_FLX      (1ULL << 12) /**< Flexible bytes reported if FDIR match. */
 /* add new RX flags here */
 
 /* add new TX flags here */