dpdk.git
4 years agonet/hns3: fix duplicated VLAN entry
Min Hu (Connor) [Fri, 22 Nov 2019 12:06:24 +0000 (20:06 +0800)]
net/hns3: fix duplicated VLAN entry

When setting vlan, hns3 driver will add vlan entry to vlan linked list
each time, and this is unreasonable.

This patch adds a check whether the VLAN to be added already exists
in the linked list and prevents adding duplicated vlan.

Fixes: 411d23b9eafb ("net/hns3: support VLAN")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix VF link status
Huisong Li [Fri, 22 Nov 2019 12:06:23 +0000 (20:06 +0800)]
net/hns3: fix VF link status

Currently, port link status is "up" in VF driver after user calling the
rte_eth_dev_stop API. This is unreasonable.

Therefore, this patch adjusts the strategy of getting link status from
PF driver for VF. VF driver should stop getting link status from PF by
canceling the alarm that VF driver send mailbox message to PF driver,
when the rte_eth_dev_stop API is called. And VF driver should restore
the alarm when the rte_eth_dev_start API is called.

Fixes: a5475d61fa34 ("net/hns3: support VF")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix mailbox response length
Chengchang Tang [Fri, 22 Nov 2019 12:06:22 +0000 (20:06 +0800)]
net/hns3: fix mailbox response length

Remove the macro 'HNS3_REG_MSG_DATA_OFFSET' which is used to prevent
access violation for response array by limiting the response data length
to 4.
But the limit value is too short to get some longer information such as
6 byte MAC address.

This patch modifies the length of response data from mailbox to allow
the response data length to be 8. So that the VF driver could get more
data from PF driver by mailbox.

Fixes: 463e748964f5 ("net/hns3: support mailbox")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@hisilicon.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix sending packets less than 60 bytes
Wei Hu (Xavier) [Fri, 22 Nov 2019 12:06:21 +0000 (20:06 +0800)]
net/hns3: fix sending packets less than 60 bytes

Ethernet minimum packet length is 64 bytes. If upper application
sends packets with less than 60 bytes in length(no CRC), driver
adds padding processing to avoid failure.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix VF configuration after abnormal exit
Wei Hu (Xavier) [Fri, 22 Nov 2019 12:06:20 +0000 (20:06 +0800)]
net/hns3: fix VF configuration after abnormal exit

When the application using VF device exits abnormally, for example,
when it is killed by 'kill -9', kernel PF netdev driver also stores
the corresponding configuration table entries of VF device.

This patch fixes it by adding message of deleting VF configuration
table entry corresponds to the revision of kernel hns3 netdev
driver, the new message is added to notify the kernel PF netdev
driver to clean up the VF configuration initialization during VF
initialization.

This revision is compatible with the old version of kernel hns3
netdev driver. The old version of kernel pf netdev driver will
ignore this message.

Fixes: a5475d61fa34 ("net/hns3: support VF")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: fix RSS hardware configuration restore
Hao Chen [Fri, 22 Nov 2019 12:06:19 +0000 (20:06 +0800)]
net/hns3: fix RSS hardware configuration restore

This patch fixes the bug that hardware configuration called
tc_size doesn't restore to the initial value when starting
the app, configuring PFC and then restarting the app,
because of the tc_mode didn't initial when rss is disabled.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agoapp/testpmd: reduce memory consumption
David Marchand [Fri, 22 Nov 2019 10:43:23 +0000 (11:43 +0100)]
app/testpmd: reduce memory consumption

Following [1], testpmd memory consumption has skyrocketted.
The rte_port structure has gotten quite fat.

struct rte_port {
[...]
  struct rte_eth_rxconf rx_conf[65536];            /* 266280 3145728 */
  /* --- cacheline 53312 boundary (3411968 bytes) was 40 bytes ago --- */
  struct rte_eth_txconf tx_conf[65536];            /* 3412008 3670016 */
  /* --- cacheline 110656 boundary (7081984 bytes) was 40 bytes ago --- */
[...]
  /* size: 8654936, cachelines: 135234, members: 31 */
[...]

testpmd handles RTE_MAX_ETHPORTS ports (32 by default) which means that it
needs ~256MB just for this internal representation.

The reason is that a testpmd rte_port (the name is quite confusing, as
it is a local type) maintains configurations for all queues of a port.
But where you would expect testpmd to use RTE_MAX_QUEUES_PER_PORT as the
maximum queue count, the rte_port uses MAX_QUEUE_ID set to 64k.

Prefer the ethdev maximum value.

After this patch:
struct rte_port {
[...]
  struct rte_eth_rxconf      rx_conf[1025];        /*  8240 49200 */
  /* --- cacheline 897 boundary (57408 bytes) was 32 bytes ago --- */
  struct rte_eth_txconf      tx_conf[1025];        /* 57440 57400 */
  /* --- cacheline 1794 boundary (114816 bytes) was 24 bytes ago --- */
[...]
  /* size: 139488, cachelines: 2180, members: 31 */
[...]

With this, we can ask for less memory in test-null.sh.

[1]: https://git.dpdk.org/dpdk/commit/?id=436b3a6b6e62

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agonet/bnxt: fix freeing all VNICs during port stop
Somnath Kotur [Thu, 21 Nov 2019 07:57:40 +0000 (13:27 +0530)]
net/bnxt: fix freeing all VNICs during port stop

Now that vnics are created only as part of the flow creation cmds
and not during init, we cannot rely on iterating only through
'nr_vnics'. We need to sweep all the vnics by using 'max_vnics'
otherwise a vnic with a stale 'rx_queue_cnt' might be left lingering
post a port stop/start operation. This could lead to a segfault.
This change is required because of the recent fix made by commit to
"fix flow creation with non-consecutive group ids".

Fixes: fcdd7210aa1f ("net/bnxt: fix flow creation with non-consecutive group ids")

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agodoc: update release notes for bnxt
Ajit Khaparde [Tue, 19 Nov 2019 01:18:37 +0000 (17:18 -0800)]
doc: update release notes for bnxt

Update release doc briefly describing updates to bnxt PMD for
19.11 release.

The support for these was added in the following commits:
1) b150a7e7ee66 ("net/bnxt: support LRO on Thor adapters")
2) be14720def9c ("net/bnxt: support FW reset")
3) df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")
4) 698aa7e95325 ("net/bnxt: add code to determine the Tx COS queue")
5) 04102f2ffc8c ("net/bnxt: update HWRM API to version 1.10.1.6")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agodoc: update bnxt feature list
Ajit Khaparde [Tue, 19 Nov 2019 23:32:30 +0000 (15:32 -0800)]
doc: update bnxt feature list

