patches for DPDK stable branches
 help / color / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Gagandeep Singh <g.singh@nxp.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	Akhil Goyal <akhil.goyal@nxp.com>, dev <dev@dpdk.org>,
	dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH 05/10] crypto/dpaa2_sec: fix global variable multiple definitions
Date: Thu, 24 Oct 2019 16:53:22 +0200
Message-ID: <CAJFAV8x_04FRrhgai6G4d72QqHN82hd0qtpVo3HzY9scYicGfg@mail.gmail.com> (raw)
In-Reply-To: <20190905145315.19395-6-ferruh.yigit@intel.com>

On Thu, Sep 5, 2019 at 4:54 PM Ferruh Yigit <ferruh.yigit@intel.com> 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 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 ‘rta_sec_era’ 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 ‘rta_sec_era’ 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 ‘rta_sec_era’ follows non-static declaration
   33 | static enum rta_sec_era rta_sec_era = 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 ‘rta_sec_era’ 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'.



-- 
David Marchand


  parent reply index

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190905145315.19395-1-ferruh.yigit@intel.com>
2019-09-05 14:53 ` [dpdk-stable] [PATCH 01/10] bus/fslmc: " Ferruh Yigit
2019-09-10 16:36   ` Sachin Saxena
2019-09-05 14:53 ` [dpdk-stable] [PATCH 02/10] net/igb: " Ferruh Yigit
2019-09-05 14:53 ` [dpdk-stable] [PATCH 03/10] crypto/null: " Ferruh Yigit
2019-09-05 14:53 ` [dpdk-stable] [PATCH 04/10] crypto/octeontx: " Ferruh Yigit
2019-09-26 11:20   ` [dpdk-stable] [EXT] " Anoob Joseph
2019-09-26 18:03     ` Ferruh Yigit
2019-09-05 14:53 ` [dpdk-stable] [PATCH 05/10] crypto/dpaa2_sec: " Ferruh Yigit
2019-09-10 16:53   ` [dpdk-stable] [dpdk-dev] " Sachin Saxena
2019-10-24 14:53   ` David Marchand [this message]
2019-10-24 14:55     ` [dpdk-stable] " Ferruh Yigit
2019-10-24 16:56       ` David Marchand
2019-10-25 10:25         ` Ferruh Yigit
2019-09-05 14:53 ` [dpdk-stable] [PATCH 06/10] crypto/virtio: " Ferruh Yigit
2019-09-05 14:53 ` [dpdk-stable] [PATCH 07/10] compress/octeontx: " Ferruh Yigit
2019-09-05 16:00   ` [dpdk-stable] [EXT] " Ashish Gupta
2019-09-05 14:53 ` [dpdk-stable] [PATCH 08/10] app/testpmd: " Ferruh Yigit
2019-10-12 12:36   ` Thomas Monjalon
2019-09-05 14:53 ` [dpdk-stable] [PATCH 09/10] app/test-pipeline: " Ferruh Yigit
2019-09-05 15:01   ` Dumitrescu, Cristian
2019-09-05 15:19     ` Ferruh Yigit
2019-09-05 14:53 ` [dpdk-stable] [PATCH 10/10] test: " Ferruh Yigit
2019-09-05 15:45   ` Honnappa Nagarahalli

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJFAV8x_04FRrhgai6G4d72QqHN82hd0qtpVo3HzY9scYicGfg@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=g.singh@nxp.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox