Commit Graph

13444 Commits

Author SHA1 Message Date
Adrien Mazarguil
b2b0dd9d14 maintainers: fix responsibility of flow API bits
The following commits lack MAINTAINERS entries for this mess.

Fixes: 4d73b6fb99 ("doc: add generic flow API guide")
Fixes: 19c90af628 ("app/testpmd: add flow command")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-05-17 19:06:23 +02:00
Ophir Munk
2ef1c0da89 net/tap: fix isolation mode toggling
Running testpmd command "flow isolae <port> 0" (i.e. disabling flow
isolation) followed by command "flow isolate <port> 1" (i.e. enabling
flow isolation) may result in a TAP error:
PMD: Kernel refused TC filter rule creation (17): File exists

Root cause analysis: when disabling flow isolation we keep the local
rule to redirect packets on TX (TAP_REMOTE_TX index) while we add it
again when enabling flow isolation. As a result this rule is added
two times in a row which results in "File exists" error.
The fix is to identify the "File exists" error and silently ignore it.

Another issue occurs when enabling isolation mode several times in a
row in which case the same tc rules are added consecutively and
rte_flow structs are added to a linked list before removing the
previous rte_flow structs.
The fix is to act upon isolation mode command only when there is a
change from "0" to "1" (or vice versa).

Fixes: f503d26948 ("net/tap: support flow API isolated mode")
Cc: stable@dpdk.org

Reviewed-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2018-05-17 16:01:05 +02:00
Pascal Mazon
a52dfd00c2 maintainers: hand off ownership of tap PMD
I have unfortunately no longer time enough for maintaining Tap PMD.
Keith has kindly volunteered to take over maintainership. He's been at
the origin of this PMD and knows well how it works.

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2018-05-17 15:57:08 +02:00
Maxime Coquelin
c16915b871 vhost: improve dirty pages logging performance
This patch caches all dirty pages logging until the used ring index
is updated.

The goal of this optimization is to fix a performance regression
introduced when the vhost library started to use atomic operations
to set bits in the shared dirty log map. While the fix was valid
as previous implementation wasn't safe against concurrent accesses,
contention was induced.

With this patch, during migration, we have:
1. Less atomic operations as only a single atomic OR operation
per 32 or 64 (depending on CPU) pages.
2. Less atomic operations as during a burst, the same page will
be marked dirty only once.
3. Less write memory barriers.

Fixes: 897f13a1f7 ("vhost: make page logging atomic")
Cc: stable@dpdk.org

Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
2018-05-17 14:19:05 +02:00
Shahaf Shuler
34511c25d5 net/mlx5: fix build without tunnel RSS support
IBV_RX_HASH_INNER should be referenced only when having tunnel support
in the Verbs headers.

Fixes: 80f2d0ed7f ("net/mlx5: add hardware flow debug dump")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
2018-05-17 12:31:42 +02:00
Matan Azrad
1f106da2bf net/mlx5: support MPLS-in-GRE and MPLS-in-UDP
Add support for MPLS over GRE and MPLS over UDP tunnel types as
described in the next RFCs:
1. https://tools.ietf.org/html/rfc4023
2. https://tools.ietf.org/html/rfc7510
3. https://tools.ietf.org/html/rfc4385

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-05-17 12:31:42 +02:00
Shahaf Shuler
dd3331c6f1 net/mlx5: add Bluefield device id
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-05-17 12:31:42 +02:00
Shahaf Shuler
8fe576ad17 net/mlx5: fix flow director drop rule deletion crash
Drop flow rules are created on the ETH queue even though the parser layer
matches the flow rule layer (L3/L4)

Fixes: 6f2f4948b2 ("net/mlx5: fix flow director rule deletion crash")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-05-17 12:31:42 +02:00
Xiao Wang
88e5469ff8 net/virtio-user: fix device init in legacy-mem mode
In legacy-mem mode, memory event callback registering is not supported,
we should not return error in dev_init on this case.

Fixes: 12ecb2f63b ("net/virtio-user: support memory hotplug")

Suggested-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-05-17 12:29:05 +02:00
Tiwei Bie
0230e058e9 net/virtio-user: strip MAC feature when none specified
Currently VIRTIO_NET_F_MAC is set unconditionally when server
mode is used. It should be stripped when MAC isn't specified.

Fixes: bd8f50a45d ("net/virtio-user: support server mode")

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-05-17 12:29:05 +02:00
Tiwei Bie
0b94bc568f net/vhost: do not clear offload flags in Rx
The ol_flags of mbufs returned by rte_vhost_dequeue_burst()
contain necessary offload information. It can't be zeroed.