Updating bnxt.ini file.
These features were added earlier under the following commits.
1) 94d4afd2d167 ("net/bnxt: advertise scatter Rx offload capability")
2) 57d5e5bc86e4 ("net/bnxt: add statistics")
3) 88920136688c ("net/bnxt: support xstats get by id")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/mlx5: fix selection between encap and decap
Ori Kam [Thu, 21 Nov 2019 13:18:31 +0000 (13:18 +0000)]
net/mlx5: fix selection between encap and decap

The current raw_encap function selects if to decap or encap
based on the egress/ingress attribute. This concepts doesn't work
in case of FDB since all flows are considered ingress.

To solve this issue we moved to check the encap size.
if the encap size is larger then eth + ipv4 it means we are
trying to encap.

Fixes: 8ba9eee4ce32 ("net/mlx5: add raw data encap/decap to Direct Verbs")
Cc: stable@dpdk.org
Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agodoc: fix tap guide
Andrzej Ostruszka [Thu, 21 Nov 2019 13:27:01 +0000 (14:27 +0100)]
doc: fix tap guide

Corrected one typo and IP address according RFC5735.

Fixes: de96fe68ae95 ("net/tap: add basic flow API patterns and actions")
Cc: stable@dpdk.org
Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ixgbe: fix performance drop caused by MACsec
Shougang Wang [Thu, 21 Nov 2019 07:32:05 +0000 (07:32 +0000)]
net/ixgbe: fix performance drop caused by MACsec

Currently macsec offload will be enabled every time when device starts.
It will cause QoS sample application performance drop issue. This patch
adds check in dev_start ops to make sure macsec is only enabled when
required explicitly.

Fixes: 50556c88104c ("net/ixgbe: fix MACsec setting")
Cc: stable@dpdk.org
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/mlx5: fix flow tag hash list conversion
Matan Azrad [Thu, 21 Nov 2019 11:27:57 +0000 (11:27 +0000)]
net/mlx5: fix flow tag hash list conversion

When DR is not supported and DV is supported, tag action still can be
used by the metadata feature.

Wrongly, the tag hash list was not created what caused failure in
metadata action creation.

Create the tag hash list for each DV case.

Fixes: 860897d2895a ("net/mlx5: reorganize flow tables with hash list")

Signed-off-by: Matan Azrad <matan@mellanox.com>
4 years agonet/virtio-user: drop attribute unused for memory callback
Tiwei Bie [Tue, 19 Nov 2019 07:12:24 +0000 (15:12 +0800)]
net/virtio-user: drop attribute unused for memory callback

The "addr" param has been used since the event callbacks are enabled
for external memory. So the "__rte_unused" should be dropped.

Besides, slightly refine the coding style by consistently assuming
tabs are 8 characters.

Fixes: f32c7c9de961 ("malloc: enable event callbacks for external memory")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agoapp/testpmd: fix memory leak on detach
Stephen Hemminger [Wed, 20 Nov 2019 23:26:28 +0000 (15:26 -0800)]
app/testpmd: fix memory leak on detach

The RTE_FOREACH_MATCHING_DEV iterator requires that
if a break is done before the end of the loop,
the function rte_eth_iterator_cleanup() must be called.

Fixes: 55e51c962432 ("app/testpmd: add device related commands")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
4 years agonet/ice: support flow director for normal GTPU
Yahui Cao [Thu, 21 Nov 2019 11:20:15 +0000 (19:20 +0800)]
net/ice: support flow director for normal GTPU

Add FDIR support for normal GTP-U packet, which doesn't contain GTP_PSC
extension header.

Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel")

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix pattern name of GTPU with extension header
Yahui Cao [Thu, 21 Nov 2019 11:20:14 +0000 (19:20 +0800)]
net/ice: fix pattern name of GTPU with extension header

Pattern name of GTP-U flow with extension header should be
xxx_gtpu_eh_xxx. So it will not conflict with the pattern name of a
GTP-U flow that does not contains extension header.

Fixes: 3e4eab9c2192 ("net/ice: add pattern manifest")

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix flow director conflict
Qi Zhang [Thu, 21 Nov 2019 02:57:24 +0000 (10:57 +0800)]
net/ice: fix flow director conflict

Flow type "IPv4 + UDP" or "IPv4 + TCP" is conflict with "IPv4 + any"
flow type. If a rule for IPv4 + any is created, we should reject any
rule for IPv4 + UDP otherwise the first rule may be impacted, same
decision should be made on a reverse order.  For IPv6 and IPv4 GTPU
inner case, we have the same limitation.

Fixes: 109e8e06249e ("net/ice: configure HW flow director rule")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agodoc: fix a typo in EAL guide
Anatoly Burakov [Thu, 21 Nov 2019 12:39:23 +0000 (12:39 +0000)]
doc: fix a typo in EAL guide

The correct name for virt2memseg API is `rte_mem_virt2memseg`, not
`rte_virt2memseg`.

Fixes: 950e8fb4e194 ("mem: allow registering external memory areas")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agodoc: add core queries in power example guide
David Hunt [Fri, 15 Nov 2019 12:51:24 +0000 (12:51 +0000)]
doc: add core queries in power example guide

This patch adds some minor updates for the vm_power_manager and guest_cli
example applications.

Now that the virtio-serial channels between vm_power manager and
the guest_cli has bi-directional capability, there are some new commands.

Firstly, the command in vm_power_manager to enable queries for a given VM:

  * set_query {vm_name} enable|disable

Then, commands to query the frequencies and capabilities of the cores
in the VM:

  * query_cpu_freq {core_num}|all
  * query_cpu_caps {core_num}|all

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
4 years agoeal: fix header file install with meson
Ali Alnubani [Tue, 26 Nov 2019 15:38:36 +0000 (15:38 +0000)]
eal: fix header file install with meson

The header file 'rte_vfio.h' might be required by some external apps.
This patch adds it to the list of common_headers so that it's
installed by meson.

