From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 06E80293C for ; Tue, 22 May 2018 11:59:05 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id a67-v6so30051720wmf.3 for ; Tue, 22 May 2018 02:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0P/qkSkKsbz5cEDDRaQropetcLAJyV7dPp/dmZhOb2k=; b=c2PvPaxgnPIXUueHwXVSNHJ5vKXwi2MsvDrNWCqEmsg2rat8FQqvcY8uXpcjUWWXWB A8BXlovDljk/+4NZ379GYcrcUWr2XOqdxNTaNql49SHAF9qWom0RwEsEVt75w+tsuj6G FGnA6fz5NINGX/AAUjjhPoQE9p9bacKMdhsvaH4OiHY+Dg+ec0S+aayExSfMhriKn+cs IFRGDPmasAtN9SVOHTJedMRika7x3iMnUaQU3WHpl/r9vp/I7UeaRnF82Nul5iVA6Xt5 M/ZLqdFhcuIj6XMtxeFVN0A/Vb/D9UXPrCG28nfCXQ0ahk+6EdzUEVV3v40yRIDuJTVv ckBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0P/qkSkKsbz5cEDDRaQropetcLAJyV7dPp/dmZhOb2k=; b=egXIzUoCBR1RXNSkW2VXlZ2do7z+DxgQTHYTod6R5EZ859D6fYo0cbN/PF7sV7VK+C +byEo2EcnmEmZTZOtwtNQ8dXnvLtc4qHTCjLy02sH6M6MhYOdoYFENHps9ubV13agXbF K1dYvS4nt879vhFh2696jGgBtryQExV8BIRCAX/DksBToKpF029s/asdMZcrmxaV/Dw1 PSBW+7w8nA5jOlddZS84WkDq1izsqWFrlG2LHH1hvxHwPlX5F8Ym6Ik0aG5e28Aan9hu yMeWaTNjb+Mca6QcZ45tE+xfCEkYUBomBVEWMl96ucIM3kYIS/EF50PWbMFZCNtThAfW 30Dw== X-Gm-Message-State: ALKqPwcJZJtKnRJgwBS7xE9QzAgyK3sxbqwTN/FIFCGCAhi/rmraowgp +CPpFWfIWifPEqW/8i1YJ0HF4Q== X-Google-Smtp-Source: AB8JxZqtnUXRtEnC55M1xEO0cZfWvS0ZhuamdCStRtPmhCBgBuuQw3xHnY9d4Nha8Rm6nJGREKTIzg== X-Received: by 2002:a1c:8e95:: with SMTP id q143-v6mr618214wmd.161.1526983144758; Tue, 22 May 2018 02:59:04 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 194-v6sm21777269wml.20.2018.05.22.02.59.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 02:59:04 -0700 (PDT) Date: Tue, 22 May 2018 11:58:49 +0200 From: Adrien Mazarguil To: Ferruh Yigit Cc: Shahaf Shuler , dev@dpdk.org, Ophir Munk Message-ID: <20180522095849.GV6497@6wind.com> References: <20180515154853.6361-1-adrien.mazarguil@6wind.com> <20180521154829.6297-1-adrien.mazarguil@6wind.com> <20180521154829.6297-2-adrien.mazarguil@6wind.com> <8025075e-0962-55f1-74ef-cee891647204@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8025075e-0962-55f1-74ef-cee891647204@intel.com> Subject: Re: [dpdk-dev] [PATCH v2 2/2] net/mlx4: refactor RSS conversion functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2018 09:59:05 -0000 On Tue, May 22, 2018 at 10:41:35AM +0100, Ferruh Yigit wrote: > On 5/21/2018 4:50 PM, Adrien Mazarguil wrote: > > Since commit 97b2217ae5bc ("net/mlx4: advertise supported RSS hash > > functions"), this PMD includes two similar-looking functions that convert > > RSS hash fields between Verbs and DPDK formats. > > > > This patch refactors them as a single two-way function and gets rid of > > redundant helper macros. > > > > Note the loss of the "static" keyword on the out[] (now verbs[]) array > > introduced by commit cbd737416c34 ("net/mlx4: avoid constant recreations in > > function") is what prevents the reliance on macro definitions for static > > initializers at the expense of a few extra instructions. An acceptable > > trade-off given this function is not involved in data plane operations. > > - static const uint64_t out[RTE_DIM(in)] = { > > + const uint64_t verbs[RTE_DIM(dpdk)] = { > > + [INNER] = IBV_RX_HASH_INNER, > > [IPV4] = IBV_RX_HASH_SRC_IPV4 | IBV_RX_HASH_DST_IPV4, > > + [IPV4_1] = verbs[IPV4], > > + [IPV4_2] = verbs[IPV4], > > [IPV6] = IBV_RX_HASH_SRC_IPV6 | IBV_RX_HASH_DST_IPV6, > > + [IPV6_1] = verbs[IPV6], > > + [IPV6_2] = verbs[IPV6], > > + [IPV6_3] = verbs[IPV6], > > [TCP] = IBV_RX_HASH_SRC_PORT_TCP | IBV_RX_HASH_DST_PORT_TCP, > > [UDP] = IBV_RX_HASH_SRC_PORT_UDP | IBV_RX_HASH_DST_PORT_UDP, > > + [IPV4_TCP] = verbs[IPV4] | verbs[TCP], > > This gives following build error with ICC [1]. Is it guarantied that in above > assignment the executing order will be the same order with code? > > [1] > .../dpdk/drivers/net/mlx4/mlx4_flow.c(135): error #592: variable "verbs" is used > before its value is set > [IPV4_TCP] = verbs[IPV4] | verbs[TCP], Didn't see this error with GCC nor clang (compilation and validation OK with both), however ICC is correct, initialization order is not guaranteed here. This shortcut is unsafe, I'll have to come up with something else. -- Adrien Mazarguil 6WIND