From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 634DDA32A2 for ; Thu, 24 Oct 2019 16:53:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 452421EB40; Thu, 24 Oct 2019 16:53:44 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 317331EB2F for ; Thu, 24 Oct 2019 16:53:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571928819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/GkO1xa5dGZGc/T32xasv51IUJ6KNvI/FfhFUQjIgOk=; b=QlT+SdkoYy2XpQUhxGPD8Tgm0YzXEmUrJ9ROZ0nUep11yQXeFahMV3tyFn43Anfkyn/SdW ZJB6frdzBmHr+2cvtjHL8kB7oAts/3W+WkzlfKQwKCqcYn5zA2Q3ScnBGcQy3aGD/zuQ+g aqtpkdlfm6X4lmZ516wPqO5EtyaNB0Y= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-242-85sfIqdhPFi9Fbq7_IZX4Q-1; Thu, 24 Oct 2019 10:53:35 -0400 Received: by mail-vk1-f200.google.com with SMTP id d64so10837083vke.6 for ; Thu, 24 Oct 2019 07:53:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=/GkO1xa5dGZGc/T32xasv51IUJ6KNvI/FfhFUQjIgOk=; b=Iq068KaHkaEeB487i09s+Hz6b3oaM6lzxsbO1F6aCcD11NY3VCFJSgVIOpadaN7ljT r86MSKgQ4IXISyCAYcz4tkRZRaE/KcCF8uUDCmZrw1cjFXE0ajhO/U/RHN9GosJd+N50 xYE7Dj356UA0eoJKzHhfRQ+DuS2lVRKs+EEWaINX8t8J/9pFZCKglse8g8hqklYuq7Eu jGBSLLiGI99JpqHCab3pGL25CMAGHzjxBlxTPEs8PljqqvVWIMfAXvelv/YOQAg+V7kP K31DkPcBBa6zbtdDJNaxkVf/kYS6HkFdIfM6AbIIMRe6FR1/RdlUoHVfDfplBMDab5tS M+zw== X-Gm-Message-State: APjAAAW7XAtj17hqxbX0IjcB/tlRJvtsvDMm48AR5oxUJTnuPwWk1jm3 5tMFm8RoJ4fmdM8UYyGv0Om1xVYKLmEeU40gtFXJ+XYMthi06R1pCgbXq/X5zQ2EjFI1Q/qLn+f 3dSyI4+gO6rDtSSx4VQmYbrw= X-Received: by 2002:a67:e88b:: with SMTP id x11mr8961454vsn.180.1571928813734; Thu, 24 Oct 2019 07:53:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqycVyB8F2KzDyvnuyYYT1c3DMykRbr4gSYOcm2uf14s5DkOVlfiuG25ZWQgk7guVl/DWUBwv2KyFregJ6/rupE= X-Received: by 2002:a67:e88b:: with SMTP id x11mr8961432vsn.180.1571928813231; Thu, 24 Oct 2019 07:53:33 -0700 (PDT) MIME-Version: 1.0 References: <20190905145315.19395-1-ferruh.yigit@intel.com> <20190905145315.19395-6-ferruh.yigit@intel.com> In-Reply-To: <20190905145315.19395-6-ferruh.yigit@intel.com> From: David Marchand Date: Thu, 24 Oct 2019 16:53:22 +0200 Message-ID: To: Ferruh Yigit Cc: Gagandeep Singh , Hemant Agrawal , Akhil Goyal , dev , dpdk stable X-MC-Unique: 85sfIqdhPFi9Fbq7_IZX4Q-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-stable] [PATCH 05/10] crypto/dpaa2_sec: fix global variable multiple definitions X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Thu, Sep 5, 2019 at 4:54 PM Ferruh Yigit wrote: > > 'rta_sec_era' global variable is defined in 'crypto/dpaa2_sec', > 'crypto/caam_jr' & 'crypto/dpaa_sec' PMDs with the same name. This means > they share same storage when application linked with static DPDK > library, which is not the intention. Three differing drivers sharing > same global variable is a defect. > > Variable has been used by multiple header files in static inline > functions and these header files are shared by all three PMDs, this > forces using same variable name in three PMDs. > > Since the variable is used only single .c file in 'crypto/dpaa2_sec' & > 'crypto/dpaa_sec' converting global variable to 'static', this requires > removing 'extern' definition from header files, and this requires moving > the global variable definition before including those headers in .c > files. > > For 'crypto/caam_jr' multiple .c files exists and includes these > headers which prevent making variable static, so only one file has the > global variable and others has 'extern' keyword on .c files. > > This change should let all three drivers have their own storage for the > 'rta_sec_era' global variable without multiple definitions. > > Fixes: 1d678de329ab ("crypto/caam_jr: add basic job ring routines") > Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA pla= tform") > Cc: stable@dpdk.org Hit a build issue, with gcc, static build: ../drivers/crypto/dpaa_sec/dpaa_sec.c:33:25: error: static declaration of =E2=80=98rta_sec_era=E2=80=99 follows non-static declaration 33 | static enum rta_sec_era rta_sec_era; | ^~~~~~~~~~~ In file included from ../drivers/crypto/dpaa_sec/../dpaa2_sec/hw/rta/sec_run_time_asm.h:10, from ../drivers/crypto/dpaa_sec/dpaa_sec.c:32: ../drivers/crypto/dpaa_sec/../dpaa2_sec/hw/desc.h:21:25: note: previous declaration of =E2=80=98rta_sec_era=E2=80=99 was here 21 | extern enum rta_sec_era rta_sec_era; | ^~~~~~~~~~~ And ../drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c:33:25: error: static declaration of =E2=80=98rta_sec_era=E2=80=99 follows non-static declaration 33 | static enum rta_sec_era rta_sec_era =3D RTA_SEC_ERA_8; | ^~~~~~~~~~~ In file included from ../drivers/crypto/dpaa2_sec/hw/rta/sec_run_time_asm.h= :10, from ../drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c:32: ../drivers/crypto/dpaa2_sec/hw/desc.h:21:25: note: previous declaration of =E2=80=98rta_sec_era=E2=80=99 was here 21 | extern enum rta_sec_era rta_sec_era; | ^~~~~~~~~~~ [5/86] Compiling C object 'drivers/a715181@@tmp_rte_pmd_caam_jr@sta/crypto_caam_jr_caam_jr.c.o'. --=20 David Marchand