Commit Graph

82 Commits

Author SHA1 Message Date
Andrew Rybchenko
dfc6b2fd8d mbuf: remove Intel offload checks from generic API
rte_validate_tx_offload() is used in Tx prepare callbacks
(RTE_LIBRTE_ETHDEV_DEBUG only) to check Tx offloads consistency.
Requirement that packet headers should not be fragmented is not
documented and unclear where it comes from except
rte_net_intel_cksum_prepare() functions which relies on it.

It could be NIC vendor specific driver or hardware limitation, but,
if so, it should be documented and checked in corresponding Tx
prepare callbacks.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-04-02 16:42:52 +02:00
Nemanja Marjanovic
a2fe4c1b38 net: add PPPoE ethertypes
Add PPPoE ethertypes in to rte_ether.h.

Signed-off-by: Nemanja Marjanovic <nemanja.marjanovic@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2019-03-29 20:55:25 +01:00
Konstantin Ananyev
19b08e5406 net: add ESP trailer structure definition
define esp_tail structure.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-01-10 16:57:22 +01:00
Bruce Richardson
8743d499a5 net: fix underflow for checksum of invalid IPv4 packets
If we receive a packet with an invalid IP header, where the total packet
length is reported as less than the IP header length, we would end up
getting an underflow in the length subtraction.

This could cause us to checksum e.g. 4GB of data in the case where the
result of the subtraction was -1.

We fix this by having the function return 0 - an invalid sum - when
the length is less than the header length.

Fixes: af75078fec ("first public release")
Fixes: 6006818cfb ("net: new checksum functions")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-12-21 16:22:41 +01:00
Ferruh Yigit
9eb0688412 lib: fix shifting 32-bit signed variable 31 times
Fix cppcheck warning by marking variable as unsigned.

Fixes: dc276b5780 ("acl: new library")
Fixes: 986ff526fb ("net: add CRC computation API")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-06 01:14:05 +01:00
Shahaf Shuler
be685863a9 net: fix build with pedantic
The following error popped when compiling with -pedantic:

In file included from
 drivers/net/mlx5/mlx5_flow_dv.c:28:0:
 include/rte_gre.h:20:2:
 error: type of bit-field 'res2' is a GCC  extension [-Werror=pedantic]
 uint16_t res2:4; /**< Reserved */

Fixing by adding the __extension__ attribute.

Fixes: 894f71a380 ("net: add GRE header structure")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-05 15:01:25 +01:00
Ferruh Yigit
b74fd6b842 add missing static keyword to globals
Some global variables can indeed be static, add static keyword to them.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-29 02:01:08 +01:00
Olivier Matz
140af04e63 net: support MPLS in software packet type parser
Add RTE_PTYPE_L2_ETHER_MPLS packet type support in rte_net_get_ptype().

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:06 +02:00
Olivier Matz
e480cf487a net: add MPLS header structure
Add the Mpls header structure in librte_net. It will be used by next
patch that adds the support of Mpls L2 layer in the software packet
type parser.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:06 +02:00
Didier Pallard
ae0207d4b5 net: fix Intel prepare function for IP checksum offload
Current Intel tx prepare function does not properly handle the
case where only IP checksum is requested, without requesting
any L4 checksum or TSO: IP checksum is not properly reset to 0
and output packet may contain invalid IP checksum.

Fixes: 4fb7e803eb ("ethdev: add Tx preparation")
Cc: stable@dpdk.org

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2018-09-28 01:41:02 +02:00
Gage Eads
68248ad1b9 net: rename u16 to fix shadowed declaration
This patch renames u16 to u16_buf. u16 as a variable name causes a shadowed
declaration warning if, for example, the application also typedefs u16
(e.g. by including a header containing "typedef unsigned short u16") and
the application is built with -Wshadow.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-06-27 22:55:54 +02:00
Andy Green
f37a2e7c74 net: explicit cast in L4 checksum
GCC 8.1 warned:

In function 'rte_ipv4_udptcp_cksum':
rte_byteorder.h:51:24: warning: conversion from 'long unsigned int' to
'uint32_t' {aka 'unsigned int'} may change value [-Wconversion]
 #define rte_bswap16(x) ((uint16_t) (__builtin_constant_p(x) ?  \
                        ^
