diff mbox

[0/3] ODP Crypto API

Message ID C1BBCB674C57E643932FC661E0B0D4660EE3017C@xmb-aln-x01.cisco.com
State New
Headers show

Commit Message

Robbie King July 25, 2014, 4:18 p.m. UTC
I agree we need to add something for cross compiling.  My apologies
for my limited knowledge of cross compiling.  If the user builds/links
against the latest openssl libcrypto from git, will it always work if the 
executable is then run on a system with a packaged openssl library?

Thanks,
Robbie

-----Original Message-----
From: Anders Roxell [mailto:anders.roxell@linaro.org] 
Sent: Friday, July 25, 2014 7:56 AM
To: Taras Kondratiuk
Cc: Robbie King (robking); lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API

On 2014-07-25 13:01, Taras Kondratiuk wrote:
> On 07/24/2014 09:27 PM, Anders Roxell wrote:
> >Hi Robbie,
> >
> >On 2014-07-24 13:53, Robbie King wrote:
> >>Hello all,
> >>
> >>Per the latest ODP crypto discussions, here are patches
> >>to add the ODP crypto API header file as well as the
> >>linux-generic implementation.  The IPsec test application
> >>will be in a separate patch set.
> >
> >I like what you've done.
> >
> >Just some nits.
> >1. Copyright year 2013, change to 2014
> >2. Probably me that don't know how to do this but, how can I cross
> >    compile for arm?
> 
> Hi Anders,
> 
> I'm using OE's toolchain and sysroot which already have openssl in it.

Hi, I did it like this:


$ git clone git://git.openssl.org/openssl.git
$ cd openssl
Tested on both v8 and v7:

v8
$ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu-
--prefix=/home/anders/src/install-openssl-aarch64
$ make
$ make install

v7:
$ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf-
--prefix=/home/anders/src/install-openssl
$ make
$ make install


added this patch ontop of Robbbies three patches:
$ git df



building ODP v8:
$ ./configure --host=aarch64-linux-gnu
--with-openssl-path=/home/anders/src/install-openssl-aarch64
$ make

building ODP v7:
$ ./configure --host=arm-linux-gnueabihf
--with-openssl-path=/home/anders/src/install-openssl
$ make


Robbie we need to add this and probably something in the README howto
build openssl right?

Cheers,
Anders

Comments

