[dpdk-dev,06/17] bond: support of unified packet type

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

Commit Message

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

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_pmd_bond/rte_eth_bond_pmd.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
  

Comments

Doherty, Declan Feb. 11, 2015, 3:01 p.m. UTC | #1
On 29/01/15 03:15, Helin Zhang wrote:
> To unify packet types among all PMDs, bit masks of packet type for
> ol_flags are replaced by unified packet type.
>
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> ---
>   lib/librte_pmd_bond/rte_eth_bond_pmd.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
> index 8b80297..acd8e77 100644
> --- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c
> +++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
> @@ -319,12 +319,11 @@ xmit_l23_hash(const struct rte_mbuf *buf, uint8_t slave_count)
>
>   	hash = ether_hash(eth_hdr);
>
> -	if (buf->ol_flags & PKT_RX_IPV4_HDR) {
> +	if (RTE_ETH_IS_IPV4_HDR(buf->packet_type)) {
>   		struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)
>   				((char *)(eth_hdr + 1) + vlan_offset);
>   		l3hash = ipv4_hash(ipv4_hdr);
> -
> -	} else if  (buf->ol_flags & PKT_RX_IPV6_HDR) {
> +	} else if  (RTE_ETH_IS_IPV6_HDR(buf->packet_type)) {
>   		struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)
>   				((char *)(eth_hdr + 1) + vlan_offset);
>   		l3hash = ipv6_hash(ipv6_hdr);
> @@ -346,7 +345,7 @@ xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count)
>   	struct tcp_hdr *tcp_hdr = NULL;
>   	uint32_t hash, l3hash = 0, l4hash = 0;
>
> -	if (buf->ol_flags & PKT_RX_IPV4_HDR) {
> +	if (RTE_ETH_IS_IPV4_HDR(buf->packet_type)) {
>   		struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)
>   				((char *)(eth_hdr + 1) + vlan_offset);
>   		size_t ip_hdr_offset;
> @@ -365,7 +364,7 @@ xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count)
>   					ip_hdr_offset);
>   			l4hash = HASH_L4_PORTS(udp_hdr);
>   		}
> -	} else if  (buf->ol_flags & PKT_RX_IPV6_HDR) {
> +	} else if  (RTE_ETH_IS_IPV6_HDR(buf->packet_type)) {
>   		struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)
>   				((char *)(eth_hdr + 1) + vlan_offset);
>   		l3hash = ipv6_hash(ipv6_hdr);
>

Hey Helin,
this patch should no longer be necessary as commit # 
bffc9b35e3acd70895b73616c850d8d37fe5732e removed all references to the 
ol_flags in the link bonding code.

Declan
  
Zhang, Helin Feb. 13, 2015, 12:36 a.m. UTC | #2
Hi Declan

Yes, I got it. I already have v2 patch of it which has no changes for bond anymore. Thanks!

Regards,
Helin

> -----Original Message-----
> From: Doherty, Declan
> Sent: Wednesday, February 11, 2015 11:01 PM
> To: Zhang, Helin; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 06/17] bond: support of unified packet type
> 
> On 29/01/15 03:15, Helin Zhang wrote:
> > To unify packet types among all PMDs, bit masks of packet type for
> > ol_flags are replaced by unified packet type.
> >
> > Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> > ---
> >   lib/librte_pmd_bond/rte_eth_bond_pmd.c | 9 ++++-----
> >   1 file changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c
> > b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
> > index 8b80297..acd8e77 100644
> > --- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c
> > +++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
> > @@ -319,12 +319,11 @@ xmit_l23_hash(const struct rte_mbuf *buf,
> > uint8_t slave_count)
> >
> >   	hash = ether_hash(eth_hdr);
> >
> > -	if (buf->ol_flags & PKT_RX_IPV4_HDR) {
> > +	if (RTE_ETH_IS_IPV4_HDR(buf->packet_type)) {
> >   		struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)
> >   				((char *)(eth_hdr + 1) + vlan_offset);
> >   		l3hash = ipv4_hash(ipv4_hdr);
> > -
> > -	} else if  (buf->ol_flags & PKT_RX_IPV6_HDR) {
> > +	} else if  (RTE_ETH_IS_IPV6_HDR(buf->packet_type)) {
> >   		struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)
> >   				((char *)(eth_hdr + 1) + vlan_offset);
> >   		l3hash = ipv6_hash(ipv6_hdr);
> > @@ -346,7 +345,7 @@ xmit_l34_hash(const struct rte_mbuf *buf, uint8_t
> slave_count)
> >   	struct tcp_hdr *tcp_hdr = NULL;
> >   	uint32_t hash, l3hash = 0, l4hash = 0;
> >
> > -	if (buf->ol_flags & PKT_RX_IPV4_HDR) {
> > +	if (RTE_ETH_IS_IPV4_HDR(buf->packet_type)) {
> >   		struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)
> >   				((char *)(eth_hdr + 1) + vlan_offset);
> >   		size_t ip_hdr_offset;
> > @@ -365,7 +364,7 @@ xmit_l34_hash(const struct rte_mbuf *buf, uint8_t
> slave_count)
> >   					ip_hdr_offset);
> >   			l4hash = HASH_L4_PORTS(udp_hdr);
> >   		}
> > -	} else if  (buf->ol_flags & PKT_RX_IPV6_HDR) {
> > +	} else if  (RTE_ETH_IS_IPV6_HDR(buf->packet_type)) {
> >   		struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)
> >   				((char *)(eth_hdr + 1) + vlan_offset);
> >   		l3hash = ipv6_hash(ipv6_hdr);
> >
> 
> Hey Helin,
> this patch should no longer be necessary as commit #
> bffc9b35e3acd70895b73616c850d8d37fe5732e removed all references to the
> ol_flags in the link bonding code.
> 
> Declan
  

Patch

diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
index 8b80297..acd8e77 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c
+++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
@@ -319,12 +319,11 @@  xmit_l23_hash(const struct rte_mbuf *buf, uint8_t slave_count)
 
 	hash = ether_hash(eth_hdr);
 
-	if (buf->ol_flags & PKT_RX_IPV4_HDR) {
+	if (RTE_ETH_IS_IPV4_HDR(buf->packet_type)) {
 		struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)
 				((char *)(eth_hdr + 1) + vlan_offset);
 		l3hash = ipv4_hash(ipv4_hdr);
-
-	} else if  (buf->ol_flags & PKT_RX_IPV6_HDR) {
+	} else if  (RTE_ETH_IS_IPV6_HDR(buf->packet_type)) {
 		struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)
 				((char *)(eth_hdr + 1) + vlan_offset);
 		l3hash = ipv6_hash(ipv6_hdr);
@@ -346,7 +345,7 @@  xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count)
 	struct tcp_hdr *tcp_hdr = NULL;
 	uint32_t hash, l3hash = 0, l4hash = 0;
 
-	if (buf->ol_flags & PKT_RX_IPV4_HDR) {
+	if (RTE_ETH_IS_IPV4_HDR(buf->packet_type)) {
 		struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)
 				((char *)(eth_hdr + 1) + vlan_offset);
 		size_t ip_hdr_offset;
@@ -365,7 +364,7 @@  xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count)
 					ip_hdr_offset);
 			l4hash = HASH_L4_PORTS(udp_hdr);
 		}
-	} else if  (buf->ol_flags & PKT_RX_IPV6_HDR) {
+	} else if  (RTE_ETH_IS_IPV6_HDR(buf->packet_type)) {
 		struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)
 				((char *)(eth_hdr + 1) + vlan_offset);
 		l3hash = ipv6_hash(ipv6_hdr);