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 93915A32A2 for ; Thu, 24 Oct 2019 18:56:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DEE6F1EB02; Thu, 24 Oct 2019 18:56:56 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 249DC1E9D9 for ; Thu, 24 Oct 2019 18:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571936214; 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=g3xSkLutdP4xeXROy5kXP5OdvJeOJou398lML0tpZyg=; b=Z+kmBi6Yh/Eean2i3GC1bdEtPTliBeFmdiE3ABw8QuNOfJAABek9ljfOvojPrR3HzsvF1V 5CbBZOZo8CZzhe9eHrCdYjRx2NXtk+OHF9r+84thNxR1U/8B6u9FqKKonfyvIu/hYao6hy 8dnWXs6IOpp9fvUzA4v6gCcW07k1cXM= Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-171-JR2RpxRBMf6-7WYA6Bxgkw-1; Thu, 24 Oct 2019 12:56:50 -0400 Received: by mail-ua1-f69.google.com with SMTP id q60so3267809uaq.11 for ; Thu, 24 Oct 2019 09:56:50 -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=g3xSkLutdP4xeXROy5kXP5OdvJeOJou398lML0tpZyg=; b=Sp4S/8e9NjhCYGXmPxlGWtTHGqxiHmSrLO9SrbGK7ixZAvp7LkSEjxffx13l12B3yZ 41x7kVHnGGX4+OyEYE1uc42p4KN6o22bUE2774E9Uxx0X117HGcy851+dxJ3ZUNNx9eV UP6z9WOoVlVzM6Op3DFjxS0GIWTzEimW6HC8SC/6w8GG7/DoSLURydd6nOkfqTA9gqwu wNxQibkVn7W5kC9pc4IGHEx35UflBItnlpqa6qPmvZimel4FZ7AmEHjtBnIkygsNsJ0Z 5LepzUNy2KrjmrB0UaSaqbPfUQn+LmP/HNqeLoZnkjTmvfOyPm9bVwZAEFzkK/y8hzls vAlg== X-Gm-Message-State: APjAAAVB7BcjbxS+swpoc6aLX7NGoWUsNNJv9LUI6exHYUCKe3d7J3pu lLzONThSpddgpsw21k69HZD+g7rW3XFiG6mF6yKgap9sw7YEtTlb+lnfqJUDwH6UsIIQSzVsNBT VPXlxT/HxgKRoWoE9S4A= X-Received: by 2002:a9f:3772:: with SMTP id a47mr1360939uae.53.1571936209775; Thu, 24 Oct 2019 09:56:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlhizfMlDu09eSaCN9vGl+iQfOH8/r8fYyemSLNUDAZuDzcOBF3VwYB/P0Gp4Hml5qnEfXuRkxf90Balxc7x0= X-Received: by 2002:a9f:3772:: with SMTP id a47mr1360918uae.53.1571936209287; Thu, 24 Oct 2019 09:56:49 -0700 (PDT) MIME-Version: 1.0 References: <20190905145315.19395-1-ferruh.yigit@intel.com> <20190905145315.19395-6-ferruh.yigit@intel.com> <49a25529-cb30-c9ec-9da9-82f3c492ce61@intel.com> In-Reply-To: <49a25529-cb30-c9ec-9da9-82f3c492ce61@intel.com> From: David Marchand Date: Thu, 24 Oct 2019 18:56:38 +0200 Message-ID: To: Ferruh Yigit Cc: Gagandeep Singh , Hemant Agrawal , Akhil Goyal , dev , dpdk stable X-MC-Unique: JR2RpxRBMf6-7WYA6Bxgkw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH 05/10] crypto/dpaa2_sec: fix global variable multiple definitions 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Oct 24, 2019 at 4:55 PM Ferruh Yigit wrote= : > > On 10/24/2019 3:53 PM, David Marchand wrote: > > On Thu, Sep 5, 2019 at 4:54 PM Ferruh Yigit wr= ote: > >> > >> 'rta_sec_era' global variable is defined in 'crypto/dpaa2_sec', > >> 'crypto/caam_jr' & 'crypto/dpaa_sec' PMDs with the same name. This mea= ns > >> 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 require= s > >> removing 'extern' definition from header files, and this requires movi= ng > >> 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 th= e > >> '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 = platform") > >> 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 declara= tion > > 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_a= sm.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'. > > > > > Would you be OK to defer the set to the next release? Either that or I only take the other 7 patches that are fine (dropped patch 4 and 9, as discussed some time ago). --=20 David Marchand