Fiona Trahe [Tue, 22 May 2018 10:33:30 +0000 (11:33 +0100)]
compressdev: clarify when private xform can be cleared
As the private_xform data can be shared by many operations
and across queue_pairs, it would be performance impacting
for PMDs to track inflights associated with one. It makes
more sense to push the responsibility to the application to
keep track of its usage and only delete the private_xform when
there are no more ops using it.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
crypto/scheduler: fix 64-bit mask of workers cores
The list of workers cores was represented by 64-bit bitmask.
It doesn't work if system has cores with id higher than 63.
This fix changes list of workers cores to array of uint16_t.
The size of array equals to RTE_MAX_LCORE.
Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode") Cc: stable@dpdk.org Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Pablo de Lara [Tue, 15 May 2018 19:13:13 +0000 (20:13 +0100)]
cryptodev: fix supported size check
Crypto capability structure contains supported
sizes for key, IV, digest, etc. on different algorithms.
These sizes can be expressed as a single value or
a range of values.
The check was broken when a size was checked against
a range with multiple values.
Also, for more clarity, the param_range_check macro
has been converted into a function.
Fixes: 38227c0e3ad2 ("cryptodev: retrieve device info") Cc: stable@dpdk.org Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Pablo de Lara [Tue, 15 May 2018 20:21:02 +0000 (21:21 +0100)]
crypto/aesni_gcm: remove unneeded cast
qp->temp_digest is already an array of uint8_t,
so no need to cast to uint8_t*.
Fixes: baf1e63bfd65 ("crypto/aesni_gcm: do not append digest") Cc: stable@dpdk.org Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Pablo de Lara [Tue, 15 May 2018 19:15:27 +0000 (20:15 +0100)]
crypto/aesni_mb: fix capabilities
Missing AES-CMAC supported parameters
in PMD capabilities.
Fixes: 6491dbbecebb ("crypto/aesni_mb: support AES CMAC") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Jerin Jacob [Wed, 16 May 2018 12:28:04 +0000 (17:58 +0530)]
app/crypto-perf: fix parameters copy
Since arm64 was using plain memcpy for rte_memcpy, gcc 8.1, could
detect size was more than source address range. In this case, the
source was wrong.
test/test/test_cryptodev.c: In function 'test_multi_session_random_usage':
rte_memcpy_64.h:364:29: error: 'memcpy'
forming offset [113, 184] is out of the bounds [0, 112] of object
'testsuite_params' with type 'struct crypto_testsuite_params'
[-Werror=array-bounds]
#define rte_memcpy(d, s, n) memcpy((d), (s), (n))
^~~~~~~~~~~~~~~~~~~~~
test/test/test_cryptodev.c:6618:3: note:
in expansion of macro 'rte_memcpy'
rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
^~~~~~~~~~
test/test/test_cryptodev.c:140:39: note:
'testsuite_params' declared here
static struct crypto_testsuite_params testsuite_params = { NULL };
Fixes: ffbe3be0d4b5 ("app/test: add libcrypto") Cc: stable@dpdk.org Suggested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Jerin Jacob [Wed, 16 May 2018 12:28:03 +0000 (17:58 +0530)]
app/crypto-perf: use strcpy for allocated string
inlined from ‘cperf_test_vector_get_from_file’ at
app/test-crypto-perf/cperf_test_vector_parsing.c:578:11:
app/test-crypto-perf/cperf_test_vector_parsing.c:510: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-crypto-perf/cperf_test_vector_parsing.c:528: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));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found this issue with meson build and gcc 8.1.
Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application") Cc: stable@dpdk.org Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Fan Zhang [Wed, 16 May 2018 13:10:32 +0000 (14:10 +0100)]
crypto/scheduler: fix possible duplicated ring names
This patch fixes the possible duplicated ring names in multi-core
scheduler. Originally two or more multi-core schedulers may have
same worker ring names thus will cause initialization error.
Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode") Cc: stable@dpdk.org Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
When scheduler mode changed from multicore to roundrobin and
back to multicore, scheduler tries to create memory rings with
the same name and fails. The fix allows to lookup and re-use
previously allocated memory rings.
Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode") Cc: stable@dpdk.org Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Fan Zhang <roy.fan.zhang@intel.com> Tested-by: Reshma Pattan <reshma.pattan@intel.com>
Thomas Monjalon [Tue, 22 May 2018 11:28:17 +0000 (13:28 +0200)]
bus/vdev: replace device list lock by a recursive one
A device like failsafe can manage sub-devices.
When removing such device, it removes its sub-devices
and try to take the same vdev_device_list_lock.
It was causing a deadlock because the lock was not recursive.
Andy Green [Tue, 22 May 2018 01:24:47 +0000 (09:24 +0800)]
ethdev: fix type and scope of variables in Rx burst
GCC 8.1 warned:
In function 'rte_eth_rx_burst':
rte_ethdev.h:3836:18: warning: conversion to 'int16_t'
{aka 'short int'} from 'uint16_t' {aka 'short unsigned int'}
may change the sign of the result [-Wsign-conversion]
int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
^
rte_ethdev.h:3844:50: warning: conversion to 'uint16_t'
{aka 'short unsigned int'} from 'int16_t' {aka 'short int'}
may change the sign of the result [-Wsign-conversion]
nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
^~~~~
rte_ethdev.h:3844:12: warning: conversion to 'int16_t'
{aka 'short int'} from 'uint16_t' {aka 'short unsigned int'}
may change the sign of the result [-Wsign-conversion]
nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
^~
rte_ethdev.h:3851:9: warning: conversion to 'uint16_t'
{aka 'short unsigned int'} from 'int16_t' {aka 'short int'}
may change the sign of the result [-Wsign-conversion]
return nb_rx;
^~~~~
The second part of the patch is solved by its own basic
block because it is inside a preprocessor conditional.
Bringing the declaration of the var to the top of the
function would require that also being given its own
preprocessor conditional, or a (void)var to avoid an
unused var warning. The basic block is no worse than
those imho.
Fixes: 467465d86df1 ("ethdev: add packet count parameter to Rx callback") Fixes: 4dc294158cac ("ethdev: support optional Rx and Tx callbacks") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Andy Green [Tue, 22 May 2018 01:24:42 +0000 (09:24 +0800)]
mbuf: avoid integer promotion in prepend/adj/chain
GCC 8.1 warned:
In function 'rte_pktmbuf_prepend':
rte_mbuf.h:1908:17: warning: conversion from 'int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
m->data_off -= len;
^~~
m->data_off is a uint16_t
uint16_t data_off;
len (a uint16_t) is promoted to an int using -=. Do the
subtraction explicitly and cast the result to uint16_t.
The below += or -= changes are solving the same thing.
In function 'rte_pktmbuf_adj':
rte_mbuf.h:1969:17: warning: conversion from 'int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
m->data_off += len;
^~~
In function 'rte_pktmbuf_chain':
rte_mbuf.h:2082:19: warning: conversion from 'int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
head->nb_segs += tail->nb_segs;
^~~~
Also uint16_t
uint16_t nb_segs; /**< Number of segments. */
Fixes: 08b563ffb19d ("mbuf: replace data pointer by an offset") Fixes: 1a60a0daa6e4 ("mbuf: fix segments number type increase") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Andy Green [Tue, 22 May 2018 01:24:32 +0000 (09:24 +0800)]
mbuf: avoid implicit demotion in 64-bit arithmetic
GCC 8.1 warned:
In function 'rte_validate_tx_offload':
rte_mbuf.h:2112:19: warning: conversion to 'uint64_t'
{aka 'long unsigned int'} from 'int' may change the
sign of the result [-Wsign-conversion]
inner_l3_offset += m->outer_l2_len + m->outer_l3_len;
^~
Andy Green [Tue, 22 May 2018 01:24:37 +0000 (09:24 +0800)]
mbuf: fix type of variables in linearize function
GCC 8.1 warned:
In function 'rte_pktmbuf_linearize':
rte_mbuf.h:1873:32: warning: conversion to 'int' from 'uint32_t'
{aka 'unsigned int'} may change the sign of the result [-Wsign-conversion]
rte_mbuf.h:2166:13: note: in expansion of macro 'rte_pktmbuf_pkt_len'
copy_len = rte_pktmbuf_pkt_len(mbuf) - rte_pktmbuf_data_len(mbuf);
rte_mbuf.h:2180:51: warning: conversion to 'size_t'
{aka 'long unsigned int'} from 'int' may change the
sign of the result [-Wsign-conversion]
rte_memcpy(buffer, rte_pktmbuf_mtod(m, char *), seg_len);
^~~~~~~
The temp is consumed as a size_t. So let's make it
a size_t in the first place.
Fixes: 1feda4d8fc ("mbuf: add a function to linearize a packet") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Andy Green [Tue, 22 May 2018 01:24:27 +0000 (09:24 +0800)]
mbuf: fix type of private size in detach
GCC 8.1 warned:
In function 'rte_pktmbuf_detach':
rte_mbuf.h:1583:17: warning: conversion from 'uint32_t'
{aka 'unsigned int'} to 'uint16_t' {aka 'short unsigned int'}
may change value [-Wconversion]
m->priv_size = priv_size;
^~~~~~~~~
The temp priv_size is declared as a uint32_t. But it
only deals in uint16_t. m->priv_size is a uint16_t.
Change it to a uint16_t.
Fixes: 355e6735b3 ("mbuf: fix cloning with private mbuf data") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Andy Green [Tue, 22 May 2018 01:24:22 +0000 (09:24 +0800)]
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>
Andy Green [Tue, 22 May 2018 01:24:17 +0000 (09:24 +0800)]
eal: explicit cast in rwlock functions
GCC 8.1 warned:
In function 'rte_rwlock_read_lock':
rte_rwlock.h:74:12: warning: conversion to 'uint32_t'
{aka 'unsigned int'} from 'int32_t' {aka 'int'} may
change the sign of the result [-Wsign-conversion]
x, x + 1);
^
rte_rwlock.h:74:17: warning: conversion to 'uint32_t'
{aka 'unsigned int'} from 'int' may change the sign
of the result [-Wsign-conversion]
x, x + 1);
~~^~~
In function 'rte_rwlock_write_lock':
rte_rwlock.h:110:15: warning: unsigned conversion
from 'int' to 'uint32_t' {aka 'unsigned int'}
changes value from '-1' to '4294967295' [-Wsign-conversion]
0, -1);
^~
Again in this case we are making explicit the exact cast
that was always happening implicitly. The patch does not
change the generated code.
The int32_t temp "x" is required to be signed to detect
a < 0 error condition from the lock status. Afterwards,
it has always been implicitly cast to uint32_t when it
is used in the arguments to rte_atomic32_cmpset()...
gcc8.1 objects to the implicit cast now and requires us
to cast it explicitly.
Fixes: af75078fec ("first public release") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Andy Green [Tue, 22 May 2018 01:24:12 +0000 (09:24 +0800)]
eal/x86: fix type of variable in memcpy function
GCC 8.1 warned:
rte_memcpy.h:793:2: note: in expansion of macro 'MOVEUNALIGNED_LEFT47'
MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
^~~~~~~~~~~~~~~~~~~~
rte_memcpy.h:649:51: warning: conversion from 'size_t'
{aka 'long unsigned int'} to 'int' may change value [-Wconversion]
case 0x0B: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0B); break;
^
rte_memcpy.h:616:15: note: in definition of macro 'MOVEUNALIGNED_LEFT47_IMM'
tmp = len;
^~~
rte_memcpy.h:793:2: note: in expansion of macro 'MOVEUNALIGNED_LEFT47'
MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
^~~~~~~~~~~~~~~~~~~~
rte_memcpy.h:618:13: warning: conversion to 'size_t'
{aka 'long unsigned int'} from 'int'
may change the sign of the result [-Wsign-conversion]
tmp -= len;
^~
rte_memcpy.h:649:16: note: in expansion of macro 'MOVEUNALIGNED_LEFT47_IMM'
case 0x0B: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0B); break;
^~~~~~~~~~~~~~~~~~~~~~~~
rte_memcpy.h:793:2: note: in expansion of macro 'MOVEUNALIGNED_LEFT47'
MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
^~~~~~~~~~~~~~~~~~~~
rte_memcpy.h:618:13: warning: conversion to 'size_t'
{aka 'long unsigned int'} from 'int'
may change the sign of the result [-Wsign-conversion]
tmp -= len;
^~
We can eliminate the problems by setting the type of tmp to
size_t in the first place.
Fixes: d35cc1fe6a ("eal/x86: revert select optimized memcpy at run-time") Cc: stable@dpdk.org Suggested-by: Bruce Richardson <bruce.richardson@intel.com> Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Daniel Shelepov [Mon, 14 May 2018 21:12:15 +0000 (21:12 +0000)]
app/testpmd: fix burst stats reporting
When RTE_TEST_PMD_RECORD_BURST_STATS is enabled, testpmd collects
burst statistics and includes them in the port stats report. The
summary should include top 2 most frequent burst sizes, but there is a
bug in finding the top-2. During the scan of burst size counts, the
top-2 can change only if top-1 also changes.
Added logic to update the top-2 if current burst size is larger than
existing top-2, but smaller than existing top-1.
Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Daniel Shelepov <dashel@microsoft.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Gavin Hu [Thu, 17 May 2018 02:46:10 +0000 (10:46 +0800)]
raw/ifpga: fix ARM build with clang
The patch fixes the compile issue with clang on ARM64, as well as
clang + X86 builing hosts.
Newly introduced #pragma pack(1) in the header file caused compiling
issues for the files who included it.
In file included from drivers/raw/ifpga_rawdev/base/ifpga_fme_dperf.c:5:
In file included from drivers/raw/ifpga_rawdev/base/ifpga_feature_dev.h:8:
drivers/raw/ifpga_rawdev/base/ifpga_hw.h:8:10: error:
the current #pragma pack alignment value is modified in the included file
The fix is to change the #pragma pack alignment locally and not have
effect on other files who included this header file.
Gavin Hu [Thu, 17 May 2018 02:46:09 +0000 (10:46 +0800)]
eventdev: fix build with clang on ARM
This patch fix the clang compiling issue reported on the ARM64
builing hosts. ev is a pointer in size of 64bit, but herein
it should be the size of its content.
lib/librte_eventdev/rte_event_crypto_adapter.c:530:49: error:
'rte_memcpy' call operates on objects of type 'struct rte_event'
while the size is based on a different type
'struct rte_event *' [-Werror,-Wsizeof-pointer-memaccess]
rte_memcpy(ev, &m_data->response_info, sizeof(ev));
lib/librte_eventdev/rte_event_crypto_adapter.c:530:49:
note: did you mean to dereference the argument to 'sizeof' (and multiply
it by the number of elements)?
rte_memcpy(ev, &m_data->response_info, sizeof(ev));
Fixes: 7901eac340 ("eventdev: add crypto adapter implementation") Signed-off-by: Gavin Hu <gavin.hu@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Andy Green [Fri, 18 May 2018 13:02:38 +0000 (21:02 +0800)]
ethdev: explicit cast of queue count return
GCC 8.1 produces a warning:
rte_ethdev.h: In function 'rte_eth_rx_queue_count':
rte_ethdev.h:3882:10: warning: conversion to 'int' from 'uint32_t'
{aka 'unsigned int'} may change the sign of the result [-Wsign-conversion]
return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: 33cf6be04d60 ("ethdev: add sanity checks to functions") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com>
Andy Green [Thu, 17 May 2018 13:50:17 +0000 (21:50 +0800)]
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: 6006818cfb26 ("net: new checksum functions") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com>
Andy Green [Thu, 17 May 2018 13:49:57 +0000 (21:49 +0800)]
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: 6006818cfb26 ("net: new checksum functions") Fixes: 4199fdea60c3 ("mbuf: generic support for TCP segmentation offload") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com>
Andy Green [Thu, 17 May 2018 13:49:47 +0000 (21:49 +0800)]
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: 7ef007291004 ("ethdev: random MAC address") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Andy Green [Thu, 17 May 2018 13:50:22 +0000 (21:50 +0800)]
mbuf: explicit cast of size on detach
GCC 8.1 warned:
In function 'rte_pktmbuf_detach':
rte_mbuf.h:1580:14: warning: conversion from 'long unsigned int'
to 'uint32_t' {aka 'unsigned int'} may change value [-Wconversion]
mbuf_size = sizeof(struct rte_mbuf) + priv_size;
^~~~~~
Fixes: 355e6735b335 ("mbuf: fix cloning with private mbuf data") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com>
Andy Green [Thu, 17 May 2018 13:49:42 +0000 (21:49 +0800)]
mbuf: explicit cast of external buffer length
GCC 8.1 warned:
rte_common.h:141:34:
warning: conversion from 'long unsigned int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
#define RTE_PTR_DIFF(ptr1, ptr2) ((uintptr_t)(ptr1) - (uintptr_t)(ptr2))
^
rte_mbuf.h:1360:13:
note: in expansion of macro 'RTE_PTR_DIFF'
*buf_len = RTE_PTR_DIFF(shinfo, buf_addr);
Fixes: a53aa2b9f3be ("mbuf: support attaching external buffer") Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Andy Green [Thu, 17 May 2018 13:49:37 +0000 (21:49 +0800)]
mbuf: explicit cast of headroom on reset
GCC 8.1 warned:
rte_common.h:384:2:
warning: conversion from 'int' to 'uint16_t'
{aka 'short unsigned int'} may change value [-Wconversion]
__extension__ ({ \
^~~~~~~~~~~~~
rte_mbuf.h:1204:16:
note: in expansion of macro 'RTE_MIN'
m->data_off = RTE_MIN(RTE_PKTMBUF_HEADROOM, (uint16_t)m->buf_len);
RTE_PKTMBUF_HEADROOM is typ 128, so it doesn't make trouble.
Fixes: 08b563ffb19d ("mbuf: replace data pointer by an offset") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Andy Green [Thu, 17 May 2018 13:49:27 +0000 (21:49 +0800)]
mbuf: fix reference counter integer promotion
GCC 8.1 warned:
"1 + value", where value is an uint16_t causes promotion
to a signed int. The compiler complained that we are
shoving an int into a uint16_t return type with different
size and sign.
Bumping and returning value directly instead removes the
promotion and the problem.
Fixes: f20b50b946da ("mbuf: optimize refcnt update") Fixes: a53aa2b9f3be ("mbuf: support attaching external buffer") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Andy Green [Thu, 17 May 2018 13:49:22 +0000 (21:49 +0800)]
ring: remove signed type flip-flopping
GCC 8.1 warns:
rte_ring.h:350:46:
warning: conversion to 'uint32_t' {aka 'unsigned int'}
from 'int' may change the sign of the result
[-Wsign-conversion]
update_tail(&r->prod, prod_head, prod_next, is_sp, 1);
The visible apis take unsigned int, then call a private
api taking an int, which finally calls an api taking an
unsigned int.
Convert the private api to take unsigned int removing
5 x warning similar to that shown above.
Fixes: 0dfc98c507b1 ("ring: separate out head index manipulation") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Andy Green [Thu, 17 May 2018 13:49:17 +0000 (21:49 +0800)]
ring: remove useless variables
There were warnings with GCC 8.1:
In function '__rte_ring_move_prod_head':
rte_ring_generic.h:76:3:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
const uint32_t cons_tail = r->cons.tail;
^~~~~
In function '__rte_ring_move_cons_head':
rte_ring_generic.h:147:3:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
const uint32_t prod_tail = r->prod.tail;
Fixes: 0dfc98c507b1 ("ring: separate out head index manipulation") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Andy Green [Thu, 17 May 2018 13:50:37 +0000 (21:50 +0800)]
eal: explicit cast in constant byte swap
GCC 8.1 warns:
rte_byteorder.h: In function 'rte_constant_bswap16':
rte_byteorder.h:54:45: warning: conversion from
'int' to 'uint16_t' {aka 'short unsigned int'}
may change value [-Wconversion]
((((uint16_t)(v) & UINT16_C(0x00ff)) << 8) | \
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
(((uint16_t)(v) & UINT16_C(0xff00)) >> 8))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rte_byteorder.h:126:9: note: in expansion of macro
'RTE_STATIC_BSWAP16'
return RTE_STATIC_BSWAP16(x);
^~~~~~~~~~~~~~~~~~
The other two sizes are going to be afflicted the
same, so get the same fix.
Fixes: b75667ef9f7e ("eal: add static endianness conversion macros") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com>
Andy Green [Thu, 17 May 2018 13:49:12 +0000 (21:49 +0800)]
eal: fix casts in random functions
GCC 8.1 warns:
In function 'rte_srand':
rte_random.h:34:10:
warning: conversion to 'long int' from 'long unsigned int'
may change the sign of the result [-Wsign-conversion]
srand48((long unsigned int)seedval);
rte_random.h:51:8:
warning: conversion to 'uint64_t' {aka 'long unsigned int'}
from 'long int' may change the sign of the result
[-Wsign-conversion]
val = lrand48();
^~~~~~~
rte_random.h:53:6:
warning: conversion to 'long unsigned int' from 'long int'
may change the sign of the result [-Wsign-conversion]
val += lrand48();
Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Andy Green [Thu, 17 May 2018 14:03:48 +0000 (22:03 +0800)]
eal: explicit cast of strlcpy return
GCC 8.1 warns:
rte_string_fns.h: In function 'rte_strlcpy':
rte_string_fns.h:58:9:
warning: conversion to 'size_t' {aka 'long unsigned int'} from
'int' may change the sign of the result [-Wsign-conversion]
return snprintf(dst, size, "%s", src);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: 5364de644a4b ("eal: support strlcpy function") Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
David Marchand [Wed, 16 May 2018 11:10:40 +0000 (13:10 +0200)]
mbuf: fix C++ build on void pointer cast
Including rte_mbuf.h in C++ triggers the following warning as C++ does not
allow implicit casting of a void *.
In file included from test.cpp:1:0:
rte_mbuf.h: In function ‘rte_mbuf_ext_shared_info*
rte_pktmbuf_ext_shinfo_init_helper(void*, uint16_t*,
rte_mbuf_extbuf_free_callback_t, void*)’:
rte_mbuf.h:1349:9: error: invalid conversion
from ‘void*’ to ‘rte_mbuf_ext_shared_info*’ [-fpermissive]
shinfo = RTE_PTR_ALIGN_FLOOR(RTE_PTR_SUB(buf_end,
^
Fixes: a53aa2b9f3be ("mbuf: support attaching external buffer") Signed-off-by: David Marchand <david.marchand@6wind.com>
Roman Zhukov [Wed, 16 May 2018 14:21:23 +0000 (15:21 +0100)]
net/sfc: fix errno if flow API RSS action parse fails
The value of rte_errno must be positive in case of an error.
Fixes: d77d07391d4d ("net/sfc: support flow API RSS action") Cc: stable@dpdk.org Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Adrien Mazarguil [Wed, 16 May 2018 16:20:54 +0000 (18:20 +0200)]
net/mlx4: fix shifts of signed values in Tx
This patch addresses the following issues reported by cppcheck:
[drivers/net/mlx4/mlx4_rxtx.c:266]: (error) Shifting signed 32-bit value
by 31 bits is undefined behaviour
[drivers/net/mlx4/mlx4_rxtx.c:624]: (error) Shifting signed 32-bit value
by 31 bits is undefined behaviour
[drivers/net/mlx4/mlx4_txq.c:89]: (error) Shifting signed 32-bit value by
31 bits is undefined behaviour
[drivers/net/mlx4/mlx4_txq.c:91]: (error) Shifting signed 32-bit value by
31 bits is undefined behaviour
Shahaf Shuler [Tue, 15 May 2018 13:23:24 +0000 (16:23 +0300)]
net/mlx5: fix default RSS level
Using inner RSS by default for GRE leads to memory corruption as the
extra flow items added for the inner RSS are not counted in the flow
attributes buffer size.
Fixing by enforcing the default RSS level to be outer. This much
simplify the flow engine and more robust.
Future optimization for out of the box RSS can be done on subsequent
commits.
Xiaoyun Li [Thu, 17 May 2018 11:24:14 +0000 (19:24 +0800)]
net/avf: fix traffic blocked on reset
When resetting ports, traffic will be blocked. There is a mistake when
getting hw info at avf_dev_stop. This causes the device stop without
stopping queues. This patch fixes this issue.
Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Cc: stable@dpdk.org Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> Acked-by: Helin Zhang <helin.zhang@intel.com>
Wenzhuo Lu [Thu, 17 May 2018 05:34:09 +0000 (13:34 +0800)]
net/ixgbe: fix too many interrupts
To support kernel VF, PBA bit is always set. But it may
cause the too many interrupts issue on specific Linux
kernel versions, e.g. 4.4.0-116.
PF host should set the auto clean, mask and throttling
as we always set the register for kernel VF.
Fixes: 6b75183ac4d0 ("net/ixgbe: fix wrong PBA setting") Cc: stable@dpdk.org Signed-off-by: Michael Luo <michael.luo@intel.com> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com> Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Beilei Xing [Tue, 15 May 2018 16:19:05 +0000 (00:19 +0800)]
net/i40e: fix failing to disable FDIR Tx queue
If flow director is enabled, FDIR Tx queue can't
be disabled when exiting application. Root cause
is FDIR Tx queue is not disabled before removing
HMC backing store.
Ivan Malov [Wed, 16 May 2018 13:24:03 +0000 (14:24 +0100)]
net/sfc: improve unsupported flow pattern message
Such a message could be generated by two places
in the code, and there is a difference in the
text albeit there is no difference in the meaning.
These two messages must be the same so that
automated error log comparison may be carried
out without confusion.
Fixes: a9825ccf5bb8 ("net/sfc: support flow API filters") Cc: stable@dpdk.org Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Andrew Rybchenko [Wed, 16 May 2018 12:35:36 +0000 (13:35 +0100)]
net/sfc: fix minimum number of Rx descriptors in ESSB mode
Number of descriptors in equal stride super-buffer Rx mode defines
number of packet buffers to be used. Each HW Rx descriptor has
many packet buffers and the number depends on total size of mbuf
and CONFIG_RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB value.
Typically it makes a bit less than 32 buffers per descriptor.
Since HW Rx descriptors must be pushed by 8, it makes about 256
as required minimum. Double it in advertised minimum to allow for
at least 2 refill blocks.
Fixes: 390f9b8d82c9 ("net/sfc: support equal stride super-buffer Rx mode") Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Ophir Munk [Mon, 14 May 2018 22:26:27 +0000 (22:26 +0000)]
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: f503d2694825 ("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>
Pascal Mazon [Thu, 17 May 2018 09:44:58 +0000 (11:44 +0200)]
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>
Maxime Coquelin [Thu, 17 May 2018 11:44:47 +0000 (13:44 +0200)]
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: 897f13a1f726 ("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>
Matan Azrad [Tue, 15 May 2018 11:07:14 +0000 (11:07 +0000)]
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
Tiwei Bie [Fri, 11 May 2018 10:55:42 +0000 (18:55 +0800)]
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: bd8f50a45d0f ("net/virtio-user: support server mode") Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
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>
Fan Zhang [Wed, 9 May 2018 14:08:39 +0000 (15:08 +0100)]
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: 3bb595ecd682 ("vhost/crypto: add request handler") Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Jiayu Hu [Fri, 11 May 2018 07:26:07 +0000 (15:26 +0800)]
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: bd8f50a45d0f ("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>
Andy Green [Mon, 14 May 2018 05:04:38 +0000 (13:04 +0800)]
net/mlx5: fix uninitialized variable in probing
Fixes: ccdcba53a3f4 ("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>
Andy Green [Mon, 14 May 2018 05:04:43 +0000 (13:04 +0800)]
net/bnx2x: fix memzone name overrun
Fixes: 540a211084a7 ("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>
Anatoly Burakov [Mon, 14 May 2018 16:06:15 +0000 (17:06 +0100)]
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: aab4f62d6c1c ("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>
Anatoly Burakov [Tue, 15 May 2018 10:44:52 +0000 (11:44 +0100)]
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: 56236363b481 ("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>
Andy Green [Tue, 15 May 2018 07:31:00 +0000 (15:31 +0800)]
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: fe5f777b5383 ("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>
Anatoly Burakov [Mon, 14 May 2018 16:27:42 +0000 (17:27 +0100)]
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.
Anatoly Burakov [Mon, 14 May 2018 16:27:41 +0000 (17:27 +0100)]
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.
Anatoly Burakov [Mon, 14 May 2018 16:27:40 +0000 (17:27 +0100)]
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().
Andy Green [Mon, 14 May 2018 05:01:07 +0000 (13:01 +0800)]
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: f714a18885a6 ("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>
Andy Green [Mon, 14 May 2018 05:01:02 +0000 (13:01 +0800)]
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: 2deb6b5246d7 ("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>
Andy Green [Mon, 14 May 2018 05:00:52 +0000 (13:00 +0800)]
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: e7dc5d7becc5 ("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>
Andy Green [Mon, 14 May 2018 05:00:47 +0000 (13:00 +0800)]
net/sfc: make sure that stats name is nul-terminated
Fixes: 73280c1e4ff2 ("net/sfc: support xstats retrieval by ID") Fixes: 7b9891769f4b ("net/sfc: support extended statistics") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Andy Green [Mon, 14 May 2018 05:00:42 +0000 (13:00 +0800)]
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: 86a2265e59d7 ("qede: add SRIOV support") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Andy Green [Mon, 14 May 2018 05:00:32 +0000 (13:00 +0800)]
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: e6decee38209 ("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>