Fixes: f63d356ee9 ("net/vhost: insert/strip VLAN header in software")
Cc: stable@dpdk.org

Reported-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-05-17 12:29:05 +02:00
Fan Zhang
3c79609fda vhost/crypto: handle virtually non-contiguous buffers
This patch enables the handling of buffers non-contiguous in
virtual address space in the vhost_crypto. Instead of using
rte_vhost_va_from_guest_pa(), the host virtual address is
converted by vhost_iova_to_vva() for wider use cases.

For copy mode, the copy length is limited to the chunk size,
next chunks VAs being fetched afterward.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-05-17 12:29:05 +02:00
Fan Zhang
2017bc3356 vhost/crypto: fix descriptor move
This patch fixes the redundant descriptor move in the copy mode
of vhost crypto. Originally the redundant descriptor move will
cause the message parsing error.

Fixes: 3bb595ecd6 ("vhost/crypto: add request handler")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-05-17 12:29:05 +02:00
Jiayu Hu
6e1e590457 net/virtio-user: fix feature setting with vhost-net backend
When the backend is vhost-net, virtio-user must work in client mode and
needs to request features from the backend in virtio_user_dev_init().
But currently, virtio-user is assigned to default features in this case.

This patch is to fix this inappropriate feature setting.

Fixes: bd8f50a45d ("net/virtio-user: support server mode")

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Zhiyong Yang <zhiyong.yang@intel.com>
2018-05-17 12:28:54 +02:00
Thomas Monjalon
08b7521c35 version: 18.05-rc4
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-05-15 22:38:39 +02:00
Rasesh Mody
03803462f0 net/qede: fix default Tx offload config
Correct the default Tx offload config

Fixes: 946dfd18a4 ("net/qede: convert to new Rx/Tx offloads API")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-05-15 22:33:42 +02:00
Andy Green
f11a4a7d8a net/mlx5: fix uninitialized variable in probing
Fixes: ccdcba53a3 ("net/mlx5: use Netlink to add/remove MAC addresses")

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-05-15 22:29:22 +02:00
Andy Green
52f7664434 net/bnx2x: fix memzone name overrun
Fixes: 540a211084 ("bnx2x: driver core")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-05-15 22:28:12 +02:00
Andy Green
d9b8838ab2 net/bnx2x: fix KR2 device check
In function ‘elink_check_kr2_wa’:
drivers/net/bnx2x/elink.c:12922:28:
error: bitwise comparison always evaluates to false
[-Werror=tautological-compare]
        ((next_page & 0xe0) == 0x2))));

This was fixed elsewhere in 2014

Fixes: b5bf771922 ("bnx2x: driver support routines")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-05-15 22:26:46 +02:00
Andy Green
d88b346d9a net/bnx2x: do not cast function pointers as a policy
This is stopping the compiler telling you when you have
done something stupid... that is something none of us
can afford...

Now gcc 8.x can tell you did something stupid despite
trying to hide the evidence.

Remove all the "black magic" casts.

Fix the actual problems.

Fixes: b5bf771922 ("bnx2x: driver support routines")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-05-15 22:25:17 +02:00
Anatoly Burakov
460354cd4e mempool: fix virtual address population
Currently, populate_virt will check if mempool is already populated.
This will cause inability to reserve multi-chunk mempools if
contiguous memory is not a hard requirement, because if allocating
all-contiguous memory fails, mempool will retry with virtual addresses
and will call populate_virt. It seems that the original code never
anticipated more than one non-physically contiguous area.

Fix it by removing the check in populate virt. populate_anon() function
calls populate_virt() also, and it can be reasonably inferred that it is
expecting that virtual area is not already populated. Even though a
similar check is already in place there, also add the check that was
part of populate_virt() just in case.

Fixes: aab4f62d6c ("mempool: support no hugepage mode")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-05-15 16:30:14 +02:00
Anatoly Burakov
3f697d2ee5 eal: move runtime directory creation after args parsing
The intention of the original code was to create runtime data
directory as early as possible, however it was moved too early,
before the arguments were parsed, resulting in --file-prefix
option essentially not working.

Fix this by moving eal_create_runtime_dir() to after command
line arguments parsing.

Fixes: 56236363b4 ("eal: add directory for runtime data")

Reported-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-05-15 15:22:40 +02:00
Andy Green
52f711f7b8 bus/pci: fix size of driver name buffer
Variable dri_name is a pointer and it is incorrect to use its
size as the buffer size. Caller knows the buffer size and
it is safer to pass it explicitly.

