[dpdk-dev,v3] mk: gcc -march support for intel processors code names

Message ID 1476135193-4721-1-git-send-email-reshma.pattan@intel.com
State Accepted, archived
Headers show

Commit Message

Reshma Pattan Oct. 10, 2016, 9:33 p.m.
The GCC 4.9 -march option supports the intel code names for processors,
for example -march=silvermont, -march=broadwell.
The RTE_MACHINE config flag can be used to pass code name to
the compiler as -march flag.

Release notes is updated.

Linux and FreeBSD getting started guides are updated with recommended
gcc version as 4.9 and above.

Some of the gmake command examples in sample application guide and driver
guides are updated with gcc version as 4.9.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
 doc/guides/freebsd_gsg/build_dpdk.rst        | 4 ++--
 doc/guides/freebsd_gsg/build_sample_apps.rst | 6 +++---
 doc/guides/linux_gsg/sys_reqs.rst            | 6 +++---
 doc/guides/nics/bnx2x.rst                    | 4 ++--
 doc/guides/nics/qede.rst                     | 2 +-
 doc/guides/rel_notes/release_16_11.rst       | 5 +++++
 mk/target/generic/rte.vars.mk                | 4 ++++
 7 files changed, 20 insertions(+), 11 deletions(-)

v3:
Reverted changes of mk/toolchain/gcc/rte.toolchain-compat.mk.

v2:
Updated Linux and FreeBSD gsg guides, sample application guide and other driver doc
with recommended gcc version as 4.9 and above.

Comments

Thomas Monjalon Oct. 12, 2016, 12:33 p.m. | #1
2016-10-10 22:33, Reshma Pattan:
> The GCC 4.9 -march option supports the intel code names for processors,
> for example -march=silvermont, -march=broadwell.
> The RTE_MACHINE config flag can be used to pass code name to
> the compiler as -march flag.
> 
> Release notes is updated.
> 
> Linux and FreeBSD getting started guides are updated with recommended
> gcc version as 4.9 and above.
> 
> Some of the gmake command examples in sample application guide and driver
> guides are updated with gcc version as 4.9.
> 
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>

Applied, thanks

How the -march=broadwell option will work with icc and clang?
Reshma Pattan Oct. 12, 2016, 1:38 p.m. | #2
Hi

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Wednesday, October 12, 2016 1:34 PM
> To: Pattan, Reshma <reshma.pattan@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3] mk: gcc -march support for intel processors
> code names
> 
> 2016-10-10 22:33, Reshma Pattan:
> > The GCC 4.9 -march option supports the intel code names for
> > processors, for example -march=silvermont, -march=broadwell.
> > The RTE_MACHINE config flag can be used to pass code name to the
> > compiler as -march flag.
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> 
> Applied, thanks
> 
> How the -march=broadwell option will work with icc and clang?

Clang does support broadwell option.
And I do have Icc version" icc (ICC) 16.0.3 20160415" which doesn't support code names.

Any other info you are explicitly looking for?

Thanks,
Reshma
Thomas Monjalon Oct. 12, 2016, 2:20 p.m. | #3
2016-10-12 13:38, Pattan, Reshma:
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > 2016-10-10 22:33, Reshma Pattan:
> > > The GCC 4.9 -march option supports the intel code names for
> > > processors, for example -march=silvermont, -march=broadwell.
> > > The RTE_MACHINE config flag can be used to pass code name to the
> > > compiler as -march flag.
> > >
> > > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > 
> > Applied, thanks
> > 
> > How the -march=broadwell option will work with icc and clang?
> 
> Clang does support broadwell option.
> And I do have Icc version" icc (ICC) 16.0.3 20160415" which doesn't support code names.
> 
> Any other info you are explicitly looking for?

Yes, why are we still supporting ICC?

Clearly this patch does not care about ICC.
Note that it is not an acceptance blocker but it would be interesting
to have some news of ICC from time to time, regarding supported archs
and performance of the generated code.

Patch

diff --git a/doc/guides/freebsd_gsg/build_dpdk.rst b/doc/guides/freebsd_gsg/build_dpdk.rst
index 27f21de..24a9f87 100644
--- a/doc/guides/freebsd_gsg/build_dpdk.rst
+++ b/doc/guides/freebsd_gsg/build_dpdk.rst
@@ -88,7 +88,7 @@  The ports required and their locations are as follows:
 For compiling and using the DPDK with gcc, the compiler must be installed
 from the ports collection:
 
-* gcc: version 4.8 is recommended ``/usr/ports/lang/gcc48``.
+* gcc: version 4.9 is recommended ``/usr/ports/lang/gcc49``.
   Ensure that ``CPU_OPTS`` is selected (default is OFF).
 
 When running the make config-recursive command, a dialog may be presented to the
@@ -164,7 +164,7 @@  For example to compile for FreeBSD use:
    If the compiler binary to be used does not correspond to that given in the
    TOOLCHAIN part of the target, the compiler command may need to be explicitly
    specified. For example, if compiling for gcc, where the gcc binary is called
-   gcc4.8, the command would need to be ``gmake install T=<target> CC=gcc4.8``.
+   gcc4.9, the command would need to be ``gmake install T=<target> CC=gcc4.9``.
 
 Browsing the Installed DPDK Environment Target
 ----------------------------------------------
diff --git a/doc/guides/freebsd_gsg/build_sample_apps.rst b/doc/guides/freebsd_gsg/build_sample_apps.rst
index 2662303..fffc4c0 100644
--- a/doc/guides/freebsd_gsg/build_sample_apps.rst
+++ b/doc/guides/freebsd_gsg/build_sample_apps.rst
@@ -54,7 +54,7 @@  the following variables must be exported:
 
 The following is an example of creating the ``helloworld`` application, which runs
 in the DPDK FreeBSD environment. While the example demonstrates compiling