Fixes: 610beca42ea4 ("build: remove library special cases")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Reviewed-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/ioat: fix possible null dereference
Bruce Richardson [Mon, 25 Nov 2019 16:47:41 +0000 (16:47 +0000)]
examples/ioat: fix possible null dereference

When searching for raw devices with the correct type, we check the driver
name using strcmp, without first checking that the call to info get
succeeded and assigned a value to that pointer.

If the call to get the device info fails, we can treat it as if the device
didn't match, and continue the loop, so the easiest fix is just to skip the
strcmp if the driver_name is null. [A non-null value from a previous failed
match is ok as it too causes the same behaviour of another loop iteration].

Coverity issue: 350353
Fixes: 2328542ed84e ("examples/ioat: add rawdev copy mode")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/ioat: handle error when querying number of stats
Bruce Richardson [Mon, 25 Nov 2019 15:36:20 +0000 (15:36 +0000)]
examples/ioat: handle error when querying number of stats

To get the amount of memory needed for stats, we call the xstats_get_names
function with a NULL parameter, which can return -1 on error. This negative
value was not previously handled correctly, so we adjust things to quit the
stats printing routine if this basic call fails.

Coverity issue: 350346
Fixes: 632bcd9b5d4f ("examples/ioat: print statistics")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/ioat: handle failure case for ioat dequeue
Bruce Richardson [Mon, 25 Nov 2019 15:23:03 +0000 (15:23 +0000)]
examples/ioat: handle failure case for ioat dequeue

On a failure with the ioat dequeue, -1 is returned, which was not properly
handled. This could lead to out-of-bounds reads on a later loop which
assumed a positive return value. Fix this by treating an error as though a
dequeue of 0 had been encountered.

Coverity issue: 350342
Coverity issue: 350349
Fixes: 2328542ed84e ("examples/ioat: add rawdev copy mode")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agomalloc: fix memory element size in case of padding
Xueming Li [Thu, 21 Nov 2019 14:25:02 +0000 (14:25 +0000)]
malloc: fix memory element size in case of padding

This patch fixes wrong inner memory element size when joining two
elements.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agodoc: update QoS scheduler guides
Jasvinder Singh [Tue, 26 Nov 2019 14:28:29 +0000 (14:28 +0000)]
doc: update QoS scheduler guides

Updates documentation to reflect the changes in the QoS scheduler
library and example.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
4 years agocrypto/ccp: fix digest size capabilities
Amaranath Somalapuram [Fri, 22 Nov 2019 06:47:47 +0000 (12:17 +0530)]
crypto/ccp: fix digest size capabilities

CCP can support varied digest sizes ranging from 1 to some max value
But the current code support only fixed max values.
This patch updates the minimum digest sizes to 1

Fixes: e0d88a394e ("crypto/ccp: support run-time CPU based auth")
Cc: stable@dpdk.org
Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
4 years agocrypto/ccp: fix scheduling of burst
Amaranath Somalapuram [Fri, 22 Nov 2019 06:47:17 +0000 (12:17 +0530)]
crypto/ccp: fix scheduling of burst

CCP driver was scheduling only one CCP in a single burst(enqueue).
Effective throughput was limited to 1 CCP performance.
Scheduling multiple ccp within one burst will increase the ccp performance.
this changes will divide the enqueue packets equally among the multiple CCP

Fixes: e0d88a394e ("crypto/ccp: support run-time CPU based auth")
Cc: stable@dpdk.org
Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
4 years agocrypto/ccp: fix CPU authentication crash
Amaranath Somalapuram [Fri, 22 Nov 2019 06:46:47 +0000 (12:16 +0530)]
crypto/ccp: fix CPU authentication crash

when ccp_auth_opt=1 is set and if authentication error occurred,
ccp driver crash. The enqueue referance count nb_ops miss match
with dequeue nb_ops on authentication error.

Fixes: e0d88a394e ("crypto/ccp: support run-time CPU based auth")
Cc: stable@dpdk.org
Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
4 years agocrypto/ccp: fix maximum queues and burst size
Amaranath Somalapuram [Fri, 22 Nov 2019 06:46:15 +0000 (12:16 +0530)]
crypto/ccp: fix maximum queues and burst size

CCP driver crash when running l2fwd
issue happen when changing MAX_PKT_BURST 32 to 256
increasing the CCP qp to 8 and CCP_MAX_BURST to 256

Fixes: ef4b04f87f ("crypto/ccp: support device init")
Cc: stable@dpdk.org
Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
4 years agodoc: fix l2fwd-crypto usage in CCP guide
Amaranath Somalapuram [Fri, 22 Nov 2019 06:45:45 +0000 (12:15 +0530)]
doc: fix l2fwd-crypto usage in CCP guide

Update the CCP doc for fixing description of some parameter,
Changing AES_CBC to aes-cbc, SHA1_HMAC to sha1-hmac.

Fixes: 4433ced9aa ("doc: add AMD CCP guide")
Cc: stable@dpdk.org
Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
4 years agoapp/crypto-perf: fix input of AEAD decrypt
Archana Muniganti [Thu, 21 Nov 2019 11:14:27 +0000 (16:44 +0530)]
app/crypto-perf: fix input of AEAD decrypt

In AEAD decrypt (verify mode), test data should point to
cipher text instead of plain text

Fixes: 5b2b0a740fba ("app/crypto-perf: overwrite mbuf when verifying")
Cc: stable@dpdk.org
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agotest/event_crypto: fix check for HW support
Hemant Agrawal [Thu, 7 Nov 2019 09:01:21 +0000 (14:31 +0530)]
test/event_crypto: fix check for HW support

When HW is available but the mode mismatches, it is better
to skip the test case.

Fixes: aa026482baf9 ("test/event_crypto: no service core when HW support available")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
4 years agotest/event_crypto: fix to avail mempool entries
Hemant Agrawal [Thu, 7 Nov 2019 09:01:20 +0000 (14:31 +0530)]
test/event_crypto: fix to avail mempool entries

Added the missed code to avail the mempool entries before
pool free.

Fixes: 24054e3640a2 ("test/crypto: use separate session mempools")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
4 years agotest/event_crypto: fix missing IV for AES
Hemant Agrawal [Thu, 7 Nov 2019 09:01:19 +0000 (14:31 +0530)]
test/event_crypto: fix missing IV for AES