rte_byteorder.h:85:29: note: in expansion of macro 'rte_bswap16'
 #define rte_be_to_cpu_16(x) rte_bswap16(x)
                             ^~~~~~~~~~~
rte_ip.h:321:11: note: in expansion of macro 'rte_be_to_cpu_16'
  l4_len = rte_be_to_cpu_16(ipv4_hdr->total_length) -
           ^~~~~~~~~~~~~~~~

Also with this one, it is a cast that always occurred
and is just being done explicitly, with no changes to
the generated code.

The warning stack is misleading, it points to the last
element in the macro that produced the lhs of the subtraction
above.  But the only "unsigned long int" in the expression is
the result of the sizeof() on the rhs, it promotes the
subtraction result to unsigned long.  So the error actually
relates to the result of the outer subtraction.

The actual error is "you are trying to put an unsigned long
into a uint32_t".  We always did so, the fix is just to inform
the compiler it is intentional with an explicit cast.

Fixes: 6006818cfb ("net: new checksum functions")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-05-22 16:27:09 +02:00
Andy Green
8bf255bb38 net: explicit cast of protocol in IPv6 checksum
GCC 8.1 warned:

In function 'rte_ipv6_phdr_cksum':
rte_ip.h:378:18: warning: conversion to 'uint32_t' {aka 'unsigned int'}
from 'int' may change the sign of the result [-Wsign-conversion]
  psd_hdr.proto = (ipv6_hdr->proto << 24);

Fixes: 6006818cfb ("net: new checksum functions")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
2018-05-21 00:21:34 +02:00
Andy Green
466de6d5d8 net: explicit cast of IP checksum to 16-bit
GCC 8.1 warned:

In function 'rte_raw_cksum_mbuf':
rte_ip.h:225:22: warning: conversion from 'uint32_t'
{aka 'unsigned int'} to 'uint16_t' {aka 'short unsigned int'}
may change value [-Wconversion]
    tmp = rte_bswap16(tmp);
                      ^~~

In function 'rte_ipv4_cksum':
rte_ip.h:256:35: warning: conversion from 'int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
  return (cksum == 0xffff) ? cksum : ~cksum;
         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

rte_ip.h:332:9: warning: conversion from 'uint32_t'
{aka 'unsigned int'} to 'uint16_t' {aka 'short unsigned int'}
may change value [-Wconversion]
  return cksum;
         ^~~~~

In function 'rte_ipv6_udptcp_cksum':
rte_ip.h:421:9: warning: conversion from 'uint32_t' {aka 'unsigned int'}
to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion]
  return cksum;
         ^~~~~

Fixes: 6006818cfb ("net: new checksum functions")
Fixes: 4199fdea60 ("mbuf: generic support for TCP segmentation offload")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
2018-05-21 00:21:30 +02:00
Andy Green
beb4076567 net: explicit cast of multicast bit clearing
GCC 8.1 warned:

rte_ether.h:213:13:
warning: conversion from 'int' to 'uint8_t'
{aka 'unsigned char'} may change value [-Wconversion]
  addr[0] &= ~ETHER_GROUP_ADDR;

Fixes: 7ef0072910 ("ethdev: random MAC address")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-05-21 00:21:24 +02:00
Ferruh Yigit
04db1d0da7 lib: clear experimental version tag in linker scripts
Remove version tag from experimental block in linker version scripts
(.map files).

That label is not used by linker and information only. It is useful
for version blocks but not useful for experimental block but confusing.
Removing those labels.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2018-05-14 03:37:28 +02:00
Andy Green
5a7e5accc6 net: move stack variable at top of VLAN strip function
In function 'rte_vlan_strip':
rte_ether.h:357:2:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  struct vlan_hdr *vh = (struct vlan_hdr *)(eh + 1);

Fixes: c974021a59 ("ether: add soft vlan encap/decap")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
2018-05-13 22:45:25 +02:00
Xueming Li
6f99e5b54e ethdev: introduce new tunnel VXLAN-GPE
VXLAN-GPE enables VXLAN for all protocols. Protocol link:
https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-05.txt

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-04-27 18:00:55 +01:00
Adrien Mazarguil
e58638c324 ethdev: fix TPID handling in flow API
TPID handling in rte_flow VLAN and E_TAG pattern item definitions is not
consistent with the normal stacking order of pattern items, which is
confusing to applications.

