diff mbox series

[4/5] net/i40e: fix compilation on ARM BE

Message ID 1509617335-6354-4-git-send-email-hemant.agrawal@nxp.com
State Superseded
Headers show
Series [1/5] pmdinfogen: fix cross compilation for ARM BE | expand

Commit Message

Hemant Agrawal Nov. 2, 2017, 10:08 a.m. UTC
This patch fixes the following error observed when
compiling with ARM BE compiler.

i40e_ethdev.c: In function ‘i40e_dev_tunnel_filter_set’:
i40e_ethdev.c:6988:5: error: lvalue required as unary ‘&’ operand
     &rte_cpu_to_le_32(ipv4_addr),

Fixes: edc845bd53ec ("app/testpmd: fix build on FreeBSD")
Cc: Marvin Liu <yong.liu@intel.com>
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 drivers/net/i40e/i40e_ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

-- 
2.7.4

Comments

Xing, Beilei Nov. 3, 2017, 3:03 a.m. UTC | #1
> -----Original Message-----

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Hemant Agrawal

> Sent: Thursday, November 2, 2017 6:09 PM

> To: dev@dpdk.org

> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Liu, Yong <yong.liu@intel.com>;

> stable@dpdk.org

> Subject: [dpdk-dev] [PATCH 4/5] net/i40e: fix compilation on ARM BE

> 

> This patch fixes the following error observed when compiling with ARM BE

> compiler.

> 

> i40e_ethdev.c: In function ‘i40e_dev_tunnel_filter_set’:

> i40e_ethdev.c:6988:5: error: lvalue required as unary ‘&’ operand

>      &rte_cpu_to_le_32(ipv4_addr),

> 

> Fixes: edc845bd53ec ("app/testpmd: fix build on FreeBSD")

> Cc: Marvin Liu <yong.liu@intel.com>

> Cc: stable@dpdk.org

> 

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>


Acked-by: Beilei Xing <beilei.xing@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index bcd9ef1..c66f101 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -6951,7 +6951,7 @@  i40e_dev_tunnel_filter_set(struct i40e_pf *pf,
 			uint8_t add)
 {
 	uint16_t ip_type;
-	uint32_t ipv4_addr;
+	uint32_t ipv4_addr, ipv4_addr_le;
 	uint8_t i, tun_type = 0;
 	/* internal varialbe to convert ipv6 byte order */
 	uint32_t convert_ipv6[4];
@@ -6984,8 +6984,9 @@  i40e_dev_tunnel_filter_set(struct i40e_pf *pf,
 	if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) {
 		ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4;
 		ipv4_addr = rte_be_to_cpu_32(tunnel_filter->ip_addr.ipv4_addr);
+		ipv4_addr_le = rte_cpu_to_le_32(ipv4_addr);
 		rte_memcpy(&pfilter->element.ipaddr.v4.data,
-				&rte_cpu_to_le_32(ipv4_addr),
+				&ipv4_addr_le,
 				sizeof(pfilter->element.ipaddr.v4.data));
 	} else {
 		ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6;
@@ -7302,7 +7303,7 @@  i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
 		      uint8_t add)
 {
 	uint16_t ip_type;
-	uint32_t ipv4_addr;
+	uint32_t ipv4_addr, ipv4_addr_le;
 	uint8_t i, tun_type = 0;
 	/* internal variable to convert ipv6 byte order */
 	uint32_t convert_ipv6[4];
@@ -7338,8 +7339,9 @@  i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
 	if (tunnel_filter->ip_type == I40E_TUNNEL_IPTYPE_IPV4) {
 		ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4;
 		ipv4_addr = rte_be_to_cpu_32(tunnel_filter->ip_addr.ipv4_addr);
+		ipv4_addr_le = rte_cpu_to_le_32(ipv4_addr);
 		rte_memcpy(&pfilter->element.ipaddr.v4.data,
-				&rte_cpu_to_le_32(ipv4_addr),
+				&ipv4_addr_le,
 				sizeof(pfilter->element.ipaddr.v4.data));
 	} else {
 		ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6;