The IV was not set, which was causing HW based SEC on DPAA1
to fail.

Fixes: b2196237eb8a ("test/event_crypto: change cipher algo")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
4 years agoapp/eventdev: check function errors
Pavan Nikhilesh [Thu, 21 Nov 2019 19:22:39 +0000 (00:52 +0530)]
app/eventdev: check function errors

Fix unchecked return values reported by coverity.

Coverity Issue: 336861
Coverity Issue: 349906
Fixes: 032a965a8f1d ("app/eventdev: support Tx adapter")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoapp/eventdev: fix divide by zero
Pavan Nikhilesh [Thu, 21 Nov 2019 19:22:38 +0000 (00:52 +0530)]
app/eventdev: fix divide by zero

Fix possible divide by zero condition when calculating percentages.

Coverity issue: 277205
Coverity issue: 277234
Fixes: d008f20bce23 ("app/eventdev: add event timer adapter as a producer")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agodoc: fix command line in l2fwd-event guide
Pavan Nikhilesh [Thu, 21 Nov 2019 18:27:16 +0000 (23:57 +0530)]
doc: fix command line in l2fwd-event guide

Fix incorrect command line argument documented for l2fwd-event.

Bugzilla ID: 367
Bugzilla ID: 368
Fixes: 14d7ea259aeb ("doc: add application usage guide for l2fwd-event")

Reported-by: Vipin Varghese <vipin.varghese@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoexamples/l2fwd-event: check function errors
Pavan Nikhilesh [Thu, 21 Nov 2019 18:27:15 +0000 (23:57 +0530)]
examples/l2fwd-event: check function errors

Validate `rte_eth_link_get_nowait`, `rte_service_map_lcore_set` and
`rte_eth_dev_info_get` return values.

Coverity issue: 350600
Coverity issue: 350601
Coverity issue: 350602

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/octeontx2: update start timestamp periodically
Pavan Nikhilesh [Fri, 22 Nov 2019 15:44:30 +0000 (21:14 +0530)]
event/octeontx2: update start timestamp periodically

Update start timestamp periodically to prevent drift.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/octeontx2: update SSO buffers based on timer count
Pavan Nikhilesh [Fri, 22 Nov 2019 15:44:29 +0000 (21:14 +0530)]
event/octeontx2: update SSO buffers based on timer count

Update SSO internal XAQ buffers based on number of timers in event timer
adapter.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/octeontx2: improve chunk pool performance
Pavan Nikhilesh [Fri, 22 Nov 2019 15:44:28 +0000 (21:14 +0530)]
event/octeontx2: improve chunk pool performance

Enable mempool cache for internal mempool to improve alloc performance.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/octeontx2: use opposite bucket for current chunk
Pavan Nikhilesh [Fri, 22 Nov 2019 15:44:27 +0000 (21:14 +0530)]
event/octeontx2: use opposite bucket for current chunk

Since TIM buckets are always aligned to 32B and our cache line size being
128B, we will always have a cache miss when reading current_chunk pointer.
Avoid the cache miss by storing the current_chunk pointer in the bucket
opposite to the current bucket.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/octeontx2: fix HW timer race condition
Pavan Nikhilesh [Fri, 22 Nov 2019 15:44:26 +0000 (21:14 +0530)]
event/octeontx2: fix HW timer race condition

Fix HW race condition observed when timeout resolution is low (<5us).
When HW traverses a given TIM bucket it will clear chunk_remainder,
but since SW always decreases the chunk_remainder at the start of the
arm routine it might cause a race where SW updates chunk_remainder
after HW has cleared it that lead to nasty side effects.

Fixes: 95e4e4ec7469 ("event/octeontx2: add timer arm timeout burst")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agonet/octeontx: set queue offload capabilities
Pavan Nikhilesh [Wed, 20 Nov 2019 03:48:07 +0000 (09:18 +0530)]
net/octeontx: set queue offload capabilities

Make Rx queue specific offloads same as device Rx offloads.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/octeontx: add appication domain validation
Pavan Nikhilesh [Wed, 20 Nov 2019 03:48:06 +0000 (09:18 +0530)]
event/octeontx: add appication domain validation

Add applicaton domain validation for OCTEON TX TIM vfs aka Event timer.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agomempool/octeontx: add application domain validation
Pavan Nikhilesh [Wed, 20 Nov 2019 03:48:05 +0000 (09:18 +0530)]
mempool/octeontx: add application domain validation

Add application domain validation for OCTEON TX FPA vfs.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agonet/octeontx: cleanup redundant mbox structs
Pavan Nikhilesh [Wed, 20 Nov 2019 03:48:04 +0000 (09:18 +0530)]
net/octeontx: cleanup redundant mbox structs

Cleanup redudant mail box structures.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agonet/octeontx: add application domain validation
Pavan Nikhilesh [Wed, 20 Nov 2019 03:48:03 +0000 (09:18 +0530)]
net/octeontx: add application domain validation

Add domain validation for PKI and PKO vfs

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agocommon/octeontx: update mbox to version 1.1.3
Pavan Nikhilesh [Wed, 20 Nov 2019 03:48:02 +0000 (09:18 +0530)]
common/octeontx: update mbox to version 1.1.3

Sync mail box data structures to version 1.1.3.
Add mail box version verification and defer initializing octeontx
devices if mail box version mismatches.
Update OCTEON TX limitaion with max mempool size used.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
4 years agobuildtools: fix build with coverage
David Marchand [Mon, 25 Nov 2019 08:10:07 +0000 (09:10 +0100)]
buildtools: fix build with coverage

A compiler can reuse a variable name and prefix it when instrumenting
with coverage.

Example:
$ make defconfig T=x86_64-native-linux-gcc O=master
$ make EXTRA_CFLAGS='--coverage' O=master
[...]
    CC rte_flow.o
 rte_flow_dynf_metadata_offs is not flagged as experimental but is listed
 in version map
 Please add __rte_experimental to the definition of
 rte_flow_dynf_metadata_offs

$ objdump -t master/build/lib/librte_ethdev/rte_flow.o |grep _offs$
0000000000000000 l     F .text.startup 000000000000000a
  _GLOBAL__sub_I_65535_0_rte_flow_dynf_metadata_offs
