diff mbox

[dpdk-dev,v4,08/21] mbuf: extend fdir field

Message ID 1413939687-11177-9-git-send-email-jingjing.wu@intel.com (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Jingjing Wu Oct. 22, 2014, 1:01 a.m. UTC
extend fdir field to support flex bytes reported when fdir match

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 lib/librte_mbuf/rte_mbuf.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Thomas Monjalon Oct. 28, 2014, 1:28 p.m. UTC | #1
2014-10-22 09:01, Jingjing Wu:
> extend fdir field to support flex bytes reported when fdir match

The commit log should explain why it is required (i40e?).
It will help to understand when digging into git history of mbuf file.

> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -171,8 +173,14 @@ struct rte_mbuf {
>  	union {
>  		uint32_t rss;     /**< RSS hash result if RSS enabled */
>  		struct {
> -			uint16_t hash;
> -			uint16_t id;
> +			union {
> +				struct {
> +					uint16_t hash;
> +					uint16_t id;
> +				};
> +				uint32_t lo; /**< flexible bytes low*/
> +			};
> +			uint32_t hi;         /**< flexible bytes high*/
>  		} fdir;           /**< Filter identifier if FDIR enabled */

Please explain what could be the data of "flexible bytes high".
Jingjing Wu Oct. 29, 2014, 1:45 a.m. UTC | #2
Hi, Thomas

Thanks for your comments.

Jingjing

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Tuesday, October 28, 2014 9:28 PM
> To: Wu, Jingjing
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v4 08/21] mbuf: extend fdir field
> 
> 2014-10-22 09:01, Jingjing Wu:
> > extend fdir field to support flex bytes reported when fdir match
> 
> The commit log should explain why it is required (i40e?).
> It will help to understand when digging into git history of mbuf file.
> 
OK. Will explain.

> > --- a/lib/librte_mbuf/rte_mbuf.h
> > +++ b/lib/librte_mbuf/rte_mbuf.h
> > @@ -171,8 +173,14 @@ struct rte_mbuf {
> >  	union {
> >  		uint32_t rss;     /**< RSS hash result if RSS enabled */
> >  		struct {
> > -			uint16_t hash;
> > -			uint16_t id;
> > +			union {
> > +				struct {
> > +					uint16_t hash;
> > +					uint16_t id;
> > +				};
> > +				uint32_t lo; /**< flexible bytes low*/
> > +			};
> > +			uint32_t hi;         /**< flexible bytes high*/
> >  		} fdir;           /**< Filter identifier if FDIR enabled */
> 
> Please explain what could be the data of "flexible bytes high".
> 
When set the report status to report flex bytes, flexible bytes high field
report first 4 bytes in "little endian" notation.
OK. Will add comments in detail.
> --
> Thomas
diff mbox

Patch

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index ddadc21..d2fbf40 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -91,6 +91,8 @@  extern "C" {
 #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_FDIR_ID       (1ULL << 11) /**< FD id reported if FDIR match. */
+#define PKT_RX_FDIR_FLX      (1ULL << 12) /**< Flexible bytes reported if FDIR match. */
 
 #define PKT_TX_VLAN_PKT      (1ULL << 55) /**< TX packet is a 802.1q VLAN packet. */
 #define PKT_TX_IP_CKSUM      (1ULL << 54) /**< IP cksum of TX pkt. computed by NIC. */
@@ -171,8 +173,14 @@  struct rte_mbuf {
 	union {
 		uint32_t rss;     /**< RSS hash result if RSS enabled */
 		struct {
-			uint16_t hash;
-			uint16_t id;
+			union {
+				struct {
+					uint16_t hash;
+					uint16_t id;
+				};
+				uint32_t lo; /**< flexible bytes low*/
+			};
+			uint32_t hi;         /**< flexible bytes high*/
 		} fdir;           /**< Filter identifier if FDIR enabled */
 		uint32_t sched;   /**< Hierarchical scheduler */
 	} hash;                   /**< hash information */