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 BE36FA32A2 for ; Thu, 24 Oct 2019 18:56:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B3DBE1E9D9; Thu, 24 Oct 2019 18:56:55 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 2F1C71E9D9 for ; Thu, 24 Oct 2019 18:56:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571936213; 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=JexL9sdzrBVM8RESit0K6Mf2GQJ0Gm2KLaq9RFbluVRA+mv8tZ+7atvED8ZVOw+m4uzwCs j+ohC2Ikev4L0DW+eQj8vdsrhGJbLIpQcPg3JiedkiZ4d+tNjau7dXCBgtVLkBZrGFH8Pa D0sDw72Xahqb2FeJ2kbqVR+hHTnZEto= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-357-zwkooKFzNFKBVm5Y-XProQ-1; Thu, 24 Oct 2019 12:56:50 -0400 Received: by mail-ua1-f72.google.com with SMTP id b5so377621uap.6 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=nMpvcQ6bImKqqf9COTdjdA7QXDAKVQS4hF/1k0IPwFsIyYQ3wMNzkHDlg+yjXPnHwk FYBdMXDNN6P3QnqMA+mVclhEsy6bXeTfqPxmJJoukrFNUYoNSXnjUS8woJki4+LPxwZr +QtQl8jRuu5mkLQvSHeGgdsWLOdAM3OoQ2EXhYveYVMIrvqjDrWfbH9+h6FZXuZEB8Kv oHYDcWZogdb4lB34v+ngLKUY/F4Asf7d/VuDceEpDfqNrjvcBYodg+XgJ5qEBsNVMfeQ idsAr/xarJ8EvRatzioKcMFHw0mQ/G/ez/jICwMpEsAazE+UmiZgL58qJ7EXnqPL10NX Q+AA== X-Gm-Message-State: APjAAAXie7I3T4O0nKcKX6Fqu1ZnKbECe3rssPZv+U7TgAUVGu+uPpBu irecACQVzQ0PQvUwOSpQ/vJL64SEPvIHfWwgrt1L044ezN4WQZSu+6hBgRezl/sQ787eyF4rkaN 3UVGw9kKVhMUTq+cOaMxJeqM= X-Received: by 2002:a9f:3772:: with SMTP id a47mr1360940uae.53.1571936209776; 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: zwkooKFzNFKBVm5Y-XProQ-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, 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