0000000000000620 g     O .data 0000000000000004
  rte_flow_dynf_metadata_offs

Protect against this by adding a space character in the pattern.

Fixes: a4bcd61de82d ("buildtools: add script to check experimental API exports")
Cc: stable@dpdk.org
Reported-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
4 years agobuildtools: fix experimental symbols listing
David Marchand [Mon, 25 Nov 2019 08:10:06 +0000 (09:10 +0100)]
buildtools: fix experimental symbols listing

The map-list-symbol.sh script displays the filename, section and symbol
names of map files.

Example:
$ buildtools/map-list-symbol.sh -S EXPERIMENTAL \
    lib/librte_ethdev/rte_ethdev_version.map |grep rte_mtr_create
lib/librte_ethdev/rte_ethdev_version.map EXPERIMENTAL rte_mtr_create

The experimental symbol check should only consider the symbol name.

Fixes: 3290ac14eb94 ("buildtools: detect discrepancies for experimental symbols")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
4 years agomem: clarify documentation of virt2iova behaviour
Anatoly Burakov [Thu, 14 Nov 2019 14:13:06 +0000 (14:13 +0000)]
mem: clarify documentation of virt2iova behaviour

It may not be immediately clear that rte_mem_virt2iova does not actually
check the internal memseg table, and will instead either return VA (in
IOVA as VA mode), or will fall back to kernel page table walk (in IOVA
as PA mode).

Add a note to API documentation indicating the above.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
4 years agopower: fix error log on guest message polling
David Hunt [Mon, 25 Nov 2019 15:00:42 +0000 (15:00 +0000)]
power: fix error log on guest message polling

Should be passing errno rather than ret, which could be negative.

Coverity issue: 350362
Fixes: 9dc843eb273b ("power: extend guest channel API for reading")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
4 years agoremove blank lines at end of file
Stephen Hemminger [Mon, 11 Nov 2019 19:50:15 +0000 (11:50 -0800)]
remove blank lines at end of file

Remove trailing blank lines. They serve no purpose and are just
editor leftovers.
These can cause git to complain about whitespace errors during merges.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoexamples/multi_process: fix client crash with sparse ports
Stephen Hemminger [Mon, 5 Aug 2019 16:38:17 +0000 (09:38 -0700)]
examples/multi_process: fix client crash with sparse ports

The mp_client crashes if run on Azure or any system where ethdev
ports are owned. In that case, the tx_buffer and tx_stats for the
real port were initialized correctly, but the wrong port was used.

For example if the server has Ports 3 and 5. Then calling
rte_eth_tx_buffer_flush on any other buffer will dereference null
because the tx buffer for that port was not allocated.

Also:
   - the flush code is common enough that it should not be marked
     unlikely
   - combine conditions to reduce indentation
   - avoid unnecessary if() if sent is zero.

Fixes: e2366e74e029 ("examples: use buffered Tx")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agoexamples/multi_process: check server port validity
Stephen Hemminger [Mon, 5 Aug 2019 16:38:16 +0000 (09:38 -0700)]
examples/multi_process: check server port validity

The mp_server incorrectly allows a port mask that included hidden
ports and which later caused either lost packets or failed initialization.

This fixes explicitly checking that each bit in portmask is a
valid port before using it.

Fixes: 5b7ba31148a8 ("ethdev: add port ownership")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agotest/rcu: fix build for small number of cores
Gavin Hu [Mon, 25 Nov 2019 03:36:33 +0000 (11:36 +0800)]
test/rcu: fix build for small number of cores

If the RTE_MAX_LCORE is less than 10, a compilation error is generated:
app/test/test_rcu_qsbr.c:234:10: error: comparison of integer
expressions of different signedness: ‘unsigned int’ and ‘int’
[-Werror=sign-compare]

The cause is (RTE_MAX_LCORE - 10) results in a negative value.

To fix, use rte_rand() to find a number between 0 and RTE_MAX_LCORE.

Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
4 years agomk: remove library search path from binary
Ferruh Yigit [Fri, 22 Nov 2019 11:30:23 +0000 (11:30 +0000)]
mk: remove library search path from binary

This patch functionally reverts the patch in fixes line to not have any
hardcoded library path in the final binary for the security reasons, in
case this binary distributed to production environment.

RPATH only added in RTE_DEVEL_BUILD case and this binary shouldn't
distributed, but still removing it to be cautious.

Fixes: 8919f73bcbaa ("mk: add build directory to library search path")
Cc: stable@dpdk.org
Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agombuf: extend mbuf pool private structure
Shahaf Shuler [Mon, 25 Nov 2019 10:21:32 +0000 (10:21 +0000)]
mbuf: extend mbuf pool private structure

With the API and ABI freeze ahead, it will be good to reserve
some bits on the private structure for future use.

Otherwise we will potentially need to maintain two different
private structure during 2020 period.

There is already one use case for those reserved bits[1]

The reserved field should be set to 0 by the user.

[1] https://patches.dpdk.org/patch/63077/

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agobuild: fix Windows build
Bruce Richardson [Sat, 23 Nov 2019 02:59:59 +0000 (18:59 -0800)]
build: fix Windows build

While most windows apps can handle both "\" and "/" as path separators,
"more" is treating the "/" as the start of a command-line flag in this
case, causing errors.

Fixes: cba806e07d6f ("build: change ABI versioning to global")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Tested-by: Pallavi Kadam <pallavi.kadam@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agodevtools: disable automatic probing in null testing
Thomas Monjalon [Fri, 22 Nov 2019 13:38:28 +0000 (14:38 +0100)]
devtools: disable automatic probing in null testing

The script test-null.sh is supposed to do a quick and simple
run of testpmd with null PMD only, for sanity check.
As it is not supposed to test probing of any other PMD,
physical device probing is switched to whitelist mode
by using a fake PCI address (0:0.0).
It will also help to keep memory usage stable across platforms.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agoversion: 19.11-rc3
Thomas Monjalon [Wed, 20 Nov 2019 23:56:30 +0000 (00:56 +0100)]
version: 19.11-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agopower: handle frequency increase with turbo disabled
Mattias Rönnblom [Thu, 14 Nov 2019 14:10:36 +0000 (15:10 +0100)]
power: handle frequency increase with turbo disabled