-using gcc version 4.8, compiling with clang will be similar, except that the ``CC=``
+using gcc version 4.9, compiling with clang will be similar, except that the ``CC=``
 parameter can probably be omitted. The ``helloworld`` example may be found in the
 ``${RTE_SDK}/examples`` directory.
 
@@ -72,7 +72,7 @@  in the build directory.
     setenv RTE_SDK $HOME/DPDK
     setenv RTE_TARGET x86_64-native-bsdapp-gcc
 
-    gmake CC=gcc48
+    gmake CC=gcc49
       CC main.o
       LD helloworld
       INSTALL-APP helloworld
@@ -96,7 +96,7 @@  in the build directory.
     cd my_rte_app/
     setenv RTE_TARGET x86_64-native-bsdapp-gcc
 
-    gmake CC=gcc48
+    gmake CC=gcc49
       CC main.o
       LD helloworld
       INSTALL-APP helloworld
diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst
index b321544..3d74342 100644
--- a/doc/guides/linux_gsg/sys_reqs.rst
+++ b/doc/guides/linux_gsg/sys_reqs.rst
@@ -61,8 +61,8 @@  Compilation of the DPDK
 
 *   coreutils: ``cmp``, ``sed``, ``grep``, ``arch``, etc.
 
-*   gcc: versions 4.5.x or later is recommended for ``i686/x86_64``. Versions 4.8.x or later is recommended
-    for ``ppc_64`` and ``x86_x32`` ABI. On some distributions, some specific compiler flags and linker flags are enabled by
+*   gcc: versions 4.9 or later is recommended for all platforms.
+    On some distributions, some specific compiler flags and linker flags are enabled by
     default and affect performance (``-fstack-protector``, for example). Please refer to the documentation
     of your distribution and to ``gcc -dumpspecs``.
 
@@ -82,7 +82,7 @@  Compilation of the DPDK
 .. note::
 
     x86_x32 ABI is currently supported with distribution packages only on Ubuntu
-    higher than 13.10 or recent Debian distribution. The only supported  compiler is gcc 4.8+.
+    higher than 13.10 or recent Debian distribution. The only supported  compiler is gcc 4.9+.
 
 .. note::
 
diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
index 6453168..6d1768a 100644
--- a/doc/guides/nics/bnx2x.rst
+++ b/doc/guides/nics/bnx2x.rst
@@ -162,7 +162,7 @@  To compile BNX2X PMD for FreeBSD x86_64 gcc target, run the following "gmake"
 command::
 
    cd <DPDK-source-directory>
-   gmake config T=x86_64-native-bsdapp-gcc install -Wl,-rpath=/usr/local/lib/gcc48 CC=gcc48
+   gmake config T=x86_64-native-bsdapp-gcc install -Wl,-rpath=/usr/local/lib/gcc49 CC=gcc49
 
 To compile BNX2X PMD for FreeBSD x86_64 gcc target, run the following "gmake"
 command:
@@ -170,7 +170,7 @@  command:
 .. code-block:: console
 
    cd <DPDK-source-directory>
-   gmake config T=x86_64-native-bsdapp-gcc install -Wl,-rpath=/usr/local/lib/gcc48 CC=gcc48
+   gmake config T=x86_64-native-bsdapp-gcc install -Wl,-rpath=/usr/local/lib/gcc49 CC=gcc49
 
 Linux
 -----
diff --git a/doc/guides/nics/qede.rst b/doc/guides/nics/qede.rst
index 53d749c..3af755e 100644
--- a/doc/guides/nics/qede.rst
+++ b/doc/guides/nics/qede.rst
@@ -150,7 +150,7 @@  command::
 
    cd <DPDK-source-directory>
    gmake config T=x86_64-native-bsdapp-gcc install -Wl,-rpath=\
-                                        /usr/local/lib/gcc48 CC=gcc48
+                                        /usr/local/lib/gcc49 CC=gcc49
 
 
 Sample Application Notes
diff --git a/doc/guides/rel_notes/release_16_11.rst b/doc/guides/rel_notes/release_16_11.rst
index 905186a..f55bac4 100644
--- a/doc/guides/rel_notes/release_16_11.rst
+++ b/doc/guides/rel_notes/release_16_11.rst
@@ -89,6 +89,11 @@  New Features
   * AES CBC IV generation with cipher forward function
   * AES GCM/CTR mode
 
+* **Added support for new gcc -march option.**
+
+  The GCC 4.9 ``-march`` option supports the Intel processor code names.
+  The config option ``RTE_MACHINE`` can be used to pass code names to the compiler as ``-march`` flag.
+
 
 Resolved Issues
 ---------------
diff --git a/mk/target/generic/rte.vars.mk b/mk/target/generic/rte.vars.mk
index 75a616a..b31e426 100644
--- a/mk/target/generic/rte.vars.mk
+++ b/mk/target/generic/rte.vars.mk
@@ -50,7 +50,11 @@ 
 #   - can define CPU_ASFLAGS variable (overriden by cmdline value) that
 #     overrides the one defined in arch.
 #
+ifneq ($(wildcard $(RTE_SDK)/mk/machine/$(RTE_MACHINE)/rte.vars.mk),)
 include $(RTE_SDK)/mk/machine/$(RTE_MACHINE)/rte.vars.mk
+else
+MACHINE_CFLAGS := -march=$(RTE_MACHINE)
+endif
 
 #
 # arch: