[dpdk-dev,1/5] net/fm10k: add back Rx checksum offload

Message ID 1472147299-2376-2-git-send-email-xiao.w.wang@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Xiao Wang Aug. 25, 2016, 5:48 p.m. UTC
  A previous patch (http://dpdk.org/dev/patchwork/patch/12937/) removed
some necessary lines about Rx checksum by mistake, this patch adds
them back.

Fixes: 6046898f5097 ("net/mbuf: remove unused Rx error flags")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 drivers/net/fm10k/fm10k_rxtx.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

Olivier Matz Aug. 26, 2016, 7:27 a.m. UTC | #1
Hi Xiao,

On 08/25/2016 07:48 PM, Xiao Wang wrote:
> A previous patch (http://dpdk.org/dev/patchwork/patch/12937/) removed
> some necessary lines about Rx checksum by mistake, this patch adds
> them back.
> 
> Fixes: 6046898f5097 ("net/mbuf: remove unused Rx error flags")
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>

Just a small comment about the title, what do you thinkg about:
"net/fm10k: fix Rx checksum flags" ?
I think having the word "fix" in the title would help for finding these
commits for the stable version.

Apart from that, thanks for fixing my mistake :)


Regards,
Olivier
  
Xiao Wang Aug. 31, 2016, 9:02 a.m. UTC | #2
Hi Olivier,

> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Friday, August 26, 2016 3:27 PM
> To: Wang, Xiao W <xiao.w.wang@intel.com>; Chen, Jing D
> <jing.d.chen@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [PATCH 1/5] net/fm10k: add back Rx checksum offload
> 
> Hi Xiao,
> 
> On 08/25/2016 07:48 PM, Xiao Wang wrote:
> > A previous patch (http://dpdk.org/dev/patchwork/patch/12937/) removed
> > some necessary lines about Rx checksum by mistake, this patch adds
> > them back.
> >
> > Fixes: 6046898f5097 ("net/mbuf: remove unused Rx error flags")
> >
> > Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> 
> Just a small comment about the title, what do you thinkg about:
> "net/fm10k: fix Rx checksum flags" ?
> I think having the word "fix" in the title would help for finding these
> commits for the stable version.
> 
> Apart from that, thanks for fixing my mistake :)
> 
> 
> Regards,
> Olivier

I agree with you, will change the commit log in V2.

Best Regards,
Xiao
  

Patch

diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 5b2d04b..bf5888b 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -96,6 +96,16 @@  rx_desc_to_ol_flags(struct rte_mbuf *m, const union fm10k_rx_desc *d)
 
 	if (d->w.pkt_info & FM10K_RXD_RSSTYPE_MASK)
 		m->ol_flags |= PKT_RX_RSS_HASH;
+
+	if (unlikely((d->d.staterr &
+		(FM10K_RXD_STATUS_IPCS | FM10K_RXD_STATUS_IPE)) ==
+		(FM10K_RXD_STATUS_IPCS | FM10K_RXD_STATUS_IPE)))
+		m->ol_flags |= PKT_RX_IP_CKSUM_BAD;
+
+	if (unlikely((d->d.staterr &
+		(FM10K_RXD_STATUS_L4CS | FM10K_RXD_STATUS_L4E)) ==
+		(FM10K_RXD_STATUS_L4CS | FM10K_RXD_STATUS_L4E)))
+		m->ol_flags |= PKT_RX_L4_CKSUM_BAD;
 }
 
 uint16_t