patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] bugfix: rte_raw_checksum
@ 2020-05-27 13:40 guohongzhi
  2020-05-27 14:58 ` [dpdk-stable] [dpdk-dev] " Morten Brørup
  2020-06-24 12:21 ` [dpdk-stable] " Thomas Monjalon
  0 siblings, 2 replies; 8+ messages in thread
From: guohongzhi @ 2020-05-27 13:40 UTC (permalink / raw)
  To: dev
  Cc: stable, olivier.matz, mb, konstantin.ananyev, jiayu.hu,
	ferruh.yigit, nicolas.chautru, cristian.dumitrescu, zhoujingbin,
	chenchanghu, jerry.lilijun, haifeng.lin, guohongzhi1

From: Hongzhi Guo <guohongzhi1@huawei.com>

__rte_raw_cksum should consider Big Endian.

Signed-off-by: Hongzhi Guo <guohongzhi1@huawei.com>
---
 lib/librte_net/rte_ip.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index 1ceb7b7..eb863d4 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -140,7 +140,11 @@ __rte_raw_cksum(const void *buf, size_t len, uint32_t sum)
 
 	/* if length is in odd bytes */
 	if (len == 1)
+#if (RTE_BYTE_ORDER == RTE_BIG_ENDIAN)
+		sum += *((const uint8_t *)u16_buf) << 8;
+#else
 		sum += *((const uint8_t *)u16_buf);
+#endif
 
 	return sum;
 }
-- 
2.21.0.windows.1



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

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 13:40 [dpdk-stable] [PATCH] bugfix: rte_raw_checksum guohongzhi
2020-05-27 14:58 ` [dpdk-stable] [dpdk-dev] " Morten Brørup
2020-06-24 12:21 ` [dpdk-stable] " Thomas Monjalon
2020-06-24 13:00   ` Morten Brørup
2020-06-24 15:04     ` Thomas Monjalon
2020-06-24 15:11       ` [dpdk-stable] [dpdk-dev] " Morten Brørup
2020-07-06  7:36         ` Olivier Matz
2020-07-06  7:46           ` Olivier Matz

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox