On 4/18/2024 8:28 AM, Chengwen Feng wrote:
> 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: DPDK CI report compiler error (see [2] for more details):
> ../drivers/net/cxgbe/cxgbe_ethdev.c:214:9: error: missing braces around
> initializer [-Werror=missing-braces]
> struct rte_eth_link new_link = { 0 };
> The same error with qos_sched example:
> ../examples/qos_sched/init.c:338:10: error: missing braces around
> initializer [-Werror=missing-braces]
> struct rte_eth_link link = {0};
> So this commit replace { 0 } with memset in cxgbe and qos_sched.
>
As this commit is already fixing the build errors, not sure if there is
a value to provide reference to errors, you can briefly describe change
something like:
"The impacted components have been adapted to the struct change."
> [1] Strict aliasing problem with rte_eth_linkstatus_set()
> https://marc.info/?l=dpdk-dev&m=171274148514777&w=3
>
I wasn't aware marc.info, but for consistency you can use DPDK mail list
archive, inbox.dpdk.org, like:
https://inbox.dpdk.org/dev/[email protected]/
> [2] https://mails.dpdk.org/archives/test-report/2024-April/637966.html
>
> Cc: [email protected]
>
> Signed-off-by: Chengwen Feng <[email protected]>
> Signed-off-by: Dengdui Huang <[email protected]>
> Acked-by: Morten Brørup <[email protected]>