Fixes: fe5f777b53 ("bus/pci: replace strncpy by strlcpy")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-05-15 15:19:13 +02:00
Ferruh Yigit
ff75dd7d65 version: 18.05-rc3
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-05-15 00:03:42 +01:00
Anatoly Burakov
5b18d86dec eal: move runtime data into dedicated directory
Fix all calls to functions in eal_filesystem to produce paths
residing inside dedicated DPDK runtime directory. Leaving DPDK
runtime config in place as 3rd-party applications within the
DPDK ecosystem might rely on this path to determine whether
DPDK is running, so moving that will be postponed to the next
release cycle.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-05-15 00:35:12 +02:00
Anatoly Burakov
56236363b4 eal: add directory for runtime data
Currently, during runtime, DPDK will store a bunch of files here
and there (in /var/run, /tmp or in $HOME). Fix it by creating a
DPDK-specific runtime directory, under which all runtime data
will be placed. The template for creating this runtime directory
is the following:

  <base path>/dpdk/<DPDK prefix>/

Where <base path> is set to either "/var/run" if run as root, or
$XDG_RUNTIME_DIR if run as non-root, with a fallback to /tmp if
$XDG_RUNTIME_DIR is not defined. So, for example, if run as root,
by default all runtime data will be stored at /var/run/dpdk/rte/.

There is no equivalent of "mkdir -p", so we will be creating the
path step by step.

Nothing uses this new path yet, changes for that will come in
next commit.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
2018-05-15 00:35:08 +02:00
Anatoly Burakov
a2a2e499e5 mem: rename function returning hugepage data path
The original name for this path was not too descriptive and
confusing. Rename it to a more appropriate and descriptive name:
it stores data about hugepages, so name it eal_hugepage_data_path().

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
2018-05-15 00:35:02 +02:00
Anatoly Burakov
dcbfbe3c80 eal: remove unused path pattern
The define was a leftover from IVSHMEM library.

Fixes: c711ccb309 ("ivshmem: remove library and its EAL integration")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Marchand <david.marchand@6wind.com>
2018-05-15 00:34:58 +02:00
Andy Green
5831a2198a devtools: provide more generic grep in git check
On Fedora 28, every patch is faulted for
"Wrong headline uppercase", because [A-Z] is not
always case sensitive.

Change to use [[:upper:]]

Signed-off-by: Andy Green <andy@warmcat.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-05-14 23:32:23 +02:00
Andy Green
f2790f9cf8 app/bbdev: use strcpy for allocated string
app/test-bbdev/test_bbdev_vector.c:895:3:
  error: ‘strncpy’ output truncated before terminating nul copying as
  many bytes from a string as its length [-Werror=stringop-truncation]
   strncpy(entry, line, strlen(line));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

app/test-bbdev/test_bbdev_vector.c:917:5:
  error: ‘strncat’ output truncated before terminating nul copying as
  many bytes from a string as its length [-Werror=stringop-truncation]
   strncat(entry, line, strlen(line));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: f714a18885 ("app/testbbdev: add test application for bbdev")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-05-14 23:32:23 +02:00
Andy Green
3cef37eb98 app/procinfo: fix sprintf overrun
app/proc-info/main.c: In function ‘nic_xstats_display’:
app/proc-info/main.c:495:45: error:
‘%s’ directive writing up to 255 bytes into a regioni of size between 165 and 232
[-Werror=format-overflow=]
    sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%"
                                             ^~
     PRIu64"\n", host_id, port_id, counter_type,
                                   ~~~~~~~~~~~~
app/proc-info/main.c:495:4: note:
‘sprintf’ output between 31 and 435 bytes into a destination of size 256
    sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     PRIu64"\n", host_id, port_id, counter_type,
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     xstats_names[i].name, values[i]);

Fixes: 2deb6b5246 ("app/procinfo: add collectd format and host id")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-05-14 23:32:23 +02:00
Andy Green
d7a13d2d1c net/vdev_netvsc: replace strncpy by strlcpy
Continue snprintf to strlcpy conversions started by commit
c022cb400e ("convert snprintf to strlcpy").

Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-05-14 23:32:23 +02:00
Andy Green
2e4d2e563f net/vdev_netvsc: readlink inputs cannot be aliased
drivers/net/vdev_netvsc/vdev_netvsc.c:335:2:error:
passing argument 2 to restrict-qualified parameter aliases with argument 1
  ret = readlink(buf, buf, size);
  ^~~