Problem is that when followed by one of these layers, the EtherType field
of the preceding layer keeps its "inner" definition, and the "outer" TPID
is provided by the subsequent layer, the reverse of how a packet looks like
on the wire:

 Wire:     [ ETH TPID = A | VLAN EtherType = B | B DATA ]
 rte_flow: [ ETH EtherType = B | VLAN TPID = A | B DATA ]

Worse, when QinQ is involved, the stacking order of VLAN layers is
unspecified. It is unclear whether it should be reversed (innermost to
outermost) as well given TPID applies to the previous layer:

 Wire:       [ ETH TPID = A | VLAN TPID = B | VLAN EtherType = C | C DATA ]
 rte_flow 1: [ ETH EtherType = C | VLAN TPID = B | VLAN TPID = A | C DATA ]
 rte_flow 2: [ ETH EtherType = C | VLAN TPID = A | VLAN TPID = B | C DATA ]

While specifying EtherType/TPID is hopefully rarely necessary, the stacking
order in case of QinQ and the lack of documentation remain an issue.

This patch replaces TPID in the VLAN pattern item with an inner
EtherType/TPID as is usually done everywhere else (e.g. struct vlan_hdr),
clarifies documentation and updates all relevant code.

It breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_query()
- rte_flow_validate()

Summary of changes for PMDs that implement ETH, VLAN or E_TAG pattern
items:

- bnxt: EtherType matching is supported with and without VLAN, but TPID
  matching is not and triggers an error.

- e1000: EtherType matching is only supported with the ETHERTYPE filter,
  which does not support VLAN matching, therefore no impact.

- enic: same as bnxt.

- i40e: same as bnxt with existing FDIR limitations on allowed EtherType
  values. The remaining filter types (VXLAN, NVGRE, QINQ) do not support
  EtherType matching.

- ixgbe: same as e1000, with additional minor change to rely on the new
  E-Tag macro definition.

- mlx4: EtherType/TPID matching is not supported, no impact.

- mlx5: same as bnxt.

- mvpp2: same as bnxt.

- sfc: same as bnxt.

- tap: same as bnxt.

Fixes: b1a4b4cbc0 ("ethdev: introduce generic flow API")
Fixes: 99e7003831 ("net/ixgbe: parse L2 tunnel filter")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:54 +01:00
Didier Pallard
8f0e4d6a78 net: export IPv6 header extensions skip function
skip_ip6_ext function can be exported as a helper, it may be used
by some PMD to skip IPv6 header extensions.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2018-04-27 17:34:41 +01:00
Shahaf Shuler
5feecc57d9 align SPDX Mellanox copyrights
Aligning Mellanox SPDX copyrights to a single format.
In addition replace to SPDX licence files which were missed.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-04-11 01:47:47 +02:00
Olivier Matz
85ebc09bad net: use SPDX tags
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-02-01 02:27:22 +01:00
Bruce Richardson
6c9457c279 build: replace license text with SPDX tag
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
2018-01-30 21:58:59 +01:00
Bruce Richardson
5b9656b157 lib: build with meson
Add non-EAL libraries to DPDK build. The compat lib is a special case,
along with the previously-added EAL, but all other libs can be build using
the same set of commands, where the individual meson.build files only need
to specify their dependencies, source files, header files and ABI versions.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
2018-01-30 17:49:16 +01:00
Neil Horman
77b7b81e32 add experimental tag to appropriate functions
Append the __rte_experimental tag to api calls appearing in the
EXPERIMENTAL section of their libraries version map

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:35:29 +01:00
Xiao Wang
c09141e56f net: fix RARP generation
Due to a mistake operation from me, older version (v10) was merged to
master branch. It's the v11 should be applied. However, the master branch
is not rebase-able. Thus, this patch is made, from the diff between v10
and v11.

The diffs are:

- Add check for parameter and tailroom in rte_net_make_rarp_packet
- Allocate mbuf in rte_net_make_rarp_packet

Besides that, a link error is fixed when shared lib is enabled.

Fixes: 45ae05df82 ("net: add a helper for making RARP packet")
Fixes: c3ffdba0e8 ("vhost: use API to make RARP packet")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-21 15:51:52 +01:00
Shachar Beiser
9b20c6e902 net: add IPv6 header fields macros
Support IPv6 header vtc_flow fields : tc , flow_label

Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-01-21 15:51:52 +01:00
Nélio Laranjeiro
68bda436a3 net: fix ESP header byte ordering definition
ESP header is defined in the RFC2406 [1] as Big Endian fields it should use
the corresponding types in DPDK as well.

