From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 25C0F43E37; Wed, 10 Apr 2024 17:27:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 11F144028B; Wed, 10 Apr 2024 17:27:09 +0200 (CEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id 63D6D4021E for ; Wed, 10 Apr 2024 17:27:07 +0200 (CEST) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6ed3cafd766so2694816b3a.0 for ; Wed, 10 Apr 2024 08:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1712762826; x=1713367626; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=28lst/M5hmtQIYSIR+H53Nx8FtLtYoEW0l/u1urPfcI=; b=eihPnfDoSve5m9a3USmSsKiUqQk6ulcNN5p6l37WeRvqM/6y+XcvXZ0pY7mUOnu5Xh HheeD6AL/lfHgEOIJX9pzBWBVlIIZXVItf/qWMjAq1XE54Fam8ZOSPq0z71D477vHsel KopIWLKdGtxV3hcQpVKMdLuWwE+XNoRz8Lf/Wz40Ryoc6tcLCl2DSNY2UqKVHBKU1ouc mx+qr4hHWGcEcSuPTkDu02lBwVYdkHKJg66uoJe4vN+sEI2Kp3FfM8Mx9HWq8jyGg00i 4kZNkRfkSgzdKd6tHvI7OuGc2/pQVTfesOmndZKyBbjm1VcXwuDJEhV7PjMOGrtmV4cF T+3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712762826; x=1713367626; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=28lst/M5hmtQIYSIR+H53Nx8FtLtYoEW0l/u1urPfcI=; b=K9rnKlB6MMAZhy+E9S8i0o6CnZ2kI/fOmgkE8SM4RUtDk1upNOeBmt7jC4HQ0bZ9/Y hJtxKVBJFdnHDoUGGhjUPw6Xxy1k76NEmZ94u5bfZoFoAnNN3wy9zBfNZFLeba6Ko6aA yw3Ly0lH+uc+2vaR6UVDJ9UdDQneMlG1kd3aKlvAwx69vYwbU00SEbSGKuF5gXmZFYgQ wCxv6qdvxL/OIhcU4ElRjIsF8rI58fAd3BX6LgyOkjTsRJ9vCg8HpWV+MOd3ZLDP2+oo dXkXlo3185T9okvzxb4CTHPddYblSPPMYXGMQgFKWsi0FH7vizPbUKK6e++ZvfVhYubB ooIQ== X-Gm-Message-State: AOJu0YyxQNr3jddOD9J5V+AI+yOyJAqETtzfo5IBFwqFxFr5JWP3GTWS AZMPZW8hOltHLSflccJZocoaQjZ3v7hoyJ2wfiWs6QuGy2hHDogieOaG2K5LqSU= X-Google-Smtp-Source: AGHT+IEDEi+3wz8IQvEwFRMQdf/uAaa0RtOSz+h2ofi7RmgOJq8jtbUp+G99k6kpoRV4rl2yr1EZsw== X-Received: by 2002:a17:902:d506:b0:1e4:3321:21e9 with SMTP id b6-20020a170902d50600b001e4332121e9mr3475564plg.48.1712762826492; Wed, 10 Apr 2024 08:27:06 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id x3-20020a170902ec8300b001e249903b0fsm10447099plg.256.2024.04.10.08.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 08:27:06 -0700 (PDT) Date: Wed, 10 Apr 2024 08:27:04 -0700 From: Stephen Hemminger To: fengchengwen Cc: "dev@dpdk.org" , Dengdui Huang Subject: Re: Strict aliasing problem with rte_eth_linkstatus_set() Message-ID: <20240410082704.4691d7df@hermes.local> In-Reply-To: <8175c905-e661-b910-7f20-59b6ab605c38@huawei.com> References: <8175c905-e661-b910-7f20-59b6ab605c38@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, 10 Apr 2024 17:33:53 +0800 fengchengwen wrote: > Last=EF=BC=9A We think there are two ways to solve this problem. > 1. Add the compilation option '-fno-strict-aliasing' for hold DPDK projec= t. > 2. Use union to avoid such aliasing in rte_eth_linkstatus_set (please see= above). > PS: We prefer first way. >=20 Please send a patch to replace alias with union. PS: you can also override aliasing for a few lines of code with either prag= ma's or lots of casting. Both are messy and hard to maintain.