Yao Zhao July 25, 2014, 7:43 p.m. UTC | #1
[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:

> I agree we need to add something for cross compiling.  My apologies
> for my limited knowledge of cross compiling.  If the user builds/links
> against the latest openssl libcrypto from git, will it always work if the 
> executable is then run on a system with a packaged openssl library?
> 
No, it won't.
In theory you link with which then you run with which.

Normally you just make it work with native environment.
Distribution which supports cross compile will make it work for target
environment.

For OE/yocto, we can write a recipe to cross compile it, it will link
against the openssl which will be put on target.

yao
> Thanks,
> Robbie
> 
> -----Original Message-----
> From: Anders Roxell [mailto:anders.roxell@linaro.org] 
> Sent: Friday, July 25, 2014 7:56 AM
> To: Taras Kondratiuk
> Cc: Robbie King (robking); lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> 
> On 2014-07-25 13:01, Taras Kondratiuk wrote:
> > On 07/24/2014 09:27 PM, Anders Roxell wrote:
> > >Hi Robbie,
> > >
> > >On 2014-07-24 13:53, Robbie King wrote:
> > >>Hello all,
> > >>
> > >>Per the latest ODP crypto discussions, here are patches
> > >>to add the ODP crypto API header file as well as the
> > >>linux-generic implementation.  The IPsec test application
> > >>will be in a separate patch set.
> > >
> > >I like what you've done.
> > >
> > >Just some nits.
> > >1. Copyright year 2013, change to 2014
> > >2. Probably me that don't know how to do this but, how can I cross
> > >    compile for arm?
> > 
> > Hi Anders,
> > 
> > I'm using OE's toolchain and sysroot which already have openssl in it.
> 
> Hi, I did it like this:
> 
> 
> $ git clone git://git.openssl.org/openssl.git
> $ cd openssl
> Tested on both v8 and v7:
> 
> v8
> $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu-
> --prefix=/home/anders/src/install-openssl-aarch64
> $ make
> $ make install
> 
> v7:
> $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf-
> --prefix=/home/anders/src/install-openssl
> $ make
> $ make install
> 
> 
> added this patch ontop of Robbbies three patches:
> $ git df
> diff --git a/configure.ac b/configure.ac
> index 95d5bdf..8cf4a83 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -90,10 +90,18 @@ AM_LDFLAGS="$AM_LDFLAGS $PTHREAD_LDFLAGS"
>  # Check for openssl availability
>  ##########################################################################
>  
> +AC_ARG_WITH([openssl-path],
> +AC_HELP_STRING([--with-openssl-path=DIR Path to openssl libs and headers],
> +               [(or in the default path if not specified).]),
> +[OPENSSL_PATH=$withval
> +AM_CFLAGS="$AM_CFLAGS -I$OPENSSL_PATH/include"
> +AM_LDFLAGS="$AM_LDFLAGS -L$OPENSSL_PATH/lib"
> +],[
>  AC_CHECK_LIB([crypto], [EVP_EncryptInit], [],
>               [AC_MSG_FAILURE([can't find openssl crypto lib])])
>  AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], [],
>               [AC_MSG_FAILURE([can't find openssl crypto headers])])
> +   ])
>  
>  ##########################################################################
>  # Default warning setup
> 
> 
> 
> building ODP v8:
> $ ./configure --host=aarch64-linux-gnu
> --with-openssl-path=/home/anders/src/install-openssl-aarch64
> $ make
> 
> building ODP v7:
> $ ./configure --host=arm-linux-gnueabihf
> --with-openssl-path=/home/anders/src/install-openssl
> $ make
> 
> 
> Robbie we need to add this and probably something in the README howto
> build openssl right?
> 
> Cheers,
> Anders
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
> 
>
Anders Roxell July 26, 2014, 3:17 p.m. UTC | #2
On 2014-07-25 15:43, Yao Zhao wrote:
> [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> 
> > I agree we need to add something for cross compiling.  My apologies
> > for my limited knowledge of cross compiling.  If the user builds/links
> > against the latest openssl libcrypto from git, will it always work if the 
> > executable is then run on a system with a packaged openssl library?
> > 
> No, it won't.
> In theory you link with which then you run with which.
> 
> Normally you just make it work with native environment.
> Distribution which supports cross compile will make it work for target
> environment.
> 
> For OE/yocto, we can write a recipe to cross compile it, it will link
> against the openssl which will be put on target.

You seem to be talking two different things.

1. Robbie, you seem to be asking about ABI stability, so the answer is
   no, you can't expect it to work. However, you can (should) checkout
   the specific release tag of openssl, that you expect to be on the
   rootfs, to compile against.
   I forgot in my previous mail to mention this.

   Commands or doing that:
   # git tag will list all tags available in the repo.
   $ git tag
   # Checkout a specific tag.
   $ git checkout <tag name>

2. Yao, you seem to be talking about cross compiling in a general sense.
   However, that doesn't seem to be related to the original question,
   even though the information was correct and useful.


Cheers,
Anders
Robbie King July 26, 2014, 3:49 p.m. UTC | #3
So is the solution here to split the section I added for "crypto" in the DEPENDENCIES 
file to have a "native" and a "cross compile" subsection?  Under the cross compile 
subsection we can then list the steps we've discussed so for that will hopefully
cross compile a libodp.a that is compatible with the user's rootfs.

-----Original Message-----
From: Anders Roxell [mailto:anders.roxell@linaro.org] 
Sent: Saturday, July 26, 2014 11:17 AM
To: Yao Zhao
Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API

On 2014-07-25 15:43, Yao Zhao wrote:
> [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> 
> > I agree we need to add something for cross compiling.  My apologies
> > for my limited knowledge of cross compiling.  If the user builds/links
> > against the latest openssl libcrypto from git, will it always work if the 
> > executable is then run on a system with a packaged openssl library?
> > 
> No, it won't.
> In theory you link with which then you run with which.
> 
> Normally you just make it work with native environment.
> Distribution which supports cross compile will make it work for target
> environment.
> 
> For OE/yocto, we can write a recipe to cross compile it, it will link
> against the openssl which will be put on target.

You seem to be talking two different things.

1. Robbie, you seem to be asking about ABI stability, so the answer is
   no, you can't expect it to work. However, you can (should) checkout
   the specific release tag of openssl, that you expect to be on the
   rootfs, to compile against.
   I forgot in my previous mail to mention this.

   Commands or doing that:
   # git tag will list all tags available in the repo.
   $ git tag
   # Checkout a specific tag.
   $ git checkout <tag name>

2. Yao, you seem to be talking about cross compiling in a general sense.
   However, that doesn't seem to be related to the original question,
   even though the information was correct and useful.


Cheers,
Anders
Anders Roxell July 28, 2014, 5:18 p.m. UTC | #4
On 2014-07-26 15:49, Robbie King (robking) wrote:
> So is the solution here to split the section I added for "crypto" in the DEPENDENCIES 
> file to have a "native" and a "cross compile" subsection?  Under the cross compile 
> subsection we can then list the steps we've discussed so for that will hopefully
> cross compile a libodp.a that is compatible with the user's rootfs.

I'm sorry for the late reply!

Yup, that sounds good with the subsections.

Maybe section 3 should say something else than "crypto" if we need to add
more dependencies like crypto in the future, unsure what we should say
though. =/
Ideas what we can say?

Cheers,
Anders

> 
> -----Original Message-----
> From: Anders Roxell [mailto:anders.roxell@linaro.org] 
> Sent: Saturday, July 26, 2014 11:17 AM
> To: Yao Zhao
> Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> 
> On 2014-07-25 15:43, Yao Zhao wrote:
> > [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> > 
> > > I agree we need to add something for cross compiling.  My apologies
> > > for my limited knowledge of cross compiling.  If the user builds/links
> > > against the latest openssl libcrypto from git, will it always work if the 
> > > executable is then run on a system with a packaged openssl library?
> > > 
> > No, it won't.
> > In theory you link with which then you run with which.
> > 
> > Normally you just make it work with native environment.
> > Distribution which supports cross compile will make it work for target
> > environment.
> > 
> > For OE/yocto, we can write a recipe to cross compile it, it will link
> > against the openssl which will be put on target.
> 
> You seem to be talking two different things.
> 
> 1. Robbie, you seem to be asking about ABI stability, so the answer is
>    no, you can't expect it to work. However, you can (should) checkout
>    the specific release tag of openssl, that you expect to be on the
>    rootfs, to compile against.
>    I forgot in my previous mail to mention this.
> 
>    Commands or doing that:
>    # git tag will list all tags available in the repo.
>    $ git tag
>    # Checkout a specific tag.
>    $ git checkout <tag name>
> 
> 2. Yao, you seem to be talking about cross compiling in a general sense.
>    However, that doesn't seem to be related to the original question,
>    even though the information was correct and useful.
> 
> 
> Cheers,
> Anders
Robbie King July 29, 2014, 1:35 a.m. UTC | #5
Here's what I have in "DEPENDENCIES", what do you think?
--------------------------------------------------------

Prerequisites for building the OpenDataPlane (ODP) API

1. Linux kernel >= 3.0

   Version 3.0+ needed for the sendmmsg() interface

2. autotools

   automake
   autoconf
   autoconf-archive
   libtool

   On Debian/Ubuntu systems:
   $ sudo apt-get install automake autoconf autoconf-archive libtool

   On CentOS/RedHat/Fedora systems:
   $ sudo yum install automake autoconf autoconf-archive libtool libtoolize

3. required libraries

   Libraries currently required to link: openssl

3.1 native build

   For native compilation, simply load the necessary libraries using the appropriate
   tool set.

   On Debian/Ubuntu systems:
   $ sudo apt-get install libssl-dev

   On CentOS/RedHat/Fedora systems:
   $ sudo yum install openssl-devel

3.2 cross compilation build

   Cross compilation requires cross compiling the individual libraries.  In order for
   a cross compiled executable to run on a target system, one must build the same
   version as that which is installed on the target rootfs.

   For example, to build openssl for both 32 and 64 bit compilation:
   
   # Clone openssl repository
   $ git clone git://git.openssl.org/openssl.git
   $ cd openssl

   # The command "git tag" will list all tags available in the repo.
   $ git tag

   # Checkout the specific tag to match openssl library in your target rootfs
   $ git checkout <tag name>

   # Build and install 64 bit version of openssl
   $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- \
     --prefix=/home/user/src/install-openssl-aarch64
   $ make
   $ make install

   # Build and install 32 bit version of openssl
   $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf- \
     --prefix=/home/user/src/install-openssl
   $ make
   $ make install
  
   # You may now build either 32 or 64 bit ODP
   $ git clone git://git.linaro.org/lng/odp.git odp
   $ cd odp
   $ ./bootstrap

   # Build 32 bit version of ODP
   $ ./configure --host=arm-linux-gnueabihf \
     --with-openssl-path=/home/user/src/install-openssl
   $ make

   # Or build 64 bit version of ODP
   $ ./configure --host=aarch64-linux-gnu \
     --with-openssl-path=/home/user/src/install-openssl-aarch64
   $ make

-----Original Message-----
From: Anders Roxell [mailto:anders.roxell@linaro.org] 
Sent: Monday, July 28, 2014 1:19 PM
To: Robbie King (robking)
Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API

On 2014-07-26 15:49, Robbie King (robking) wrote:
> So is the solution here to split the section I added for "crypto" in the DEPENDENCIES 
> file to have a "native" and a "cross compile" subsection?  Under the cross compile 
> subsection we can then list the steps we've discussed so for that will hopefully
> cross compile a libodp.a that is compatible with the user's rootfs.

I'm sorry for the late reply!

Yup, that sounds good with the subsections.

Maybe section 3 should say something else than "crypto" if we need to add
more dependencies like crypto in the future, unsure what we should say
though. =/
Ideas what we can say?

Cheers,
Anders

> 
> -----Original Message-----
> From: Anders Roxell [mailto:anders.roxell@linaro.org] 
> Sent: Saturday, July 26, 2014 11:17 AM
> To: Yao Zhao
> Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> 
> On 2014-07-25 15:43, Yao Zhao wrote:
> > [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> > 
> > > I agree we need to add something for cross compiling.  My apologies
> > > for my limited knowledge of cross compiling.  If the user builds/links
> > > against the latest openssl libcrypto from git, will it always work if the 
> > > executable is then run on a system with a packaged openssl library?
> > > 
> > No, it won't.
> > In theory you link with which then you run with which.
> > 
> > Normally you just make it work with native environment.
> > Distribution which supports cross compile will make it work for target
> > environment.
> > 
> > For OE/yocto, we can write a recipe to cross compile it, it will link
> > against the openssl which will be put on target.
> 
> You seem to be talking two different things.
> 
> 1. Robbie, you seem to be asking about ABI stability, so the answer is
>    no, you can't expect it to work. However, you can (should) checkout
>    the specific release tag of openssl, that you expect to be on the
>    rootfs, to compile against.
>    I forgot in my previous mail to mention this.
> 
>    Commands or doing that:
>    # git tag will list all tags available in the repo.
>    $ git tag
>    # Checkout a specific tag.
>    $ git checkout <tag name>
> 
> 2. Yao, you seem to be talking about cross compiling in a general sense.
>    However, that doesn't seem to be related to the original question,
>    even though the information was correct and useful.
> 
> 
> Cheers,
> Anders
Anders Roxell July 29, 2014, 7:21 a.m. UTC | #6
On 2014-07-29 01:35, Robbie King (robking) wrote:
> Here's what I have in "DEPENDENCIES", what do you think?
> --------------------------------------------------------
> 
> Prerequisites for building the OpenDataPlane (ODP) API
> 
> 1. Linux kernel >= 3.0
> 
>    Version 3.0+ needed for the sendmmsg() interface
> 
> 2. autotools
> 
>    automake
>    autoconf
>    autoconf-archive
>    libtool
> 
>    On Debian/Ubuntu systems:
>    $ sudo apt-get install automake autoconf autoconf-archive libtool
> 
>    On CentOS/RedHat/Fedora systems:
>    $ sudo yum install automake autoconf autoconf-archive libtool libtoolize
> 
> 3. required libraries
> 
>    Libraries currently required to link: openssl
> 
> 3.1 native build
> 
>    For native compilation, simply load the necessary libraries using the appropriate
>    tool set.
> 
>    On Debian/Ubuntu systems:
>    $ sudo apt-get install libssl-dev
> 
>    On CentOS/RedHat/Fedora systems:
>    $ sudo yum install openssl-devel
> 
> 3.2 cross compilation build
> 
>    Cross compilation requires cross compiling the individual libraries.  In order for
>    a cross compiled executable to run on a target system, one must build the same
>    version as that which is installed on the target rootfs.
> 
>    For example, to build openssl for both 32 and 64 bit compilation:
>    
>    # Clone openssl repository
>    $ git clone git://git.openssl.org/openssl.git
>    $ cd openssl
> 
>    # The command "git tag" will list all tags available in the repo.
>    $ git tag
> 
>    # Checkout the specific tag to match openssl library in your target rootfs
>    $ git checkout <tag name>
> 
>    # Build and install 64 bit version of openssl
>    $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- \
>      --prefix=/home/user/src/install-openssl-aarch64
>    $ make
>    $ make install
> 
>    # Build and install 32 bit version of openssl
>    $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf- \
>      --prefix=/home/user/src/install-openssl
>    $ make
>    $ make install
>   
>    # You may now build either 32 or 64 bit ODP
>    $ git clone git://git.linaro.org/lng/odp.git odp
>    $ cd odp
>    $ ./bootstrap
> 
>    # Build 32 bit version of ODP
>    $ ./configure --host=arm-linux-gnueabihf \
>      --with-openssl-path=/home/user/src/install-openssl
>    $ make
> 
>    # Or build 64 bit version of ODP
>    $ ./configure --host=aarch64-linux-gnu \
>      --with-openssl-path=/home/user/src/install-openssl-aarch64
>    $ make

Looks good!
Just a minor nit:
Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit
version of openssl below 32 bit version?


Cheers,
Anders

> 
> -----Original Message-----
> From: Anders Roxell [mailto:anders.roxell@linaro.org] 
> Sent: Monday, July 28, 2014 1:19 PM
> To: Robbie King (robking)
> Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> 
> On 2014-07-26 15:49, Robbie King (robking) wrote:
> > So is the solution here to split the section I added for "crypto" in the DEPENDENCIES 
> > file to have a "native" and a "cross compile" subsection?  Under the cross compile 
> > subsection we can then list the steps we've discussed so for that will hopefully
> > cross compile a libodp.a that is compatible with the user's rootfs.
> 
> I'm sorry for the late reply!
> 
> Yup, that sounds good with the subsections.
> 
> Maybe section 3 should say something else than "crypto" if we need to add
> more dependencies like crypto in the future, unsure what we should say
> though. =/
> Ideas what we can say?
> 
> Cheers,
> Anders
> 
> > 
> > -----Original Message-----
> > From: Anders Roxell [mailto:anders.roxell@linaro.org] 
> > Sent: Saturday, July 26, 2014 11:17 AM
> > To: Yao Zhao
> > Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org
> > Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > 
> > On 2014-07-25 15:43, Yao Zhao wrote:
> > > [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> > > 
> > > > I agree we need to add something for cross compiling.  My apologies
> > > > for my limited knowledge of cross compiling.  If the user builds/links
> > > > against the latest openssl libcrypto from git, will it always work if the 
> > > > executable is then run on a system with a packaged openssl library?
> > > > 
> > > No, it won't.
> > > In theory you link with which then you run with which.
> > > 
> > > Normally you just make it work with native environment.
> > > Distribution which supports cross compile will make it work for target
> > > environment.
> > > 
> > > For OE/yocto, we can write a recipe to cross compile it, it will link
> > > against the openssl which will be put on target.
> > 
> > You seem to be talking two different things.
> > 
> > 1. Robbie, you seem to be asking about ABI stability, so the answer is
> >    no, you can't expect it to work. However, you can (should) checkout
> >    the specific release tag of openssl, that you expect to be on the
> >    rootfs, to compile against.
> >    I forgot in my previous mail to mention this.
> > 
> >    Commands or doing that:
> >    # git tag will list all tags available in the repo.
> >    $ git tag
> >    # Checkout a specific tag.
> >    $ git checkout <tag name>
> > 
> > 2. Yao, you seem to be talking about cross compiling in a general sense.
> >    However, that doesn't seem to be related to the original question,
> >    even though the information was correct and useful.
> > 
> > 
> > Cheers,
> > Anders
> 
> -- 
> Anders Roxell
> anders.roxell@linaro.org
> M: +46 709 71 42 85 | IRC: roxell
Robbie King July 29, 2014, 2:44 p.m. UTC | #7
Thanks Anders for all your help.  I should have this together
today.  

I did notice that I cannot build ARM once I have built X86 in
my workspace.  Is there a "clean" target that will truly wipe
out everything such that you can bootstrap and configure again?

-----Original Message-----
From: Anders Roxell [mailto:anders.roxell@linaro.org] 
Sent: Tuesday, July 29, 2014 3:22 AM
To: Robbie King (robking)
Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API

On 2014-07-29 01:35, Robbie King (robking) wrote:
> Here's what I have in "DEPENDENCIES", what do you think?
> --------------------------------------------------------
> 
> Prerequisites for building the OpenDataPlane (ODP) API
> 
> 1. Linux kernel >= 3.0
> 
>    Version 3.0+ needed for the sendmmsg() interface
> 
> 2. autotools
> 
>    automake
>    autoconf
>    autoconf-archive
>    libtool
> 
>    On Debian/Ubuntu systems:
>    $ sudo apt-get install automake autoconf autoconf-archive libtool
> 
>    On CentOS/RedHat/Fedora systems:
>    $ sudo yum install automake autoconf autoconf-archive libtool libtoolize
> 
> 3. required libraries
> 
>    Libraries currently required to link: openssl
> 
> 3.1 native build
> 
>    For native compilation, simply load the necessary libraries using the appropriate
>    tool set.
> 
>    On Debian/Ubuntu systems:
>    $ sudo apt-get install libssl-dev
> 
>    On CentOS/RedHat/Fedora systems:
>    $ sudo yum install openssl-devel
> 
> 3.2 cross compilation build
> 
>    Cross compilation requires cross compiling the individual libraries.  In order for
>    a cross compiled executable to run on a target system, one must build the same
>    version as that which is installed on the target rootfs.
> 
>    For example, to build openssl for both 32 and 64 bit compilation:
>    
>    # Clone openssl repository
>    $ git clone git://git.openssl.org/openssl.git
>    $ cd openssl
> 
>    # The command "git tag" will list all tags available in the repo.
>    $ git tag
> 
>    # Checkout the specific tag to match openssl library in your target rootfs
>    $ git checkout <tag name>
> 
>    # Build and install 64 bit version of openssl
>    $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- \
>      --prefix=/home/user/src/install-openssl-aarch64
>    $ make
>    $ make install
> 
>    # Build and install 32 bit version of openssl
>    $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf- \
>      --prefix=/home/user/src/install-openssl
>    $ make
>    $ make install
>   
>    # You may now build either 32 or 64 bit ODP
>    $ git clone git://git.linaro.org/lng/odp.git odp
>    $ cd odp
>    $ ./bootstrap
> 
>    # Build 32 bit version of ODP
>    $ ./configure --host=arm-linux-gnueabihf \
>      --with-openssl-path=/home/user/src/install-openssl
>    $ make
> 
>    # Or build 64 bit version of ODP
>    $ ./configure --host=aarch64-linux-gnu \
>      --with-openssl-path=/home/user/src/install-openssl-aarch64
>    $ make

Looks good!
Just a minor nit:
Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit
version of openssl below 32 bit version?


Cheers,
Anders

> 
> -----Original Message-----
> From: Anders Roxell [mailto:anders.roxell@linaro.org] 
> Sent: Monday, July 28, 2014 1:19 PM
> To: Robbie King (robking)
> Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> 
> On 2014-07-26 15:49, Robbie King (robking) wrote:
> > So is the solution here to split the section I added for "crypto" in the DEPENDENCIES 
> > file to have a "native" and a "cross compile" subsection?  Under the cross compile 
> > subsection we can then list the steps we've discussed so for that will hopefully
> > cross compile a libodp.a that is compatible with the user's rootfs.
> 
> I'm sorry for the late reply!
> 
> Yup, that sounds good with the subsections.
> 
> Maybe section 3 should say something else than "crypto" if we need to add
> more dependencies like crypto in the future, unsure what we should say
> though. =/
> Ideas what we can say?
> 
> Cheers,
> Anders
> 
> > 
> > -----Original Message-----
> > From: Anders Roxell [mailto:anders.roxell@linaro.org] 
> > Sent: Saturday, July 26, 2014 11:17 AM
> > To: Yao Zhao
> > Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org
> > Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > 
> > On 2014-07-25 15:43, Yao Zhao wrote:
> > > [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> > > 
> > > > I agree we need to add something for cross compiling.  My apologies
> > > > for my limited knowledge of cross compiling.  If the user builds/links
> > > > against the latest openssl libcrypto from git, will it always work if the 
> > > > executable is then run on a system with a packaged openssl library?
> > > > 
> > > No, it won't.
> > > In theory you link with which then you run with which.
> > > 
> > > Normally you just make it work with native environment.
> > > Distribution which supports cross compile will make it work for target
> > > environment.
> > > 
> > > For OE/yocto, we can write a recipe to cross compile it, it will link
> > > against the openssl which will be put on target.
> > 
> > You seem to be talking two different things.
> > 
> > 1. Robbie, you seem to be asking about ABI stability, so the answer is
> >    no, you can't expect it to work. However, you can (should) checkout
> >    the specific release tag of openssl, that you expect to be on the
> >    rootfs, to compile against.
> >    I forgot in my previous mail to mention this.
> > 
> >    Commands or doing that:
> >    # git tag will list all tags available in the repo.
> >    $ git tag
> >    # Checkout a specific tag.
> >    $ git checkout <tag name>
> > 
> > 2. Yao, you seem to be talking about cross compiling in a general sense.
> >    However, that doesn't seem to be related to the original question,
> >    even though the information was correct and useful.
> > 
> > 
> > Cheers,
> > Anders
> 
> -- 
> Anders Roxell
> anders.roxell@linaro.org
> M: +46 709 71 42 85 | IRC: roxell
Yao Zhao July 29, 2014, 3:13 p.m. UTC | #8
It is nice to mention the dependency in DEPENDENCIES file.

I wrote a opendataplane recipe for openembedded/yocto:
You can put the bb and inc like me in poky/yocto's some layer,
and add the opendataplane in local.conf:
IMAGE_INSTALL_append += "opendataplane"
this will install opendataplane's binaries on target.

For this Crypto API patch, there is no way to turn it off so I
just add dependency in the recipe.
For the DPDK support, it should add dependency, sdk location when
--with-linux-dpdk specified.

yao

yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$ 
cat opendataplane.bb
require opendataplane.inc

SRCREV  = "${AUTOREV}"
SRC_URI = "git://git.linaro.org/lng/odp.git"

yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$ 
cat opendataplane.inc
SUMMARY = "Cross platform Open Data Plane application APIs"

DESCRIPTION = "The OpenDataPlane project has been established to \
produce an open-source, cross-platform set of application \
programming interfaces (APIs) for the networking data plane."

HOMEPAGE = "http://www.opendataplane.org"
SECTION = "networking"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"

COMPATIBLE_HOST = "^((?!mips).*)$"

DEPENDS = "openssl"
RDEPENDS_${PN} = "libcrypto"

PACKAGECONFIG ??= "platform_linux_generic"
PACKAGECONFIG[netmap] = "--enable-netmap,,,"
PACKAGECONFIG[platform_linux_generic] = "--with-platform=linux-generic,,,"
PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
PACKAGECONFIG[platform_linux_keystone2] = 
"--with-platform=linux-keystone2,,,"

S = "${WORKDIR}/git"

inherit autotools

do_configure_prepend () {
     ./bootstrap
}

------------------------------------------------------------------------

*From:* Anders Roxell <anders.roxell@linaro.org>
*Sent:* Tuesday, July 29, 2014 3:21AM
*To:* Robbie King (robking) <robking@cisco.com>
*Cc:* Zhao, Yao, Taras Kondratiuk <taras.kondratiuk@linaro.org>, 
lng-odp@lists.linaro.org <lng-odp@lists.linaro.org>
*Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API

On 2014-07-29 01:35, Robbie King (robking) wrote:

> Here's what I have in "DEPENDENCIES", what do you think?
> --------------------------------------------------------
>
> Prerequisites for building the OpenDataPlane (ODP) API
>
> 1. Linux kernel >= 3.0
>
>     Version 3.0+ needed for the sendmmsg() interface
>
> 2. autotools
>
>     automake
>     autoconf
>     autoconf-archive
>     libtool
>
>     On Debian/Ubuntu systems:
>     $ sudo apt-get install automake autoconf autoconf-archive libtool
>
>     On CentOS/RedHat/Fedora systems:
>     $ sudo yum install automake autoconf autoconf-archive libtool libtoolize
>
> 3. required libraries
>
>     Libraries currently required to link: openssl
>
> 3.1 native build
>
>     For native compilation, simply load the necessary libraries using the appropriate
>     tool set.
>
>     On Debian/Ubuntu systems:
>     $ sudo apt-get install libssl-dev
>
>     On CentOS/RedHat/Fedora systems:
>     $ sudo yum install openssl-devel
>
> 3.2 cross compilation build
>
>     Cross compilation requires cross compiling the individual libraries.  In order for
>     a cross compiled executable to run on a target system, one must build the same
>     version as that which is installed on the target rootfs.
>
>     For example, to build openssl for both 32 and 64 bit compilation:
>     
>     # Clone openssl repository
>     $ git clone git://git.openssl.org/openssl.git
>     $ cd openssl
>
>     # The command "git tag" will list all tags available in the repo.
>     $ git tag
>
>     # Checkout the specific tag to match openssl library in your target rootfs
>     $ git checkout <tag name>
>
>     # Build and install 64 bit version of openssl
>     $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- \
>       --prefix=/home/user/src/install-openssl-aarch64
>     $ make
>     $ make install
>
>     # Build and install 32 bit version of openssl
>     $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf- \
>       --prefix=/home/user/src/install-openssl
>     $ make
>     $ make install
>    
>     # You may now build either 32 or 64 bit ODP
>     $ git clone git://git.linaro.org/lng/odp.git odp
>     $ cd odp
>     $ ./bootstrap
>
>     # Build 32 bit version of ODP
>     $ ./configure --host=arm-linux-gnueabihf \
>       --with-openssl-path=/home/user/src/install-openssl
>     $ make
>
>     # Or build 64 bit version of ODP
>     $ ./configure --host=aarch64-linux-gnu \
>       --with-openssl-path=/home/user/src/install-openssl-aarch64
>     $ make

Looks good!
Just a minor nit:
Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit
version of openssl below 32 bit version?


Cheers,
Anders

> -----Original Message-----
> From: Anders Roxell [mailto:anders.roxell@linaro.org]
> Sent: Monday, July 28, 2014 1:19 PM
> To: Robbie King (robking)
> Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
>
> On 2014-07-26 15:49, Robbie King (robking) wrote:
>> So is the solution here to split the section I added for "crypto" in the DEPENDENCIES
>> file to have a "native" and a "cross compile" subsection?  Under the cross compile
>> subsection we can then list the steps we've discussed so for that will hopefully
>> cross compile a libodp.a that is compatible with the user's rootfs.
> I'm sorry for the late reply!
>
> Yup, that sounds good with the subsections.
>
> Maybe section 3 should say something else than "crypto" if we need to add
> more dependencies like crypto in the future, unsure what we should say
> though. =/
> Ideas what we can say?
>
> Cheers,
> Anders
>
>> -----Original Message-----
>> From: Anders Roxell [mailto:anders.roxell@linaro.org]
>> Sent: Saturday, July 26, 2014 11:17 AM
>> To: Yao Zhao
>> Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org
>> Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
>>
>> On 2014-07-25 15:43, Yao Zhao wrote:
>>> [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
>>>
>>>> I agree we need to add something for cross compiling.  My apologies
>>>> for my limited knowledge of cross compiling.  If the user builds/links
>>>> against the latest openssl libcrypto from git, will it always work if the
>>>> executable is then run on a system with a packaged openssl library?
>>>>
>>> No, it won't.
>>> In theory you link with which then you run with which.
>>>
>>> Normally you just make it work with native environment.
>>> Distribution which supports cross compile will make it work for target
>>> environment.
>>>
>>> For OE/yocto, we can write a recipe to cross compile it, it will link
>>> against the openssl which will be put on target.
>> You seem to be talking two different things.
>>
>> 1. Robbie, you seem to be asking about ABI stability, so the answer is
>>     no, you can't expect it to work. However, you can (should) checkout
>>     the specific release tag of openssl, that you expect to be on the
>>     rootfs, to compile against.
>>     I forgot in my previous mail to mention this.
>>
>>     Commands or doing that:
>>     # git tag will list all tags available in the repo.
>>     $ git tag
>>     # Checkout a specific tag.
>>     $ git checkout <tag name>
>>
>> 2. Yao, you seem to be talking about cross compiling in a general sense.
>>     However, that doesn't seem to be related to the original question,
>>     even though the information was correct and useful.
>>
>>
>> Cheers,
>> Anders
> -- 
> Anders Roxell
> anders.roxell@linaro.org
> M: +46 709 71 42 85 | IRC: roxell
require opendataplane.inc

SRCREV  = "${AUTOREV}"
SRC_URI = "git://git.linaro.org/lng/odp.git"
SUMMARY = "Cross platform Open Data Plane application APIs"

DESCRIPTION = "The OpenDataPlane project has been established to \
produce an open-source, cross-platform set of application \
programming interfaces (APIs) for the networking data plane."

HOMEPAGE = "http://www.opendataplane.org"
SECTION = "networking"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
                 
COMPATIBLE_HOST = "^((?!mips).*)$"

DEPENDS = "openssl"
RDEPENDS_${PN} = "libcrypto"

PACKAGECONFIG ??= "platform_linux_generic"
PACKAGECONFIG[netmap] = "--enable-netmap,,,"
PACKAGECONFIG[platform_linux_generic] = "--with-platform=linux-generic,,,"
PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
PACKAGECONFIG[platform_linux_keystone2] = "--with-platform=linux-keystone2,,,"

S = "${WORKDIR}/git"

inherit autotools

do_configure_prepend () {
    ./bootstrap
}
Robbie King July 29, 2014, 3:16 p.m. UTC | #9
Sorry to ask, but is this something we could do after getting this
into the repository?  Getting this in has drawn out for two weeks
now.  I think it would be helpful to get this in for HW vendors.

From: Yao Zhao [mailto:yao.zhao@windriver.com]

Sent: Tuesday, July 29, 2014 11:14 AM
To: Anders Roxell; Robbie King (robking)
Cc: Taras Kondratiuk; lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API

It is nice to mention the dependency in DEPENDENCIES file.

I wrote a opendataplane recipe for openembedded/yocto:
You can put the bb and inc like me in poky/yocto's some layer,
and add the opendataplane in local.conf:
IMAGE_INSTALL_append += "opendataplane"
this will install opendataplane's binaries on target.

For this Crypto API patch, there is no way to turn it off so I
just add dependency in the recipe.
For the DPDK support, it should add dependency, sdk location when
--with-linux-dpdk specified.

yao

yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$ cat opendataplane.bb
require opendataplane.inc

SRCREV  = "${AUTOREV}"                                                                                                ./con
SRC_URI = "git://git.linaro.org/lng/odp.git"

yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$ cat opendataplane.inc
SUMMARY = "Cross platform Open Data Plane application APIs"

DESCRIPTION = "The OpenDataPlane project has been established to \
produce an open-source, cross-platform set of application \
programming interfaces (APIs) for the networking data plane."

HOMEPAGE = "http://www.opendataplane.org"<http://www.opendataplane.org>
SECTION = "networking"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"<file:///\\LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2>

COMPATIBLE_HOST = "^((?!mips).*)$"

DEPENDS = "openssl"
RDEPENDS_${PN} = "libcrypto"

PACKAGECONFIG ??= "platform_linux_generic"
PACKAGECONFIG[netmap] = "--enable-netmap,,,"
PACKAGECONFIG[platform_linux_generic] = "--with-platform=linux-generic,,,"
PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
PACKAGECONFIG[platform_linux_keystone2] = "--with-platform=linux-keystone2,,,"

S = "${WORKDIR}/git"

inherit autotools

do_configure_prepend () {
    ./bootstrap
}
________________________________

From: Anders Roxell <anders.roxell@linaro.org><mailto:anders.roxell@linaro.org>

Sent: Tuesday, July 29, 2014 3:21AM
To: Robbie King (robking) <robking@cisco.com><mailto:robking@cisco.com>
Cc: Zhao, Yao, Taras Kondratiuk <taras.kondratiuk@linaro.org><mailto:taras.kondratiuk@linaro.org>, lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <lng-odp@lists.linaro.org><mailto:lng-odp@lists.linaro.org>
Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API

On 2014-07-29 01:35, Robbie King (robking) wrote:

Here's what I have in "DEPENDENCIES", what do you think?

--------------------------------------------------------



Prerequisites for building the OpenDataPlane (ODP) API



1. Linux kernel >= 3.0



   Version 3.0+ needed for the sendmmsg() interface



2. autotools



   automake

   autoconf

   autoconf-archive

   libtool



   On Debian/Ubuntu systems:

   $ sudo apt-get install automake autoconf autoconf-archive libtool



   On CentOS/RedHat/Fedora systems:

   $ sudo yum install automake autoconf autoconf-archive libtool libtoolize



3. required libraries



   Libraries currently required to link: openssl



3.1 native build



   For native compilation, simply load the necessary libraries using the appropriate

   tool set.



   On Debian/Ubuntu systems:

   $ sudo apt-get install libssl-dev



   On CentOS/RedHat/Fedora systems:

   $ sudo yum install openssl-devel



3.2 cross compilation build



   Cross compilation requires cross compiling the individual libraries.  In order for

   a cross compiled executable to run on a target system, one must build the same

   version as that which is installed on the target rootfs.



   For example, to build openssl for both 32 and 64 bit compilation:



   # Clone openssl repository

   $ git clone git://git.openssl.org/openssl.git

   $ cd openssl



   # The command "git tag" will list all tags available in the repo.

   $ git tag



   # Checkout the specific tag to match openssl library in your target rootfs

   $ git checkout <tag name>



   # Build and install 64 bit version of openssl

   $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- \

     --prefix=/home/user/src/install-openssl-aarch64

   $ make

   $ make install



   # Build and install 32 bit version of openssl

   $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf- \

     --prefix=/home/user/src/install-openssl

   $ make

   $ make install



   # You may now build either 32 or 64 bit ODP

   $ git clone git://git.linaro.org/lng/odp.git odp

   $ cd odp

   $ ./bootstrap



   # Build 32 bit version of ODP

   $ ./configure --host=arm-linux-gnueabihf \

     --with-openssl-path=/home/user/src/install-openssl

   $ make



   # Or build 64 bit version of ODP

   $ ./configure --host=aarch64-linux-gnu \

     --with-openssl-path=/home/user/src/install-openssl-aarch64

   $ make

Looks good!

Just a minor nit:

Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit

version of openssl below 32 bit version?





Cheers,

Anders



-----Original Message-----

From: Anders Roxell [mailto:anders.roxell@linaro.org]


Sent: Monday, July 28, 2014 1:19 PM

To: Robbie King (robking)

Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org>

Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API



On 2014-07-26 15:49, Robbie King (robking) wrote:

So is the solution here to split the section I added for "crypto" in the DEPENDENCIES

file to have a "native" and a "cross compile" subsection?  Under the cross compile

subsection we can then list the steps we've discussed so for that will hopefully

cross compile a libodp.a that is compatible with the user's rootfs.

I'm sorry for the late reply!



Yup, that sounds good with the subsections.



Maybe section 3 should say something else than "crypto" if we need to add

more dependencies like crypto in the future, unsure what we should say

though. =/

Ideas what we can say?



Cheers,

Anders



-----Original Message-----

From: Anders Roxell [mailto:anders.roxell@linaro.org]


Sent: Saturday, July 26, 2014 11:17 AM

To: Yao Zhao

Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org>

Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API



On 2014-07-25 15:43, Yao Zhao wrote:

[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:



I agree we need to add something for cross compiling.  My apologies

for my limited knowledge of cross compiling.  If the user builds/links

against the latest openssl libcrypto from git, will it always work if the

executable is then run on a system with a packaged openssl library?



No, it won't.

In theory you link with which then you run with which.



Normally you just make it work with native environment.

Distribution which supports cross compile will make it work for target

environment.



For OE/yocto, we can write a recipe to cross compile it, it will link

against the openssl which will be put on target.

You seem to be talking two different things.



1. Robbie, you seem to be asking about ABI stability, so the answer is

   no, you can't expect it to work. However, you can (should) checkout

   the specific release tag of openssl, that you expect to be on the

   rootfs, to compile against.

   I forgot in my previous mail to mention this.



   Commands or doing that:

   # git tag will list all tags available in the repo.

   $ git tag

   # Checkout a specific tag.

   $ git checkout <tag name>



2. Yao, you seem to be talking about cross compiling in a general sense.

   However, that doesn't seem to be related to the original question,

   even though the information was correct and useful.





Cheers,

Anders

--

Anders Roxell

anders.roxell@linaro.org<mailto:anders.roxell@linaro.org>

M: +46 709 71 42 85 | IRC: roxell
Yao Zhao July 29, 2014, 3:24 p.m. UTC | #10
Robbie,

I don't have any objection to your code, code is awesome
clear to me.

I only provided a yocto bb recipe for people interested in
odp and want to compile odp with yocto.

And add the dependency in the bb to show that normally
what distro needs to do to compile your package.

yao
------------------------------------------------------------------------

*From:* Robbie King (robking)
*Sent:* Tuesday, July 29, 2014 11:16AM
*To:* Zhao, Yao, Anders Roxell
*Cc:* Taras Kondratiuk, lng-odp@lists.linaro.org
*Subject:* RE: [lng-odp] [PATCH 0/3] ODP Crypto API

Sorry to ask, but is this something we could do after getting this

into the repository?  Getting this in has drawn out for two weeks

now. I think it would be helpful to get this in for HW vendors.

*From:*Yao Zhao [mailto:yao.zhao@windriver.com]
*Sent:* Tuesday, July 29, 2014 11:14 AM
*To:* Anders Roxell; Robbie King (robking)
*Cc:* Taras Kondratiuk; lng-odp@lists.linaro.org
*Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API

It is nice to mention the dependency in DEPENDENCIES file.

I wrote a opendataplane recipe for openembedded/yocto:
You can put the bb and inc like me in poky/yocto's some layer,
and add the opendataplane in local.conf:
IMAGE_INSTALL_append += "opendataplane"
this will install opendataplane's binaries on target.

For this Crypto API patch, there is no way to turn it off so I
just add dependency in the recipe.
For the DPDK support, it should add dependency, sdk location when
--with-linux-dpdk specified.

yao

yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$ 
cat opendataplane.bb
require opendataplane.inc

SRCREV  = "${AUTOREV}" ./con
SRC_URI = "git://git.linaro.org/lng/odp.git"

yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$ 
cat opendataplane.inc
SUMMARY = "Cross platform Open Data Plane application APIs"

DESCRIPTION = "The OpenDataPlane project has been established to \
produce an open-source, cross-platform set of application \
programming interfaces (APIs) for the networking data plane."

HOMEPAGE = "http://www.opendataplane.org" <http://www.opendataplane.org>
SECTION = "networking"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2" 
<file:///%5C%5CLICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2>

COMPATIBLE_HOST = "^((?!mips).*)$"

DEPENDS = "openssl"
RDEPENDS_${PN} = "libcrypto"

PACKAGECONFIG ??= "platform_linux_generic"
PACKAGECONFIG[netmap] = "--enable-netmap,,,"
PACKAGECONFIG[platform_linux_generic] = "--with-platform=linux-generic,,,"
PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
PACKAGECONFIG[platform_linux_keystone2] = 
"--with-platform=linux-keystone2,,,"

S = "${WORKDIR}/git"

inherit autotools

do_configure_prepend () {
     ./bootstrap
}

------------------------------------------------------------------------


*From:* Anders Roxell <anders.roxell@linaro.org> 
<mailto:anders.roxell@linaro.org>
*Sent:* Tuesday, July 29, 2014 3:21AM
*To:* Robbie King (robking) <robking@cisco.com> <mailto:robking@cisco.com>
*Cc:* Zhao, Yao, Taras Kondratiuk <taras.kondratiuk@linaro.org> 
<mailto:taras.kondratiuk@linaro.org>, lng-odp@lists.linaro.org 
<mailto:lng-odp@lists.linaro.org> <lng-odp@lists.linaro.org> 
<mailto:lng-odp@lists.linaro.org>
*Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API

On 2014-07-29 01:35, Robbie King (robking) wrote:

    Here's what I have in "DEPENDENCIES", what do you think?

    --------------------------------------------------------

      

    Prerequisites for building the OpenDataPlane (ODP) API

      

    1. Linux kernel >= 3.0

      

        Version 3.0+ needed for the sendmmsg() interface

      

    2. autotools

      

        automake

        autoconf

        autoconf-archive

        libtool

      

        On Debian/Ubuntu systems:

        $ sudo apt-get install automake autoconf autoconf-archive libtool

      

        On CentOS/RedHat/Fedora systems:

        $ sudo yum install automake autoconf autoconf-archive libtool libtoolize

      

    3. required libraries

      

        Libraries currently required to link: openssl

      

    3.1 native build

      

        For native compilation, simply load the necessary libraries using the appropriate

        tool set.

      

        On Debian/Ubuntu systems:

        $ sudo apt-get install libssl-dev

      

        On CentOS/RedHat/Fedora systems:

        $ sudo yum install openssl-devel

      

    3.2 cross compilation build

      

        Cross compilation requires cross compiling the individual libraries.  In order for

        a cross compiled executable to run on a target system, one must build the same

        version as that which is installed on the target rootfs.

      

        For example, to build openssl for both 32 and 64 bit compilation:

        

        # Clone openssl repository

        $ git clone git://git.openssl.org/openssl.git

        $ cd openssl

      

        # The command "git tag" will list all tags available in the repo.

        $ git tag

      

        # Checkout the specific tag to match openssl library in your target rootfs

        $ git checkout <tag name>

      

        # Build and install 64 bit version of openssl

        $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- \

          --prefix=/home/user/src/install-openssl-aarch64

        $ make

        $ make install

      

        # Build and install 32 bit version of openssl

        $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf- \

          --prefix=/home/user/src/install-openssl

        $ make

        $ make install

       

        # You may now build either 32 or 64 bit ODP

        $ git clone git://git.linaro.org/lng/odp.git odp

        $ cd odp

        $ ./bootstrap

      

        # Build 32 bit version of ODP

        $ ./configure --host=arm-linux-gnueabihf \

          --with-openssl-path=/home/user/src/install-openssl

        $ make

      

        # Or build 64 bit version of ODP

        $ ./configure --host=aarch64-linux-gnu \

          --with-openssl-path=/home/user/src/install-openssl-aarch64

        $ make

Looks good!

Just a minor nit:

Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit

version of openssl below 32 bit version?

  

  

Cheers,

Anders

  

    -----Original Message-----

    From: Anders Roxell [mailto:anders.roxell@linaro.org]

    Sent: Monday, July 28, 2014 1:19 PM

    To: Robbie King (robking)

    Cc: Yao Zhao; Taras Kondratiuk;lng-odp@lists.linaro.org  <mailto:lng-odp@lists.linaro.org>

    Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API

      

    On 2014-07-26 15:49, Robbie King (robking) wrote:

        So is the solution here to split the section I added for "crypto" in the DEPENDENCIES

        file to have a "native" and a "cross compile" subsection?  Under the cross compile

        subsection we can then list the steps we've discussed so for that will hopefully

        cross compile a libodp.a that is compatible with the user's rootfs.

    I'm sorry for the late reply!

      

    Yup, that sounds good with the subsections.

      

    Maybe section 3 should say something else than "crypto" if we need to add

    more dependencies like crypto in the future, unsure what we should say

    though. =/

    Ideas what we can say?

      

    Cheers,

    Anders

      

        -----Original Message-----

        From: Anders Roxell [mailto:anders.roxell@linaro.org]

        Sent: Saturday, July 26, 2014 11:17 AM

        To: Yao Zhao

        Cc: Robbie King (robking); Taras Kondratiuk;lng-odp@lists.linaro.org  <mailto:lng-odp@lists.linaro.org>

        Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API

          

        On 2014-07-25 15:43, Yao Zhao wrote:

            [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:

              

                I agree we need to add something for cross compiling.  My apologies

                for my limited knowledge of cross compiling.  If the user builds/links

                against the latest openssl libcrypto from git, will it always work if the

                executable is then run on a system with a packaged openssl library?

                  

            No, it won't.

            In theory you link with which then you run with which.

              

            Normally you just make it work with native environment.

            Distribution which supports cross compile will make it work for target

            environment.

              

            For OE/yocto, we can write a recipe to cross compile it, it will link

            against the openssl which will be put on target.

        You seem to be talking two different things.

          

        1. Robbie, you seem to be asking about ABI stability, so the answer is

            no, you can't expect it to work. However, you can (should) checkout

            the specific release tag of openssl, that you expect to be on the

            rootfs, to compile against.

            I forgot in my previous mail to mention this.

          

            Commands or doing that:

            # git tag will list all tags available in the repo.

            $ git tag

            # Checkout a specific tag.

            $ git checkout <tag name>

          

        2. Yao, you seem to be talking about cross compiling in a general sense.

            However, that doesn't seem to be related to the original question,

            even though the information was correct and useful.

          

          

        Cheers,

        Anders

    -- 

    Anders Roxell

    anders.roxell@linaro.org  <mailto:anders.roxell@linaro.org>

    M: +46 709 71 42 85 | IRC: roxell
Robbie King July 29, 2014, 3:43 p.m. UTC | #11
Thanks Yao, I do think we could use more information
for the various build scenarios when cross compiling.

From: Yao Zhao [mailto:yao.zhao@windriver.com]

Sent: Tuesday, July 29, 2014 11:24 AM
To: Robbie King (robking); Anders Roxell
Cc: Taras Kondratiuk; lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API

Robbie,

I don't have any objection to your code, code is awesome
clear to me.

I only provided a yocto bb recipe for people interested in
odp and want to compile odp with yocto.

And add the dependency in the bb to show that normally
what distro needs to do to compile your package.

yao
________________________________

From: Robbie King (robking)

Sent: Tuesday, July 29, 2014 11:16AM
To: Zhao, Yao, Anders Roxell
Cc: Taras Kondratiuk, lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org>
Subject: RE: [lng-odp] [PATCH 0/3] ODP Crypto API
Sorry to ask, but is this something we could do after getting this
into the repository?  Getting this in has drawn out for two weeks
now.  I think it would be helpful to get this in for HW vendors.

From: Yao Zhao [mailto:yao.zhao@windriver.com]

Sent: Tuesday, July 29, 2014 11:14 AM
To: Anders Roxell; Robbie King (robking)
Cc: Taras Kondratiuk; lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org>
Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API

It is nice to mention the dependency in DEPENDENCIES file.

I wrote a opendataplane recipe for openembedded/yocto:
You can put the bb and inc like me in poky/yocto's some layer,
and add the opendataplane in local.conf:
IMAGE_INSTALL_append += "opendataplane"
this will install opendataplane's binaries on target.

For this Crypto API patch, there is no way to turn it off so I
just add dependency in the recipe.
For the DPDK support, it should add dependency, sdk location when
--with-linux-dpdk specified.

yao

yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$ cat opendataplane.bb
require opendataplane.inc

SRCREV  = "${AUTOREV}"                                                                                               ./con
SRC_URI = "git://git.linaro.org/lng/odp.git"

yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$ cat opendataplane.inc
SUMMARY = "Cross platform Open Data Plane application APIs"

DESCRIPTION = "The OpenDataPlane project has been established to \
produce an open-source, cross-platform set of application \
programming interfaces (APIs) for the networking data plane."

HOMEPAGE = "http://www.opendataplane.org"<http://www.opendataplane.org>
SECTION = "networking"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"<file:///\\%5C%5CLICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2>

COMPATIBLE_HOST = "^((?!mips).*)$"

DEPENDS = "openssl"
RDEPENDS_${PN} = "libcrypto"

PACKAGECONFIG ??= "platform_linux_generic"
PACKAGECONFIG[netmap] = "--enable-netmap,,,"
PACKAGECONFIG[platform_linux_generic] = "--with-platform=linux-generic,,,"
PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
PACKAGECONFIG[platform_linux_keystone2] = "--with-platform=linux-keystone2,,,"

S = "${WORKDIR}/git"

inherit autotools

do_configure_prepend () {
    ./bootstrap
}
________________________________

From: Anders Roxell <anders.roxell@linaro.org><mailto:anders.roxell@linaro.org>

Sent: Tuesday, July 29, 2014 3:21AM
To: Robbie King (robking) <robking@cisco.com><mailto:robking@cisco.com>
Cc: Zhao, Yao, Taras Kondratiuk <taras.kondratiuk@linaro.org><mailto:taras.kondratiuk@linaro.org>, lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <lng-odp@lists.linaro.org><mailto:lng-odp@lists.linaro.org>
Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API

On 2014-07-29 01:35, Robbie King (robking) wrote:

Here's what I have in "DEPENDENCIES", what do you think?

--------------------------------------------------------



Prerequisites for building the OpenDataPlane (ODP) API



1. Linux kernel >= 3.0



   Version 3.0+ needed for the sendmmsg() interface



2. autotools



   automake

   autoconf

   autoconf-archive

   libtool



   On Debian/Ubuntu systems:

   $ sudo apt-get install automake autoconf autoconf-archive libtool



   On CentOS/RedHat/Fedora systems:

   $ sudo yum install automake autoconf autoconf-archive libtool libtoolize



3. required libraries



   Libraries currently required to link: openssl



3.1 native build



   For native compilation, simply load the necessary libraries using the appropriate

   tool set.



   On Debian/Ubuntu systems:

   $ sudo apt-get install libssl-dev



   On CentOS/RedHat/Fedora systems:

   $ sudo yum install openssl-devel



3.2 cross compilation build



   Cross compilation requires cross compiling the individual libraries.  In order for

   a cross compiled executable to run on a target system, one must build the same

   version as that which is installed on the target rootfs.



   For example, to build openssl for both 32 and 64 bit compilation:



   # Clone openssl repository

   $ git clone git://git.openssl.org/openssl.git

   $ cd openssl



   # The command "git tag" will list all tags available in the repo.

   $ git tag



   # Checkout the specific tag to match openssl library in your target rootfs

   $ git checkout <tag name>



   # Build and install 64 bit version of openssl

   $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- \

     --prefix=/home/user/src/install-openssl-aarch64

   $ make

   $ make install



   # Build and install 32 bit version of openssl

   $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf- \

     --prefix=/home/user/src/install-openssl

   $ make

   $ make install



   # You may now build either 32 or 64 bit ODP

   $ git clone git://git.linaro.org/lng/odp.git odp

   $ cd odp

   $ ./bootstrap



   # Build 32 bit version of ODP

   $ ./configure --host=arm-linux-gnueabihf \

     --with-openssl-path=/home/user/src/install-openssl

   $ make



   # Or build 64 bit version of ODP

   $ ./configure --host=aarch64-linux-gnu \

     --with-openssl-path=/home/user/src/install-openssl-aarch64

   $ make

Looks good!

Just a minor nit:

Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit

version of openssl below 32 bit version?





Cheers,

Anders



-----Original Message-----

From: Anders Roxell [mailto:anders.roxell@linaro.org]


Sent: Monday, July 28, 2014 1:19 PM

To: Robbie King (robking)

Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org>

Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API



On 2014-07-26 15:49, Robbie King (robking) wrote:

So is the solution here to split the section I added for "crypto" in the DEPENDENCIES

file to have a "native" and a "cross compile" subsection?  Under the cross compile

subsection we can then list the steps we've discussed so for that will hopefully

cross compile a libodp.a that is compatible with the user's rootfs.

I'm sorry for the late reply!



Yup, that sounds good with the subsections.



Maybe section 3 should say something else than "crypto" if we need to add

more dependencies like crypto in the future, unsure what we should say

though. =/

Ideas what we can say?



Cheers,

Anders



-----Original Message-----

From: Anders Roxell [mailto:anders.roxell@linaro.org]


Sent: Saturday, July 26, 2014 11:17 AM

To: Yao Zhao

Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org>

Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API



On 2014-07-25 15:43, Yao Zhao wrote:

[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:



I agree we need to add something for cross compiling.  My apologies

for my limited knowledge of cross compiling.  If the user builds/links

against the latest openssl libcrypto from git, will it always work if the

executable is then run on a system with a packaged openssl library?



No, it won't.

In theory you link with which then you run with which.



Normally you just make it work with native environment.

Distribution which supports cross compile will make it work for target

environment.



For OE/yocto, we can write a recipe to cross compile it, it will link

against the openssl which will be put on target.

You seem to be talking two different things.



1. Robbie, you seem to be asking about ABI stability, so the answer is

   no, you can't expect it to work. However, you can (should) checkout

   the specific release tag of openssl, that you expect to be on the

   rootfs, to compile against.

   I forgot in my previous mail to mention this.



   Commands or doing that:

   # git tag will list all tags available in the repo.

   $ git tag

   # Checkout a specific tag.

   $ git checkout <tag name>



2. Yao, you seem to be talking about cross compiling in a general sense.

   However, that doesn't seem to be related to the original question,

   even though the information was correct and useful.





Cheers,

Anders

--

Anders Roxell

anders.roxell@linaro.org<mailto:anders.roxell@linaro.org>

M: +46 709 71 42 85 | IRC: roxell
Anders Roxell July 29, 2014, 5:58 p.m. UTC | #12
On 2014-07-29 14:44, Robbie King (robking) wrote:
> Thanks Anders for all your help.  I should have this together
> today.  
> 
> I did notice that I cannot build ARM once I have built X86 in
> my workspace.  Is there a "clean" target that will truly wipe
> out everything such that you can bootstrap and configure again?

make distclean

and then ./configure <with params>... again.

that should work

Cheers,
Anders

> 
> -----Original Message-----
> From: Anders Roxell [mailto:anders.roxell@linaro.org] 
> Sent: Tuesday, July 29, 2014 3:22 AM
> To: Robbie King (robking)
> Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> 
> On 2014-07-29 01:35, Robbie King (robking) wrote:
> > Here's what I have in "DEPENDENCIES", what do you think?
> > --------------------------------------------------------
> > 
> > Prerequisites for building the OpenDataPlane (ODP) API
> > 
> > 1. Linux kernel >= 3.0
> > 
> >    Version 3.0+ needed for the sendmmsg() interface
> > 
> > 2. autotools
> > 
> >    automake
> >    autoconf
> >    autoconf-archive
> >    libtool
> > 
> >    On Debian/Ubuntu systems:
> >    $ sudo apt-get install automake autoconf autoconf-archive libtool
> > 
> >    On CentOS/RedHat/Fedora systems:
> >    $ sudo yum install automake autoconf autoconf-archive libtool libtoolize
> > 
> > 3. required libraries
> > 
> >    Libraries currently required to link: openssl
> > 
> > 3.1 native build
> > 
> >    For native compilation, simply load the necessary libraries using the appropriate
> >    tool set.
> > 
> >    On Debian/Ubuntu systems:
> >    $ sudo apt-get install libssl-dev
> > 
> >    On CentOS/RedHat/Fedora systems:
> >    $ sudo yum install openssl-devel
> > 
> > 3.2 cross compilation build
> > 
> >    Cross compilation requires cross compiling the individual libraries.  In order for
> >    a cross compiled executable to run on a target system, one must build the same
> >    version as that which is installed on the target rootfs.
> > 
> >    For example, to build openssl for both 32 and 64 bit compilation:
> >    
> >    # Clone openssl repository
> >    $ git clone git://git.openssl.org/openssl.git
> >    $ cd openssl
> > 
> >    # The command "git tag" will list all tags available in the repo.
> >    $ git tag
> > 
> >    # Checkout the specific tag to match openssl library in your target rootfs
> >    $ git checkout <tag name>
> > 
> >    # Build and install 64 bit version of openssl
> >    $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- \
> >      --prefix=/home/user/src/install-openssl-aarch64
> >    $ make
> >    $ make install
> > 
> >    # Build and install 32 bit version of openssl
> >    $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf- \
> >      --prefix=/home/user/src/install-openssl
> >    $ make
> >    $ make install
> >   
> >    # You may now build either 32 or 64 bit ODP
> >    $ git clone git://git.linaro.org/lng/odp.git odp
> >    $ cd odp
> >    $ ./bootstrap
> > 
> >    # Build 32 bit version of ODP
> >    $ ./configure --host=arm-linux-gnueabihf \
> >      --with-openssl-path=/home/user/src/install-openssl
> >    $ make
> > 
> >    # Or build 64 bit version of ODP
> >    $ ./configure --host=aarch64-linux-gnu \
> >      --with-openssl-path=/home/user/src/install-openssl-aarch64
> >    $ make
> 
> Looks good!
> Just a minor nit:
> Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit
> version of openssl below 32 bit version?
> 
> 
> Cheers,
> Anders
> 
> > 
> > -----Original Message-----
> > From: Anders Roxell [mailto:anders.roxell@linaro.org] 
> > Sent: Monday, July 28, 2014 1:19 PM
> > To: Robbie King (robking)
> > Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> > Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > 
> > On 2014-07-26 15:49, Robbie King (robking) wrote:
> > > So is the solution here to split the section I added for "crypto" in the DEPENDENCIES 
> > > file to have a "native" and a "cross compile" subsection?  Under the cross compile 
> > > subsection we can then list the steps we've discussed so for that will hopefully
> > > cross compile a libodp.a that is compatible with the user's rootfs.
> > 
> > I'm sorry for the late reply!
> > 
> > Yup, that sounds good with the subsections.
> > 
> > Maybe section 3 should say something else than "crypto" if we need to add
> > more dependencies like crypto in the future, unsure what we should say
> > though. =/
> > Ideas what we can say?
> > 
> > Cheers,
> > Anders
> > 
> > > 
> > > -----Original Message-----
> > > From: Anders Roxell [mailto:anders.roxell@linaro.org] 
> > > Sent: Saturday, July 26, 2014 11:17 AM
> > > To: Yao Zhao
> > > Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org
> > > Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > > 
> > > On 2014-07-25 15:43, Yao Zhao wrote:
> > > > [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> > > > 
> > > > > I agree we need to add something for cross compiling.  My apologies
> > > > > for my limited knowledge of cross compiling.  If the user builds/links
> > > > > against the latest openssl libcrypto from git, will it always work if the 
> > > > > executable is then run on a system with a packaged openssl library?
> > > > > 
> > > > No, it won't.
> > > > In theory you link with which then you run with which.
> > > > 
> > > > Normally you just make it work with native environment.
> > > > Distribution which supports cross compile will make it work for target
> > > > environment.
> > > > 
> > > > For OE/yocto, we can write a recipe to cross compile it, it will link
> > > > against the openssl which will be put on target.
> > > 
> > > You seem to be talking two different things.
> > > 
> > > 1. Robbie, you seem to be asking about ABI stability, so the answer is
> > >    no, you can't expect it to work. However, you can (should) checkout
> > >    the specific release tag of openssl, that you expect to be on the
> > >    rootfs, to compile against.
> > >    I forgot in my previous mail to mention this.
> > > 
> > >    Commands or doing that:
> > >    # git tag will list all tags available in the repo.
> > >    $ git tag
> > >    # Checkout a specific tag.
> > >    $ git checkout <tag name>
> > > 
> > > 2. Yao, you seem to be talking about cross compiling in a general sense.
> > >    However, that doesn't seem to be related to the original question,
> > >    even though the information was correct and useful.
> > > 
> > > 
> > > Cheers,
> > > Anders
> > 
> > -- 
> > Anders Roxell
> > anders.roxell@linaro.org
> > M: +46 709 71 42 85 | IRC: roxell
Anders Roxell July 29, 2014, 6:07 p.m. UTC | #13
Hi Yao, 

Nice... When will you push the recipe?

Just some nits see inline comments below.

On 2014-07-29 11:13, Yao Zhao wrote:
> It is nice to mention the dependency in DEPENDENCIES file.
> 
> I wrote a opendataplane recipe for openembedded/yocto:
> You can put the bb and inc like me in poky/yocto's some layer,
> and add the opendataplane in local.conf:
> IMAGE_INSTALL_append += "opendataplane"
> this will install opendataplane's binaries on target.
> 
> For this Crypto API patch, there is no way to turn it off so I
> just add dependency in the recipe.
> For the DPDK support, it should add dependency, sdk location when
> --with-linux-dpdk specified.
> 
> yao
> 
> yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> cat opendataplane.bb
> require opendataplane.inc
> 
> SRCREV  = "${AUTOREV}"

Do we want AUTOREV here and not release tags?

> SRC_URI = "git://git.linaro.org/lng/odp.git"
> 
> yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> cat opendataplane.inc
> SUMMARY = "Cross platform Open Data Plane application APIs"

Open Data Plane -> OpenDataPlane

> 
> DESCRIPTION = "The OpenDataPlane project has been established to \
> produce an open-source, cross-platform set of application \
> programming interfaces (APIs) for the networking data plane."
> 
> HOMEPAGE = "http://www.opendataplane.org"
> SECTION = "networking"
> LICENSE = "BSD-3-Clause"
> LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> 
> COMPATIBLE_HOST = "^((?!mips).*)$"
> 
> DEPENDS = "openssl"
> RDEPENDS_${PN} = "libcrypto"
> 
> PACKAGECONFIG ??= "platform_linux_generic"
> PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> PACKAGECONFIG[platform_linux_generic] = "--with-platform=linux-generic,,,"
> PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> PACKAGECONFIG[platform_linux_keystone2] =
> "--with-platform=linux-keystone2,,,"

Don't we need to add a recipe for dpdk to build linux-dpdk and a recipe for OpenEM
to build linux-keystone2?

Cheers,
Anders

> 
> S = "${WORKDIR}/git"
> 
> inherit autotools
> 
> do_configure_prepend () {
>     ./bootstrap
> }
> 
> ------------------------------------------------------------------------
> 
> *From:* Anders Roxell <anders.roxell@linaro.org>
> *Sent:* Tuesday, July 29, 2014 3:21AM
> *To:* Robbie King (robking) <robking@cisco.com>
> *Cc:* Zhao, Yao, Taras Kondratiuk <taras.kondratiuk@linaro.org>,
> lng-odp@lists.linaro.org <lng-odp@lists.linaro.org>
> *Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> 
> On 2014-07-29 01:35, Robbie King (robking) wrote:
> 
> >Here's what I have in "DEPENDENCIES", what do you think?
> >--------------------------------------------------------
> >
> >Prerequisites for building the OpenDataPlane (ODP) API
> >
> >1. Linux kernel >= 3.0
> >
> >    Version 3.0+ needed for the sendmmsg() interface
> >
> >2. autotools
> >
> >    automake
> >    autoconf
> >    autoconf-archive
> >    libtool
> >
> >    On Debian/Ubuntu systems:
> >    $ sudo apt-get install automake autoconf autoconf-archive libtool
> >
> >    On CentOS/RedHat/Fedora systems:
> >    $ sudo yum install automake autoconf autoconf-archive libtool libtoolize
> >
> >3. required libraries
> >
> >    Libraries currently required to link: openssl
> >
> >3.1 native build
> >
> >    For native compilation, simply load the necessary libraries using the appropriate
> >    tool set.
> >
> >    On Debian/Ubuntu systems:
> >    $ sudo apt-get install libssl-dev
> >
> >    On CentOS/RedHat/Fedora systems:
> >    $ sudo yum install openssl-devel
> >
> >3.2 cross compilation build
> >
> >    Cross compilation requires cross compiling the individual libraries.  In order for
> >    a cross compiled executable to run on a target system, one must build the same
> >    version as that which is installed on the target rootfs.
> >
> >    For example, to build openssl for both 32 and 64 bit compilation:
> >    # Clone openssl repository
> >    $ git clone git://git.openssl.org/openssl.git
> >    $ cd openssl
> >
> >    # The command "git tag" will list all tags available in the repo.
> >    $ git tag
> >
> >    # Checkout the specific tag to match openssl library in your target rootfs
> >    $ git checkout <tag name>
> >
> >    # Build and install 64 bit version of openssl
> >    $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- \
> >      --prefix=/home/user/src/install-openssl-aarch64
> >    $ make
> >    $ make install
> >
> >    # Build and install 32 bit version of openssl
> >    $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf- \
> >      --prefix=/home/user/src/install-openssl
> >    $ make
> >    $ make install
> >    # You may now build either 32 or 64 bit ODP
> >    $ git clone git://git.linaro.org/lng/odp.git odp
> >    $ cd odp
> >    $ ./bootstrap
> >
> >    # Build 32 bit version of ODP
> >    $ ./configure --host=arm-linux-gnueabihf \
> >      --with-openssl-path=/home/user/src/install-openssl
> >    $ make
> >
> >    # Or build 64 bit version of ODP
> >    $ ./configure --host=aarch64-linux-gnu \
> >      --with-openssl-path=/home/user/src/install-openssl-aarch64
> >    $ make
> 
> Looks good!
> Just a minor nit:
> Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit
> version of openssl below 32 bit version?
> 
> 
> Cheers,
> Anders
> 
> >-----Original Message-----
> >From: Anders Roxell [mailto:anders.roxell@linaro.org]
> >Sent: Monday, July 28, 2014 1:19 PM
> >To: Robbie King (robking)
> >Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> >Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> >
> >On 2014-07-26 15:49, Robbie King (robking) wrote:
> >>So is the solution here to split the section I added for "crypto" in the DEPENDENCIES
> >>file to have a "native" and a "cross compile" subsection?  Under the cross compile
> >>subsection we can then list the steps we've discussed so for that will hopefully
> >>cross compile a libodp.a that is compatible with the user's rootfs.
> >I'm sorry for the late reply!
> >
> >Yup, that sounds good with the subsections.
> >
> >Maybe section 3 should say something else than "crypto" if we need to add
> >more dependencies like crypto in the future, unsure what we should say
> >though. =/
> >Ideas what we can say?
> >
> >Cheers,
> >Anders
> >
> >>-----Original Message-----
> >>From: Anders Roxell [mailto:anders.roxell@linaro.org]
> >>Sent: Saturday, July 26, 2014 11:17 AM
> >>To: Yao Zhao
> >>Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org
> >>Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> >>
> >>On 2014-07-25 15:43, Yao Zhao wrote:
> >>>[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> >>>
> >>>>I agree we need to add something for cross compiling.  My apologies
> >>>>for my limited knowledge of cross compiling.  If the user builds/links
> >>>>against the latest openssl libcrypto from git, will it always work if the
> >>>>executable is then run on a system with a packaged openssl library?
> >>>>
> >>>No, it won't.
> >>>In theory you link with which then you run with which.
> >>>
> >>>Normally you just make it work with native environment.
> >>>Distribution which supports cross compile will make it work for target
> >>>environment.
> >>>
> >>>For OE/yocto, we can write a recipe to cross compile it, it will link
> >>>against the openssl which will be put on target.
> >>You seem to be talking two different things.
> >>
> >>1. Robbie, you seem to be asking about ABI stability, so the answer is
> >>    no, you can't expect it to work. However, you can (should) checkout
> >>    the specific release tag of openssl, that you expect to be on the
> >>    rootfs, to compile against.
> >>    I forgot in my previous mail to mention this.
> >>
> >>    Commands or doing that:
> >>    # git tag will list all tags available in the repo.
> >>    $ git tag
> >>    # Checkout a specific tag.
> >>    $ git checkout <tag name>
> >>
> >>2. Yao, you seem to be talking about cross compiling in a general sense.
> >>    However, that doesn't seem to be related to the original question,
> >>    even though the information was correct and useful.
> >>
> >>
> >>Cheers,
> >>Anders
> >-- 
> >Anders Roxell
> >anders.roxell@linaro.org
> >M: +46 709 71 42 85 | IRC: roxell
> 
> 
> 

> require opendataplane.inc
> 
> SRCREV  = "${AUTOREV}"
> SRC_URI = "git://git.linaro.org/lng/odp.git"

> SUMMARY = "Cross platform Open Data Plane application APIs"
> 
> DESCRIPTION = "The OpenDataPlane project has been established to \
> produce an open-source, cross-platform set of application \
> programming interfaces (APIs) for the networking data plane."
> 
> HOMEPAGE = "http://www.opendataplane.org"
> SECTION = "networking"
> LICENSE = "BSD-3-Clause"
> LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
>                  
> COMPATIBLE_HOST = "^((?!mips).*)$"
> 
> DEPENDS = "openssl"
> RDEPENDS_${PN} = "libcrypto"
> 
> PACKAGECONFIG ??= "platform_linux_generic"
> PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> PACKAGECONFIG[platform_linux_generic] = "--with-platform=linux-generic,,,"
> PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> PACKAGECONFIG[platform_linux_keystone2] = "--with-platform=linux-keystone2,,,"
> 
> S = "${WORKDIR}/git"
> 
> inherit autotools
> 
> do_configure_prepend () {
>     ./bootstrap
> }
Yao Zhao July 29, 2014, 7:17 p.m. UTC | #14
[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 29/07/2014 (Tue 20:07) Anders Roxell wrote:

> Hi Yao, 
> 
> Nice... When will you push the recipe?
> 
If there is no opendataplane recipe I can try to push to a yoctl layer.
> Just some nits see inline comments below.
> 
> On 2014-07-29 11:13, Yao Zhao wrote:
> > It is nice to mention the dependency in DEPENDENCIES file.
> > 
> > I wrote a opendataplane recipe for openembedded/yocto:
> > You can put the bb and inc like me in poky/yocto's some layer,
> > and add the opendataplane in local.conf:
> > IMAGE_INSTALL_append += "opendataplane"
> > this will install opendataplane's binaries on target.
> > 
> > For this Crypto API patch, there is no way to turn it off so I
> > just add dependency in the recipe.
> > For the DPDK support, it should add dependency, sdk location when
> > --with-linux-dpdk specified.
> > 
> > yao
> > 
> > yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> > cat opendataplane.bb
> > require opendataplane.inc
> > 
> > SRCREV  = "${AUTOREV}"
> 
> Do we want AUTOREV here and not release tags?
> 
AUTOREV will use latest from master.
Normally there should be a ${BPN}_${PV}.bb which will use specific
commit/release.
I can write one for official release 0.2 if necessary.

> > SRC_URI = "git://git.linaro.org/lng/odp.git"
> > 
> > yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> > cat opendataplane.inc
> > SUMMARY = "Cross platform Open Data Plane application APIs"
> 
> Open Data Plane -> OpenDataPlane
> 
OK!
> > 
> > DESCRIPTION = "The OpenDataPlane project has been established to \
> > produce an open-source, cross-platform set of application \
> > programming interfaces (APIs) for the networking data plane."
> > 
> > HOMEPAGE = "http://www.opendataplane.org"
> > SECTION = "networking"
> > LICENSE = "BSD-3-Clause"
> > LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> > 
> > COMPATIBLE_HOST = "^((?!mips).*)$"
> > 
> > DEPENDS = "openssl"
> > RDEPENDS_${PN} = "libcrypto"
> > 
> > PACKAGECONFIG ??= "platform_linux_generic"
> > PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> > PACKAGECONFIG[platform_linux_generic] = "--with-platform=linux-generic,,,"
> > PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> > PACKAGECONFIG[platform_linux_keystone2] =
> > "--with-platform=linux-keystone2,,,"
> 
> Don't we need to add a recipe for dpdk to build linux-dpdk and a recipe for OpenEM
> to build linux-keystone2?
> 

We do need a recipe for dpdk, keystone2 but I am not familiar with
keystone2, if it is dpdk I am fine but it will take some time to write
one, not like this recipe it will take only 1 or 2 hours.

As dpdk exists for a while, I am guessing there should be a recipe
available somewhere.
When these platforms used, special [C|LD]flags might be needed.

I only tested this with linux generic on mips, arm, x86_64 although mips
is not supported and odp doesn't work with qemuarm(armv5).

yao
> Cheers,
> Anders
> 
> > 
> > S = "${WORKDIR}/git"
> > 
> > inherit autotools
> > 
> > do_configure_prepend () {
> >     ./bootstrap
> > }
> > 
> > ------------------------------------------------------------------------
> > 
> > *From:* Anders Roxell <anders.roxell@linaro.org>
> > *Sent:* Tuesday, July 29, 2014 3:21AM
> > *To:* Robbie King (robking) <robking@cisco.com>
> > *Cc:* Zhao, Yao, Taras Kondratiuk <taras.kondratiuk@linaro.org>,
> > lng-odp@lists.linaro.org <lng-odp@lists.linaro.org>
> > *Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > 
> > On 2014-07-29 01:35, Robbie King (robking) wrote:
> > 
> > >Here's what I have in "DEPENDENCIES", what do you think?
> > >--------------------------------------------------------
> > >
> > >Prerequisites for building the OpenDataPlane (ODP) API
> > >
> > >1. Linux kernel >= 3.0
> > >
> > >    Version 3.0+ needed for the sendmmsg() interface
> > >
> > >2. autotools
> > >
> > >    automake
> > >    autoconf
> > >    autoconf-archive
> > >    libtool
> > >
> > >    On Debian/Ubuntu systems:
> > >    $ sudo apt-get install automake autoconf autoconf-archive libtool
> > >
> > >    On CentOS/RedHat/Fedora systems:
> > >    $ sudo yum install automake autoconf autoconf-archive libtool libtoolize
> > >
> > >3. required libraries
> > >
> > >    Libraries currently required to link: openssl
> > >
> > >3.1 native build
> > >
> > >    For native compilation, simply load the necessary libraries using the appropriate
> > >    tool set.
> > >
> > >    On Debian/Ubuntu systems:
> > >    $ sudo apt-get install libssl-dev
> > >
> > >    On CentOS/RedHat/Fedora systems:
> > >    $ sudo yum install openssl-devel
> > >
> > >3.2 cross compilation build
> > >
> > >    Cross compilation requires cross compiling the individual libraries.  In order for
> > >    a cross compiled executable to run on a target system, one must build the same
> > >    version as that which is installed on the target rootfs.
> > >
> > >    For example, to build openssl for both 32 and 64 bit compilation:
> > >    # Clone openssl repository
> > >    $ git clone git://git.openssl.org/openssl.git
> > >    $ cd openssl
> > >
> > >    # The command "git tag" will list all tags available in the repo.
> > >    $ git tag
> > >
> > >    # Checkout the specific tag to match openssl library in your target rootfs
> > >    $ git checkout <tag name>
> > >
> > >    # Build and install 64 bit version of openssl
> > >    $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- \
> > >      --prefix=/home/user/src/install-openssl-aarch64
> > >    $ make
> > >    $ make install
> > >
> > >    # Build and install 32 bit version of openssl
> > >    $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf- \
> > >      --prefix=/home/user/src/install-openssl
> > >    $ make
> > >    $ make install
> > >    # You may now build either 32 or 64 bit ODP
> > >    $ git clone git://git.linaro.org/lng/odp.git odp
> > >    $ cd odp
> > >    $ ./bootstrap
> > >
> > >    # Build 32 bit version of ODP
> > >    $ ./configure --host=arm-linux-gnueabihf \
> > >      --with-openssl-path=/home/user/src/install-openssl
> > >    $ make
> > >
> > >    # Or build 64 bit version of ODP
> > >    $ ./configure --host=aarch64-linux-gnu \
> > >      --with-openssl-path=/home/user/src/install-openssl-aarch64
> > >    $ make
> > 
> > Looks good!
> > Just a minor nit:
> > Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit
> > version of openssl below 32 bit version?
> > 
> > 
> > Cheers,
> > Anders
> > 
> > >-----Original Message-----
> > >From: Anders Roxell [mailto:anders.roxell@linaro.org]
> > >Sent: Monday, July 28, 2014 1:19 PM
> > >To: Robbie King (robking)
> > >Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> > >Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > >
> > >On 2014-07-26 15:49, Robbie King (robking) wrote:
> > >>So is the solution here to split the section I added for "crypto" in the DEPENDENCIES
> > >>file to have a "native" and a "cross compile" subsection?  Under the cross compile
> > >>subsection we can then list the steps we've discussed so for that will hopefully
> > >>cross compile a libodp.a that is compatible with the user's rootfs.
> > >I'm sorry for the late reply!
> > >
> > >Yup, that sounds good with the subsections.
> > >
> > >Maybe section 3 should say something else than "crypto" if we need to add
> > >more dependencies like crypto in the future, unsure what we should say
> > >though. =/
> > >Ideas what we can say?
> > >
> > >Cheers,
> > >Anders
> > >
> > >>-----Original Message-----
> > >>From: Anders Roxell [mailto:anders.roxell@linaro.org]
> > >>Sent: Saturday, July 26, 2014 11:17 AM
> > >>To: Yao Zhao
> > >>Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org
> > >>Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > >>
> > >>On 2014-07-25 15:43, Yao Zhao wrote:
> > >>>[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> > >>>
> > >>>>I agree we need to add something for cross compiling.  My apologies
> > >>>>for my limited knowledge of cross compiling.  If the user builds/links
> > >>>>against the latest openssl libcrypto from git, will it always work if the
> > >>>>executable is then run on a system with a packaged openssl library?
> > >>>>
> > >>>No, it won't.
> > >>>In theory you link with which then you run with which.
> > >>>
> > >>>Normally you just make it work with native environment.
> > >>>Distribution which supports cross compile will make it work for target
> > >>>environment.
> > >>>
> > >>>For OE/yocto, we can write a recipe to cross compile it, it will link
> > >>>against the openssl which will be put on target.
> > >>You seem to be talking two different things.
> > >>
> > >>1. Robbie, you seem to be asking about ABI stability, so the answer is
> > >>    no, you can't expect it to work. However, you can (should) checkout
> > >>    the specific release tag of openssl, that you expect to be on the
> > >>    rootfs, to compile against.
> > >>    I forgot in my previous mail to mention this.
> > >>
> > >>    Commands or doing that:
> > >>    # git tag will list all tags available in the repo.
> > >>    $ git tag
> > >>    # Checkout a specific tag.
> > >>    $ git checkout <tag name>
> > >>
> > >>2. Yao, you seem to be talking about cross compiling in a general sense.
> > >>    However, that doesn't seem to be related to the original question,
> > >>    even though the information was correct and useful.
> > >>
> > >>
> > >>Cheers,
> > >>Anders
> > >-- 
> > >Anders Roxell
> > >anders.roxell@linaro.org
> > >M: +46 709 71 42 85 | IRC: roxell
> > 
> > 
> > 
> 
> > require opendataplane.inc
> > 
> > SRCREV  = "${AUTOREV}"
> > SRC_URI = "git://git.linaro.org/lng/odp.git"
> 
> > SUMMARY = "Cross platform Open Data Plane application APIs"
> > 
> > DESCRIPTION = "The OpenDataPlane project has been established to \
> > produce an open-source, cross-platform set of application \
> > programming interfaces (APIs) for the networking data plane."
> > 
> > HOMEPAGE = "http://www.opendataplane.org"
> > SECTION = "networking"
> > LICENSE = "BSD-3-Clause"
> > LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> >                  
> > COMPATIBLE_HOST = "^((?!mips).*)$"
> > 
> > DEPENDS = "openssl"
> > RDEPENDS_${PN} = "libcrypto"
> > 
> > PACKAGECONFIG ??= "platform_linux_generic"
> > PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> > PACKAGECONFIG[platform_linux_generic] = "--with-platform=linux-generic,,,"
> > PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> > PACKAGECONFIG[platform_linux_keystone2] = "--with-platform=linux-keystone2,,,"
> > 
> > S = "${WORKDIR}/git"
> > 
> > inherit autotools
> > 
> > do_configure_prepend () {
> >     ./bootstrap
> > }
> 
> 
> -- 
> Anders Roxell
> anders.roxell@linaro.org
> M: +46 709 71 42 85 | IRC: roxell
Mike Holmes July 29, 2014, 7:26 p.m. UTC | #15
On 29 July 2014 15:17, Yao Zhao <yao.zhao@windriver.com> wrote:

> [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 29/07/2014 (Tue 20:07)
> Anders Roxell wrote:
>
> > Hi Yao,
> >
> > Nice... When will you push the recipe?
> >
> If there is no opendataplane recipe I can try to push to a yoctl layer.
> > Just some nits see inline comments below.
> >
> > On 2014-07-29 11:13, Yao Zhao wrote:
> > > It is nice to mention the dependency in DEPENDENCIES file.
> > >
> > > I wrote a opendataplane recipe for openembedded/yocto:
> > > You can put the bb and inc like me in poky/yocto's some layer,
> > > and add the opendataplane in local.conf:
> > > IMAGE_INSTALL_append += "opendataplane"
> > > this will install opendataplane's binaries on target.
> > >
> > > For this Crypto API patch, there is no way to turn it off so I
> > > just add dependency in the recipe.
> > > For the DPDK support, it should add dependency, sdk location when
> > > --with-linux-dpdk specified.
> > >
> > > yao
> > >
> > > yzhao2@yzhao2-OptiPlex-990
> :~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> > > cat opendataplane.bb
> > > require opendataplane.inc
> > >
> > > SRCREV  = "${AUTOREV}"
> >
> > Do we want AUTOREV here and not release tags?
> >
> AUTOREV will use latest from master.
> Normally there should be a ${BPN}_${PV}.bb which will use specific
> commit/release.
> I can write one for official release 0.2 if necessary.
>
> > > SRC_URI = "git://git.linaro.org/lng/odp.git"
> > >
> > > yzhao2@yzhao2-OptiPlex-990
> :~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> > > cat opendataplane.inc
> > > SUMMARY = "Cross platform Open Data Plane application APIs"
> >
> > Open Data Plane -> OpenDataPlane
> >
> OK!
> > >
> > > DESCRIPTION = "The OpenDataPlane project has been established to \
> > > produce an open-source, cross-platform set of application \
> > > programming interfaces (APIs) for the networking data plane."
> > >
> > > HOMEPAGE = "http://www.opendataplane.org"
> > > SECTION = "networking"
> > > LICENSE = "BSD-3-Clause"
> > > LIC_FILES_CHKSUM =
> "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> > >
> > > COMPATIBLE_HOST = "^((?!mips).*)$"
> > >
> > > DEPENDS = "openssl"
> > > RDEPENDS_${PN} = "libcrypto"
> > >
> > > PACKAGECONFIG ??= "platform_linux_generic"
> > > PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> > > PACKAGECONFIG[platform_linux_generic] =
> "--with-platform=linux-generic,,,"
> > > PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> > > PACKAGECONFIG[platform_linux_keystone2] =
> > > "--with-platform=linux-keystone2,,,"
> >
> > Don't we need to add a recipe for dpdk to build linux-dpdk and a recipe
> for OpenEM
> > to build linux-keystone2?
> >
>
> We do need a recipe for dpdk, keystone2 but I am not familiar with
> keystone2, if it is dpdk I am fine but it will take some time to write
> one, not like this recipe it will take only 1 or 2 hours.
>
> As dpdk exists for a while, I am guessing there should be a recipe
> available somewhere.
> When these platforms used, special [C|LD]flags might be needed.
>
> I only tested this with linux generic on mips, arm, x86_64 although mips
> is not supported and odp doesn't work with qemuarm(armv5).
>
Will you be looking into the issues in any detail ?
It would be good to get a bug report on the issue if you have the time,
https://bugs.linaro.org/enter_bug.cgi?product=OpenDataPlane


> yao
> > Cheers,
> > Anders
> >
> > >
> > > S = "${WORKDIR}/git"
> > >
> > > inherit autotools
> > >
> > > do_configure_prepend () {
> > >     ./bootstrap
> > > }
> > >
> > >
> ------------------------------------------------------------------------
> > >
> > > *From:* Anders Roxell <anders.roxell@linaro.org>
> > > *Sent:* Tuesday, July 29, 2014 3:21AM
> > > *To:* Robbie King (robking) <robking@cisco.com>
> > > *Cc:* Zhao, Yao, Taras Kondratiuk <taras.kondratiuk@linaro.org>,
> > > lng-odp@lists.linaro.org <lng-odp@lists.linaro.org>
> > > *Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > >
> > > On 2014-07-29 01:35, Robbie King (robking) wrote:
> > >
> > > >Here's what I have in "DEPENDENCIES", what do you think?
> > > >--------------------------------------------------------
> > > >
> > > >Prerequisites for building the OpenDataPlane (ODP) API
> > > >
> > > >1. Linux kernel >= 3.0
> > > >
> > > >    Version 3.0+ needed for the sendmmsg() interface
> > > >
> > > >2. autotools
> > > >
> > > >    automake
> > > >    autoconf
> > > >    autoconf-archive
> > > >    libtool
> > > >
> > > >    On Debian/Ubuntu systems:
> > > >    $ sudo apt-get install automake autoconf autoconf-archive libtool
> > > >
> > > >    On CentOS/RedHat/Fedora systems:
> > > >    $ sudo yum install automake autoconf autoconf-archive libtool
> libtoolize
> > > >
> > > >3. required libraries
> > > >
> > > >    Libraries currently required to link: openssl
> > > >
> > > >3.1 native build
> > > >
> > > >    For native compilation, simply load the necessary libraries using
> the appropriate
> > > >    tool set.
> > > >
> > > >    On Debian/Ubuntu systems:
> > > >    $ sudo apt-get install libssl-dev
> > > >
> > > >    On CentOS/RedHat/Fedora systems:
> > > >    $ sudo yum install openssl-devel
> > > >
> > > >3.2 cross compilation build
> > > >
> > > >    Cross compilation requires cross compiling the individual
> libraries.  In order for
> > > >    a cross compiled executable to run on a target system, one must
> build the same
> > > >    version as that which is installed on the target rootfs.
> > > >
> > > >    For example, to build openssl for both 32 and 64 bit compilation:
> > > >    # Clone openssl repository
> > > >    $ git clone git://git.openssl.org/openssl.git
> > > >    $ cd openssl
> > > >
> > > >    # The command "git tag" will list all tags available in the repo.
> > > >    $ git tag
> > > >
> > > >    # Checkout the specific tag to match openssl library in your
> target rootfs
> > > >    $ git checkout <tag name>
> > > >
> > > >    # Build and install 64 bit version of openssl
> > > >    $ ./Configure linux-aarch64
> --cross-compile-prefix=aarch64-linux-gnu- \
> > > >      --prefix=/home/user/src/install-openssl-aarch64
> > > >    $ make
> > > >    $ make install
> > > >
> > > >    # Build and install 32 bit version of openssl
> > > >    $ ./Configure linux-generic32
> --cross-compile-prefix=arm-linux-gnueabihf- \
> > > >      --prefix=/home/user/src/install-openssl
> > > >    $ make
> > > >    $ make install
> > > >    # You may now build either 32 or 64 bit ODP
> > > >    $ git clone git://git.linaro.org/lng/odp.git odp
> > > >    $ cd odp
> > > >    $ ./bootstrap
> > > >
> > > >    # Build 32 bit version of ODP
> > > >    $ ./configure --host=arm-linux-gnueabihf \
> > > >      --with-openssl-path=/home/user/src/install-openssl
> > > >    $ make
> > > >
> > > >    # Or build 64 bit version of ODP
> > > >    $ ./configure --host=aarch64-linux-gnu \
> > > >      --with-openssl-path=/home/user/src/install-openssl-aarch64
> > > >    $ make
> > >
> > > Looks good!
> > > Just a minor nit:
> > > Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit
> > > version of openssl below 32 bit version?
> > >
> > >
> > > Cheers,
> > > Anders
> > >
> > > >-----Original Message-----
> > > >From: Anders Roxell [mailto:anders.roxell@linaro.org]
> > > >Sent: Monday, July 28, 2014 1:19 PM
> > > >To: Robbie King (robking)
> > > >Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> > > >Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > > >
> > > >On 2014-07-26 15:49, Robbie King (robking) wrote:
> > > >>So is the solution here to split the section I added for "crypto" in
> the DEPENDENCIES
> > > >>file to have a "native" and a "cross compile" subsection?  Under the
> cross compile
> > > >>subsection we can then list the steps we've discussed so for that
> will hopefully
> > > >>cross compile a libodp.a that is compatible with the user's rootfs.
> > > >I'm sorry for the late reply!
> > > >
> > > >Yup, that sounds good with the subsections.
> > > >
> > > >Maybe section 3 should say something else than "crypto" if we need to
> add
> > > >more dependencies like crypto in the future, unsure what we should say
> > > >though. =/
> > > >Ideas what we can say?
> > > >
> > > >Cheers,
> > > >Anders
> > > >
> > > >>-----Original Message-----
> > > >>From: Anders Roxell [mailto:anders.roxell@linaro.org]
> > > >>Sent: Saturday, July 26, 2014 11:17 AM
> > > >>To: Yao Zhao
> > > >>Cc: Robbie King (robking); Taras Kondratiuk;
> lng-odp@lists.linaro.org
> > > >>Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > > >>
> > > >>On 2014-07-25 15:43, Yao Zhao wrote:
> > > >>>[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri
> 16:18) Robbie King (robking) wrote:
> > > >>>
> > > >>>>I agree we need to add something for cross compiling.  My apologies
> > > >>>>for my limited knowledge of cross compiling.  If the user
> builds/links
> > > >>>>against the latest openssl libcrypto from git, will it always work
> if the
> > > >>>>executable is then run on a system with a packaged openssl library?
> > > >>>>
> > > >>>No, it won't.
> > > >>>In theory you link with which then you run with which.
> > > >>>
> > > >>>Normally you just make it work with native environment.
> > > >>>Distribution which supports cross compile will make it work for
> target
> > > >>>environment.
> > > >>>
> > > >>>For OE/yocto, we can write a recipe to cross compile it, it will
> link
> > > >>>against the openssl which will be put on target.
> > > >>You seem to be talking two different things.
> > > >>
> > > >>1. Robbie, you seem to be asking about ABI stability, so the answer
> is
> > > >>    no, you can't expect it to work. However, you can (should)
> checkout
> > > >>    the specific release tag of openssl, that you expect to be on the
> > > >>    rootfs, to compile against.
> > > >>    I forgot in my previous mail to mention this.
> > > >>
> > > >>    Commands or doing that:
> > > >>    # git tag will list all tags available in the repo.
> > > >>    $ git tag
> > > >>    # Checkout a specific tag.
> > > >>    $ git checkout <tag name>
> > > >>
> > > >>2. Yao, you seem to be talking about cross compiling in a general
> sense.
> > > >>    However, that doesn't seem to be related to the original
> question,
> > > >>    even though the information was correct and useful.
> > > >>
> > > >>
> > > >>Cheers,
> > > >>Anders
> > > >--
> > > >Anders Roxell
> > > >anders.roxell@linaro.org
> > > >M: +46 709 71 42 85 | IRC: roxell
> > >
> > >
> > >
> >
> > > require opendataplane.inc
> > >
> > > SRCREV  = "${AUTOREV}"
> > > SRC_URI = "git://git.linaro.org/lng/odp.git"
> >
> > > SUMMARY = "Cross platform Open Data Plane application APIs"
> > >
> > > DESCRIPTION = "The OpenDataPlane project has been established to \
> > > produce an open-source, cross-platform set of application \
> > > programming interfaces (APIs) for the networking data plane."
> > >
> > > HOMEPAGE = "http://www.opendataplane.org"
> > > SECTION = "networking"
> > > LICENSE = "BSD-3-Clause"
> > > LIC_FILES_CHKSUM =
> "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> > >
> > > COMPATIBLE_HOST = "^((?!mips).*)$"
> > >
> > > DEPENDS = "openssl"
> > > RDEPENDS_${PN} = "libcrypto"
> > >
> > > PACKAGECONFIG ??= "platform_linux_generic"
> > > PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> > > PACKAGECONFIG[platform_linux_generic] =
> "--with-platform=linux-generic,,,"
> > > PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> > > PACKAGECONFIG[platform_linux_keystone2] =
> "--with-platform=linux-keystone2,,,"
> > >
> > > S = "${WORKDIR}/git"
> > >
> > > inherit autotools
> > >
> > > do_configure_prepend () {
> > >     ./bootstrap
> > > }
> >
> >
> > --
> > Anders Roxell
> > anders.roxell@linaro.org
> > M: +46 709 71 42 85 | IRC: roxell
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Aws Ismail July 29, 2014, 7:28 p.m. UTC | #16
On Tuesday, July 29, 2014 at 3:17 PM, Yao Zhao wrote:
[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 29/07/2014 (Tue 20:07) Anders Roxell wrote:
> 
> > Hi Yao, 
> > 
> > Nice... When will you push the recipe?
> If there is no opendataplane recipe I can try to push to a yoctl layer.
> > Just some nits see inline comments below.
> > 
> > On 2014-07-29 11:13, Yao Zhao wrote:
> > > It is nice to mention the dependency in DEPENDENCIES file.
> > > 
> > > I wrote a opendataplane recipe for openembedded/yocto:
> > > You can put the bb and inc like me in poky/yocto's some layer,
> > > and add the opendataplane in local.conf:
> > > IMAGE_INSTALL_append += "opendataplane"
> > > this will install opendataplane's binaries on target.
> > > 
> > > For this Crypto API patch, there is no way to turn it off so I
> > > just add dependency in the recipe.
> > > For the DPDK support, it should add dependency, sdk location when
> > > --with-linux-dpdk specified.
> > > 
> > > yao
> > > 
> > > yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> > > cat opendataplane.bb
> > > require opendataplane.inc
> > > 
> > > SRCREV = "${AUTOREV}"
> > 
> > Do we want AUTOREV here and not release tags?
> AUTOREV will use latest from master.
> Normally there should be a ${BPN}_${PV}.bb which will use specific
> commit/release.
> I can write one for official release 0.2 if necessary.
> 
> > > SRC_URI = "git://git.linaro.org/lng/odp.git"
> > > 
> > > yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> > > cat opendataplane.inc
> > > SUMMARY = "Cross platform Open Data Plane application APIs"
> > 
> > Open Data Plane -> OpenDataPlane
> OK!
> > > 
> > > DESCRIPTION = "The OpenDataPlane project has been established to \
> > > produce an open-source, cross-platform set of application \
> > > programming interfaces (APIs) for the networking data plane."
> > > 
> > > HOMEPAGE = "http://www.opendataplane.org"
> > > SECTION = "networking"
> > > LICENSE = "BSD-3-Clause"
> > > LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> > > 
> > > COMPATIBLE_HOST = "^((?!mips).*)$"
> > > 
> > > DEPENDS = "openssl"
> > > RDEPENDS_${PN} = "libcrypto"
> > > 
> > > PACKAGECONFIG ??= "platform_linux_generic"
> > > PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> > > PACKAGECONFIG[platform_linux_generic] = "--with-platform=linux-generic,,,"
> > > PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> > > PACKAGECONFIG[platform_linux_keystone2] =
> > > "--with-platform=linux-keystone2,,,"
> > 
> > Don't we need to add a recipe for dpdk to build linux-dpdk and a recipe for OpenEM
> > to build linux-keystone2?
> 
> We do need a recipe for dpdk, keystone2 but I am not familiar with
> keystone2, if it is dpdk I am fine but it will take some time to write
> one, not like this recipe it will take only 1 or 2 hours.
> 
> As dpdk exists for a while, I am guessing there should be a recipe
> available somewhere.
> When these platforms used, special [C|LD]flags might be needed.
> 
dpdk is already part of yocto's meta-intel layer. 

http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/tree/common/recipes-extended/dpdk

So there is no need to create a new one.

Aws\ 
> I only tested this with linux generic on mips, arm, x86_64 although mips
> is not supported and odp doesn't work with qemuarm(armv5).
> 
> yao
> > Cheers,
> > Anders
> > 
> > > 
> > > S = "${WORKDIR}/git"
> > > 
> > > inherit autotools
> > > 
> > > do_configure_prepend () {
> > >  ./bootstrap
> > > }
> > > 
> > > ------------------------------------------------------------------------
> > > 
> > > *From:* Anders Roxell <anders.roxell@linaro.org>
> > > *Sent:* Tuesday, July 29, 2014 3:21AM
> > > *To:* Robbie King (robking) <robking@cisco.com>
> > > *Cc:* Zhao, Yao, Taras Kondratiuk <taras.kondratiuk@linaro.org>,
> > > lng-odp@lists.linaro.org <lng-odp@lists.linaro.org>
> > > *Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > > 
> > > On 2014-07-29 01:35, Robbie King (robking) wrote:
> > > 
> > > > Here's what I have in "DEPENDENCIES", what do you think?
> > > > --------------------------------------------------------
> > > > 
> > > > Prerequisites for building the OpenDataPlane (ODP) API
> > > > 
> > > > 1. Linux kernel >= 3.0
> > > > 
> > > >  Version 3.0+ needed for the sendmmsg() interface
> > > > 
> > > > 2. autotools
> > > > 
> > > >  automake
> > > >  autoconf
> > > >  autoconf-archive
> > > >  libtool
> > > > 
> > > >  On Debian/Ubuntu systems:
> > > >  $ sudo apt-get install automake autoconf autoconf-archive libtool
> > > > 
> > > >  On CentOS/RedHat/Fedora systems:
> > > >  $ sudo yum install automake autoconf autoconf-archive libtool libtoolize
> > > > 
> > > > 3. required libraries
> > > > 
> > > >  Libraries currently required to link: openssl
> > > > 
> > > > 3.1 native build
> > > > 
> > > >  For native compilation, simply load the necessary libraries using the appropriate
> > > >  tool set.
> > > > 
> > > >  On Debian/Ubuntu systems:
> > > >  $ sudo apt-get install libssl-dev
> > > > 
> > > >  On CentOS/RedHat/Fedora systems:
> > > >  $ sudo yum install openssl-devel
> > > > 
> > > > 3.2 cross compilation build
> > > > 
> > > >  Cross compilation requires cross compiling the individual libraries. In order for
> > > >  a cross compiled executable to run on a target system, one must build the same
> > > >  version as that which is installed on the target rootfs.
> > > > 
> > > >  For example, to build openssl for both 32 and 64 bit compilation:
> > > >  # Clone openssl repository
> > > >  $ git clone git://git.openssl.org/openssl.git
> > > >  $ cd openssl
> > > > 
> > > >  # The command "git tag" will list all tags available in the repo.
> > > >  $ git tag
> > > > 
> > > >  # Checkout the specific tag to match openssl library in your target rootfs
> > > >  $ git checkout <tag name>
> > > > 
> > > >  # Build and install 64 bit version of openssl
> > > >  $ ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- \
> > > >  --prefix=/home/user/src/install-openssl-aarch64
> > > >  $ make
> > > >  $ make install
> > > > 
> > > >  # Build and install 32 bit version of openssl
> > > >  $ ./Configure linux-generic32 --cross-compile-prefix=arm-linux-gnueabihf- \
> > > >  --prefix=/home/user/src/install-openssl
> > > >  $ make
> > > >  $ make install
> > > >  # You may now build either 32 or 64 bit ODP
> > > >  $ git clone git://git.linaro.org/lng/odp.git odp
> > > >  $ cd odp
> > > >  $ ./bootstrap
> > > > 
> > > >  # Build 32 bit version of ODP
> > > >  $ ./configure --host=arm-linux-gnueabihf \
> > > >  --with-openssl-path=/home/user/src/install-openssl
> > > >  $ make
> > > > 
> > > >  # Or build 64 bit version of ODP
> > > >  $ ./configure --host=aarch64-linux-gnu \
> > > >  --with-openssl-path=/home/user/src/install-openssl-aarch64
> > > >  $ make
> > > 
> > > Looks good!
> > > Just a minor nit:
> > > Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit
> > > version of openssl below 32 bit version?
> > > 
> > > 
> > > Cheers,
> > > Anders
> > > 
> > > > -----Original Message-----
> > > > From: Anders Roxell [mailto:anders.roxell@linaro.org]
> > > > Sent: Monday, July 28, 2014 1:19 PM
> > > > To: Robbie King (robking)
> > > > Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> > > > Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > > > 
> > > > On 2014-07-26 15:49, Robbie King (robking) wrote:
> > > > > So is the solution here to split the section I added for "crypto" in the DEPENDENCIES
> > > > > file to have a "native" and a "cross compile" subsection? Under the cross compile
> > > > > subsection we can then list the steps we've discussed so for that will hopefully
> > > > > cross compile a libodp.a that is compatible with the user's rootfs.
> > > > I'm sorry for the late reply!
> > > > 
> > > > Yup, that sounds good with the subsections.
> > > > 
> > > > Maybe section 3 should say something else than "crypto" if we need to add
> > > > more dependencies like crypto in the future, unsure what we should say
> > > > though. =/
> > > > Ideas what we can say?
> > > > 
> > > > Cheers,
> > > > Anders
> > > > 
> > > > > -----Original Message-----
> > > > > From: Anders Roxell [mailto:anders.roxell@linaro.org]
> > > > > Sent: Saturday, July 26, 2014 11:17 AM
> > > > > To: Yao Zhao
> > > > > Cc: Robbie King (robking); Taras Kondratiuk; lng-odp@lists.linaro.org
> > > > > Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > > > > 
> > > > > On 2014-07-25 15:43, Yao Zhao wrote:
> > > > > > [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> > > > > > 
> > > > > > > I agree we need to add something for cross compiling. My apologies
> > > > > > > for my limited knowledge of cross compiling. If the user builds/links
> > > > > > > against the latest openssl libcrypto from git, will it always work if the
> > > > > > > executable is then run on a system with a packaged openssl library?
> > > > > > No, it won't.
> > > > > > In theory you link with which then you run with which.
> > > > > > 
> > > > > > Normally you just make it work with native environment.
> > > > > > Distribution which supports cross compile will make it work for target
> > > > > > environment.
> > > > > > 
> > > > > > For OE/yocto, we can write a recipe to cross compile it, it will link
> > > > > > against the openssl which will be put on target.
> > > > > You seem to be talking two different things.
> > > > > 
> > > > > 1. Robbie, you seem to be asking about ABI stability, so the answer is
> > > > >  no, you can't expect it to work. However, you can (should) checkout
> > > > >  the specific release tag of openssl, that you expect to be on the
> > > > >  rootfs, to compile against.
> > > > >  I forgot in my previous mail to mention this.
> > > > > 
> > > > >  Commands or doing that:
> > > > >  # git tag will list all tags available in the repo.
> > > > >  $ git tag
> > > > >  # Checkout a specific tag.
> > > > >  $ git checkout <tag name>
> > > > > 
> > > > > 2. Yao, you seem to be talking about cross compiling in a general sense.
> > > > >  However, that doesn't seem to be related to the original question,
> > > > >  even though the information was correct and useful.
> > > > > 
> > > > > 
> > > > > Cheers,
> > > > > Anders
> > > > -- 
> > > > Anders Roxell
> > > > anders.roxell@linaro.org
> > > > M: +46 709 71 42 85 | IRC: roxell
> > 
> > > require opendataplane.inc
> > > 
> > > SRCREV = "${AUTOREV}"
> > > SRC_URI = "git://git.linaro.org/lng/odp.git"
> > 
> > > SUMMARY = "Cross platform Open Data Plane application APIs"
> > > 
> > > DESCRIPTION = "The OpenDataPlane project has been established to \
> > > produce an open-source, cross-platform set of application \
> > > programming interfaces (APIs) for the networking data plane."
> > > 
> > > HOMEPAGE = "http://www.opendataplane.org"
> > > SECTION = "networking"
> > > LICENSE = "BSD-3-Clause"
> > > LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> > > 
> > > COMPATIBLE_HOST = "^((?!mips).*)$"
> > > 
> > > DEPENDS = "openssl"
> > > RDEPENDS_${PN} = "libcrypto"
> > > 
> > > PACKAGECONFIG ??= "platform_linux_generic"
> > > PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> > > PACKAGECONFIG[platform_linux_generic] = "--with-platform=linux-generic,,,"
> > > PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> > > PACKAGECONFIG[platform_linux_keystone2] = "--with-platform=linux-keystone2,,,"
> > > 
> > > S = "${WORKDIR}/git"
> > > 
> > > inherit autotools
> > > 
> > > do_configure_prepend () {
> > >  ./bootstrap
> > > }
> > 
> > 
> > -- 
> > Anders Roxell
> > anders.roxell@linaro.org
> > M: +46 709 71 42 85 | IRC: roxell
> 
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Yao Zhao July 29, 2014, 8:12 p.m. UTC | #17
[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 29/07/2014 (Tue 15:26) Mike Holmes wrote:

>    On 29 July 2014 15:17, Yao Zhao <yao.zhao@windriver.com> wrote:
> 
>      [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 29/07/2014 (Tue 20:07)
>      Anders Roxell wrote:
> 
>      > Hi Yao,
>      >
>      > Nice... When will you push the recipe?
>      >
>      If there is no opendataplane recipe I can try to push to a yoctl layer.
>      > Just some nits see inline comments below.
>      >
>      > On 2014-07-29 11:13, Yao Zhao wrote:
>      > > It is nice to mention the dependency in DEPENDENCIES file.
>      > >
>      > > I wrote a opendataplane recipe for openembedded/yocto:
>      > > You can put the bb and inc like me in poky/yocto's some layer,
>      > > and add the opendataplane in local.conf:
>      > > IMAGE_INSTALL_append += "opendataplane"
>      > > this will install opendataplane's binaries on target.
>      > >
>      > > For this Crypto API patch, there is no way to turn it off so I
>      > > just add dependency in the recipe.
>      > > For the DPDK support, it should add dependency, sdk location when
>      > > --with-linux-dpdk specified.
>      > >
>      > > yao
>      > >
>      > >
>      yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
>      > > cat opendataplane.bb
>      > > require opendataplane.inc
>      > >
>      > > SRCREV  = "${AUTOREV}"
>      >
>      > Do we want AUTOREV here and not release tags?
>      >
>      AUTOREV will use latest from master.
>      Normally there should be a ${BPN}_${PV}.bb which will use specific
>      commit/release.
>      I can write one for official release 0.2 if necessary.
>      > > SRC_URI = "git://git.linaro.org/lng/odp.git"
>      > >
>      > >
>      yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
>      > > cat opendataplane.inc
>      > > SUMMARY = "Cross platform Open Data Plane application APIs"
>      >
>      > Open Data Plane -> OpenDataPlane
>      >
>      OK!
>      > >
>      > > DESCRIPTION = "The OpenDataPlane project has been established to \
>      > > produce an open-source, cross-platform set of application \
>      > > programming interfaces (APIs) for the networking data plane."
>      > >
>      > > HOMEPAGE = "http://www.opendataplane.org"
>      > > SECTION = "networking"
>      > > LICENSE = "BSD-3-Clause"
>      > > LIC_FILES_CHKSUM =
>      "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
>      > >
>      > > COMPATIBLE_HOST = "^((?!mips).*)$"
>      > >
>      > > DEPENDS = "openssl"
>      > > RDEPENDS_${PN} = "libcrypto"
>      > >
>      > > PACKAGECONFIG ??= "platform_linux_generic"
>      > > PACKAGECONFIG[netmap] = "--enable-netmap,,,"
>      > > PACKAGECONFIG[platform_linux_generic] =
>      "--with-platform=linux-generic,,,"
>      > > PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
>      > > PACKAGECONFIG[platform_linux_keystone2] =
>      > > "--with-platform=linux-keystone2,,,"
>      >
>      > Don't we need to add a recipe for dpdk to build linux-dpdk and a
>      recipe for OpenEM
>      > to build linux-keystone2?
>      >
> 
>      We do need a recipe for dpdk, keystone2 but I am not familiar with
>      keystone2, if it is dpdk I am fine but it will take some time to write
>      one, not like this recipe it will take only 1 or 2 hours.
> 
>      As dpdk exists for a while, I am guessing there should be a recipe
>      available somewhere.
>      When these platforms used, special [C|LD]flags might be needed.
> 
>      I only tested this with linux generic on mips, arm, x86_64 although mips
>      is not supported and odp doesn't work with qemuarm(armv5).
> 
>    Will you be looking into the issues in any detail ?
The problem log is below:
And I don't think that is odp problem.
OE's qemuarm is using armv5te which seems no support "dmb", sounds like
a OE problem.

Build Configuration:
BB_VERSION        = "1.22.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "qemuarm"
DISTRO            = "poky"
DISTRO_VERSION    = "1.6.1"
TUNE_FEATURES     = "armv5 thumb dsp"
TARGET_FPU        = "soft"
meta
meta-yocto

| arm-poky-linux-gnueabi-libtool: compile:  arm-poky-linux-gnueabi-gcc
-march=armv5te -marm -mthumb-interwork --sysroot=/home/yzhao2/buildmount
1/poky2014/poky/build/qemuarm/tmp/sysroots/qemuarm -DHAVE_CONFIG_H -I.
-pthread -DODP_DEBUG_PRINT=1 -W -Wall -Werror -Wstrict-prototypes -Wmiss
ing-prototypes -Wmissing-declarations -Wold-style-definition
-Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual
-Wformat-nonliteral -Wfo
rmat-security -Wundef -Wwrite-strings -I./include -I./include/api
-I../../include -O2 -pipe -g -feliminate-unused-debug-types -c
odp_barrier.c 
-o odp_barrier.o
| arm-poky-linux-gnueabi-libtool: compile:  arm-poky-linux-gnueabi-gcc
-march=armv5te -marm -mthumb-interwork --sysroot=/home/yzhao2/buildmount
1/poky2014/poky/build/qemuarm/tmp/sysroots/qemuarm -DHAVE_CONFIG_H -I.
-pthread -DODP_DEBUG_PRINT=1 -W -Wall -Werror -Wstrict-prototypes -Wmiss
ing-prototypes -Wmissing-declarations -Wold-style-definition
-Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual
-Wformat-nonliteral -Wfo
rmat-security -Wundef -Wwrite-strings -I./include -I./include/api
-I../../include -O2 -pipe -g -feliminate-unused-debug-types -c
odp_buffer.c -
o odp_buffer.o
| {standard input}: Assembler messages:
| {standard input}:40: Error: selected processor does not support ARM
mode `dmb st'
| {standard input}:72: Error: selected processor does not support ARM
mode `dmb st'
| make[2]: *** [odp_barrier.lo] Error 1

yao
>    It would be good to get a bug report on the issue if you have the time,
>     https://bugs.linaro.org/enter_bug.cgi?product=OpenDataPlane
> 
>      yao
>      > Cheers,
>      > Anders
>      >
>      > >
>      > > S = "${WORKDIR}/git"
>      > >
>      > > inherit autotools
>      > >
>      > > do_configure_prepend () {
>      > >     ./bootstrap
>      > > }
>      > >
>      > >
>      ------------------------------------------------------------------------
>      > >
>      > > *From:* Anders Roxell <anders.roxell@linaro.org>
>      > > *Sent:* Tuesday, July 29, 2014 3:21AM
>      > > *To:* Robbie King (robking) <robking@cisco.com>
>      > > *Cc:* Zhao, Yao, Taras Kondratiuk <taras.kondratiuk@linaro.org>,
>      > > lng-odp@lists.linaro.org <lng-odp@lists.linaro.org>
>      > > *Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API
>      > >
>      > > On 2014-07-29 01:35, Robbie King (robking) wrote:
>      > >
>      > > >Here's what I have in "DEPENDENCIES", what do you think?
>      > > >--------------------------------------------------------
>      > > >
>      > > >Prerequisites for building the OpenDataPlane (ODP) API
>      > > >
>      > > >1. Linux kernel >= 3.0
>      > > >
>      > > >    Version 3.0+ needed for the sendmmsg() interface
>      > > >
>      > > >2. autotools
>      > > >
>      > > >    automake
>      > > >    autoconf
>      > > >    autoconf-archive
>      > > >    libtool
>      > > >
>      > > >    On Debian/Ubuntu systems:
>      > > >    $ sudo apt-get install automake autoconf autoconf-archive
>      libtool
>      > > >
>      > > >    On CentOS/RedHat/Fedora systems:
>      > > >    $ sudo yum install automake autoconf autoconf-archive libtool
>      libtoolize
>      > > >
>      > > >3. required libraries
>      > > >
>      > > >    Libraries currently required to link: openssl
>      > > >
>      > > >3.1 native build
>      > > >
>      > > >    For native compilation, simply load the necessary libraries
>      using the appropriate
>      > > >    tool set.
>      > > >
>      > > >    On Debian/Ubuntu systems:
>      > > >    $ sudo apt-get install libssl-dev
>      > > >
>      > > >    On CentOS/RedHat/Fedora systems:
>      > > >    $ sudo yum install openssl-devel
>      > > >
>      > > >3.2 cross compilation build
>      > > >
>      > > >    Cross compilation requires cross compiling the individual
>      libraries.  In order for
>      > > >    a cross compiled executable to run on a target system, one must
>      build the same
>      > > >    version as that which is installed on the target rootfs.
>      > > >
>      > > >    For example, to build openssl for both 32 and 64 bit
>      compilation:
>      > > >    # Clone openssl repository
>      > > >    $ git clone git://git.openssl.org/openssl.git
>      > > >    $ cd openssl
>      > > >
>      > > >    # The command "git tag" will list all tags available in the
>      repo.
>      > > >    $ git tag
>      > > >
>      > > >    # Checkout the specific tag to match openssl library in your
>      target rootfs
>      > > >    $ git checkout <tag name>
>      > > >
>      > > >    # Build and install 64 bit version of openssl
>      > > >    $ ./Configure linux-aarch64
>      --cross-compile-prefix=aarch64-linux-gnu- \
>      > > >      --prefix=/home/user/src/install-openssl-aarch64
>      > > >    $ make
>      > > >    $ make install
>      > > >
>      > > >    # Build and install 32 bit version of openssl
>      > > >    $ ./Configure linux-generic32
>      --cross-compile-prefix=arm-linux-gnueabihf- \
>      > > >      --prefix=/home/user/src/install-openssl
>      > > >    $ make
>      > > >    $ make install
>      > > >    # You may now build either 32 or 64 bit ODP
>      > > >    $ git clone git://git.linaro.org/lng/odp.git odp
>      > > >    $ cd odp
>      > > >    $ ./bootstrap
>      > > >
>      > > >    # Build 32 bit version of ODP
>      > > >    $ ./configure --host=arm-linux-gnueabihf \
>      > > >      --with-openssl-path=/home/user/src/install-openssl
>      > > >    $ make
>      > > >
>      > > >    # Or build 64 bit version of ODP
>      > > >    $ ./configure --host=aarch64-linux-gnu \
>      > > >      --with-openssl-path=/home/user/src/install-openssl-aarch64
>      > > >    $ make
>      > >
>      > > Looks good!
>      > > Just a minor nit:
>      > > Maybe we should move 64 bit version of ODP above 32 bit or move 64
>      bit
>      > > version of openssl below 32 bit version?
>      > >
>      > >
>      > > Cheers,
>      > > Anders
>      > >
>      > > >-----Original Message-----
>      > > >From: Anders Roxell [mailto:anders.roxell@linaro.org]
>      > > >Sent: Monday, July 28, 2014 1:19 PM
>      > > >To: Robbie King (robking)
>      > > >Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
>      > > >Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
>      > > >
>      > > >On 2014-07-26 15:49, Robbie King (robking) wrote:
>      > > >>So is the solution here to split the section I added for "crypto"
>      in the DEPENDENCIES
>      > > >>file to have a "native" and a "cross compile" subsection?  Under
>      the cross compile
>      > > >>subsection we can then list the steps we've discussed so for that
>      will hopefully
>      > > >>cross compile a libodp.a that is compatible with the user's
>      rootfs.
>      > > >I'm sorry for the late reply!
>      > > >
>      > > >Yup, that sounds good with the subsections.
>      > > >
>      > > >Maybe section 3 should say something else than "crypto" if we need
>      to add
>      > > >more dependencies like crypto in the future, unsure what we should
>      say
>      > > >though. =/
>      > > >Ideas what we can say?
>      > > >
>      > > >Cheers,
>      > > >Anders
>      > > >
>      > > >>-----Original Message-----
>      > > >>From: Anders Roxell [mailto:anders.roxell@linaro.org]
>      > > >>Sent: Saturday, July 26, 2014 11:17 AM
>      > > >>To: Yao Zhao
>      > > >>Cc: Robbie King (robking); Taras Kondratiuk;
>      lng-odp@lists.linaro.org
>      > > >>Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
>      > > >>
>      > > >>On 2014-07-25 15:43, Yao Zhao wrote:
>      > > >>>[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri
>      16:18) Robbie King (robking) wrote:
>      > > >>>
>      > > >>>>I agree we need to add something for cross compiling.  My
>      apologies
>      > > >>>>for my limited knowledge of cross compiling.  If the user
>      builds/links
>      > > >>>>against the latest openssl libcrypto from git, will it always
>      work if the
>      > > >>>>executable is then run on a system with a packaged openssl
>      library?
>      > > >>>>
>      > > >>>No, it won't.
>      > > >>>In theory you link with which then you run with which.
>      > > >>>
>      > > >>>Normally you just make it work with native environment.
>      > > >>>Distribution which supports cross compile will make it work for
>      target
>      > > >>>environment.
>      > > >>>
>      > > >>>For OE/yocto, we can write a recipe to cross compile it, it will
>      link
>      > > >>>against the openssl which will be put on target.
>      > > >>You seem to be talking two different things.
>      > > >>
>      > > >>1. Robbie, you seem to be asking about ABI stability, so the
>      answer is
>      > > >>    no, you can't expect it to work. However, you can (should)
>      checkout
>      > > >>    the specific release tag of openssl, that you expect to be on
>      the
>      > > >>    rootfs, to compile against.
>      > > >>    I forgot in my previous mail to mention this.
>      > > >>
>      > > >>    Commands or doing that:
>      > > >>    # git tag will list all tags available in the repo.
>      > > >>    $ git tag
>      > > >>    # Checkout a specific tag.
>      > > >>    $ git checkout <tag name>
>      > > >>
>      > > >>2. Yao, you seem to be talking about cross compiling in a general
>      sense.
>      > > >>    However, that doesn't seem to be related to the original
>      question,
>      > > >>    even though the information was correct and useful.
>      > > >>
>      > > >>
>      > > >>Cheers,
>      > > >>Anders
>      > > >--
>      > > >Anders Roxell
>      > > >anders.roxell@linaro.org
>      > > >M: +46 709 71 42 85 | IRC: roxell
>      > >
>      > >
>      > >
>      >
>      > > require opendataplane.inc
>      > >
>      > > SRCREV  = "${AUTOREV}"
>      > > SRC_URI = "git://git.linaro.org/lng/odp.git"
>      >
>      > > SUMMARY = "Cross platform Open Data Plane application APIs"
>      > >
>      > > DESCRIPTION = "The OpenDataPlane project has been established to \
>      > > produce an open-source, cross-platform set of application \
>      > > programming interfaces (APIs) for the networking data plane."
>      > >
>      > > HOMEPAGE = "http://www.opendataplane.org"
>      > > SECTION = "networking"
>      > > LICENSE = "BSD-3-Clause"
>      > > LIC_FILES_CHKSUM =
>      "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
>      > >
>      > > COMPATIBLE_HOST = "^((?!mips).*)$"
>      > >
>      > > DEPENDS = "openssl"
>      > > RDEPENDS_${PN} = "libcrypto"
>      > >
>      > > PACKAGECONFIG ??= "platform_linux_generic"
>      > > PACKAGECONFIG[netmap] = "--enable-netmap,,,"
>      > > PACKAGECONFIG[platform_linux_generic] =
>      "--with-platform=linux-generic,,,"
>      > > PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
>      > > PACKAGECONFIG[platform_linux_keystone2] =
>      "--with-platform=linux-keystone2,,,"
>      > >
>      > > S = "${WORKDIR}/git"
>      > >
>      > > inherit autotools
>      > >
>      > > do_configure_prepend () {
>      > >     ./bootstrap
>      > > }
>      >
>      >
>      > --
>      > Anders Roxell
>      > anders.roxell@linaro.org
>      > M: +46 709 71 42 85 | IRC: roxell
> 
>      _______________________________________________
>      lng-odp mailing list
>      lng-odp@lists.linaro.org
>      http://lists.linaro.org/mailman/listinfo/lng-odp
> 
>    --
>    Mike Holmes 
>    Linaro Technical Manager / Lead 
>    LNG - ODP
Maxim Uvarov July 30, 2014, 10:20 a.m. UTC | #18
Robbie, please don't take attention to OE for now. Packaging is separate 
task and it's not related to api development. I will check that your 
final version
compiles on arm with cross tool.

Yao, Aws, for now we have OE recipe:
https://git.linaro.org/openembedded/meta-linaro.git/blob/HEAD:/meta-linaro/recipes-extra/odp/odp.bb

which needs to be synced with your version.

Thank you,
Maxim.

On 07/29/2014 11:28 PM, Aws Ismail wrote:
>
> On Tuesday, July 29, 2014 at 3:17 PM, Yao Zhao wrote:
>
>> [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 29/07/2014 (Tue 20:07) 
>> Anders Roxell wrote:
>>
>>> Hi Yao,
>>>
>>> Nice... When will you push the recipe?
>> If there is no opendataplane recipe I can try to push to a yoctl layer.
>>> Just some nits see inline comments below.
>>>
>>> On 2014-07-29 11:13, Yao Zhao wrote:
>>>> It is nice to mention the dependency in DEPENDENCIES file.
>>>>
>>>> I wrote a opendataplane recipe for openembedded/yocto:
>>>> You can put the bb and inc like me in poky/yocto's some layer,
>>>> and add the opendataplane in local.conf:
>>>> IMAGE_INSTALL_append += "opendataplane"
>>>> this will install opendataplane's binaries on target.
>>>>
>>>> For this Crypto API patch, there is no way to turn it off so I
>>>> just add dependency in the recipe.
>>>> For the DPDK support, it should add dependency, sdk location when
>>>> --with-linux-dpdk specified.
>>>>
>>>> yao
>>>>
>>>> yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
>>>> cat opendataplane.bb
>>>> require opendataplane.inc
>>>>
>>>> SRCREV = "${AUTOREV}"
>>>
>>> Do we want AUTOREV here and not release tags?
>> AUTOREV will use latest from master.
>> Normally there should be a ${BPN}_${PV}.bb which will use specific
>> commit/release.
>> I can write one for official release 0.2 if necessary.
>>
>>>> SRC_URI = "git://git.linaro.org/lng/odp.git 
>>>> <http://git.linaro.org/lng/odp.git>"
>>>>
>>>> yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
>>>> cat opendataplane.inc
>>>> SUMMARY = "Cross platform Open Data Plane application APIs"
>>>
>>> Open Data Plane -> OpenDataPlane
>> OK!
>>>>
>>>> DESCRIPTION = "The OpenDataPlane project has been established to \
>>>> produce an open-source, cross-platform set of application \
>>>> programming interfaces (APIs) for the networking data plane."
>>>>
>>>> HOMEPAGE = "http://www.opendataplane.org"
>>>> SECTION = "networking"
>>>> LICENSE = "BSD-3-Clause"
>>>> LIC_FILES_CHKSUM = 
>>>> "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
>>>>
>>>> COMPATIBLE_HOST = "^((?!mips).*)$"
>>>>
>>>> DEPENDS = "openssl"
>>>> RDEPENDS_${PN} = "libcrypto"
>>>>
>>>> PACKAGECONFIG ??= "platform_linux_generic"
>>>> PACKAGECONFIG[netmap] = "--enable-netmap,,,"
>>>> PACKAGECONFIG[platform_linux_generic] = 
>>>> "--with-platform=linux-generic,,,"
>>>> PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
>>>> PACKAGECONFIG[platform_linux_keystone2] =
>>>> "--with-platform=linux-keystone2,,,"
>>>
>>> Don't we need to add a recipe for dpdk to build linux-dpdk and a 
>>> recipe for OpenEM
>>> to build linux-keystone2?
>>
>> We do need a recipe for dpdk, keystone2 but I am not familiar with
>> keystone2, if it is dpdk I am fine but it will take some time to write
>> one, not like this recipe it will take only 1 or 2 hours.
>>
>> As dpdk exists for a while, I am guessing there should be a recipe
>> available somewhere.
>> When these platforms used, special [C|LD]flags might be needed.
>>
> dpdk is already part of yocto's meta-intel layer.
>
> http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/tree/common/recipes-extended/dpdk
>
> So there is no need to create a new one.
>
> Aws\
>> I only tested this with linux generic on mips, arm, x86_64 although mips
>> is not supported and odp doesn't work with qemuarm(armv5).
>>
>> yao
>>> Cheers,
>>> Anders
>>>
>>>>
>>>> S = "${WORKDIR}/git"
>>>>
>>>> inherit autotools
>>>>
>>>> do_configure_prepend () {
>>>> ./bootstrap
>>>> }
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> *From:* Anders Roxell <anders.roxell@linaro.org 
>>>> <mailto:anders.roxell@linaro.org>>
>>>> *Sent:* Tuesday, July 29, 2014 3:21AM
>>>> *To:* Robbie King (robking) <robking@cisco.com 
>>>> <mailto:robking@cisco.com>>
>>>> *Cc:* Zhao, Yao, Taras Kondratiuk <taras.kondratiuk@linaro.org 
>>>> <mailto:taras.kondratiuk@linaro.org>>,
>>>> lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> 
>>>> <lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>>
>>>> *Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API
>>>>
>>>> On 2014-07-29 01:35, Robbie King (robking) wrote:
>>>>
>>>>> Here's what I have in "DEPENDENCIES", what do you think?
>>>>> --------------------------------------------------------
>>>>>
>>>>> Prerequisites for building the OpenDataPlane (ODP) API
>>>>>
>>>>> 1. Linux kernel >= 3.0
>>>>>
>>>>> Version 3.0+ needed for the sendmmsg() interface
>>>>>
>>>>> 2. autotools
>>>>> <
>>>>> automake
>>>>> autoconf
>>>>> autoconf-archive
>>>>> libtool
>>>>>
>>>>> On Debian/Ubuntu systems:
>>>>> $ sudo apt-get install automake autoconf autoconf-archive libtool
>>>>>
>>>>> On CentOS/RedHat/Fedora systems:
>>>>> $ sudo yum install automake autoconf autoconf-archive libtool 
>>>>> libtoolize
>>>>>
>>>>> 3. required libraries
>>>>>
>>>>> Libraries currently required to link: openssl
>>>>>
>>>>> 3.1 native build
>>>>>
>>>>> For native compilation, simply load the necessary libraries using 
>>>>> the appropriate
>>>>> tool set.
>>>>>
>>>>> On Debian/Ubuntu systems:
>>>>> $$ sudo apt-get install libssl-dev
>>>>>
>>>>> On CentOS/RedHat/Fedora systems:
>>>>> $ sudo yum install openssl-devel
>>>>>
>>>>> 3.2 cross compilation build
>>>>>
>>>>> Cross compilation requires cross compiling the individual 
>>>>> libraries. Inn order for
>>>>> a cross compiled executable to run on a target system, one must 
>>>>> build the same
>>>>> version as that which is installed on the target rootfs.
>>>>>
>>>>> For example, to build openssl for both 32 and 64 bit compilation:
>>>>> # Clone openssl repository
>>>>> $ git clone git://git.openssl.org/openssl.git 
>>>>> <http://git.openssl.org/openssl.git>
>>>>> $ cd openssl
>>>>>
>>>>> # The command "git tag" will list all tags available in the repo.
>>>>> $ git tag
>>>>>
>>>>> ## Checkout the specific tag to match openssl library in your 
>>>>> target rootfs
>>>>> $ git checkout <tag name>
>>>>>
>>>>> # Build and install 64 bit version of openssl
>>>>> $ ./Configure linux-aarch64 
>>>>> --cross-compile-prefix=aarch64-linux-gnu- \
>>>>> --prefix=/home/user/src/install-openssl-aarch64
>>>>> $ make
>>>>> $ make install
>>>>>
>>>>> ## Build and install 32 bit version of openssl
>>>>> $ ./Configure linux-generic32 
>>>>> --cross-compile-prefix=arm-linux-gnueabihf- \
>>>>> --prefix=/home/user/src/install-openssl
>>>>> $ make
>>>>> $ make install
>>>>> # You may now build either 32 or 64 bit ODP
>>>>> $ git clone git://git.linaro.org/lng/odp.git 
>>>>> <http://git.linaro.org/lng/odp.git> odp
>>>>> $ cd odp
>>>>> $ ./bootstrap
>>>>>
>>>>> # Build 32 bit version of ODP
>>>>> $ ./configure --host=arm-linux-gnueabihf \
>>>>> --with-openssl-path=/home/user/src/install-openssl
>>>>> $ make
>>>>>
>>>>> # Or build 64 bit version of ODP
>>>>> $ ./configure --host=aarch64-linux-gnu \
>>>>> --with-openssl-path=/home/user/src/install-openssl-aarch64
>>>>> $ make
>>>>
>>>> Looks good!
>>>> Just a minor nit:
>>>> Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit
>>>> version of openssl below 32 bit version?
>>>>
>>>>
>>>> Cheers,
>>>> Anders
>>>>
>>>>> -----Original Message-----
>>>>> From: Anders Roxell [mailto:anders.roxell@linaro.org]
>>>>> Sent: Monday, July 28, 2014 1:19 PM
>>>>> To: Robbie King (robking)
>>>>> Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org 
>>>>> <mailto:lng-odp@lists.linaro.org>
>>>>> Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
>>>>>
>>>>> On 2014-07-26 15:49, Robbie King (robking) wrote:
>>>>>> So is the solution here to split the section I added for "crypto" 
>>>>>> in the DEPENDENCIES
>>>>>> file to have a "native" and a "cross compile" subsection? Under 
>>>>>> the cross compile
>>>>>> subsection we can then list the steps we've discussed so for that 
>>>>>> will hopefully
>>>>>> cross compile a libodp.a that is compatible with the user's rootfs.
>>>>> I'm sorry for the late reply!
>>>>>
>>>>> Yup, that sounds good with the subsections.
>>>>>
>>>>> Maybe section 3 should say something else than "crypto" if we need 
>>>>> to add
>>>>> more dependencies like crypto in the future, unsure what we should say
>>>>> though. =/
>>>>> Ideas what we can say?
>>>>>
>>>>> Cheers,
>>>>> Anders
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Anders Roxell [mailto:anders.roxell@linaro.org]
>>>>>> Sent: Saturday, July 26, 2014 11:17 AM
>>>>>> To: Yao Zhao
>>>>>> Cc: Robbie King (robking); Taras Kondratiuk; 
>>>>>> lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>>>>>> Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
>>>>>>
>>>>>> On 2014-07-25 15:43, Yao Zhao wrote:
>>>>>>> [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 25/07/2014 (Fri 
>>>>>>> 16:18) Robbie King (robking) wrote:
>>>>>>>
>>>>>>>> I agree we need to add something for cross compiling. My apologies
>>>>>>>> for my limited knowledge of cross compiling. If the user 
>>>>>>>> builds/links
>>>>>>>> against the latest openssl libcrypto from git, will it always 
>>>>>>>> work if the
>>>>>>>> executable is then run on a system with a packaged openssl library?
>>>>>>> No, it won't.
>>>>>>> In theory you link with which then you run with which.
>>>>>>>
>>>>>>> Normally you just make it work with native environment.
>>>>>>> Distribution which supports cross compile will make it work for 
>>>>>>> target
>>>>>>> environment.
>>>>>>>
>>>>>>> For OE/yocto, we can write a recipe to cross compile it, it will 
>>>>>>> link
>>>>>>> against the openssl which will be put on target.
>>>>>> You seem to be talking two different things.
>>>>>>
>>>>>> 1. Robbie, you seem to be asking about ABI stability, so the 
>>>>>> answer is
>>>>>> no, you can't expect it to work. However, you can (should) checkout
>>>>>> the specific release tag of openssl, that you expect to be on the
>>>>>> rootfs, to compile against.
>>>>>> I forgot in my previous mail to mention this.
>>>>>>
>>>>>> Commands or doing that:
>>>>>> # git tag will list all tags available in the repo.
>>>>>> $ git tag
>>>>>> # Checkout a specific tag.
>>>>>> $ git checkout <tag name>
>>>>>>
>>>>>> 2. Yao, you seem to be talking about cross compiling in a general 
>>>>>> sense.
>>>>>> However, that doesn't seem to be related to the original question,
>>>>>> even though the information was correct and useful.
>>>>>>
>>>>>>
>>>>>> Cheers,
>>>>>> Anders
>>>>> -- 
>>>>> Anders Roxell
>>>>> anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
>>>>> M: +46 709 71 42 85 | IRC: roxell
>>>
>>>> require opendataplane.inc
>>>>
>>>> SRCREV = "${AUTOREV}"
>>>> SRC_URI = "git://git.linaro.org/lng/odp.git 
>>>> <http://git.linaro.org/lng/odp.git>"
>>>
>>>> SUMMARY = "Cross platform Open Data Plane application APIs"
>>>>
>>>> DESCRIPTION = "The OpenDataPlane project has been established to \
>>>> produce an open-source, cross-platform set of application \
>>>> programming interfaces (APIs) for the networking data plane."
>>>>
>>>> HOMEPAGE = "http://www.opendataplane.org"
>>>> SECTION = "networking"
>>>> LICENSE = "BSD-3-Clause"
>>>> LIC_FILES_CHKSUM = 
>>>> "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
>>>>
>>>> COMPATIBLE__HOST = "^((?!mips).*)$"
>>>>
>>>> DEPENDS = "openssl"
>>>> RDEPENDS_${PN} = "libcrypto"
>>>>
>>>> PACKAGECONFIG ??= "platform_linux_generic"
>>>> PACKAGECONFIG[netmap] = "--enable-netmap,,,"
>>>> PACKAGECONFIG[platform_linux_generic] = 
>>>> "--with-platform=linux-generic,,,"
>>>> PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
>>>> PACKAGECONFIG[platform_linux_keystone2] = 
>>>> "--with-platform=linux-keystone2,,,"
>>>>
>>>> S = "${WORKDIR}/git"
>>>>
>>>> inherit autotools
>>>>
>>>> do_configure_prepend () {
>>>> ./bootstrap
>>>> }
>>>
>>>
>>> -- 
>>> Anders Roxell
>>> anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
>>> M: +46 709 71 42 85 | IRC: roxell
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Yao Zhao July 30, 2014, 1:29 p.m. UTC | #19
[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 30/07/2014 (Wed 14:20) Maxim Uvarov wrote:

> Robbie, please don't take attention to OE for now. Packaging is
> separate task and it's not related to api development. I will check
> that your final version
> compiles on arm with cross tool.
> 
> Yao, Aws, for now we have OE recipe:
> https://git.linaro.org/openembedded/meta-linaro.git/blob/HEAD:/meta-linaro/recipes-extra/odp/odp.bb
> 
> which needs to be synced with your version.
> 
Hi Maxim,

I didn't realize there is a opendataplane recipe already.
Where I can send the patch to?

I made the linux-dpdk working too now.
Sorry Robbie, using this thread.

thanks,
yao
> Thank you,
> Maxim.
> 
> On 07/29/2014 11:28 PM, Aws Ismail wrote:
> >
> >On Tuesday, July 29, 2014 at 3:17 PM, Yao Zhao wrote:
> >
> >>[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 29/07/2014 (Tue
> >>20:07) Anders Roxell wrote:
> >>
> >>>Hi Yao,
> >>>
> >>>Nice... When will you push the recipe?
> >>If there is no opendataplane recipe I can try to push to a yoctl layer.
> >>>Just some nits see inline comments below.
> >>>
> >>>On 2014-07-29 11:13, Yao Zhao wrote:
> >>>>It is nice to mention the dependency in DEPENDENCIES file.
> >>>>
> >>>>I wrote a opendataplane recipe for openembedded/yocto:
> >>>>You can put the bb and inc like me in poky/yocto's some layer,
> >>>>and add the opendataplane in local.conf:
> >>>>IMAGE_INSTALL_append += "opendataplane"
> >>>>this will install opendataplane's binaries on target.
> >>>>
> >>>>For this Crypto API patch, there is no way to turn it off so I
> >>>>just add dependency in the recipe.
> >>>>For the DPDK support, it should add dependency, sdk location when
> >>>>--with-linux-dpdk specified.
> >>>>
> >>>>yao
> >>>>
> >>>>yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> >>>>cat opendataplane.bb
> >>>>require opendataplane.inc
> >>>>
> >>>>SRCREV = "${AUTOREV}"
> >>>
> >>>Do we want AUTOREV here and not release tags?
> >>AUTOREV will use latest from master.
> >>Normally there should be a ${BPN}_${PV}.bb which will use specific
> >>commit/release.
> >>I can write one for official release 0.2 if necessary.
> >>
> >>>>SRC_URI = "git://git.linaro.org/lng/odp.git
> >>>><http://git.linaro.org/lng/odp.git>"
> >>>>
> >>>>yzhao2@yzhao2-OptiPlex-990:~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> >>>>cat opendataplane.inc
> >>>>SUMMARY = "Cross platform Open Data Plane application APIs"
> >>>
> >>>Open Data Plane -> OpenDataPlane
> >>OK!
> >>>>
> >>>>DESCRIPTION = "The OpenDataPlane project has been established to \
> >>>>produce an open-source, cross-platform set of application \
> >>>>programming interfaces (APIs) for the networking data plane."
> >>>>
> >>>>HOMEPAGE = "http://www.opendataplane.org"
> >>>>SECTION = "networking"
> >>>>LICENSE = "BSD-3-Clause"
> >>>>LIC_FILES_CHKSUM =
> >>>>"file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> >>>>
> >>>>COMPATIBLE_HOST = "^((?!mips).*)$"
> >>>>
> >>>>DEPENDS = "openssl"
> >>>>RDEPENDS_${PN} = "libcrypto"
> >>>>
> >>>>PACKAGECONFIG ??= "platform_linux_generic"
> >>>>PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> >>>>PACKAGECONFIG[platform_linux_generic] =
> >>>>"--with-platform=linux-generic,,,"
> >>>>PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> >>>>PACKAGECONFIG[platform_linux_keystone2] =
> >>>>"--with-platform=linux-keystone2,,,"
> >>>
> >>>Don't we need to add a recipe for dpdk to build linux-dpdk and
> >>>a recipe for OpenEM
> >>>to build linux-keystone2?
> >>
> >>We do need a recipe for dpdk, keystone2 but I am not familiar with
> >>keystone2, if it is dpdk I am fine but it will take some time to write
> >>one, not like this recipe it will take only 1 or 2 hours.
> >>
> >>As dpdk exists for a while, I am guessing there should be a recipe
> >>available somewhere.
> >>When these platforms used, special [C|LD]flags might be needed.
> >>
> >dpdk is already part of yocto's meta-intel layer.
> >
> >http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/tree/common/recipes-extended/dpdk
> >
> >So there is no need to create a new one.
> >
> >Aws\
> >>I only tested this with linux generic on mips, arm, x86_64 although mips
> >>is not supported and odp doesn't work with qemuarm(armv5).
> >>
> >>yao
> >>>Cheers,
> >>>Anders
> >>>
> >>>>
> >>>>S = "${WORKDIR}/git"
> >>>>
> >>>>inherit autotools
> >>>>
> >>>>do_configure_prepend () {
> >>>>./bootstrap
> >>>>}
> >>>>
> >>>>------------------------------------------------------------------------
> >>>>
> >>>>*From:* Anders Roxell <anders.roxell@linaro.org
> >>>><mailto:anders.roxell@linaro.org>>
> >>>>*Sent:* Tuesday, July 29, 2014 3:21AM
> >>>>*To:* Robbie King (robking) <robking@cisco.com
> >>>><mailto:robking@cisco.com>>
> >>>>*Cc:* Zhao, Yao, Taras Kondratiuk
> >>>><taras.kondratiuk@linaro.org
> >>>><mailto:taras.kondratiuk@linaro.org>>,
> >>>>lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
> >>>><lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>>
> >>>>*Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> >>>>
> >>>>On 2014-07-29 01:35, Robbie King (robking) wrote:
> >>>>
> >>>>>Here's what I have in "DEPENDENCIES", what do you think?
> >>>>>--------------------------------------------------------
> >>>>>
> >>>>>Prerequisites for building the OpenDataPlane (ODP) API
> >>>>>
> >>>>>1. Linux kernel >= 3.0
> >>>>>
> >>>>>Version 3.0+ needed for the sendmmsg() interface
> >>>>>
> >>>>>2. autotools
> >>>>><
> >>>>>automake
> >>>>>autoconf
> >>>>>autoconf-archive
> >>>>>libtool
> >>>>>
> >>>>>On Debian/Ubuntu systems:
> >>>>>$ sudo apt-get install automake autoconf autoconf-archive libtool
> >>>>>
> >>>>>On CentOS/RedHat/Fedora systems:
> >>>>>$ sudo yum install automake autoconf autoconf-archive
> >>>>>libtool libtoolize
> >>>>>
> >>>>>3. required libraries
> >>>>>
> >>>>>Libraries currently required to link: openssl
> >>>>>
> >>>>>3.1 native build
> >>>>>
> >>>>>For native compilation, simply load the necessary
> >>>>>libraries using the appropriate
> >>>>>tool set.
> >>>>>
> >>>>>On Debian/Ubuntu systems:
> >>>>>$$ sudo apt-get install libssl-dev
> >>>>>
> >>>>>On CentOS/RedHat/Fedora systems:
> >>>>>$ sudo yum install openssl-devel
> >>>>>
> >>>>>3.2 cross compilation build
> >>>>>
> >>>>>Cross compilation requires cross compiling the individual
> >>>>>libraries. Inn order for
> >>>>>a cross compiled executable to run on a target system, one
> >>>>>must build the same
> >>>>>version as that which is installed on the target rootfs.
> >>>>>
> >>>>>For example, to build openssl for both 32 and 64 bit compilation:
> >>>>># Clone openssl repository
> >>>>>$ git clone git://git.openssl.org/openssl.git
> >>>>><http://git.openssl.org/openssl.git>
> >>>>>$ cd openssl
> >>>>>
> >>>>># The command "git tag" will list all tags available in the repo.
> >>>>>$ git tag
> >>>>>
> >>>>>## Checkout the specific tag to match openssl library in
> >>>>>your target rootfs
> >>>>>$ git checkout <tag name>
> >>>>>
> >>>>># Build and install 64 bit version of openssl
> >>>>>$ ./Configure linux-aarch64
> >>>>>--cross-compile-prefix=aarch64-linux-gnu- \
> >>>>>--prefix=/home/user/src/install-openssl-aarch64
> >>>>>$ make
> >>>>>$ make install
> >>>>>
> >>>>>## Build and install 32 bit version of openssl
> >>>>>$ ./Configure linux-generic32
> >>>>>--cross-compile-prefix=arm-linux-gnueabihf- \
> >>>>>--prefix=/home/user/src/install-openssl
> >>>>>$ make
> >>>>>$ make install
> >>>>># You may now build either 32 or 64 bit ODP
> >>>>>$ git clone git://git.linaro.org/lng/odp.git
> >>>>><http://git.linaro.org/lng/odp.git> odp
> >>>>>$ cd odp
> >>>>>$ ./bootstrap
> >>>>>
> >>>>># Build 32 bit version of ODP
> >>>>>$ ./configure --host=arm-linux-gnueabihf \
> >>>>>--with-openssl-path=/home/user/src/install-openssl
> >>>>>$ make
> >>>>>
> >>>>># Or build 64 bit version of ODP
> >>>>>$ ./configure --host=aarch64-linux-gnu \
> >>>>>--with-openssl-path=/home/user/src/install-openssl-aarch64
> >>>>>$ make
> >>>>
> >>>>Looks good!
> >>>>Just a minor nit:
> >>>>Maybe we should move 64 bit version of ODP above 32 bit or move 64 bit
> >>>>version of openssl below 32 bit version?
> >>>>
> >>>>
> >>>>Cheers,
> >>>>Anders
> >>>>
> >>>>>-----Original Message-----
> >>>>>From: Anders Roxell [mailto:anders.roxell@linaro.org]
> >>>>>Sent: Monday, July 28, 2014 1:19 PM
> >>>>>To: Robbie King (robking)
> >>>>>Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> >>>>><mailto:lng-odp@lists.linaro.org>
> >>>>>Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> >>>>>
> >>>>>On 2014-07-26 15:49, Robbie King (robking) wrote:
> >>>>>>So is the solution here to split the section I added for
> >>>>>>"crypto" in the DEPENDENCIES
> >>>>>>file to have a "native" and a "cross compile"
> >>>>>>subsection? Under the cross compile
> >>>>>>subsection we can then list the steps we've discussed so
> >>>>>>for that will hopefully
> >>>>>>cross compile a libodp.a that is compatible with the user's rootfs.
> >>>>>I'm sorry for the late reply!
> >>>>>
> >>>>>Yup, that sounds good with the subsections.
> >>>>>
> >>>>>Maybe section 3 should say something else than "crypto" if
> >>>>>we need to add
> >>>>>more dependencies like crypto in the future, unsure what we should say
> >>>>>though. =/
> >>>>>Ideas what we can say?
> >>>>>
> >>>>>Cheers,
> >>>>>Anders
> >>>>>
> >>>>>>-----Original Message-----
> >>>>>>From: Anders Roxell [mailto:anders.roxell@linaro.org]
> >>>>>>Sent: Saturday, July 26, 2014 11:17 AM
> >>>>>>To: Yao Zhao
> >>>>>>Cc: Robbie King (robking); Taras Kondratiuk;
> >>>>>>lng-odp@lists.linaro.org
> >>>>>><mailto:lng-odp@lists.linaro.org>
> >>>>>>Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> >>>>>>
> >>>>>>On 2014-07-25 15:43, Yao Zhao wrote:
> >>>>>>>[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On
> >>>>>>>25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> >>>>>>>
> >>>>>>>>I agree we need to add something for cross compiling. My apologies
> >>>>>>>>for my limited knowledge of cross compiling. If the
> >>>>>>>>user builds/links
> >>>>>>>>against the latest openssl libcrypto from git, will
> >>>>>>>>it always work if the
> >>>>>>>>executable is then run on a system with a packaged openssl library?
> >>>>>>>No, it won't.
> >>>>>>>In theory you link with which then you run with which.
> >>>>>>>
> >>>>>>>Normally you just make it work with native environment.
> >>>>>>>Distribution which supports cross compile will make it
> >>>>>>>work for target
> >>>>>>>environment.
> >>>>>>>
> >>>>>>>For OE/yocto, we can write a recipe to cross compile
> >>>>>>>it, it will link
> >>>>>>>against the openssl which will be put on target.
> >>>>>>You seem to be talking two different things.
> >>>>>>
> >>>>>>1. Robbie, you seem to be asking about ABI stability, so
> >>>>>>the answer is
> >>>>>>no, you can't expect it to work. However, you can (should) checkout
> >>>>>>the specific release tag of openssl, that you expect to be on the
> >>>>>>rootfs, to compile against.
> >>>>>>I forgot in my previous mail to mention this.
> >>>>>>
> >>>>>>Commands or doing that:
> >>>>>># git tag will list all tags available in the repo.
> >>>>>>$ git tag
> >>>>>># Checkout a specific tag.
> >>>>>>$ git checkout <tag name>
> >>>>>>
> >>>>>>2. Yao, you seem to be talking about cross compiling in
> >>>>>>a general sense.
> >>>>>>However, that doesn't seem to be related to the original question,
> >>>>>>even though the information was correct and useful.
> >>>>>>
> >>>>>>
> >>>>>>Cheers,
> >>>>>>Anders
> >>>>>-- 
> >>>>>Anders Roxell
> >>>>>anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
> >>>>>M: +46 709 71 42 85 | IRC: roxell
> >>>
> >>>>require opendataplane.inc
> >>>>
> >>>>SRCREV = "${AUTOREV}"
> >>>>SRC_URI = "git://git.linaro.org/lng/odp.git
> >>>><http://git.linaro.org/lng/odp.git>"
> >>>
> >>>>SUMMARY = "Cross platform Open Data Plane application APIs"
> >>>>
> >>>>DESCRIPTION = "The OpenDataPlane project has been established to \
> >>>>produce an open-source, cross-platform set of application \
> >>>>programming interfaces (APIs) for the networking data plane."
> >>>>
> >>>>HOMEPAGE = "http://www.opendataplane.org"
> >>>>SECTION = "networking"
> >>>>LICENSE = "BSD-3-Clause"
> >>>>LIC_FILES_CHKSUM =
> >>>>"file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> >>>>
> >>>>COMPATIBLE__HOST = "^((?!mips).*)$"
> >>>>
> >>>>DEPENDS = "openssl"
> >>>>RDEPENDS_${PN} = "libcrypto"
> >>>>
> >>>>PACKAGECONFIG ??= "platform_linux_generic"
> >>>>PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> >>>>PACKAGECONFIG[platform_linux_generic] =
> >>>>"--with-platform=linux-generic,,,"
> >>>>PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> >>>>PACKAGECONFIG[platform_linux_keystone2] =
> >>>>"--with-platform=linux-keystone2,,,"
> >>>>
> >>>>S = "${WORKDIR}/git"
> >>>>
> >>>>inherit autotools
> >>>>
> >>>>do_configure_prepend () {
> >>>>./bootstrap
> >>>>}
> >>>
> >>>
> >>>-- 
> >>>Anders Roxell
> >>>anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
> >>>M: +46 709 71 42 85 | IRC: roxell
> >>
> >>_______________________________________________
> >>lng-odp mailing list
> >>lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
> >>http://lists.linaro.org/mailman/listinfo/lng-odp
> >
> >
> >
> >_______________________________________________
> >lng-odp mailing list
> >lng-odp@lists.linaro.org
> >http://lists.linaro.org/mailman/listinfo/lng-odp
> 
> 
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Mike Holmes July 30, 2014, 2:22 p.m. UTC | #20
Yao we are using gerrit for the OE work:
git clone https://review.linaro.org/openembedded/meta-linaro
https://review.linaro.org/#/admin/projects/openembedded/meta-linaro

I don't actually know if you could submit there or not as an external
contributor but you could try as a starting point.

Mike


On 30 July 2014 09:29, Yao Zhao <yao.zhao@windriver.com> wrote:

> [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 30/07/2014 (Wed 14:20) Maxim
> Uvarov wrote:
>
> > Robbie, please don't take attention to OE for now. Packaging is
> > separate task and it's not related to api development. I will check
> > that your final version
> > compiles on arm with cross tool.
> >
> > Yao, Aws, for now we have OE recipe:
> >
> https://git.linaro.org/openembedded/meta-linaro.git/blob/HEAD:/meta-linaro/recipes-extra/odp/odp.bb
> >
> > which needs to be synced with your version.
> >
> Hi Maxim,
>
> I didn't realize there is a opendataplane recipe already.
> Where I can send the patch to?
>
> I made the linux-dpdk working too now.
> Sorry Robbie, using this thread.
>
> thanks,
> yao
> > Thank you,
> > Maxim.
> >
> > On 07/29/2014 11:28 PM, Aws Ismail wrote:
> > >
> > >On Tuesday, July 29, 2014 at 3:17 PM, Yao Zhao wrote:
> > >
> > >>[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 29/07/2014 (Tue
> > >>20:07) Anders Roxell wrote:
> > >>
> > >>>Hi Yao,
> > >>>
> > >>>Nice... When will you push the recipe?
> > >>If there is no opendataplane recipe I can try to push to a yoctl layer.
> > >>>Just some nits see inline comments below.
> > >>>
> > >>>On 2014-07-29 11:13, Yao Zhao wrote:
> > >>>>It is nice to mention the dependency in DEPENDENCIES file.
> > >>>>
> > >>>>I wrote a opendataplane recipe for openembedded/yocto:
> > >>>>You can put the bb and inc like me in poky/yocto's some layer,
> > >>>>and add the opendataplane in local.conf:
> > >>>>IMAGE_INSTALL_append += "opendataplane"
> > >>>>this will install opendataplane's binaries on target.
> > >>>>
> > >>>>For this Crypto API patch, there is no way to turn it off so I
> > >>>>just add dependency in the recipe.
> > >>>>For the DPDK support, it should add dependency, sdk location when
> > >>>>--with-linux-dpdk specified.
> > >>>>
> > >>>>yao
> > >>>>
> > >>>>yzhao2@yzhao2-OptiPlex-990
> :~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> > >>>>cat opendataplane.bb
> > >>>>require opendataplane.inc
> > >>>>
> > >>>>SRCREV = "${AUTOREV}"
> > >>>
> > >>>Do we want AUTOREV here and not release tags?
> > >>AUTOREV will use latest from master.
> > >>Normally there should be a ${BPN}_${PV}.bb which will use specific
> > >>commit/release.
> > >>I can write one for official release 0.2 if necessary.
> > >>
> > >>>>SRC_URI = "git://git.linaro.org/lng/odp.git
> > >>>><http://git.linaro.org/lng/odp.git>"
> > >>>>
> > >>>>yzhao2@yzhao2-OptiPlex-990
> :~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> > >>>>cat opendataplane.inc
> > >>>>SUMMARY = "Cross platform Open Data Plane application APIs"
> > >>>
> > >>>Open Data Plane -> OpenDataPlane
> > >>OK!
> > >>>>
> > >>>>DESCRIPTION = "The OpenDataPlane project has been established to \
> > >>>>produce an open-source, cross-platform set of application \
> > >>>>programming interfaces (APIs) for the networking data plane."
> > >>>>
> > >>>>HOMEPAGE = "http://www.opendataplane.org"
> > >>>>SECTION = "networking"
> > >>>>LICENSE = "BSD-3-Clause"
> > >>>>LIC_FILES_CHKSUM =
> > >>>>"file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> > >>>>
> > >>>>COMPATIBLE_HOST = "^((?!mips).*)$"
> > >>>>
> > >>>>DEPENDS = "openssl"
> > >>>>RDEPENDS_${PN} = "libcrypto"
> > >>>>
> > >>>>PACKAGECONFIG ??= "platform_linux_generic"
> > >>>>PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> > >>>>PACKAGECONFIG[platform_linux_generic] =
> > >>>>"--with-platform=linux-generic,,,"
> > >>>>PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> > >>>>PACKAGECONFIG[platform_linux_keystone2] =
> > >>>>"--with-platform=linux-keystone2,,,"
> > >>>
> > >>>Don't we need to add a recipe for dpdk to build linux-dpdk and
> > >>>a recipe for OpenEM
> > >>>to build linux-keystone2?
> > >>
> > >>We do need a recipe for dpdk, keystone2 but I am not familiar with
> > >>keystone2, if it is dpdk I am fine but it will take some time to write
> > >>one, not like this recipe it will take only 1 or 2 hours.
> > >>
> > >>As dpdk exists for a while, I am guessing there should be a recipe
> > >>available somewhere.
> > >>When these platforms used, special [C|LD]flags might be needed.
> > >>
> > >dpdk is already part of yocto's meta-intel layer.
> > >
> > >
> http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/tree/common/recipes-extended/dpdk
> > >
> > >So there is no need to create a new one.
> > >
> > >Aws\
> > >>I only tested this with linux generic on mips, arm, x86_64 although
> mips
> > >>is not supported and odp doesn't work with qemuarm(armv5).
> > >>
> > >>yao
> > >>>Cheers,
> > >>>Anders
> > >>>
> > >>>>
> > >>>>S = "${WORKDIR}/git"
> > >>>>
> > >>>>inherit autotools
> > >>>>
> > >>>>do_configure_prepend () {
> > >>>>./bootstrap
> > >>>>}
> > >>>>
> >
> >>>>------------------------------------------------------------------------
> > >>>>
> > >>>>*From:* Anders Roxell <anders.roxell@linaro.org
> > >>>><mailto:anders.roxell@linaro.org>>
> > >>>>*Sent:* Tuesday, July 29, 2014 3:21AM
> > >>>>*To:* Robbie King (robking) <robking@cisco.com
> > >>>><mailto:robking@cisco.com>>
> > >>>>*Cc:* Zhao, Yao, Taras Kondratiuk
> > >>>><taras.kondratiuk@linaro.org
> > >>>><mailto:taras.kondratiuk@linaro.org>>,
> > >>>>lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
> > >>>><lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>>
> > >>>>*Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > >>>>
> > >>>>On 2014-07-29 01:35, Robbie King (robking) wrote:
> > >>>>
> > >>>>>Here's what I have in "DEPENDENCIES", what do you think?
> > >>>>>--------------------------------------------------------
> > >>>>>
> > >>>>>Prerequisites for building the OpenDataPlane (ODP) API
> > >>>>>
> > >>>>>1. Linux kernel >= 3.0
> > >>>>>
> > >>>>>Version 3.0+ needed for the sendmmsg() interface
> > >>>>>
> > >>>>>2. autotools
> > >>>>><
> > >>>>>automake
> > >>>>>autoconf
> > >>>>>autoconf-archive
> > >>>>>libtool
> > >>>>>
> > >>>>>On Debian/Ubuntu systems:
> > >>>>>$ sudo apt-get install automake autoconf autoconf-archive libtool
> > >>>>>
> > >>>>>On CentOS/RedHat/Fedora systems:
> > >>>>>$ sudo yum install automake autoconf autoconf-archive
> > >>>>>libtool libtoolize
> > >>>>>
> > >>>>>3. required libraries
> > >>>>>
> > >>>>>Libraries currently required to link: openssl
> > >>>>>
> > >>>>>3.1 native build
> > >>>>>
> > >>>>>For native compilation, simply load the necessary
> > >>>>>libraries using the appropriate
> > >>>>>tool set.
> > >>>>>
> > >>>>>On Debian/Ubuntu systems:
> > >>>>>$$ sudo apt-get install libssl-dev
> > >>>>>
> > >>>>>On CentOS/RedHat/Fedora systems:
> > >>>>>$ sudo yum install openssl-devel
> > >>>>>
> > >>>>>3.2 cross compilation build
> > >>>>>
> > >>>>>Cross compilation requires cross compiling the individual
> > >>>>>libraries. Inn order for
> > >>>>>a cross compiled executable to run on a target system, one
> > >>>>>must build the same
> > >>>>>version as that which is installed on the target rootfs.
> > >>>>>
> > >>>>>For example, to build openssl for both 32 and 64 bit compilation:
> > >>>>># Clone openssl repository
> > >>>>>$ git clone git://git.openssl.org/openssl.git
> > >>>>><http://git.openssl.org/openssl.git>
> > >>>>>$ cd openssl
> > >>>>>
> > >>>>># The command "git tag" will list all tags available in the repo.
> > >>>>>$ git tag
> > >>>>>
> > >>>>>## Checkout the specific tag to match openssl library in
> > >>>>>your target rootfs
> > >>>>>$ git checkout <tag name>
> > >>>>>
> > >>>>># Build and install 64 bit version of openssl
> > >>>>>$ ./Configure linux-aarch64
> > >>>>>--cross-compile-prefix=aarch64-linux-gnu- \
> > >>>>>--prefix=/home/user/src/install-openssl-aarch64
> > >>>>>$ make
> > >>>>>$ make install
> > >>>>>
> > >>>>>## Build and install 32 bit version of openssl
> > >>>>>$ ./Configure linux-generic32
> > >>>>>--cross-compile-prefix=arm-linux-gnueabihf- \
> > >>>>>--prefix=/home/user/src/install-openssl
> > >>>>>$ make
> > >>>>>$ make install
> > >>>>># You may now build either 32 or 64 bit ODP
> > >>>>>$ git clone git://git.linaro.org/lng/odp.git
> > >>>>><http://git.linaro.org/lng/odp.git> odp
> > >>>>>$ cd odp
> > >>>>>$ ./bootstrap
> > >>>>>
> > >>>>># Build 32 bit version of ODP
> > >>>>>$ ./configure --host=arm-linux-gnueabihf \
> > >>>>>--with-openssl-path=/home/user/src/install-openssl
> > >>>>>$ make
> > >>>>>
> > >>>>># Or build 64 bit version of ODP
> > >>>>>$ ./configure --host=aarch64-linux-gnu \
> > >>>>>--with-openssl-path=/home/user/src/install-openssl-aarch64
> > >>>>>$ make
> > >>>>
> > >>>>Looks good!
> > >>>>Just a minor nit:
> > >>>>Maybe we should move 64 bit version of ODP above 32 bit or move 64
> bit
> > >>>>version of openssl below 32 bit version?
> > >>>>
> > >>>>
> > >>>>Cheers,
> > >>>>Anders
> > >>>>
> > >>>>>-----Original Message-----
> > >>>>>From: Anders Roxell [mailto:anders.roxell@linaro.org]
> > >>>>>Sent: Monday, July 28, 2014 1:19 PM
> > >>>>>To: Robbie King (robking)
> > >>>>>Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> > >>>>><mailto:lng-odp@lists.linaro.org>
> > >>>>>Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > >>>>>
> > >>>>>On 2014-07-26 15:49, Robbie King (robking) wrote:
> > >>>>>>So is the solution here to split the section I added for
> > >>>>>>"crypto" in the DEPENDENCIES
> > >>>>>>file to have a "native" and a "cross compile"
> > >>>>>>subsection? Under the cross compile
> > >>>>>>subsection we can then list the steps we've discussed so
> > >>>>>>for that will hopefully
> > >>>>>>cross compile a libodp.a that is compatible with the user's rootfs.
> > >>>>>I'm sorry for the late reply!
> > >>>>>
> > >>>>>Yup, that sounds good with the subsections.
> > >>>>>
> > >>>>>Maybe section 3 should say something else than "crypto" if
> > >>>>>we need to add
> > >>>>>more dependencies like crypto in the future, unsure what we should
> say
> > >>>>>though. =/
> > >>>>>Ideas what we can say?
> > >>>>>
> > >>>>>Cheers,
> > >>>>>Anders
> > >>>>>
> > >>>>>>-----Original Message-----
> > >>>>>>From: Anders Roxell [mailto:anders.roxell@linaro.org]
> > >>>>>>Sent: Saturday, July 26, 2014 11:17 AM
> > >>>>>>To: Yao Zhao
> > >>>>>>Cc: Robbie King (robking); Taras Kondratiuk;
> > >>>>>>lng-odp@lists.linaro.org
> > >>>>>><mailto:lng-odp@lists.linaro.org>
> > >>>>>>Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > >>>>>>
> > >>>>>>On 2014-07-25 15:43, Yao Zhao wrote:
> > >>>>>>>[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On
> > >>>>>>>25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> > >>>>>>>
> > >>>>>>>>I agree we need to add something for cross compiling. My
> apologies
> > >>>>>>>>for my limited knowledge of cross compiling. If the
> > >>>>>>>>user builds/links
> > >>>>>>>>against the latest openssl libcrypto from git, will
> > >>>>>>>>it always work if the
> > >>>>>>>>executable is then run on a system with a packaged openssl
> library?
> > >>>>>>>No, it won't.
> > >>>>>>>In theory you link with which then you run with which.
> > >>>>>>>
> > >>>>>>>Normally you just make it work with native environment.
> > >>>>>>>Distribution which supports cross compile will make it
> > >>>>>>>work for target
> > >>>>>>>environment.
> > >>>>>>>
> > >>>>>>>For OE/yocto, we can write a recipe to cross compile
> > >>>>>>>it, it will link
> > >>>>>>>against the openssl which will be put on target.
> > >>>>>>You seem to be talking two different things.
> > >>>>>>
> > >>>>>>1. Robbie, you seem to be asking about ABI stability, so
> > >>>>>>the answer is
> > >>>>>>no, you can't expect it to work. However, you can (should) checkout
> > >>>>>>the specific release tag of openssl, that you expect to be on the
> > >>>>>>rootfs, to compile against.
> > >>>>>>I forgot in my previous mail to mention this.
> > >>>>>>
> > >>>>>>Commands or doing that:
> > >>>>>># git tag will list all tags available in the repo.
> > >>>>>>$ git tag
> > >>>>>># Checkout a specific tag.
> > >>>>>>$ git checkout <tag name>
> > >>>>>>
> > >>>>>>2. Yao, you seem to be talking about cross compiling in
> > >>>>>>a general sense.
> > >>>>>>However, that doesn't seem to be related to the original question,
> > >>>>>>even though the information was correct and useful.
> > >>>>>>
> > >>>>>>
> > >>>>>>Cheers,
> > >>>>>>Anders
> > >>>>>--
> > >>>>>Anders Roxell
> > >>>>>anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
> > >>>>>M: +46 709 71 42 85 | IRC: roxell
> > >>>
> > >>>>require opendataplane.inc
> > >>>>
> > >>>>SRCREV = "${AUTOREV}"
> > >>>>SRC_URI = "git://git.linaro.org/lng/odp.git
> > >>>><http://git.linaro.org/lng/odp.git>"
> > >>>
> > >>>>SUMMARY = "Cross platform Open Data Plane application APIs"
> > >>>>
> > >>>>DESCRIPTION = "The OpenDataPlane project has been established to \
> > >>>>produce an open-source, cross-platform set of application \
> > >>>>programming interfaces (APIs) for the networking data plane."
> > >>>>
> > >>>>HOMEPAGE = "http://www.opendataplane.org"
> > >>>>SECTION = "networking"
> > >>>>LICENSE = "BSD-3-Clause"
> > >>>>LIC_FILES_CHKSUM =
> > >>>>"file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> > >>>>
> > >>>>COMPATIBLE__HOST = "^((?!mips).*)$"
> > >>>>
> > >>>>DEPENDS = "openssl"
> > >>>>RDEPENDS_${PN} = "libcrypto"
> > >>>>
> > >>>>PACKAGECONFIG ??= "platform_linux_generic"
> > >>>>PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> > >>>>PACKAGECONFIG[platform_linux_generic] =
> > >>>>"--with-platform=linux-generic,,,"
> > >>>>PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> > >>>>PACKAGECONFIG[platform_linux_keystone2] =
> > >>>>"--with-platform=linux-keystone2,,,"
> > >>>>
> > >>>>S = "${WORKDIR}/git"
> > >>>>
> > >>>>inherit autotools
> > >>>>
> > >>>>do_configure_prepend () {
> > >>>>./bootstrap
> > >>>>}
> > >>>
> > >>>
> > >>>--
> > >>>Anders Roxell
> > >>>anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
> > >>>M: +46 709 71 42 85 | IRC: roxell
> > >>
> > >>_______________________________________________
> > >>lng-odp mailing list
> > >>lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
> > >>http://lists.linaro.org/mailman/listinfo/lng-odp
> > >
> > >
> > >
> > >_______________________________________________
> > >lng-odp mailing list
> > >lng-odp@lists.linaro.org
> > >http://lists.linaro.org/mailman/listinfo/lng-odp
> >
> >
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Anders Roxell July 30, 2014, 7:14 p.m. UTC | #21
On 2014-07-30 10:22, Mike Holmes wrote:
> Yao we are using gerrit for the OE work:
> git clone https://review.linaro.org/openembedded/meta-linaro
> https://review.linaro.org/#/admin/projects/openembedded/meta-linaro
> 
> I don't actually know if you could submit there or not as an external
> contributor but you could try as a starting point.

I would like to see the recipe in OE and in there we have a tag
(released) version.
I like your proposal of the recipe Yao.

Can you please try to push that to OE?

Cheers,
Anders

> 
> Mike
> 
> 
> On 30 July 2014 09:29, Yao Zhao <yao.zhao@windriver.com> wrote:
> 
> > [Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 30/07/2014 (Wed 14:20) Maxim
> > Uvarov wrote:
> >
> > > Robbie, please don't take attention to OE for now. Packaging is
> > > separate task and it's not related to api development. I will check
> > > that your final version
> > > compiles on arm with cross tool.
> > >
> > > Yao, Aws, for now we have OE recipe:
> > >
> > https://git.linaro.org/openembedded/meta-linaro.git/blob/HEAD:/meta-linaro/recipes-extra/odp/odp.bb
> > >
> > > which needs to be synced with your version.
> > >
> > Hi Maxim,
> >
> > I didn't realize there is a opendataplane recipe already.
> > Where I can send the patch to?
> >
> > I made the linux-dpdk working too now.
> > Sorry Robbie, using this thread.
> >
> > thanks,
> > yao
> > > Thank you,
> > > Maxim.
> > >
> > > On 07/29/2014 11:28 PM, Aws Ismail wrote:
> > > >
> > > >On Tuesday, July 29, 2014 at 3:17 PM, Yao Zhao wrote:
> > > >
> > > >>[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On 29/07/2014 (Tue
> > > >>20:07) Anders Roxell wrote:
> > > >>
> > > >>>Hi Yao,
> > > >>>
> > > >>>Nice... When will you push the recipe?
> > > >>If there is no opendataplane recipe I can try to push to a yoctl layer.
> > > >>>Just some nits see inline comments below.
> > > >>>
> > > >>>On 2014-07-29 11:13, Yao Zhao wrote:
> > > >>>>It is nice to mention the dependency in DEPENDENCIES file.
> > > >>>>
> > > >>>>I wrote a opendataplane recipe for openembedded/yocto:
> > > >>>>You can put the bb and inc like me in poky/yocto's some layer,
> > > >>>>and add the opendataplane in local.conf:
> > > >>>>IMAGE_INSTALL_append += "opendataplane"
> > > >>>>this will install opendataplane's binaries on target.
> > > >>>>
> > > >>>>For this Crypto API patch, there is no way to turn it off so I
> > > >>>>just add dependency in the recipe.
> > > >>>>For the DPDK support, it should add dependency, sdk location when
> > > >>>>--with-linux-dpdk specified.
> > > >>>>
> > > >>>>yao
> > > >>>>
> > > >>>>yzhao2@yzhao2-OptiPlex-990
> > :~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> > > >>>>cat opendataplane.bb
> > > >>>>require opendataplane.inc
> > > >>>>
> > > >>>>SRCREV = "${AUTOREV}"
> > > >>>
> > > >>>Do we want AUTOREV here and not release tags?
> > > >>AUTOREV will use latest from master.
> > > >>Normally there should be a ${BPN}_${PV}.bb which will use specific
> > > >>commit/release.
> > > >>I can write one for official release 0.2 if necessary.
> > > >>
> > > >>>>SRC_URI = "git://git.linaro.org/lng/odp.git
> > > >>>><http://git.linaro.org/lng/odp.git>"
> > > >>>>
> > > >>>>yzhao2@yzhao2-OptiPlex-990
> > :~/buildmount1/poky2014/poky/meta/recipes-connectivity/opendataplane$
> > > >>>>cat opendataplane.inc
> > > >>>>SUMMARY = "Cross platform Open Data Plane application APIs"
> > > >>>
> > > >>>Open Data Plane -> OpenDataPlane
> > > >>OK!
> > > >>>>
> > > >>>>DESCRIPTION = "The OpenDataPlane project has been established to \
> > > >>>>produce an open-source, cross-platform set of application \
> > > >>>>programming interfaces (APIs) for the networking data plane."
> > > >>>>
> > > >>>>HOMEPAGE = "http://www.opendataplane.org"
> > > >>>>SECTION = "networking"
> > > >>>>LICENSE = "BSD-3-Clause"
> > > >>>>LIC_FILES_CHKSUM =
> > > >>>>"file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> > > >>>>
> > > >>>>COMPATIBLE_HOST = "^((?!mips).*)$"
> > > >>>>
> > > >>>>DEPENDS = "openssl"
> > > >>>>RDEPENDS_${PN} = "libcrypto"
> > > >>>>
> > > >>>>PACKAGECONFIG ??= "platform_linux_generic"
> > > >>>>PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> > > >>>>PACKAGECONFIG[platform_linux_generic] =
> > > >>>>"--with-platform=linux-generic,,,"
> > > >>>>PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> > > >>>>PACKAGECONFIG[platform_linux_keystone2] =
> > > >>>>"--with-platform=linux-keystone2,,,"
> > > >>>
> > > >>>Don't we need to add a recipe for dpdk to build linux-dpdk and
> > > >>>a recipe for OpenEM
> > > >>>to build linux-keystone2?
> > > >>
> > > >>We do need a recipe for dpdk, keystone2 but I am not familiar with
> > > >>keystone2, if it is dpdk I am fine but it will take some time to write
> > > >>one, not like this recipe it will take only 1 or 2 hours.
> > > >>
> > > >>As dpdk exists for a while, I am guessing there should be a recipe
> > > >>available somewhere.
> > > >>When these platforms used, special [C|LD]flags might be needed.
> > > >>
> > > >dpdk is already part of yocto's meta-intel layer.
> > > >
> > > >
> > http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/tree/common/recipes-extended/dpdk
> > > >
> > > >So there is no need to create a new one.
> > > >
> > > >Aws\
> > > >>I only tested this with linux generic on mips, arm, x86_64 although
> > mips
> > > >>is not supported and odp doesn't work with qemuarm(armv5).
> > > >>
> > > >>yao
> > > >>>Cheers,
> > > >>>Anders
> > > >>>
> > > >>>>
> > > >>>>S = "${WORKDIR}/git"
> > > >>>>
> > > >>>>inherit autotools
> > > >>>>
> > > >>>>do_configure_prepend () {
> > > >>>>./bootstrap
> > > >>>>}
> > > >>>>
> > >
> > >>>>------------------------------------------------------------------------
> > > >>>>
> > > >>>>*From:* Anders Roxell <anders.roxell@linaro.org
> > > >>>><mailto:anders.roxell@linaro.org>>
> > > >>>>*Sent:* Tuesday, July 29, 2014 3:21AM
> > > >>>>*To:* Robbie King (robking) <robking@cisco.com
> > > >>>><mailto:robking@cisco.com>>
> > > >>>>*Cc:* Zhao, Yao, Taras Kondratiuk
> > > >>>><taras.kondratiuk@linaro.org
> > > >>>><mailto:taras.kondratiuk@linaro.org>>,
> > > >>>>lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
> > > >>>><lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>>
> > > >>>>*Subject:* Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > > >>>>
> > > >>>>On 2014-07-29 01:35, Robbie King (robking) wrote:
> > > >>>>
> > > >>>>>Here's what I have in "DEPENDENCIES", what do you think?
> > > >>>>>--------------------------------------------------------
> > > >>>>>
> > > >>>>>Prerequisites for building the OpenDataPlane (ODP) API
> > > >>>>>
> > > >>>>>1. Linux kernel >= 3.0
> > > >>>>>
> > > >>>>>Version 3.0+ needed for the sendmmsg() interface
> > > >>>>>
> > > >>>>>2. autotools
> > > >>>>><
> > > >>>>>automake
> > > >>>>>autoconf
> > > >>>>>autoconf-archive
> > > >>>>>libtool
> > > >>>>>
> > > >>>>>On Debian/Ubuntu systems:
> > > >>>>>$ sudo apt-get install automake autoconf autoconf-archive libtool
> > > >>>>>
> > > >>>>>On CentOS/RedHat/Fedora systems:
> > > >>>>>$ sudo yum install automake autoconf autoconf-archive
> > > >>>>>libtool libtoolize
> > > >>>>>
> > > >>>>>3. required libraries
> > > >>>>>
> > > >>>>>Libraries currently required to link: openssl
> > > >>>>>
> > > >>>>>3.1 native build
> > > >>>>>
> > > >>>>>For native compilation, simply load the necessary
> > > >>>>>libraries using the appropriate
> > > >>>>>tool set.
> > > >>>>>
> > > >>>>>On Debian/Ubuntu systems:
> > > >>>>>$$ sudo apt-get install libssl-dev
> > > >>>>>
> > > >>>>>On CentOS/RedHat/Fedora systems:
> > > >>>>>$ sudo yum install openssl-devel
> > > >>>>>
> > > >>>>>3.2 cross compilation build
> > > >>>>>
> > > >>>>>Cross compilation requires cross compiling the individual
> > > >>>>>libraries. Inn order for
> > > >>>>>a cross compiled executable to run on a target system, one
> > > >>>>>must build the same
> > > >>>>>version as that which is installed on the target rootfs.
> > > >>>>>
> > > >>>>>For example, to build openssl for both 32 and 64 bit compilation:
> > > >>>>># Clone openssl repository
> > > >>>>>$ git clone git://git.openssl.org/openssl.git
> > > >>>>><http://git.openssl.org/openssl.git>
> > > >>>>>$ cd openssl
> > > >>>>>
> > > >>>>># The command "git tag" will list all tags available in the repo.
> > > >>>>>$ git tag
> > > >>>>>
> > > >>>>>## Checkout the specific tag to match openssl library in
> > > >>>>>your target rootfs
> > > >>>>>$ git checkout <tag name>
> > > >>>>>
> > > >>>>># Build and install 64 bit version of openssl
> > > >>>>>$ ./Configure linux-aarch64
> > > >>>>>--cross-compile-prefix=aarch64-linux-gnu- \
> > > >>>>>--prefix=/home/user/src/install-openssl-aarch64
> > > >>>>>$ make
> > > >>>>>$ make install
> > > >>>>>
> > > >>>>>## Build and install 32 bit version of openssl
> > > >>>>>$ ./Configure linux-generic32
> > > >>>>>--cross-compile-prefix=arm-linux-gnueabihf- \
> > > >>>>>--prefix=/home/user/src/install-openssl
> > > >>>>>$ make
> > > >>>>>$ make install
> > > >>>>># You may now build either 32 or 64 bit ODP
> > > >>>>>$ git clone git://git.linaro.org/lng/odp.git
> > > >>>>><http://git.linaro.org/lng/odp.git> odp
> > > >>>>>$ cd odp
> > > >>>>>$ ./bootstrap
> > > >>>>>
> > > >>>>># Build 32 bit version of ODP
> > > >>>>>$ ./configure --host=arm-linux-gnueabihf \
> > > >>>>>--with-openssl-path=/home/user/src/install-openssl
> > > >>>>>$ make
> > > >>>>>
> > > >>>>># Or build 64 bit version of ODP
> > > >>>>>$ ./configure --host=aarch64-linux-gnu \
> > > >>>>>--with-openssl-path=/home/user/src/install-openssl-aarch64
> > > >>>>>$ make
> > > >>>>
> > > >>>>Looks good!
> > > >>>>Just a minor nit:
> > > >>>>Maybe we should move 64 bit version of ODP above 32 bit or move 64
> > bit
> > > >>>>version of openssl below 32 bit version?
> > > >>>>
> > > >>>>
> > > >>>>Cheers,
> > > >>>>Anders
> > > >>>>
> > > >>>>>-----Original Message-----
> > > >>>>>From: Anders Roxell [mailto:anders.roxell@linaro.org]
> > > >>>>>Sent: Monday, July 28, 2014 1:19 PM
> > > >>>>>To: Robbie King (robking)
> > > >>>>>Cc: Yao Zhao; Taras Kondratiuk; lng-odp@lists.linaro.org
> > > >>>>><mailto:lng-odp@lists.linaro.org>
> > > >>>>>Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > > >>>>>
> > > >>>>>On 2014-07-26 15:49, Robbie King (robking) wrote:
> > > >>>>>>So is the solution here to split the section I added for
> > > >>>>>>"crypto" in the DEPENDENCIES
> > > >>>>>>file to have a "native" and a "cross compile"
> > > >>>>>>subsection? Under the cross compile
> > > >>>>>>subsection we can then list the steps we've discussed so
> > > >>>>>>for that will hopefully
> > > >>>>>>cross compile a libodp.a that is compatible with the user's rootfs.
> > > >>>>>I'm sorry for the late reply!
> > > >>>>>
> > > >>>>>Yup, that sounds good with the subsections.
> > > >>>>>
> > > >>>>>Maybe section 3 should say something else than "crypto" if
> > > >>>>>we need to add
> > > >>>>>more dependencies like crypto in the future, unsure what we should
> > say
> > > >>>>>though. =/
> > > >>>>>Ideas what we can say?
> > > >>>>>
> > > >>>>>Cheers,
> > > >>>>>Anders
> > > >>>>>
> > > >>>>>>-----Original Message-----
> > > >>>>>>From: Anders Roxell [mailto:anders.roxell@linaro.org]
> > > >>>>>>Sent: Saturday, July 26, 2014 11:17 AM
> > > >>>>>>To: Yao Zhao
> > > >>>>>>Cc: Robbie King (robking); Taras Kondratiuk;
> > > >>>>>>lng-odp@lists.linaro.org
> > > >>>>>><mailto:lng-odp@lists.linaro.org>
> > > >>>>>>Subject: Re: [lng-odp] [PATCH 0/3] ODP Crypto API
> > > >>>>>>
> > > >>>>>>On 2014-07-25 15:43, Yao Zhao wrote:
> > > >>>>>>>[Re: [lng-odp] [PATCH 0/3] ODP Crypto API] On
> > > >>>>>>>25/07/2014 (Fri 16:18) Robbie King (robking) wrote:
> > > >>>>>>>
> > > >>>>>>>>I agree we need to add something for cross compiling. My
> > apologies
> > > >>>>>>>>for my limited knowledge of cross compiling. If the
> > > >>>>>>>>user builds/links
> > > >>>>>>>>against the latest openssl libcrypto from git, will
> > > >>>>>>>>it always work if the
> > > >>>>>>>>executable is then run on a system with a packaged openssl
> > library?
> > > >>>>>>>No, it won't.
> > > >>>>>>>In theory you link with which then you run with which.
> > > >>>>>>>
> > > >>>>>>>Normally you just make it work with native environment.
> > > >>>>>>>Distribution which supports cross compile will make it
> > > >>>>>>>work for target
> > > >>>>>>>environment.
> > > >>>>>>>
> > > >>>>>>>For OE/yocto, we can write a recipe to cross compile
> > > >>>>>>>it, it will link
> > > >>>>>>>against the openssl which will be put on target.
> > > >>>>>>You seem to be talking two different things.
> > > >>>>>>
> > > >>>>>>1. Robbie, you seem to be asking about ABI stability, so
> > > >>>>>>the answer is
> > > >>>>>>no, you can't expect it to work. However, you can (should) checkout
> > > >>>>>>the specific release tag of openssl, that you expect to be on the
> > > >>>>>>rootfs, to compile against.
> > > >>>>>>I forgot in my previous mail to mention this.
> > > >>>>>>
> > > >>>>>>Commands or doing that:
> > > >>>>>># git tag will list all tags available in the repo.
> > > >>>>>>$ git tag
> > > >>>>>># Checkout a specific tag.
> > > >>>>>>$ git checkout <tag name>
> > > >>>>>>
> > > >>>>>>2. Yao, you seem to be talking about cross compiling in
> > > >>>>>>a general sense.
> > > >>>>>>However, that doesn't seem to be related to the original question,
> > > >>>>>>even though the information was correct and useful.
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>Cheers,
> > > >>>>>>Anders
> > > >>>>>--
> > > >>>>>Anders Roxell
> > > >>>>>anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
> > > >>>>>M: +46 709 71 42 85 | IRC: roxell
> > > >>>
> > > >>>>require opendataplane.inc
> > > >>>>
> > > >>>>SRCREV = "${AUTOREV}"
> > > >>>>SRC_URI = "git://git.linaro.org/lng/odp.git
> > > >>>><http://git.linaro.org/lng/odp.git>"
> > > >>>
> > > >>>>SUMMARY = "Cross platform Open Data Plane application APIs"
> > > >>>>
> > > >>>>DESCRIPTION = "The OpenDataPlane project has been established to \
> > > >>>>produce an open-source, cross-platform set of application \
> > > >>>>programming interfaces (APIs) for the networking data plane."
> > > >>>>
> > > >>>>HOMEPAGE = "http://www.opendataplane.org"
> > > >>>>SECTION = "networking"
> > > >>>>LICENSE = "BSD-3-Clause"
> > > >>>>LIC_FILES_CHKSUM =
> > > >>>>"file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
> > > >>>>
> > > >>>>COMPATIBLE__HOST = "^((?!mips).*)$"
> > > >>>>
> > > >>>>DEPENDS = "openssl"
> > > >>>>RDEPENDS_${PN} = "libcrypto"
> > > >>>>
> > > >>>>PACKAGECONFIG ??= "platform_linux_generic"
> > > >>>>PACKAGECONFIG[netmap] = "--enable-netmap,,,"
> > > >>>>PACKAGECONFIG[platform_linux_generic] =
> > > >>>>"--with-platform=linux-generic,,,"
> > > >>>>PACKAGECONFIG[platform_linux_dpdk] = "--with-platform=linux-dpdk,,,"
> > > >>>>PACKAGECONFIG[platform_linux_keystone2] =
> > > >>>>"--with-platform=linux-keystone2,,,"
> > > >>>>
> > > >>>>S = "${WORKDIR}/git"
> > > >>>>
> > > >>>>inherit autotools
> > > >>>>
> > > >>>>do_configure_prepend () {
> > > >>>>./bootstrap
> > > >>>>}
> > > >>>
> > > >>>
> > > >>>--
> > > >>>Anders Roxell
> > > >>>anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
> > > >>>M: +46 709 71 42 85 | IRC: roxell
> > > >>
> > > >>_______________________________________________
> > > >>lng-odp mailing list
> > > >>lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
> > > >>http://lists.linaro.org/mailman/listinfo/lng-odp
> > > >
> > > >
> > > >
> > > >_______________________________________________
> > > >lng-odp mailing list
> > > >lng-odp@lists.linaro.org
> > > >http://lists.linaro.org/mailman/listinfo/lng-odp
> > >
> > >
> > > _______________________________________________
> > > lng-odp mailing list
> > > lng-odp@lists.linaro.org
> > > http://lists.linaro.org/mailman/listinfo/lng-odp
> >
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
> >
> 
> 
> 
> -- 
> *Mike Holmes*
> Linaro Technical Manager / Lead
> LNG - ODP

> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 95d5bdf..8cf4a83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,10 +90,18 @@  AM_LDFLAGS="$AM_LDFLAGS $PTHREAD_LDFLAGS"
 # Check for openssl availability
 ##########################################################################
 
+AC_ARG_WITH([openssl-path],
+AC_HELP_STRING([--with-openssl-path=DIR Path to openssl libs and headers],
+               [(or in the default path if not specified).]),
+[OPENSSL_PATH=$withval
+AM_CFLAGS="$AM_CFLAGS -I$OPENSSL_PATH/include"
+AM_LDFLAGS="$AM_LDFLAGS -L$OPENSSL_PATH/lib"
+],[
 AC_CHECK_LIB([crypto], [EVP_EncryptInit], [],
              [AC_MSG_FAILURE([can't find openssl crypto lib])])
 AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], [],
              [AC_MSG_FAILURE([can't find openssl crypto headers])])
+   ])
 
 ##########################################################################
 # Default warning setup