Fixes: e7dc5d7bec ("net/vdev_netvsc: implement core functionality")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-05-14 23:32:23 +02:00
Andy Green
ed5b98483a net/sfc: make sure that stats name is nul-terminated
Fixes: 73280c1e4f ("net/sfc: support xstats retrieval by ID")
Fixes: 7b9891769f ("net/sfc: support extended statistics")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-05-14 23:32:23 +02:00
Andy Green
f28742ba06 net/qede: fix strncpy
drivers/net/qede/qede_main.c: In function ‘qed_slowpath_start’:
drivers/net/qede/qede_main.c:307:3: error:
‘strncpy’ output may be truncated copying 12 bytes from a string of length 127
[-Werror=stringop-truncation]
   strncpy((char *)drv_version.name, (const char *)params->name,
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    MCP_DRV_VER_STR_SIZE - 4);
    ~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 86a2265e59 ("qede: add SRIOV support")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-05-14 23:32:23 +02:00
Andy Green
0fa4f3eeef net/qede: replace strncpy by strlcpy
Fixes: 8427c66479 ("net/qede/base: add attention formatting string")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-05-14 23:32:23 +02:00
Andy Green
1bcb5ecb17 net/nfp: fix memcpy out of source range
drivers/net/nfp/nfp_net.c:669:2: error:
‘memcpy’ forming offset [5, 6] is out of the bounds [0, 4]
of object ‘tmp’ with type ‘uint32_t’ {aka ‘unsigned int’}
[-Werror=array-bounds]
memcpy(&hw->mac_addr[0], &tmp, sizeof(struct ether_addr));

Fixes: e6decee382 ("net/nfp: use random MAC address if not configured")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Tested-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-05-14 23:32:23 +02:00
Andy Green
62280b7819 net/nfp: fix off-by-one and no nul on strncpy use
drivers/net/nfp/nfpcore/nfp_resource.c:76:2:error:
‘strncpy’ output may be truncated copying 8 bytes from a string of length 8
[-Werror=stringop-truncation]
  strncpy(name_pad, res->name, sizeof(name_pad));

Fixes: c7e9729da6 ("net/nfp: support CPP")

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-05-14 23:32:23 +02:00
Andy Green
01077fa9ac net/nfp: fix strncpy misuse
Fixes: c7e9729da6 ("net/nfp: support CPP")

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Tested-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-05-14 23:32:23 +02:00
Andy Green
a74640c468 net/nfp: fix buffer overflow of FW strings
drivers/net/nfp/nfp_net.c: In function ‘nfp_pf_pci_probe’:
drivers/net/nfp/nfp_net.c:3160: 23: error:
‘%s’ directive writing up to 99 bytes into a region of size 76
[-Werror=format-overflow=]
  sprintf(fw_name, "%s/%s.nffw", DEFAULT_FW_PATH, serial);

Note fw_buf still has to increase somewhat even after
restricting serial[], since otherwise:

drivers/net/nfp/nfp_net.c: In function ‘nfp_pf_pci_probe’:
drivers/net/nfp/nfp_net.c:3176:23:
error: ‘%s’ directive writing up to 99 bytes into a region of size 76
[-Werror=format-overflow=]
  sprintf(fw_name, "%s/%s", DEFAULT_FW_PATH, card);
                       ^~
drivers/net/nfp/nfp_net.c:3262:32:
  err = nfp_fw_upload(dev, nsp, card_desc);
                                ~~~~~~~~~
drivers/net/nfp/nfp_net.c:3176:2:
note: ‘sprintf’ output between 25 and 124 bytes into a destination of size 100
  sprintf(fw_name, "%s/%s", DEFAULT_FW_PATH, card);

Fixes: 896c265ef9 ("net/nfp: use new CPP interface")

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-05-14 23:32:23 +02:00
Andy Green
275782311c net/axgbe: fix EEPROM string comparison
drivers/net/axgbe/axgbe_phy_impl.c:576:6: error:
‘__builtin_memcmp_eq’ reading 16 bytes from a region of size 9
[-Werror=stringop-overflow=]
  if (memcmp(&sfp_eeprom->base[AXGBE_SFP_BASE_VENDOR_NAME],
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      AXGBE_BEL_FUSE_VENDOR, AXGBE_SFP_BASE_VENDOR_NAME_LEN))

Fixes: a5c7273771 ("net/axgbe: add phy programming APIs")

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-05-14 23:32:23 +02:00
Andy Green
dd6f8d712e bus/dpaa: fix inconsistent struct alignment
The actual descriptor for qm_mr_entry is 64-byte aligned.

But the original code plays a trick, and puts a u8 common
to the three descriptor subtypes in the union afterwards
outside their structure definitions.

Unfortunately since they compose a struct qm_fd with
alignment 8, this trick destroys the ability of the compiler
to understand what has happened, resulting in this kind of
problem:

drivers/bus/dpaa/include/fsl_qman.h:354:3: error:
alignment 1 of ‘struct <anonymous>’ is less than 8 [-Werror=packed-not-aligned]
   } __packed dcern;