[1] https://tools.ietf.org/html/rfc2406

Fixes: d4b684f719 ("net: add ESP header to generic flow steering")
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-01-20 16:10:53 +01:00
Xiao Wang
45ae05df82 net: add a helper for making RARP packet
Suggested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-01-16 18:47:49 +01:00
Jerin Jacob
baf3d63c15 lib: use SPDX tag for Cavium copyright files
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-09 16:19:01 +01:00
Olivier Matz
fa620b86e3 net: update licence for network headers
To be compliant with the DPDK licensing guidelines, switch to
BSD-3-Clause. It can be done safely since the BSD headers from which
these files derive also exist as a BSD-3-Clause license in FreeBSD.

Link: https://raw.githubusercontent.com/freebsd/freebsd/78a6b0861813af31e1354fa407c5701e8764b4d6/sys/netinet/ip_icmp.h
Link: https://raw.githubusercontent.com/freebsd/freebsd/78a6b0861813af31e1354fa407c5701e8764b4d6/sys/netinet/ip.h
Link: https://raw.githubusercontent.com/freebsd/freebsd/78a6b0861813af31e1354fa407c5701e8764b4d6/sys/netinet/sctp.h
Link: https://raw.githubusercontent.com/freebsd/freebsd/78a6b0861813af31e1354fa407c5701e8764b4d6/sys/netinet/tcp.h
Link: https://raw.githubusercontent.com/freebsd/freebsd/78a6b0861813af31e1354fa407c5701e8764b4d6/sys/netinet/udp.h

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-05 19:23:29 +01:00
Bruce Richardson
369991d997 lib: use SPDX tag for Intel copyright files
Replace the BSD license header with the SPDX tag for files
with only an Intel copyright on them.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-01-04 22:41:39 +01:00
Pavel Shirshov
e32cb57973 lib: fix typos
Signed-off-by: Pavel Shirshov <pavel.shirshov@gmail.com>
2017-11-13 06:26:17 +01:00
Thomas Monjalon
17715a5339 use macro to declare constructor functions
It is easier to find all constructor functions when they use
the same macros RTE_INIT or RTE_INIT_PRIO.

The macro definitions are moved from rte_eal.h to rte_common.h.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2017-11-06 21:56:07 +01:00
Olivier Matz
380a7aab1a mbuf: rename deprecated VLAN flags
PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated for a while.
As explained in [1], these flags were kept to let the applications and
PMDs move to the new flag. There is also a need to support Rx vlan
offload without vlan strip (at least for the ixgbe driver).

This patch renames the old flags for this feature, knowing that some
PMDs were using PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT to indicate that
the vlan tci has been saved in the mbuf structure.

It is likely that some PMDs do not set the proper flags when doing vlan
offload, and it would be worth making a pass on all of them.

Link: [1] http://dpdk.org/ml/archives/dev/2017-June/067712.html

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-26 02:33:01 +02:00
Boris Pismenny
d4b684f719 net: add ESP header to generic flow steering
The ESP header is required for IPsec crypto actions.

Signed-off-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com>
2017-10-26 03:09:59 +02:00
Olivier Matz
cbc12b0a96 mk: do not generate LDLIBS from directory dependencies
The list of libraries in LDLIBS was generated from the DEPDIRS-xyz
variable. This is valid when the subdirectory name match the library
name, but it's not always the case, especially for PMDs.

The patches removes this feature and explicitly adds the proper
libraries in LDLIBS.

Some DEPDIRS-xyz variables become useless, remove them.

Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
2017-10-24 02:14:57 +02:00
Olivier Matz
b081c1dd2e net: fix inner L2 length in packet type parser
The inner L2 length returned by rte_net_get_ptype() is not
properly initialized. If the caller does not zero the header
lengths structure, the inner_l2 field will be undefined.

Fix it by initializing inner_l2 to 0 when parsing a inner layer.

