2017-12-11 13:51:44 +01:00
|
|
|
From 3b16535193326c44209bb54b3a0f9ac3c258c8f8 Mon Sep 17 00:00:00 2001
|
2016-04-26 11:01:32 +02:00
|
|
|
From: Nirmoy Das <ndas@suse.de>
|
|
|
|
Date: Mon, 11 Apr 2016 15:01:06 +0200
|
2017-12-11 13:51:44 +01:00
|
|
|
Subject: [PATCH] enic: fix "Type-punning and strict-aliasing" warning
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
Inspired by http://pkgs.fedoraproject.org/cgit/rpms/dpdk.git/tree/dpdk-2.2-punning.patch
|
|
|
|
---
|
|
|
|
drivers/net/enic/enic_ethdev.c | 8 +++++---
|
|
|
|
1 file changed, 5 insertions(+), 3 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
|
2017-12-11 13:51:44 +01:00
|
|
|
index 33a3f87e2..35769e0ba 100644
|
2016-04-26 11:01:32 +02:00
|
|
|
--- a/drivers/net/enic/enic_ethdev.c
|
|
|
|
+++ b/drivers/net/enic/enic_ethdev.c
|
2017-12-11 13:51:44 +01:00
|
|
|
@@ -436,6 +436,8 @@ static void enicpmd_dev_stop(struct rte_eth_dev *eth_dev)
|
2016-04-26 11:01:32 +02:00
|
|
|
{
|
|
|
|
struct rte_eth_link link;
|
|
|
|
struct enic *enic = pmd_priv(eth_dev);
|
|
|
|
+ uint64_t *dev_link_ptr = (uint64_t *)ð_dev->data->dev_link;
|
|
|
|
+ uint64_t *link_ptr = (uint64_t *)&link;
|
|
|
|
|
2017-12-11 13:51:44 +01:00
|
|
|
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
|
|
|
|
return;
|
|
|
|
@@ -443,9 +445,9 @@ static void enicpmd_dev_stop(struct rte_eth_dev *eth_dev)
|
2016-04-26 11:01:32 +02:00
|
|
|
ENICPMD_FUNC_TRACE();
|
|
|
|
enic_disable(enic);
|
|
|
|
memset(&link, 0, sizeof(link));
|
|
|
|
- rte_atomic64_cmpset((uint64_t *)ð_dev->data->dev_link,
|
|
|
|
- *(uint64_t *)ð_dev->data->dev_link,
|
|
|
|
- *(uint64_t *)&link);
|
|
|
|
+ rte_atomic64_cmpset(dev_link_ptr,
|
|
|
|
+ *dev_link_ptr,
|
|
|
|
+ *link_ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
--
|
2017-12-11 13:51:44 +01:00
|
|
|
2.15.1
|
2016-04-26 11:01:32 +02:00
|
|
|
|