All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] examples/ip_fragmentation: fix check of packet type
@ 2017-03-10  3:28 Wei Dai
  2017-03-10  3:36 ` Dai, Wei
  2017-03-10 12:21 ` Ananyev, Konstantin
  0 siblings, 2 replies; 8+ messages in thread
From: Wei Dai @ 2017-03-10  3:28 UTC (permalink / raw)
  To: dev, konstantin.ananyev; +Cc: Wei Dai, stable

The packet_type in mbuf is not correctly filled by ixgbe 82599 NIC.
To use the ether_type in ethernet header to check packet type is
more reliaber.

Fixes: 3c0184cc0c60 ("examples: replace some offload flags with packet type")
Fixes: ab351fe1c95c ("mbuf: remove packet type from offload flags")

Cc: stable@dpdk.org

Reported-by: Fangfang Wei <fangfangx.wei@intel.com>
Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Fagnfang Wei <fangfangx.wei@intel.com>
---
 examples/ip_fragmentation/main.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index e1e32c6..8612984 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -268,6 +268,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
 	uint32_t i, len, next_hop_ipv4;
 	uint8_t next_hop_ipv6, port_out, ipv6;
 	int32_t len2;
+	struct ether_hdr *eth_hdr;
 
 	ipv6 = 0;
 	rxq = &qconf->rx_queue_list[queueid];
@@ -276,13 +277,14 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
 	port_out = port_in;
 
 	/* Remove the Ethernet header and trailer from the input packet */
+	eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
 	rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr));
 
 	/* Build transmission burst */
 	len = qconf->tx_mbufs[port_out].len;
 
 	/* if this is an IPv4 packet */
-	if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
+	if (eth_hdr->ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) {
 		struct ipv4_hdr *ip_hdr;
 		uint32_t ip_dst;
 		/* Read the lookup key (i.e. ip_dst) from the input packet */
@@ -316,7 +318,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
 			if (unlikely (len2 < 0))
 				return;
 		}