Calling pstate's or acpi's rte_power_freq_up() when on the highest
non-turbo frequency results in an error, if turbo is enabled in the BIOS,
but disabled via the power library.
The error is in the form of a return code and a RTE_LOG() entry
on the ERR level.

According to the API documentation, the frequency is scaled up
"according to the available frequencies". In case turbo is disabled,
that frequency is not available. This patch's rte_power_freq_up()
behaviour is also consistent with how rte_power_freq_max() is
implemented (i.e. the highest non-turbo frequency is set, in case
turbo is disabled).

Fixes: 445c6528b55f ("power: common interface for guest and host")
Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")
Cc: stable@dpdk.org
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Liang Ma <liang.j.ma@intel.com>
4 years agoapp/testpmd: fix invalid port detaching
Matan Azrad [Tue, 12 Nov 2019 08:47:39 +0000 (08:47 +0000)]
app/testpmd: fix invalid port detaching

The port was not validated before detaching.

Ignore port detach operation when the port is not valid.

Fixes: f8e5baa2662d ("app/testpmd: check not detaching device twice")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
4 years agobus/pci: clear driver on detach
Matan Azrad [Tue, 12 Nov 2019 08:47:38 +0000 (08:47 +0000)]
bus/pci: clear driver on detach

When probing, a bus is responsible for filling the driver field to
indicate the device is bound.
Let's clear this field when detaching to keep a consistent behavior.

This is not a fix per se, since the device is freed when detaching.
But at least clearing the field has been added to remind that the
driver field has a meaning for the EAL.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agokni: increase kernel version requirement for VA
Ferruh Yigit [Wed, 20 Nov 2019 17:22:26 +0000 (17:22 +0000)]
kni: increase kernel version requirement for VA

A build error reported related to the selected 'get_user_pages_remote()'
kernel API:

