From patchwork Fri Dec 16 14:27:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 88311 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1434039qgi; Fri, 16 Dec 2016 06:28:09 -0800 (PST) X-Received: by 10.55.111.134 with SMTP id k128mr2760692qkc.253.1481898489437; Fri, 16 Dec 2016 06:28:09 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h25si3283578qtb.218.2016.12.16.06.28.09; Fri, 16 Dec 2016 06:28:09 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id DF02E60DB5; Fri, 16 Dec 2016 14:28:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id AB4C560CBF; Fri, 16 Dec 2016 14:28:04 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A000960CF0; Fri, 16 Dec 2016 14:28:02 +0000 (UTC) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by lists.linaro.org (Postfix) with ESMTPS id CF1D160C98 for ; Fri, 16 Dec 2016 14:28:00 +0000 (UTC) Received: by mail-wm0-f49.google.com with SMTP id t79so37299237wmt.0 for ; Fri, 16 Dec 2016 06:28:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ugCAnVmcTocQLPPh8W5p7c+6aYw3Npri+gDwPK7U1/E=; b=PCRV7PniGcyKDE2b8y15fHWgoGNCRE9jHYTMKASkuTUgtuDyExYDC7IEocEM/QfUxH BROPVmnDYOKxHPu2i5okiWnnK0zzgnXxwC882+8Hr2b65lt+XZ2+8c7Sw6SPdkx9d+f2 D6u408rCplzjbCEPDK9nv0Y+RqG6GLPICuwaI/bhC7RHeNTvMZP3Fj2T7G7WNzXeBTb3 09cwRPGi4T8X+Z2614885sYlximqoZpRHF38kZJzqYnGL0DkBEEYiDgAF5G/DcW+kqTy Ph9eA0GvATZflqXkvFXsUWIuFcNXGxfZ5oQtpDH8CiZrvmx9BMV2kd4Fg01KzZdlv0Li IUCw== X-Gm-Message-State: AKaTC00N++SL2o7AVG9HWhLEbvsq1x/WBlwn142MlCHsO1rfNpgMHl1lgQ91Au8mmUsnqWMQfKM= X-Received: by 10.25.35.194 with SMTP id j185mr933810lfj.82.1481898479789; Fri, 16 Dec 2016 06:27:59 -0800 (PST) Received: from localhost.localdomain (ppp91-77-165-188.pppoe.mtu-net.ru. [91.77.165.188]) by smtp.gmail.com with ESMTPSA id s64sm1386837lfs.38.2016.12.16.06.27.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Dec 2016 06:27:59 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Fri, 16 Dec 2016 17:27:35 +0300 Message-Id: <1481898455-31282-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 Subject: [lng-odp] [API-NEXT PATCH] linux-gen: pktio ipc: fix clang build X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" clang is more clever on setting and not using variables, so it traps compilation. Also buffers header almost everywhere reference by pointer so size of it should not impact on performance. Signed-off-by: Maxim Uvarov --- platform/linux-generic/include/odp_buffer_internal.h | 7 +++---- platform/linux-generic/pktio/ipc.c | 7 ------- 2 files changed, 3 insertions(+), 11 deletions(-) -- 2.7.1.250.gff4ea60 diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 903f0a7..4cc51d3 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -64,11 +64,10 @@ struct odp_buffer_hdr_t { struct { void *hdr; uint8_t *data; -#ifdef _ODP_PKTIO_IPC - /* ipc mapped process can not walk over pointers, - * offset has to be used */ + /* Used only if _ODP_PKTIO_IPC is set. + * ipc mapped process can not walk over pointers, + * offset has to be used */ uint64_t ipc_data_offset; -#endif uint32_t len; } seg[CONFIG_PACKET_MAX_SEGS]; diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index 5f26b56..c9df043 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -459,12 +459,7 @@ static int ipc_pktio_recv_lockless(pktio_entry_t *pktio_entry, if (odp_unlikely(pool == ODP_POOL_INVALID)) ODP_ABORT("invalid pool"); -#ifdef _ODP_PKTIO_IPC data_pool_off = phdr->buf_hdr.seg[0].ipc_data_offset; -#else - /* compile all function code even if ipc disabled with config */ - data_pool_off = 0; -#endif pkt = odp_packet_alloc(pool, phdr->frame_len); if (odp_unlikely(pkt == ODP_PACKET_INVALID)) { @@ -590,7 +585,6 @@ static int ipc_pktio_send_lockless(pktio_entry_t *pktio_entry, data_pool_off = (uint8_t *)pkt_hdr->buf_hdr.seg[0].data - (uint8_t *)odp_shm_addr(pool->shm); -#ifdef _ODP_PKTIO_IPC /* compile all function code even if ipc disabled with config */ pkt_hdr->buf_hdr.seg[0].ipc_data_offset = data_pool_off; IPC_ODP_DBG("%d/%d send packet %llx, pool %llx," @@ -598,7 +592,6 @@ static int ipc_pktio_send_lockless(pktio_entry_t *pktio_entry, i, len, odp_packet_to_u64(pkt), odp_pool_to_u64(pool_hdl), pkt_hdr, pkt_hdr->buf_hdr.seg[0].ipc_data_offset); -#endif } /* Put packets to ring to be processed by other process. */