All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/enic: use new Rx checksum flags
@ 2017-01-11  3:42 John Daley
  2017-01-11  3:42 ` [PATCH] net/enic: remove unnecessary function parameter attributes John Daley
  2017-01-11 18:00 ` [PATCH] net/enic: use new Rx checksum flags Ferruh Yigit
  0 siblings, 2 replies; 4+ messages in thread
From: John Daley @ 2017-01-11  3:42 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, John Daley

Use the new L3 and L4 ..CKSUM_GOOD  and ..CKSUM_UNKNOWN flags to
distinguish good checksums from unknown ones.

Signed-off-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_rxtx.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index 5d59d8f..981be3a 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -260,16 +260,25 @@ enic_cq_rx_to_pkt_flags(struct cq_desc *cqd, struct rte_mbuf *mbuf)
 	}
 
 	/* checksum flags */
-	if (!enic_cq_rx_desc_csum_not_calc(cqrd) &&
-		(mbuf->packet_type & RTE_PTYPE_L3_IPV4)) {
-		uint32_t l4_flags = mbuf->packet_type & RTE_PTYPE_L4_MASK;
-
-		if (unlikely(!enic_cq_rx_desc_ipv4_csum_ok(cqrd)))
-			pkt_flags |= PKT_RX_IP_CKSUM_BAD;
-		if (l4_flags == RTE_PTYPE_L4_UDP ||
-		    l4_flags == RTE_PTYPE_L4_TCP) {
-			if (unlikely(!enic_cq_rx_desc_tcp_udp_csum_ok(cqrd)))
-				pkt_flags |= PKT_RX_L4_CKSUM_BAD;
+	if (mbuf->packet_type & RTE_PTYPE_L3_IPV4) {
+		if (enic_cq_rx_desc_csum_not_calc(cqrd))
+			pkt_flags |= (PKT_RX_IP_CKSUM_UNKNOWN &
+				     PKT_RX_L4_CKSUM_UNKNOWN);
+		else {
+			uint32_t l4_flags;
+			l4_flags = mbuf->packet_type & RTE_PTYPE_L4_MASK;
+
+			if (enic_cq_rx_desc_ipv4_csum_ok(cqrd))
+				pkt_flags |= PKT_RX_IP_CKSUM_GOOD;
+			else
+				pkt_flags |= PKT_RX_IP_CKSUM_BAD;
+
+			if (l4_flags & (RTE_PTYPE_L4_UDP | RTE_PTYPE_L4_TCP)) {
+				if (enic_cq_rx_desc_tcp_udp_csum_ok(cqrd))
+					pkt_flags |= PKT_RX_L4_CKSUM_GOOD;
+				else
+					pkt_flags |= PKT_RX_L4_CKSUM_BAD;
+			}
 		}
 	}
 
-- 
2.10.0

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

* [PATCH] net/enic: remove unnecessary function parameter attributes
  2017-01-11  3:42 [PATCH] net/enic: use new Rx checksum flags John Daley
@ 2017-01-11  3:42 ` John Daley
  2017-01-11 18:00   ` Ferruh Yigit
  2017-01-11 18:00 ` [PATCH] net/enic: use new Rx checksum flags Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: John Daley @ 2017-01-11  3:42 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, John Daley, stable

Remove __rte_unused attributes in function declaration when
the parameters really are used.

Fixes: dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series")

CC: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index 865cd76..7ff994b 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -301,8 +301,7 @@ int enic_link_update(struct enic *enic);
 void enic_fdir_info(struct enic *enic);
 void enic_fdir_info_get(struct enic *enic, struct rte_eth_fdir_info *stats);
 void copy_fltr_v1(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
-		  struct rte_eth_fdir_masks *masks);
-void copy_fltr_v2(__rte_unused struct filter_v2 *fltr,
-		  __rte_unused struct rte_eth_fdir_input *input,
 		  __rte_unused struct rte_eth_fdir_masks *masks);
+void copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
+		  struct rte_eth_fdir_masks *masks);
 #endif /* _ENIC_H_ */
-- 
2.10.0

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

* Re: [PATCH] net/enic: use new Rx checksum flags
  2017-01-11  3:42 [PATCH] net/enic: use new Rx checksum flags John Daley
  2017-01-11  3:42 ` [PATCH] net/enic: remove unnecessary function parameter attributes John Daley
@ 2017-01-11 18:00 ` Ferruh Yigit
  1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2017-01-11 18:00 UTC (permalink / raw)
  To: John Daley; +Cc: dev

On 1/11/2017 3:42 AM, John Daley wrote:
> Use the new L3 and L4 ..CKSUM_GOOD  and ..CKSUM_UNKNOWN flags to
> distinguish good checksums from unknown ones.
> 
> Signed-off-by: John Daley <johndale@cisco.com>

Applied to dpdk-next-net/master, thanks.

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

* Re: [PATCH] net/enic: remove unnecessary function parameter attributes
  2017-01-11  3:42 ` [PATCH] net/enic: remove unnecessary function parameter attributes John Daley
@ 2017-01-11 18:00   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2017-01-11 18:00 UTC (permalink / raw)
  To: John Daley; +Cc: dev, stable

On 1/11/2017 3:42 AM, John Daley wrote:
> Remove __rte_unused attributes in function declaration when
> the parameters really are used.
> 
> Fixes: dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series")
> 
> CC: stable@dpdk.org
> Signed-off-by: John Daley <johndale@cisco.com>

Applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2017-01-11 18:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11  3:42 [PATCH] net/enic: use new Rx checksum flags John Daley
2017-01-11  3:42 ` [PATCH] net/enic: remove unnecessary function parameter attributes John Daley
2017-01-11 18:00   ` Ferruh Yigit
2017-01-11 18:00 ` [PATCH] net/enic: use new Rx checksum flags Ferruh Yigit

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.