-	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
+	} else if (eth_hdr->ether_type == rte_be_to_cpu_16(ETHER_TYPE_IPv6)) {
 		/* if this is an IPv6 packet */
 		struct ipv6_hdr *ip_hdr;
 
@@ -363,8 +365,8 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
 		void *d_addr_bytes;
 
 		m = qconf->tx_mbufs[port_out].m_table[i];
-		struct ether_hdr *eth_hdr = (struct ether_hdr *)
-			rte_pktmbuf_prepend(m, (uint16_t)sizeof(struct ether_hdr));
+		eth_hdr = (struct ether_hdr *)rte_pktmbuf_prepend(m,
+			(uint16_t)sizeof(struct ether_hdr));
 		if (eth_hdr == NULL) {
 			rte_panic("No headroom in mbuf.\n");
 		}
-- 
2.7.4

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

* Re: [PATCH] examples/ip_fragmentation: fix check of packet type
  2017-03-10  3:28 [PATCH] examples/ip_fragmentation: fix check of packet type Wei Dai
@ 2017-03-10  3:36 ` Dai, Wei
  2017-03-10 12:21 ` Ananyev, Konstantin
  1 sibling, 0 replies; 8+ messages in thread
From: Dai, Wei @ 2017-03-10  3:36 UTC (permalink / raw)
  To: dev, Ananyev, Konstantin; +Cc: stable

Sorry, correct the name of Tester

> -----Original Message-----
> From: Dai, Wei
> Sent: Friday, March 10, 2017 11:28 AM
> To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Cc: Dai, Wei <wei.dai@intel.com>; stable@dpdk.org
> Subject: [PATCH] examples/ip_fragmentation: fix check of packet type
> 
> The packet_type in mbuf is not correctly filled by ixgbe 82599 NIC.
> To use the ether_type in ethernet header to check packet type is more reliaber.
> 
> Fixes: 3c0184cc0c60 ("examples: replace some offload flags with packet type")
> Fixes: ab351fe1c95c ("mbuf: remove packet type from offload flags")
> 
> Cc: stable@dpdk.org
> 
> Reported-by: Fangfang Wei <fangfangx.wei@intel.com>
> Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Fangfang Wei <fangfangx.wei@intel.com>
> ---
>  examples/ip_fragmentation/main.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/examples/ip_fragmentation/main.c
> b/examples/ip_fragmentation/main.c
> index e1e32c6..8612984 100644
> --- a/examples/ip_fragmentation/main.c
> +++ b/examples/ip_fragmentation/main.c
> @@ -268,6 +268,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct
> lcore_queue_conf *qconf,
>  	uint32_t i, len, next_hop_ipv4;
>  	uint8_t next_hop_ipv6, port_out, ipv6;
>  	int32_t len2;
> +	struct ether_hdr *eth_hdr;
> 
>  	ipv6 = 0;
>  	rxq = &qconf->rx_queue_list[queueid];
> @@ -276,13 +277,14 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct
> lcore_queue_conf *qconf,
>  	port_out = port_in;
> 
>  	/* Remove the Ethernet header and trailer from the input packet */
> +	eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
>  	rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr));
> 
>  	/* Build transmission burst */
>  	len = qconf->tx_mbufs[port_out].len;
> 
>  	/* if this is an IPv4 packet */
> -	if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
> +	if (eth_hdr->ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) {
>  		struct ipv4_hdr *ip_hdr;
>  		uint32_t ip_dst;
>  		/* Read the lookup key (i.e. ip_dst) from the input packet */ @@
> -316,7 +318,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct
> lcore_queue_conf *qconf,
>  			if (unlikely (len2 < 0))
>  				return;
>  		}
> -	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
> +	} else if (eth_hdr->ether_type == rte_be_to_cpu_16(ETHER_TYPE_IPv6)) {
>  		/* if this is an IPv6 packet */
>  		struct ipv6_hdr *ip_hdr;
> 
> @@ -363,8 +365,8 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct
> lcore_queue_conf *qconf,
>  		void *d_addr_bytes;
> 
>  		m = qconf->tx_mbufs[port_out].m_table[i];
> -		struct ether_hdr *eth_hdr = (struct ether_hdr *)
> -			rte_pktmbuf_prepend(m, (uint16_t)sizeof(struct ether_hdr));
> +		eth_hdr = (struct ether_hdr *)rte_pktmbuf_prepend(m,
> +			(uint16_t)sizeof(struct ether_hdr));
>  		if (eth_hdr == NULL) {
>  			rte_panic("No headroom in mbuf.\n");
>  		}
> --
> 2.7.4

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

* Re: [PATCH] examples/ip_fragmentation: fix check of packet type
  2017-03-10  3:28 [PATCH] examples/ip_fragmentation: fix check of packet type Wei Dai
  2017-03-10  3:36 ` Dai, Wei
@ 2017-03-10 12:21 ` Ananyev, Konstantin
  2017-03-13  3:29   ` Dai, Wei
  1 sibling, 1 reply; 8+ messages in thread
From: Ananyev, Konstantin @ 2017-03-10 12:21 UTC (permalink / raw)
  To: Dai, Wei, dev; +Cc: stable

Hi Wei,

> -----Original Message-----
> From: Dai, Wei
> Sent: Friday, March 10, 2017 3:28 AM
> To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Cc: Dai, Wei <wei.dai@intel.com>; stable@dpdk.org
> Subject: [PATCH] examples/ip_fragmentation: fix check of packet type
> 
> The packet_type in mbuf is not correctly filled by ixgbe 82599 NIC.
> To use the ether_type in ethernet header to check packet type is
> more reliaber.
> 
> Fixes: 3c0184cc0c60 ("examples: replace some offload flags with packet type")
> Fixes: ab351fe1c95c ("mbuf: remove packet type from offload flags")
> 
> Cc: stable@dpdk.org
> 
> Reported-by: Fangfang Wei <fangfangx.wei@intel.com>
> Signed-off-by: Wei Dai <wei.dai@intel.com>
> Tested-by: Fagnfang Wei <fangfangx.wei@intel.com>
> ---
>  examples/ip_fragmentation/main.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
> index e1e32c6..8612984 100644
> --- a/examples/ip_fragmentation/main.c
> +++ b/examples/ip_fragmentation/main.c
> @@ -268,6 +268,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
>  	uint32_t i, len, next_hop_ipv4;
>  	uint8_t next_hop_ipv6, port_out, ipv6;
>  	int32_t len2;
> +	struct ether_hdr *eth_hdr;
> 
>  	ipv6 = 0;
>  	rxq = &qconf->rx_queue_list[queueid];
> @@ -276,13 +277,14 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
>  	port_out = port_in;
> 
>  	/* Remove the Ethernet header and trailer from the input packet */
> +	eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
>  	rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr));
> 
>  	/* Build transmission burst */
>  	len = qconf->tx_mbufs[port_out].len;
> 
>  	/* if this is an IPv4 packet */
> -	if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
> +	if (eth_hdr->ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) {
>  		struct ipv4_hdr *ip_hdr;
>  		uint32_t ip_dst;
>  		/* Read the lookup key (i.e. ip_dst) from the input packet */
> @@ -316,7 +318,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
>  			if (unlikely (len2 < 0))
>  				return;
>  		}
> -	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
> +	} else if (eth_hdr->ether_type == rte_be_to_cpu_16(ETHER_TYPE_IPv6)) {
>  		/* if this is an IPv6 packet */
>  		struct ipv6_hdr *ip_hdr;
> 
> @@ -363,8 +365,8 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
>  		void *d_addr_bytes;
> 
>  		m = qconf->tx_mbufs[port_out].m_table[i];
> -		struct ether_hdr *eth_hdr = (struct ether_hdr *)
> -			rte_pktmbuf_prepend(m, (uint16_t)sizeof(struct ether_hdr));
> +		eth_hdr = (struct ether_hdr *)rte_pktmbuf_prepend(m,
> +			(uint16_t)sizeof(struct ether_hdr));
>  		if (eth_hdr == NULL) {
>  			rte_panic("No headroom in mbuf.\n");
>  		}

Thanks for the fix.
Would it be more convenient to do what l3fwd does:
Check what ptype capabilities are provided by HW, if no ptype support detected,
then install an RX callback?
Konstantin

> --
> 2.7.4

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

* Re: [PATCH] examples/ip_fragmentation: fix check of packet type
  2017-03-10 12:21 ` Ananyev, Konstantin
@ 2017-03-13  3:29   ` Dai, Wei
  2017-03-13  7:01     ` Ananyev, Konstantin
  0 siblings, 1 reply; 8+ messages in thread
From: Dai, Wei @ 2017-03-13  3:29 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev; +Cc: stable

Hi, Konstantin
I see your point.
I think your method can work.
But I think your method is a bit complex. As you method need to add more codes.
Anyway this is a simple bug.
How do you think now ?

> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Friday, March 10, 2017 8:21 PM
> To: Dai, Wei <wei.dai@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: RE: [PATCH] examples/ip_fragmentation: fix check of packet type
> 
> Hi Wei,
> 
> > -----Original Message-----
> > From: Dai, Wei
> > Sent: Friday, March 10, 2017 3:28 AM
> > To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>
> > Cc: Dai, Wei <wei.dai@intel.com>; stable@dpdk.org
> > Subject: [PATCH] examples/ip_fragmentation: fix check of packet type
> >
> > The packet_type in mbuf is not correctly filled by ixgbe 82599 NIC.
> > To use the ether_type in ethernet header to check packet type is more
> > reliaber.
> >
> > Fixes: 3c0184cc0c60 ("examples: replace some offload flags with packet
> > type")
> > Fixes: ab351fe1c95c ("mbuf: remove packet type from offload flags")
> >
> > Cc: stable@dpdk.org
> >
> > Reported-by: Fangfang Wei <fangfangx.wei@intel.com>
> > Signed-off-by: Wei Dai <wei.dai@intel.com>
> > Tested-by: Fagnfang Wei <fangfangx.wei@intel.com>
> > ---
> >  examples/ip_fragmentation/main.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/examples/ip_fragmentation/main.c
> > b/examples/ip_fragmentation/main.c
> > index e1e32c6..8612984 100644
> > --- a/examples/ip_fragmentation/main.c
> > +++ b/examples/ip_fragmentation/main.c
> > @@ -268,6 +268,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct
> lcore_queue_conf *qconf,
> >  	uint32_t i, len, next_hop_ipv4;
> >  	uint8_t next_hop_ipv6, port_out, ipv6;
> >  	int32_t len2;
> > +	struct ether_hdr *eth_hdr;
> >
> >  	ipv6 = 0;
> >  	rxq = &qconf->rx_queue_list[queueid]; @@ -276,13 +277,14 @@
> > l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
> >  	port_out = port_in;
> >
> >  	/* Remove the Ethernet header and trailer from the input packet */
> > +	eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
> >  	rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr));
> >
> >  	/* Build transmission burst */
> >  	len = qconf->tx_mbufs[port_out].len;
> >
> >  	/* if this is an IPv4 packet */
> > -	if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
> > +	if (eth_hdr->ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) {
> >  		struct ipv4_hdr *ip_hdr;
> >  		uint32_t ip_dst;
> >  		/* Read the lookup key (i.e. ip_dst) from the input packet */ @@
> > -316,7 +318,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct
> lcore_queue_conf *qconf,
> >  			if (unlikely (len2 < 0))
> >  				return;
> >  		}
> > -	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
> > +	} else if (eth_hdr->ether_type == rte_be_to_cpu_16(ETHER_TYPE_IPv6))
> > +{
> >  		/* if this is an IPv6 packet */
> >  		struct ipv6_hdr *ip_hdr;
> >
> > @@ -363,8 +365,8 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct
> lcore_queue_conf *qconf,
> >  		void *d_addr_bytes;
> >
> >  		m = qconf->tx_mbufs[port_out].m_table[i];
> > -		struct ether_hdr *eth_hdr = (struct ether_hdr *)
> > -			rte_pktmbuf_prepend(m, (uint16_t)sizeof(struct ether_hdr));
> > +		eth_hdr = (struct ether_hdr *)rte_pktmbuf_prepend(m,
> > +			(uint16_t)sizeof(struct ether_hdr));
> >  		if (eth_hdr == NULL) {
> >  			rte_panic("No headroom in mbuf.\n");
> >  		}
> 
> Thanks for the fix.
> Would it be more convenient to do what l3fwd does:
> Check what ptype capabilities are provided by HW, if no ptype support detected,
> then install an RX callback?
> Konstantin
> 
> > --
> > 2.7.4

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

* Re: [PATCH] examples/ip_fragmentation: fix check of packet type
  2017-03-13  3:29   ` Dai, Wei
@ 2017-03-13  7:01     ` Ananyev, Konstantin
  2017-03-13  7:56       ` Dai, Wei
  0 siblings, 1 reply; 8+ messages in thread
From: Ananyev, Konstantin @ 2017-03-13  7:01 UTC (permalink / raw)
  To: Dai, Wei, dev; +Cc: stable

Hi Wei,

> 
> Hi, Konstantin
> I see your point.
> I think your method can work.
> But I think your method is a bit complex. As you method need to add more codes.
> Anyway this is a simple bug.
> How do you think now ?

I still think it is better for all apps to handle this issue in a uniform way.
Again in that case for NICs that do support PTYPE offloads the performance should be unaffected.
Konstantin

> 
> > -----Original Message-----
> > From: Ananyev, Konstantin
> > Sent: Friday, March 10, 2017 8:21 PM
> > To: Dai, Wei <wei.dai@intel.com>; dev@dpdk.org
> > Cc: stable@dpdk.org
> > Subject: RE: [PATCH] examples/ip_fragmentation: fix check of packet type
> >
> > Hi Wei,
> >
> > > -----Original Message-----
> > > From: Dai, Wei
> > > Sent: Friday, March 10, 2017 3:28 AM
> > > To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>
> > > Cc: Dai, Wei <wei.dai@intel.com>; stable@dpdk.org
> > > Subject: [PATCH] examples/ip_fragmentation: fix check of packet type
> > >
> > > The packet_type in mbuf is not correctly filled by ixgbe 82599 NIC.
> > > To use the ether_type in ethernet header to check packet type is more
> > > reliaber.
> > >
> > > Fixes: 3c0184cc0c60 ("examples: replace some offload flags with packet
> > > type")
> > > Fixes: ab351fe1c95c ("mbuf: remove packet type from offload flags")
> > >
> > > Cc: stable@dpdk.org
> > >
> > > Reported-by: Fangfang Wei <fangfangx.wei@intel.com>
> > > Signed-off-by: Wei Dai <wei.dai@intel.com>
> > > Tested-by: Fagnfang Wei <fangfangx.wei@intel.com>
> > > ---
> > >  examples/ip_fragmentation/main.c | 10 ++++++----
> > >  1 file changed, 6 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/examples/ip_fragmentation/main.c
> > > b/examples/ip_fragmentation/main.c
> > > index e1e32c6..8612984 100644
> > > --- a/examples/ip_fragmentation/main.c
> > > +++ b/examples/ip_fragmentation/main.c
> > > @@ -268,6 +268,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct
> > lcore_queue_conf *qconf,
> > >  	uint32_t i, len, next_hop_ipv4;
> > >  	uint8_t next_hop_ipv6, port_out, ipv6;
> > >  	int32_t len2;
> > > +	struct ether_hdr *eth_hdr;
> > >
> > >  	ipv6 = 0;
> > >  	rxq = &qconf->rx_queue_list[queueid]; @@ -276,13 +277,14 @@
> > > l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
> > >  	port_out = port_in;
> > >
> > >  	/* Remove the Ethernet header and trailer from the input packet */
> > > +	eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
> > >  	rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr));
> > >
> > >  	/* Build transmission burst */
> > >  	len = qconf->tx_mbufs[port_out].len;
> > >
> > >  	/* if this is an IPv4 packet */
> > > -	if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
> > > +	if (eth_hdr->ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) {
> > >  		struct ipv4_hdr *ip_hdr;
> > >  		uint32_t ip_dst;
> > >  		/* Read the lookup key (i.e. ip_dst) from the input packet */ @@
> > > -316,7 +318,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct
> > lcore_queue_conf *qconf,
> > >  			if (unlikely (len2 < 0))
> > >  				return;
> > >  		}
> > > -	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
> > > +	} else if (eth_hdr->ether_type == rte_be_to_cpu_16(ETHER_TYPE_IPv6))
> > > +{
> > >  		/* if this is an IPv6 packet */
> > >  		struct ipv6_hdr *ip_hdr;
> > >
> > > @@ -363,8 +365,8 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct
> > lcore_queue_conf *qconf,
> > >  		void *d_addr_bytes;
> > >
> > >  		m = qconf->tx_mbufs[port_out].m_table[i];
> > > -		struct ether_hdr *eth_hdr = (struct ether_hdr *)
> > > -			rte_pktmbuf_prepend(m, (uint16_t)sizeof(struct ether_hdr));
> > > +		eth_hdr = (struct ether_hdr *)rte_pktmbuf_prepend(m,
> > > +			(uint16_t)sizeof(struct ether_hdr));
> > >  		if (eth_hdr == NULL) {
> > >  			rte_panic("No headroom in mbuf.\n");
> > >  		}
> >
> > Thanks for the fix.
> > Would it be more convenient to do what l3fwd does:
> > Check what ptype capabilities are provided by HW, if no ptype support detected,
> > then install an RX callback?
> > Konstantin
> >
> > > --
> > > 2.7.4

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

* Re: [PATCH] examples/ip_fragmentation: fix check of packet type
  2017-03-13  7:01     ` Ananyev, Konstantin
@ 2017-03-13  7:56       ` Dai, Wei
  2017-03-13 22:13         ` Ananyev, Konstantin
  0 siblings, 1 reply; 8+ messages in thread
From: Dai, Wei @ 2017-03-13  7:56 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev; +Cc: stable

> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Monday, March 13, 2017 3:02 PM
> To: Dai, Wei <wei.dai@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: RE: [PATCH] examples/ip_fragmentation: fix check of packet type
> 
> Hi Wei,
> 
> >
> > Hi, Konstantin
> > I see your point.
> > I think your method can work.
> > But I think your method is a bit complex. As you method need to add more
> codes.
> > Anyway this is a simple bug.
> > How do you think now ?
> 
> I still think it is better for all apps to handle this issue in a uniform way.
> Again in that case for NICs that do support PTYPE offloads the performance
> should be unaffected.
> Konstantin
> 

I have just had a quick look through the l3fwd and didn't find any codes to 
check what ptypes capabilities ae provided by stuff below DPDK PMD & its base driver.
L3fwd only check an input argument "--parse-ptype" to enable ptype check implemented in
a Rx callback function.
In this l3fwd rx callback function,  it has done the same thing as my code.
Anyway, I'd like to provide a v2 patch to deal with this issue in a uniform way.

Thanks & Best Regards
-Wei

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

* Re: [PATCH] examples/ip_fragmentation: fix check of packet type
  2017-03-13  7:56       ` Dai, Wei
@ 2017-03-13 22:13         ` Ananyev, Konstantin
  2017-03-14  1:18           ` Dai, Wei
  0 siblings, 1 reply; 8+ messages in thread
From: Ananyev, Konstantin @ 2017-03-13 22:13 UTC (permalink / raw)
  To: Dai, Wei, dev; +Cc: stable



> > Hi Wei,
> >
> > >
> > > Hi, Konstantin
> > > I see your point.
> > > I think your method can work.
> > > But I think your method is a bit complex. As you method need to add more
> > codes.
> > > Anyway this is a simple bug.
> > > How do you think now ?
> >
> > I still think it is better for all apps to handle this issue in a uniform way.
> > Again in that case for NICs that do support PTYPE offloads the performance
> > should be unaffected.
> > Konstantin
> >
> 
> I have just had a quick look through the l3fwd and didn't find any codes to
> check what ptypes capabilities ae provided by stuff below DPDK PMD & its base driver.
> L3fwd only check an input argument "--parse-ptype" to enable ptype check implemented in
> a Rx callback function.

As an example for lpm:
http://dpdk.org/browse/dpdk/tree/examples/l3fwd/l3fwd_lpm.c#n279
Konstantin


> In this l3fwd rx callback function,  it has done the same thing as my code.
> Anyway, I'd like to provide a v2 patch to deal with this issue in a uniform way.
> 
> Thanks & Best Regards
> -Wei

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

* Re: [PATCH] examples/ip_fragmentation: fix check of packet type
  2017-03-13 22:13         ` Ananyev, Konstantin
@ 2017-03-14  1:18           ` Dai, Wei
  0 siblings, 0 replies; 8+ messages in thread
From: Dai, Wei @ 2017-03-14  1:18 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev; +Cc: stable

> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Tuesday, March 14, 2017 6:13 AM
> To: Dai, Wei <wei.dai@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: RE: [PATCH] examples/ip_fragmentation: fix check of packet type
> 
> 
> 
> > > Hi Wei,
> > >
> > > >
> > > > Hi, Konstantin
> > > > I see your point.
> > > > I think your method can work.
> > > > But I think your method is a bit complex. As you method need to
> > > > add more
> > > codes.
> > > > Anyway this is a simple bug.
> > > > How do you think now ?
> > >
> > > I still think it is better for all apps to handle this issue in a uniform way.
> > > Again in that case for NICs that do support PTYPE offloads the
> > > performance should be unaffected.
> > > Konstantin
> > >
> >
> > I have just had a quick look through the l3fwd and didn't find any
> > codes to check what ptypes capabilities ae provided by stuff below DPDK
> PMD & its base driver.
> > L3fwd only check an input argument "--parse-ptype" to enable ptype
> > check implemented in a Rx callback function.
> 
> As an example for lpm:
> http://dpdk.org/browse/dpdk/tree/examples/l3fwd/l3fwd_lpm.c#n279
> Konstantin

Thanks for your guide.
I will use rte_eth_dev_get_supported_ptypes( ) in my v2 patch.

> 
> 
> > In this l3fwd rx callback function,  it has done the same thing as my code.
> > Anyway, I'd like to provide a v2 patch to deal with this issue in a uniform way.
> >
> > Thanks & Best Regards
> > -Wei

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

end of thread, other threads:[~2017-03-14  1:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-10  3:28 [PATCH] examples/ip_fragmentation: fix check of packet type Wei Dai
2017-03-10  3:36 ` Dai, Wei
2017-03-10 12:21 ` Ananyev, Konstantin
2017-03-13  3:29   ` Dai, Wei
2017-03-13  7:01     ` Ananyev, Konstantin
2017-03-13  7:56       ` Dai, Wei
2017-03-13 22:13         ` Ananyev, Konstantin
2017-03-14  1:18           ` Dai, Wei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.