Commit Graph

27 Commits

Author SHA1 Message Date
Jerin Jacob
9c99878aa1 log: introduce logtype register macro
Introduce the RTE_LOG_REGISTER macro to avoid the code duplication
in the logtype registration process.

It is a wrapper macro for declaring the logtype, registering it and
setting its level in the constructor context.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-03 15:52:51 +02:00
Jakub Grajciar
0a77baed7b net/memif: enable promiscuous mode
Enable promisc mode

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-04-21 13:57:08 +02:00
Vadim Podovinnikov
321908b6e3 net/memif: fix resource leak
Fixes: c41a04958b ("net/memif: support multi-process")
Cc: stable@dpdk.org

Signed-off-by: Vadim Podovinnikov <podovinnikov@protei.ru>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-04-21 13:57:06 +02:00
Thomas Monjalon
ddf06e8a08 net/memif: use common macros for cache line marker
The macros RTE_MARKER and __rte_cache_aligned can be used
for consistency for describing MEMIF_CACHELINE_ALIGN_MARK.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:07:29 +02:00
Pavan Nikhilesh
acec04c4b2 build: disable experimental API check internally
Remove setting ALLOW_EXPERIMENTAL_API individually for each Makefile and
meson.build. Instead, enable ALLOW_EXPERIMENTAL_API flag across app, lib
and drivers.
This changes reduces the clutter across the project while still
maintaining the functionality of ALLOW_EXPERIMENTAL_API i.e. warning
external applications about experimental API usage.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-04-14 16:22:34 +02:00
Július Milan
06123fdd60 net/memif: fix init when already connected
This patch fixes the situation when there is already connected pair of
memif interfaces and another slave tries to initiate the connection with
(already occupied) master. Expected behavior is that the second slave
is refused and gets disconnect message with reason: "Already connected",
while old connection remains functional.

Fixes: 09c7e63a71 ("net/memif: introduce memory interface PMD")
Cc: stable@dpdk.org

Signed-off-by: Július Milan <jmilan.dev@gmail.com>
Reviewed-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-18 10:21:41 +01:00
Július Milan
cbbbbd3365 net/memif: enable loopback
With this patch it is possible to connect 2 DPDK memifs into loopback,
i.e. when they have the same id and different roles, as for example:
  "--vdev=net_memif0,role=master,id=0"
  "--vdev=net_memif1,role=slave,id=0"

Signed-off-by: Július Milan <jmilan.dev@gmail.com>
Reviewed-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-18 10:21:41 +01:00
Július Milan
19d4c1aee8 net/memif: add link info
This information is useful or needed for user applications as t-rex.

Signed-off-by: Július Milan <jmilan.dev@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-05 09:51:21 +01:00
Pawel Modrak
85ff364f3b build: align symbols with global ABI version
Merge all versions in linker version script files to DPDK_20.0.

This commit was generated by running the following command:

:~/DPDK$ buildtools/update-abi.sh 20.0

Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2019-11-20 23:05:39 +01:00
Anatoly Burakov
fbaf943887 build: remove individual library versions
Since the library versioning for both stable and experimental ABI's is
now managed globally, the LIBABIVER and version variables no longer
serve any useful purpose, and can be removed.