on gcc 8 / Fedora 28 out of the box.

This patch moves the u8 verb into the structure definitions
composed into the union, so the alignment of the parent struct
containing the alignment 8 object can also be seen to be
alignment 8 by the compiler.  Uses of .verb are fixed up to use
.ern.verb (the same offset of +0 inside all the structs in
the union).

The final struct layout should be unchanged.

Fixes: c47ff048b9 ("bus/dpaa: add QMAN driver core routines")
Fixes: f6fadc3e63 ("bus/dpaa: add QMAN interface driver")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-05-14 23:32:23 +02:00
Andy Green
fe5f777b53 bus/pci: replace strncpy by strlcpy
In function ‘pci_get_kernel_driver_by_path’,
    inlined from ‘pci_scan_one.isra.1’ at
	drivers/bus/pci/linux/pci.c:317:8:
drivers/bus/pci/linux/pci.c:57:3: error:
‘strncpy’ specified bound depends on the length of the source argument
[-Werror=stringop-overflow=]
   strncpy(dri_name, name + 1, strlen(name + 1) + 1);

Fixes: d9a8cd9595 ("pci: add kernel driver type")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-05-14 23:32:23 +02:00
Vipin Varghese
f5fd98c802 net/tap: add default name to tun
The change adds default name to reflect TUN PMD instance. if option
name is not passed, the default dtun is taken.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-05-14 22:32:23 +01:00
Hyong Youb Kim
2b9919feab net/enic: fix missing offload capabilities
Add the following missing flags to the advertised offloads.
- DEV_RX_OFFLOAD_CRC_STRIP
  CRC is always stripped.
- DEV_RX_OFFLOAD_JUMBO_FRAME
  Jumbo support is always enabled on the NIC.
- DEV_RX_OFFLOAD_SCATTER
  Scatter Rx is currently supported.
- DEV_TX_OFFLOAD_MULTI_SEGS
  Multiple-segment transmit has always been supported.

Fixes: 93fb21fdbe ("net/enic: enable overlay offload for VXLAN and GENEVE")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
2018-05-14 22:32:23 +01:00
Matan Azrad
59056833cc net/bonding: fix slave activation simultaneously
The bonding PMD decides to activate\deactivate its slaves according to
the slaves link statuses.
Thus, it registers to the LSC events of the slaves ports and
activates\deactivates them from its LSC callbacks called asynchronously
by the host thread when the slave link status is changed.

In addition, the bonding PMD uses the callback for slave activation
when it tries to start it, this operation is probably called by the
master thread.

Consequently, a slave may be activated in the same time by two
different threads and may cause a lot of optional errors, for example,
slave mempool recreation with the same name causes an error.

Synchronize the critical section in the LSC callback using a special
new spinlock.

Fixes: 414b202343 ("bonding: fix initial link status of slave")
Fixes: a45b288ef2 ("bond: support link status polling")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2018-05-14 22:32:23 +01:00
Jingjing Wu
efe73c0d1d net/avf: fix Rx interrupt mapping
Vector used for rx mapping is different if WB_ON_ITR
is supported. The mapping table need to be updated.

Fixes: d6bde6b5ea ("net/avf: enable Rx interrupt")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Cc: stable@dpdk.org
2018-05-14 22:32:23 +01:00
Shreyansh Jain
346b02d1dc net/dpaa2: change VLAN strip value to offload flag
Fixes: 0ebce6129b ("net/dpaa2: support new ethdev offload APIs")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-05-14 22:32:23 +01:00
Rahul Lakkireddy
b84bcf4019 net/cxgbe: free resources during uninit
Move freeing up resources from dev_close() to dev_uninit(). This fixes
NULL pointer de-reference when accessing adapter context needed by
other ports under same PF, but had been freed up by the first port.
This can happen if only the first port is started up and the check
to free up all resources is still satisfied. When dev_close is
called for other ports, adapter context is NULL since it was freed
up by the first port.

Thus, by moving to dev_uninit() all the ports can be teared down
safely without need for extra checks.

Fixes: 2195df6d11 ("net/cxgbe: rework ethdev device allocation")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2018-05-14 22:32:23 +01:00
Ophir Munk
97b2217ae5 net/mlx4: advertise supported RSS hash functions
Advertise mlx4 supported RSS functions as part of dev_infos_get
callback.
Previous to this commit RSS support was reported as none. Since the
introduction of [1] it is required that all RSS configurations will be
verified.

[1] commit 8863a1fbfc ("ethdev: add supported hash function check")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
2018-05-14 22:32:23 +01:00