Fixes: 2c15c5377d ("net: support NVGRE in software packet type parser")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-10-05 23:34:45 +02:00
Jerin Jacob
3abcd29f2d update Cavium Inc copyright headers
Replace the incorrect reference to "Cavium Networks", "Cavium Ltd"
company name with correct the "Cavium, Inc" company name in
copyright headers.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-07-08 17:43:49 +02:00
Ashwin Sekhar T K
a566400e8b net: implement CRC for ARM64 NEON
Added CRC compute APIs for arm64 utilizing the pmull
capability.

Added new file net_crc_neon.h to hold the arm64 pmull
CRC implementation.

Added wrappers in rte_vect.h for those neon intrinsics
which are not supported in GCC version < 7.

Verified the changes with crc_autotest unit test case

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Acked-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 15:58:45 +02:00
Bruce Richardson
e08555a041 net: remove check for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:35:41 +02:00
Jerin Jacob
c0583d98a9 eal: introduce macro for always inline
Different drivers use internal macros like force_inline for compiler
always inline feature.
Standardizing it through __rte_always_inline macro.

Verified the change by comparing the output binary file.
No difference found in the output binary file with this change.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-06 17:21:55 +02:00
Bruce Richardson
b66c229db2 net: fix missing break in CRC switch
The #ifdef only had the break in the else leg rather than in the first leg,
leading to the value set their being overridden on fall-through.

Fixes: 986ff526fb ("net: add CRC computation API")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
2017-05-05 18:36:55 +02:00
Beilei Xing
b4325edd9a net/i40e: add LLDP check for ethertype filter
LLDP rule is not supported in ethertype filter.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-05-05 17:19:52 +02:00
Michał Mirosław
47aa48b969 net: fix stripped VLAN flag for offload emulation
Apply the new flag PKT_RX_VLAN_STRIPPED to the software emulation case
(currently only for virtio and af_packet).

Fixes: b37b528d95 ("mbuf: add new Rx flags for stripped VLAN")
Cc: stable@dpdk.org

Signed-off-by: Michał Mirosław <michal.miroslaw@atendesoftware.pl>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-05-05 15:59:40 +02:00
Adrien Mazarguil
089a878fd4 net: fix missing include in exported header
This commit addresses the following errors:

 In file included from /tmp/check-includes.sh.18889.c:1:0:
 build/include/rte_net_crc.h:86:1: error: unknown type name 'uint32_t'
 [...]

Fixes: 986ff526fb ("net: add CRC computation API")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
2017-05-01 00:10:23 +02:00
Stephen Hemminger
c5ba278876 lib: remove unnecessary void cast
Remove unnecessary casts of void * pointers to a specific type.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-04-11 18:05:10 +02:00
Jeff Guo
ff643f7d02 lib: fix IPv6 tunnel checksum
When packet is flag of "PKT_TX_OUTER_IPV6", it also need to be
considered to be tunnel case, in order to calculate the correct
csum value.

Fixes: 2b76648872 ("net/e1000: add Tx preparation")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
2017-04-10 22:49:57 +02:00
Jasvinder Singh
986ff526fb net: add CRC computation API
APIs for selecting the architecure specific implementation and computing
the crc (16-bit and 32-bit CRCs) are added. For CRCs calculation, scalar
as well as x86 intrinsic(sse4.2) versions are implemented.

The scalar version is based on generic Look-Up Table(LUT) algorithm,
while x86 intrinsic version uses carry-less multiplication for
fast CRC computation.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-05 23:03:23 +02:00
Olivier Matz
feb9f680cd mk: optimize directory dependencies
Before this patch, the management of dependencies between directories
had several issues:

- the generation of .depdirs, done at configuration is slow: it can take
  more than one minute on some slow targets (usually ~10s on a standard
  PC without -j).

- for instance, it is possible to express a dependency like:
  - app/foo depends on lib/librte_foo
  - and lib/librte_foo depends on app/bar
  But this won't work because the directories are traversed with a
  depth-first algorithm, so we have to choose between doing 'app' before
  or after 'lib'.

- the script depdirs-rule.sh is too complex.

- we cannot use "make -d" for debug, because the output of make is used for
  the generation of .depdirs.

This patch moves the DEPDIRS-* variables in the upper Makefile, making
the dependencies much easier to calculate. A DEPDIRS variable is still
used to process library dependencies in LDLIBS.

After this commit, "make config" is almost immediate.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Robin Jarry <robin.jarry@6wind.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-03-27 23:28:43 +02:00