Re: [PATCH net-next 2/6] net: hip04: use the big endian for tx and rx desc

2 messages, 2 authors, 2015-04-16 · open the first message on its own page

Re: [PATCH net-next 2/6] net: hip04: use the big endian for tx and rx desc

From: Arnd Bergmann <hidden>
Date: 2015-04-15 14:13:37

On Wednesday 15 April 2015 20:30:04 Ding Tianhong wrote:
The hip04 ethernet use the big endian for tx and rx, so set desc to
big endian and remove the unused next_addr.
I don't understand:
quoted hunk
diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index b0a7f03..6473462 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -132,19 +132,18 @@
 #define HIP04_MIN_TX_COALESCE_FRAMES   1
 
 struct tx_desc {
-       u32 send_addr;
-       u32 send_size;
-       u32 next_addr;
-       u32 cfg;
-       u32 wb_addr;
+       __be32 send_addr;
+       __be32 send_size;
+       __be32 cfg;
+       __be32 wb_addr;
 } __aligned(64);
I would think this is a hardware structure, does this not break
access to the cfg and wb_addr fields if you remove next_addr?

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH net-next 2/6] net: hip04: use the big endian for tx and rx desc

From: Ding Tianhong <hidden>
Date: 2015-04-16 06:25:26

On 2015/4/15 22:13, Arnd Bergmann wrote:
On Wednesday 15 April 2015 20:30:04 Ding Tianhong wrote:
quoted
The hip04 ethernet use the big endian for tx and rx, so set desc to
big endian and remove the unused next_addr.
I don't understand:
quoted
diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index b0a7f03..6473462 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -132,19 +132,18 @@
 #define HIP04_MIN_TX_COALESCE_FRAMES   1
 
 struct tx_desc {
-       u32 send_addr;
-       u32 send_size;
-       u32 next_addr;
-       u32 cfg;
-       u32 wb_addr;
+       __be32 send_addr;
+       __be32 send_size;
+       __be32 cfg;
+       __be32 wb_addr;
 } __aligned(64);
I would think this is a hardware structure, does this not break
access to the cfg and wb_addr fields if you remove next_addr?

	Arnd
good cache, I make a mistake here, thanks.
.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help