The replacement in Makefiles was done using the following regex:

	^(#.*\n)?LIBABIVER\s*:=\s*\d+\n(\s*\n)?

(LIBABIVER := numbers, optionally preceded by a comment and optionally
succeeded by an empty line)

The replacement for meson files was done using the following regex:

	^(#.*\n)?version\s*=\s*\d+\n(\s*\n)?

(version = numbers, optionally preceded by a comment and optionally
succeeded by an empty line)

[David]: those variables are manually removed for the files:
- drivers/common/qat/Makefile
- lib/librte_eal/meson.build
[David]: the LIBABIVER is restored for the external ethtool example
library.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2019-11-20 23:05:39 +01:00
Jakub Grajciar
43b815d881 net/memif: support zero-copy slave
Zero-copy slave support for memif PMD.
Slave interface exposes DPDK memory to
master interface. Only single file segments
are supported (EAL option --single-file-segments).

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-20 17:36:06 +01:00
Anand Sunkad
ed650f3dd8 net/memif: support multiple Tx
When Multiple slave/master Memif's interfaces are created in single
process data transmission over second connection is not successful.

Issue is because of "mq->in_port" is not initialized with
"dev->data->port_id" in memif_tx_queue_setup() function, and while
transmitting packets over second connection in eth_memif_tx function
it refer "mq->in_port" which is always zero, which leads to data
transmission always in 0th port.

To mitigate the issue,"mq->in_port" is initialized with
"dev->data->port_id" in memif_tx_queue_setup() function.

Signed-off-by: Anand Sunkad <anand.sunkad@benisontech.com>
Reviewed-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-10-25 19:00:22 +02:00
Jakub Grajciar
d803feec8d net/memif: fix Unix domain address length
Define MEMIF_SOCKET_UN_SIZE to size of unix domain socket address.
Report error in case of longer path.

Fixes: b923866c69 ("net/memif: allow for full key size in socket name")

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-25 19:00:22 +02:00
Phil Yang
a2aafb9aa6 net/memif: optimize with one-way barrier
Using 'rte_mb' to synchronize the shared ring head/tail between producer
and consumer will stall the pipeline and damage performance on the weak
memory model platforms, such like aarch64. Meanwhile update the shared
ring head and tail are observable and ordered between CPUs on IA.

Optimized this full barrier with the one-way barrier can improve the
throughput. On aarch64 n1sdp server this patch make testpmd throughput
boost 2.1%. On Intel E5-2640, testpmd got 3.98% performance gain.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-10-23 16:43:09 +02:00
Andrew Rybchenko
abfc0b9f75 net/memif: check status of getting link info
The return value of rte_eth_link_get() was changed from void to int.
Update the usage of the function according to the new return type.

Just log error if something goes wrong.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07 15:00:54 +02:00
Igor Romanov
9970a9ad07 ethdev: make stats and xstats reset callbacks return int
Change return value of the callbacks from void to int. Make
implementations across all drivers return negative errno
values in case of error conditions.

Both callbacks are updated together because a large number of
drivers assign the same function to both callbacks.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-07 15:00:54 +02:00
Stephen Hemminger
b923866c69 net/memif: allow for full key size in socket name
The key size for memif is 256 but the unix domain socket structure has
space for 100 bytes. Change it to use a larger buffer and not hard
code the keysize everywhere.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-10-07 15:00:52 +02:00
Ivan Ilchenko
bdad90d12e ethdev: change device info get callback to return int
Change eth_dev_infos_get_t return value from void to int.
Make eth_dev_infos_get_t implementations across all drivers to return
negative errno values if case of error conditions.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-07 14:45:35 +02:00
Thomas Monjalon
8f64150fa5 drivers: add some reasons for meson disabling
Some drivers were missing reasons text for their disabling in meson.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-09-12 18:32:40 +02:00
Jerin Jacob
de4473d911 net/memif: fix build with gcc 9.1
gcc-9 is stricter on NULL arguments for printf.
Fix the following build error by avoiding NULL argument to printf.

In file included from drivers/net/memif/memif_socket.c:26:
In function 'memif_socket_create',
inlined from 'memif_socket_init' at net/memif/memif_socket.c:965:12:
net/memif/rte_eth_memif.h:35:2: error:
'%s' directive argument is null [-Werror=format-overflow=]
   35 |  rte_log(RTE_LOG_ ## level, memif_logtype, \
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   36 |   "%s(): " fmt "\n", __func__, ##args)
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 09c7e63a71 ("net/memif: introduce memory interface PMD")

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
2019-08-07 10:21:33 +02:00
Phil Yang
9467deff9d net/memif: fix multi-process Tx
When working as a secondary process, it uses eth_memif_rx in PMD egress.
It should be eth_memif_tx.

Fixes: c41a04958b ("net/memif: support multi-process")

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
2019-08-06 11:26:52 +02:00
Jakub Grajciar
10bd0ad512 net/memif: fix error paths
Coverity issue: 343440, 343459, 343464, 343394
Fixes: 09c7e63a71 ("net/memif: introduce memory interface PMD")

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-08-06 10:40:54 +02:00
David Marchand
2e56e7885d net/memif: do not count unsent packets as errors
n_err reflects the number of packets that the driver did not manage to
send.
This is a temporary situation, those packets are not freed and the
application can still retry to send them later.
Hence, we can't count them as transmit failed.

Fixes: 09c7e63a71 ("net/memif: introduce memory interface PMD")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-07-26 15:27:05 +02:00
Stephen Hemminger
4a49dbd1b3 net/memif: use new ethernet address parser
Use rte_ether_unformat_addr rather than sscanf.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-07-08 21:26:52 +02:00
Stephen Hemminger
3bdd09ae07 net: deinline non-critical ethernet functions
Formatting Ethernet address and getting a random value are
not in critical path so they should not be inlined.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-07-08 21:26:52 +02:00
Jakub Grajciar
c41a04958b net/memif: support multi-process
Multi-process support for memif PMD.
Primary process handles connection establishment.
Secondary process queries for memory regions.

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-06-28 20:32:18 +02:00
Jakub Grajciar
09c7e63a71 net/memif: introduce memory interface PMD
Shared memory packet interface (memif) PMD allows for DPDK and any other
client using memif (DPDK, VPP, libmemif) to communicate using shared
memory. The created device transmits packets in a raw format. It can be
used with Ethernet mode, IP mode, or Punt/Inject. At this moment, only
Ethernet mode is supported in DPDK memif implementation. Memif is Linux
only.

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00