.../kernel/linux/kni/kni_dev.h:113:8:
  error: too few arguments to function ‘get_user_pages_remote’
  ret = get_user_pages_remote(tsk, tsk->mm, iova, 1
        ^~~~~~~~~~~~~~~~~~~~~

Currently there are three versions of the 'get_user_pages_remote()'
supported, based on kernel version < 4.9, = 4.9, > 4.9.

These version based checks are not working fine with the distro kernels
which is the cause of reported build error. The error reported by the
kernel version 4.8, but it is using API defined in > 4.9.

To be able to take control of this, and possible more, related build
error, increasing the minimum supported kernel version for iova=va with
KNI to kernel version 4.9.

This leaves us with single version of the kernel API and more manageable.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
4 years agobpf/arm: fix clang build
Ruifeng Wang [Fri, 15 Nov 2019 06:47:54 +0000 (14:47 +0800)]
bpf/arm: fix clang build

Clang has different prototype for __builtin___clear_cache().
It requires 'char *' parameters while gcc requires 'void *'.

Clang version 8.0 was used.
Warning messages during build:
../lib/librte_bpf/bpf_jit_arm64.c:1438:26: warning: incompatible pointer
types passing 'uint32_t *' (aka 'unsigned int *') to parameter of type
'char *' [-Wincompatible-pointer-types]
        __builtin___clear_cache(ctx.ins, ctx.ins + ctx.idx);
                                ^~~~~~~
../lib/librte_bpf/bpf_jit_arm64.c:1438:35: warning: incompatible pointer
types passing 'uint32_t *' (aka 'unsigned int *') to parameter of type
'char *' [-Wincompatible-pointer-types]
        __builtin___clear_cache(ctx.ins, ctx.ins + ctx.idx);
                                         ^~~~~~~~~~~~~~~~~

Fixes: f3e516772464 ("bpf/arm: add prologue and epilogue")
Cc: jerinj@marvell.com
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoconfig: add eMAG
Jerry Hao OS [Mon, 14 Oct 2019 09:34:18 +0000 (17:34 +0800)]
config: add eMAG

Add the make and meson based build infrastructure for the eMAG platform
from Ampere Computing corp., which is a 64-bit ARM processor with 32
Armv8 64-bit CPU cores. For more information, refer to:
https://amperecomputing.com/product/

Signed-off-by: Jerry Hao OS <jerryhao@os.amperecomputing.com>
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoconfig: add cortex-a76 for meson
Gavin Hu [Mon, 11 Nov 2019 05:41:51 +0000 (13:41 +0800)]
config: add cortex-a76 for meson

To make the list complete and consistent, add cortex-a76 configuration.

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoconfig: add Arm Neoverse N1 SDP
Gavin Hu [Mon, 11 Nov 2019 05:41:50 +0000 (13:41 +0800)]
config: add Arm Neoverse N1 SDP

Arm N1 SDP is an infrastructure segment development platform
based on armv8.2-a Neoverse N1 CPU. For more information, refer to:
https://community.arm.com/developer/tools-software/oss-platforms/w/
docs/440/neoverse-n1-sdp

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agodevtools: reduce list of Arm builds tested with meson
Thomas Monjalon [Wed, 20 Nov 2019 23:05:55 +0000 (00:05 +0100)]
devtools: reduce list of Arm builds tested with meson

The list of Arm configs is growing:
config/arm/arm64_armada_linux_gcc
config/arm/arm64_armv8_linux_gcc
config/arm/arm64_bluefield_linux_gcc
config/arm/arm64_dpaa_linux_gcc
config/arm/arm64_emag_linux_gcc
config/arm/arm64_n1sdp_linux_gcc
config/arm/arm64_octeontx2_linux_gcc
config/arm/arm64_thunderx2_linux_gcc
config/arm/arm64_thunderx_linux_gcc

In order to keep testing time reasonable,
and also because n1sdp is merged without a related fix in tests,
the list of configs is reduced in the script test-meson-builds.sh.

The list of tested Arm builds becomes:
build-arm64-host-clang (armv8a)
build-arm64-bluefield
build-arm64-dpaa
build-arm64-octeontx2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agobuildtools: add ABI version check script
Marcin Baran [Wed, 20 Nov 2019 17:23:39 +0000 (17:23 +0000)]
buildtools: add ABI version check script

Add a shell script that checks whether built libraries are
versioned with expected ABI (current ABI, current ABI + 1,
or EXPERIMENTAL).

The following command was used to verify current source tree
(assuming build directory is in ./build):

find ./build/lib ./build/drivers -name  \*.so \
-exec ./buildtools/check-abi-version.sh {} \; -print

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
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>
4 years agobuild: align symbols with global ABI version
Pawel Modrak [Wed, 20 Nov 2019 17:23:38 +0000 (17:23 +0000)]
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>
4 years agocommon/octeontx: add missing public symbol
Anatoly Burakov [Wed, 20 Nov 2019 17:23:37 +0000 (17:23 +0000)]
common/octeontx: add missing public symbol

The logtype symbol was missing from the .map file. Add it.

Fixes: d8dd31652cf4 ("common/octeontx: move mbox to common folder")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodistributor: rename v2.0 ABI to _single suffix
Marcin Baran [Wed, 20 Nov 2019 17:23:36 +0000 (17:23 +0000)]
distributor: rename v2.0 ABI to _single suffix

The original ABI versioning was slightly misleading in that the
DPDK 2.0 ABI was really a single mode for the distributor, and is
used as such throughout the distributor code.

Fix this by renaming all _v20 API's to _single API's, and remove
symbol versioning.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodistributor: remove deprecated code
Marcin Baran [Wed, 20 Nov 2019 17:23:35 +0000 (17:23 +0000)]
distributor: remove deprecated code

Remove code for old ABI versions ahead of ABI version bump.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agolpm: remove deprecated code
Marcin Baran [Wed, 20 Nov 2019 17:23:34 +0000 (17:23 +0000)]
lpm: remove deprecated code

Remove code for old ABI versions ahead of ABI version bump.

Signed-off-by: Marcin Baran <marcinx.baran@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>
4 years agotimer: remove deprecated code
Marcin Baran [Wed, 20 Nov 2019 17:23:33 +0000 (17:23 +0000)]
timer: remove deprecated code

Remove code for old ABI versions ahead of ABI version bump.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agobuildtools: add ABI version update script
Anatoly Burakov [Wed, 20 Nov 2019 17:23:32 +0000 (17:23 +0000)]
buildtools: add ABI version update script

In order to facilitate mass updating of version files, add a shell
script that recurses into lib/ and drivers/ directories and calls
the ABI version update script.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agobuildtools: add symbols map update script
Pawel Modrak [Wed, 20 Nov 2019 17:23:31 +0000 (17:23 +0000)]
buildtools: add symbols map update script

Add a script that automatically merges all stable ABI's under one
ABI section with the new version, while leaving experimental
section exactly as it is.

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>
4 years agobuild: remove individual library versions
Anatoly Burakov [Wed, 20 Nov 2019 17:23:30 +0000 (17:23 +0000)]
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>
4 years agobuild: change ABI versioning to global
Marcin Baran [Wed, 20 Nov 2019 17:23:28 +0000 (17:23 +0000)]
build: change ABI versioning to global

As per new ABI policy [1], all of the libraries are now versioned using
one global ABI version. Stable libraries use the MAJOR.MINOR ABI
version for their shared objects, while experimental libraries
use the 0.MAJORMINOR convention for their versioning.
Experimental library versioning is managed globally. Changes in this
patch implement the necessary steps to enable that.

The CONFIG_RTE_MAJOR_ABI option was introduced to permit multiple
DPDK versions installed side by side. The problem is now addressed
through the new ABI policy, and thus can be removed.

[David] For external libraries relying on Makefile, LIBABIVER is
preserved to avoid using DPDK global ABI version.

[1] https://doc.dpdk.org/guides/contributing/abi_policy.html

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
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>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoexamples: hide error for missing pkg-config path flag
Bruce Richardson [Fri, 15 Nov 2019 15:17:00 +0000 (15:17 +0000)]
examples: hide error for missing pkg-config path flag

Some versions of pkg-config don't support the --path flag, which is not a
fatal error when building the apps. Without the flag, the makefile just
cannot track the .pc file of DPDK as a dependency of the build. Therefore,
we can ignore the error and suppress it by redirecting to /dev/null the
stderr from that call to pkg-config.

Fixes: 22119c4591a0 ("examples: use pkg-config in makefiles")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoexamples: fix build with old pkg-config
Bruce Richardson [Fri, 15 Nov 2019 15:16:59 +0000 (15:16 +0000)]
examples: fix build with old pkg-config

Not all versions of pkg-config in distros have support for the
--define-prefix flag [1], causing errors when building examples manually or
with test-meson-builds.sh script [2].

For the former case, we need to remove the hard-coded use of the flag in
the Makefiles.

For the latter case, the flag is necessary for builds to succeed, so we
skip the tests when it's not present, passing it as part of the pkg-config
command if it is supported.

[1]
CentOS Linux release 7.7.1908 (Core)
pkg-config version 0.27.1

[2]
 ## Building cmdline
Unknown option --define-prefix
gmake: Entering directory
`...ild-x86-default/install-root/usr/local/share/dpdk/examples/cmdline'
rm -f build/cmdline build/cmdline-static build/cmdline-shared
test -d build && rmdir -p build || true
Unknown option --define-prefix
Unknown option --define-prefix
gcc -O3  main.c commands.c parse_obj_list.c -o build/cmdline-shared
main.c:14:28: fatal error: cmdline_rdline.h: No such file or directory

Fixes: ca9268529d2b ("examples: support relocated DPDK install")
Fixes: 7f80a2102bbb ("devtools: test pkg-config file")
Cc: stable@dpdk.org
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: fix Rx queue release assertions
Matan Azrad [Wed, 20 Nov 2019 09:21:16 +0000 (09:21 +0000)]
net/mlx5: fix Rx queue release assertions

In debug mode, there is assertion to validate the CQ object before the
release.

Wrongly, the assertion is done for any type of RX queue even if it
doesn't use CQ at all, for example in hairpin Rx queue.

Ignore CQ assertion when hairpin queue is released.

Fixes: e79c9be91515 ("net/mlx5: support Rx hairpin queues")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/hinic: fix secondary process
Xiaoyun Wang [Tue, 19 Nov 2019 12:31:34 +0000 (20:31 +0800)]
net/hinic: fix secondary process

The secondary process does not need to register interrupt handle,
remove rte_intr_callback_register from secondary process branch.

Fixes: 64727024d2fd ("net/hinic: add device initialization")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agoapp/testpmd: report invalid command line parameter
David Marchand [Mon, 18 Nov 2019 15:37:14 +0000 (16:37 +0100)]
app/testpmd: report invalid command line parameter

We currently do not check that a non option string has been passed to
testpmd.

Example:
$ ./master/app/testpmd --no-huge -m 512 --vdev net_null0 \
--vdev net_null1 -- -i nb-cores=2 --total-num-mbuf 2048
[...]
testpmd> show config fwd
io packet forwarding - ports=2 - cores=1 - streams=2 - NUMA support
enabled, MP allocation mode: native
Logical Core 1 (socket 0) forwards packets on 2 streams:
  RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
  RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00

Here nb-cores=2 is just ignored, while the (probably sleepy) user did not
notice this.

Validate that all strings passed to testpmd are part of a known option.

After this patch:
$ ./master/app/testpmd --no-huge -m 512 --vdev net_null0 \
--vdev net_null1 -- -i nb-cores=2 --total-num-mbuf 2048
[...]
Invalid parameter: nb-cores=2
EAL: Error - exiting with code: 1
  Cause: Command line incorrect

While at it, when passing an unknown option, print the string that gets
refused by getopt_long to help the user.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: fix L3 encapsulation flow validation
Matan Azrad [Tue, 19 Nov 2019 15:32:28 +0000 (15:32 +0000)]
net/mlx5: fix L3 encapsulation flow validation

In order to configure L3 encapsulation\decapsulation flow to mlx5
devices, 2 actions should be added to the flow actions list:
RTE_FLOW_ACTION_TYPE_RAW_DECAP and RTE_FLOW_ACTION_TYPE_RAW_ENCAP.

One of the validations for this scenario is to check that modify actions
is not done before the L3 decapsulation, because it doesn't make sense
to decapsulate a modified data.

Wrongly, this check was done for the case of L3 encapsulation what
causes a validation failure in modify + L3 encapsulation flow.

Ignore this check in case of L3 encapsulation.

Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
4 years agonet/bnxt: fix flow check for null spec and mask
Ajit Khaparde [Wed, 20 Nov 2019 03:00:23 +0000 (19:00 -0800)]
net/bnxt: fix flow check for null spec and mask

bnxt_validate_and_parse_flow_type already has protocol specific NULL
checks for rte_flow_item spec and mask and take actions accordingly.
A check at the top of the loop is redundant and is preventing the
protocol specific checks from being executed.

Fixes: b7e01f386059 ("net/bnxt: handle cleanup if flow creation fails")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix vector Rx selection
Lance Richardson [Tue, 19 Nov 2019 22:12:15 +0000 (17:12 -0500)]
net/bnxt: fix vector Rx selection

Take DEV_RX_OFFLOAD_RSS_HASH into account when deciding whether vector
mode receive can be enabled.

Fixes: 8b945a7f7dcb ("drivers/net: update Rx RSS hash offload capabilities")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix jumbo frame configuration in firmware
Rahul Gupta [Fri, 15 Nov 2019 09:40:09 +0000 (15:10 +0530)]
net/bnxt: fix jumbo frame configuration in firmware

In order to prevent reconfiguration of firmware resources for every
MTU change, configure FW with max MTU value using hwrm_func_cfg
to support all frame sizes. There is no need to overwrite the driver
level MTU variable data->mtu with the FW MTU.

Fixes: 905cd45ce30e ("net/bnxt: use configured MTU during load")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix resource qcaps with older FW
Ajit Khaparde [Mon, 18 Nov 2019 22:23:45 +0000 (14:23 -0800)]
net/bnxt: fix resource qcaps with older FW

On some old versions of FW, bnxt_hwrm_func_resc_qcaps can return an
error. This is because the command was not implemented completely
in FW till the subsequent version. Ignore the error and continue with
the driver initialization.

Fixes: edafb57ba4a1 ("net/bnxt: fix VF resource allocation")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/ice: fix flow director rule duplication check
Yahui Cao [Tue, 19 Nov 2019 16:01:00 +0000 (00:01 +0800)]
net/ice: fix flow director rule duplication check

When FDIR filter detects duplicated rule and then returns EEXIST, ice
flow will capture this error and return immediately.

Fixes: 4e27d3ed02bd ("net/ice: fix flow API framework")

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/mlx5: fix hairpin split detection
Ori Kam [Tue, 19 Nov 2019 12:38:33 +0000 (12:38 +0000)]
net/mlx5: fix hairpin split detection

When creating a flow, the flow is checked if it should be split into
2 flows based on the queue/rss acton.

If the RSS action with given without any queues, it will result in crash
due to the fact that the function checks the queue type.

This commit fixes this issue by checking if the rss action is not empty,
and at least one queue.

Fixes: d85c7b5ea59f ("net/mlx5: split hairpin flows")

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: fix assert in Tx inline settings
Viacheslav Ovsiienko [Tue, 19 Nov 2019 13:13:09 +0000 (13:13 +0000)]
net/mlx5: fix assert in Tx inline settings

Assert condition is fixed to not alert for the case
when multi-packet write is not supported/engaged at all.

Fixes: b53cd86965a1 ("net/mlx5: adjust inline setting for large Tx queue sizes")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: fix port action for LAG
Viacheslav Ovsiienko [Tue, 19 Nov 2019 09:16:04 +0000 (09:16 +0000)]
net/mlx5: fix port action for LAG

To support LAG configurations the mlx5dv_dr_action_create_dest_ib_port()
should be called instead of mlx5dv_dr_action_create_dest_vport().

Fixes: f07341e7aed3 ("net/mlx5: update source and destination vport translations")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoethdev: avoid undefined behaviour on configuration copy
Andrew Rybchenko [Tue, 19 Nov 2019 08:22:50 +0000 (08:22 +0000)]
ethdev: avoid undefined behaviour on configuration copy

memcpy() source and destination areas must not overlap and equal
pointers is the case which is really met, so handle it.

Fixes: 68b931bff287 ("ethdev: eliminate interim variable")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ice: add flow mark hint
Qi Zhang [Tue, 19 Nov 2019 06:14:42 +0000 (14:14 +0800)]
net/ice: add flow mark hint

Since not all data paths support flow mark, the driver needs
a hint from application to select the correct data path if
flow mark is required. The patch introduces a devarg
"flow-mark-support" as a workaround solution, since a standard
way is still ongoing.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>