RE: [PATCH v6] ethdev: fix strict aliasing lead to link cannot be up

2024-04-15 Thread Morten Brørup
> @@ -1701,12 +1696,8 @@ static inline void > rte_eth_linkstatus_get(const struct rte_eth_dev *dev, > struct rte_eth_link *link) > { > - RTE_ATOMIC(uint64_t) *src = (uint64_t __rte_atomic *)&(dev->data- > >dev_link); > - uint64_t *dst = (uint64_t *)link; > - > - R

[PATCH v6] ethdev: fix strict aliasing lead to link cannot be up

2024-04-13 Thread Chengwen Feng
Fix a problem introduced by a compiler upgrade (from gcc10 to gcc12.3), which will lead the hns3 NIC can't link up. The root cause is strict aliasing violation in rte_eth_linkstatus_set() with hns3 driver, see [1] for more details. This commit use union to avoid such aliasing violation. Note: DPD