Commit Graph

33306 Commits

Author SHA1 Message Date
Andrew Rybchenko
f51abd4397 mempool: remove deprecated unused defines
MEMPOOL_PG_NUM_DEFAULT and MEMPOOL_PG_SHIFT_MAX defines are unused
since xmem API removal.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2022-09-26 14:05:13 +02:00
Andrew Rybchenko
6efe9ff22d mempool: remove deprecated macro to register mempool driver
Replacement RTE_MEMPOOL_REGISTER_OPS() should be used instead.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2022-09-26 14:05:06 +02:00
Andrew Rybchenko
b0831090cd mempool: remove deprecated macro to calculate header size
MEMPOOL_HEADER_SIZE() is removed. The replacement with RTE_ prefix
is internal only since it is implementation details which are not
required in applications.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2022-09-26 14:04:51 +02:00
Bruce Richardson
2607c9cbeb telemetry: make help command more helpful
The /help telemetry command prints out the help text for the given
command passed in as parameter. However, entering /help without any
parameters does not give any useful information as to the fact that you
need to pass in a command to get help on. Update the command so it
prints its own help text when called without any parameters.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:38 +02:00
Bruce Richardson
0f3d92f373 telemetry: eliminate duplicate code for json output
When preparing the json response to a telemetry socket query, the code
for prefixing the command name, and appending the file "}" on the end of
the response was duplicated for multiple reply types. Taking this code
out of the switch statement reduces the duplication and makes the code
more maintainable.

For completeness of testing, add in a test case to validate the "null"
response type - the only leg of the switch statement not already covered
by an existing test case in the telemetry_data tests.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:38 +02:00
Bruce Richardson
d0049f7a2c test/telemetry_data: add test cases for character escaping
Add in some basic unit tests to validate the character escaping being
done on string data values, which tests end-to-end processing of those
values beyond just the json-encoding steps tested by the
"telemetry_json_autotest".

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:38 +02:00
Bruce Richardson
1306df2cd1 test/telemetry_data: refactor for maintainability
To help with the writing and maintaining of test cases in this file we
can make the following changes to it:

- rename non-test-case functions i.e. the infrastructure functions, to
  not start with "test_", so that each sub-test case can be identified
  by starting with that prefix.
- add a comment at the start of the file explaining how tests are to be
  written and managed, so as to keep consistency.
- add a trivial test-case for returning a simple string value to use as
  a reference example for those wanting to add test cases.
- improve the key macro used for validating the output from each
  function, so that the standard json preamble can be skipped for each
  function. This hides more of the infrastructure implementation from
  the user i.e. they don't need to worry what the actual command used is
  called, and also shortens the output strings so we can avoid line
  splitting in most cases.
- add clearing the "response_data" structure to the loop calling each
  test to avoid each test function having to do so individually.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:38 +02:00
Bruce Richardson
b64b2a6ce3 telemetry: limit command characters
Limit the telemetry command characters to the minimum set needed for
current implementations. This prevents issues with invalid json
characters needing to be escaped on replies.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:37 +02:00
Bruce Richardson
72f3c45c6a test/telemetry_json: add test for string escaping in objects
Add a test-case to validate that when adding strings either as the name
or the value of an entry in an object, that all values are escaped
properly.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:11 +02:00
Bruce Richardson
6918ef8eeb telemetry: add escaping of strings in dicts
When strings are added to an dict variable, we need to properly escape
the invalid json characters in the strings.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:11 +02:00
Bruce Richardson
f46d4260e7 test/telemetry-json: add test for escaping strings in arrays
Add test-case to validate that when adding strings to arrays, the
strings are properly escaped to remove any invalid characters.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:11 +02:00
Bruce Richardson
14d84fccb2 telemetry: add escaping of strings in arrays
When strings are added to an array variable, we need to properly escape
the invalid json characters in the strings.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:11 +02:00
Bruce Richardson
56069f9832 test/telemetry_json: add test for string character escaping
Add unit test to validate that when creating a string response in json,
that characters such as \n or quotes are properly escaped.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:11 +02:00
Bruce Richardson
babc521444 telemetry: fix escaping of invalid json characters
For string values returned from telemetry, escape any values that cannot
normally appear in a json string. According to the json spec[1], the
characters than need to be handled are control chars (char value < 0x20)
and '"' and '\' characters.

To handle this, we replace the snprintf call with a separate string
copying and encapsulation routine which checks each character as it
copies it to the final array.

[1] https://www.rfc-editor.org/rfc/rfc8259.txt

Bugzilla ID: 1037
Fixes: 6dd571fd07 ("telemetry: introduce new functionality")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:11 +02:00
Bruce Richardson
4493654803 test/telemetry_json: print success or failure per subtest
rather than just printing out success or failure at the end of the test
only, print out "OK" or "ERROR" for each individual test case within the
overall test. As part of this, ensure each case returns 0 on success and
any other value on failure.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:11 +02:00
Bruce Richardson
2537fb0c5f telemetry: limit characters allowed in dictionary names
To save issues with encoding the names of values in dicts, we limit the
allowed names to a subset of character values. This list of allowed
characters can be expanded as necessary in future.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:10 +02:00
Fidaullah Noonari
f92b9ebed0 malloc: fix storage size for some allocations
The amount of memory to allocate from the system for heap expansion
was calculated in a way that may yield one page more than needed.
This could hit the allocation limit from the system or EAL.
The allocation would fail despite enough memory being available.

In response to mail:
https://inbox.dpdk.org/dev/CAEYuUWCnRZNwxiOHEeTHw0Gy9aFJRLZtvAG9g=smuUvUEMcFXg@mail.gmail.com/

A reproducer has been provided by Dmitry, see:
https://inbox.dpdk.org/dev/20220922015212.03bfde66@sovereign/

Fixes: 07dcbfe010 ("malloc: support multiprocess memory hotplug")
Cc: stable@dpdk.org

Signed-off-by: Fidaullah Noonari <fidaullah.noonari@emumba.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2022-09-26 11:40:20 +02:00
Nithin Dabilpuram
479c2b1b5f net/cnxk: support multi-segment inline IPsec
Add multi-seg support for Inline IPsec.
Also in reassembly, FI_PAD is not required to compute pointer to
Fragment info because it is only at CPT_PARSE_HDR_S + FI_OFFSET * 8
and is always 8B aligned.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
2022-09-22 10:44:47 +02:00
Satheesh Paul
73fc72e125 common/cnxk: update MKEX capability flags
Update MKEX capability flags to enable parsing
VLAN PCP, DSCP and GTPv1 TEID.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2022-09-22 10:44:46 +02:00
Satheesh Paul
ad2c7b20ef common/cnxk: print counters along with flow dump
When dumping hardware flow data, print any counter
configured on the flow as well.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2022-09-22 10:44:44 +02:00
Satheesh Paul
af45c18e90 common/cnxk: fix printing disabled MKEX registers
This patch skips printing disabled MKEX registers when
dumping hardware flow MCAM entry data.

Fixes: 9869c39918 ("common/cnxk: support flow entry dump")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2022-09-22 10:44:43 +02:00
Satheesh Paul
b494807269 common/cnxk: fix missing flow counter reset
Added code to clear counters upon flow deletion.

Fixes: f9af908074 ("common/cnxk: add mcam utility API")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2022-09-22 10:44:41 +02:00
Amit Prakash Shukla
d7b080f1e7 net/mvneta: fix build with GCC 12
./drivers/net/mvneta/mvneta_rxtx.c:89:42:
	error: 'mbufs' may be used uninitialized [-Werror=maybe-uninitialized]
   89 |         MVNETA_SET_COOKIE_HIGH_ADDR(mbufs[0]);
      |                                          ^
../drivers/net/mvneta/mvneta_rxtx.c:77:26: note: 'mbufs' declared here
   77 |      struct rte_mbuf *mbufs[MRVL_NETA_BUF_RELEASE_BURST_SIZE_MAX];
      |                       ^~~~~

Fixes: ce7ea76459 ("net/mvneta: support Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
Acked-by: Liron Himi <lironh@marvell.com>
2022-09-22 10:44:39 +02:00
Rakesh Kudurumalla
dac480837c net/cnxk: dump device private information
Add support for ethdev private data dump callback for
debugging purposes.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
2022-09-22 10:44:37 +02:00
Rakesh Kudurumalla
4006ac1ffb common/cnxk: dump device basic information to file
Add helper API to complete device info for debug purposes.
This is used by ethdev dump API to dump ethdev's internal info.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
2022-09-22 10:44:36 +02:00
Vidya Sagar Velumuri
a33ed96814 net/cnxk: enable ESN and anti-replay
Enable ESN and anti-replay in IPsec capabilities
Add support for session update security API
Fix the CPT command population for ESN enabled case

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-09-22 10:44:35 +02:00
Vidya Sagar Velumuri
fe87c45543 net/cnxk: support crypto auth algo MD5
Add support for MD5 auth algo for security offload in inline mode.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-09-22 10:44:33 +02:00
Vidya Sagar Velumuri
e1a9ff6930 net/cnxk: support crypto cipher DES-CBC
Add support for DES-CBC cipher for security offload in inline mode.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-09-22 10:44:32 +02:00
Nithin Dabilpuram
61ee9dc8b6 net/cnxk: limit port-specific SA table size
Limit port specific SA table size to 1 entry when not used.
This is useful when inline device is enabled as then
Port specific SA table will not be used for Inline IPsec
inbound processing.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:31 +02:00
Nithin Dabilpuram
9c11122cd0 net/cnxk: wait for CPT FC on WQE path
Wait for CPT flow control on WQE path. This is to
avoid CPT queue overflow and thereby a CPT misc
interrupt.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:29 +02:00
Kommula Shiva Shankar
b059bbb895 common/cnxk: support Tx completion event via RQ/CQ mapping
Added RoC support for Tx completion events via RQ to CQ mapping.

Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
2022-09-22 10:44:28 +02:00
Kommula Shiva Shankar
ba6855a01d common/cnxk: add CQ limit associated with SQ
Update CQ threshold limit associated with sq.
This is used when we need completions for packets that are
successfully transmitted.

Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
2022-09-22 10:44:27 +02:00
Rakesh Kudurumalla
ddf955d391 common/cnxk: support CPT second pass
Added mailbox for masking and setting nix_rq_ctx
parameters and enabling rq masking in ipsec_cfg1
so second pass is applied to all RQ's

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
2022-09-22 10:44:25 +02:00
Satha Rao
ae8fb811a3 net/cnxk: skip PFC configuration on LBK
CNXK platforms do not support PFC on LBK so skipping
configuration on LBK interfaces.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
2022-09-22 10:44:24 +02:00
Vidya Sagar Velumuri
e30c01fbcd net/cnxk: enable 3DES-CBC cipher capability
Enable 3DES-CBC cipher capability for inline IPsec processing.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-09-22 10:44:23 +02:00
Vidya Sagar Velumuri
1e68195d65 net/cnxk: enable additional ciphers for inline
Enable below ciphers and auths as part of capabilities for inline IPsec
AES_CTR, AES_XCBC_MAC, AES_GMAC.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-09-22 10:44:21 +02:00
Harman Kalra
6cf706ce99 common/cnxk: add 98xx A1 platform
Adding support for 98xx A1 pass chip.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
2022-09-22 10:44:20 +02:00
Satha Rao
80053371b2 common/cnxk: update shaper profile with RED algorithm
Updated shaper profile with user configurable RED algorithm.
This helps in configuring a TM node in red drop mode vs
stall mode.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
2022-09-22 10:44:18 +02:00
Satha Rao
46008e1b7c common/cnxk: enable aging on CN10K platform
This patch set enables aging on CNF105 variant of CN10K platform.
Enables aging statistics while dumping/reset SQ statistics.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
2022-09-22 10:44:17 +02:00
Vidya Sagar Velumuri
e86610ac1d net/cnxk: add crypto capabilities for HMAC-SHA2
Add capabilities for HMAC_SHA2 and udp encap for 9k
security offload in inline mode.
Set explicit IV mode in IPsec context when IV is provided by the
application

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-09-22 10:44:15 +02:00
Vidya Sagar Velumuri
4440eb88dd net/cnxk: use full context IPsec structures
Use the Full context SA structures and command in IPsec fast path.
For inline outbound, populate CPT instruction as per full context.
Added new macros and functions with respect to full context.

Populate WQE ptr in CPT instruction with proper offset from mbuf.
Also add option to override outbound inline SA IV for debug
Update mbuf length based on IP version in Rx post process purposes
via environment variable.

User can set env variable as:
export ETH_SEC_IV_OVR="0x0, 0x0,..."

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:13 +02:00
Vidya Sagar Velumuri
0070027288 common/cnxk: avoid using platform-specific APIs
Replace the use of platform specific APIs with platform independent
APIs.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-09-22 10:44:11 +02:00
Nithin Dabilpuram
780b9c8924 net/cnxk: support zero AURA for inline meta
Add support for zero aura for inline meta packets and register
callback to ROC to create meta pool via mempool. Also
add devargs to override meta buffer count and size.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:10 +02:00
Nithin Dabilpuram
0f3f3ad850 common/cnxk: support zero AURA for inline inbound meta
Add support to create zero aura for inline inbound meta packets when
platform supports it.

AURA zero will hold as many buffers as all the available
pkt pool with a data to accommodate 384B in best case to store
meta packets coming from Inline IPsec.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:08 +02:00
Nithin Dabilpuram
aaea4c74b7 common/cnxk: update attributes to pools used by NIX
Update attributes to pools used by NIX so that we
can later identify which mempools are packet pools
and which are used for Inline IPsec enabled ethdev.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:07 +02:00
Nithin Dabilpuram
de00cc3521 common/cnxk: support setting NPA buffer type
Add support to set/get per-aura buf type with refs and
get sum of all aura limits matching given buf type mask
and val.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:06 +02:00
Nithin Dabilpuram
8e5a4adb4f common/cnxk: reserve AURA zero on CN10KA NPA
Reserve AURA id 0 on cn10k and provide mechanism to specifically
allocate it and free it via roc_npa_* API's.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:04 +02:00
Nithin Dabilpuram
da1ec39060 common/cnxk: delay inline device RQ enable to dev start
Similar to other RQ's, delay inline device RQ until dev is started
to avoid traffic reception when device is stopped.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:03 +02:00
Nithin Dabilpuram
93c6b6b271 common/cnxk: limit meta AURA workaround to CN10K A0
Limit meta AURA workaround to CN10K A0.
Also other NIX and Inline related Erratas applicable for CN10K A1.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:01 +02:00
Nithin Dabilpuram
8c8568bc0b net/cnxk: fix missing FC wait for outbound vector mode
Fix missing FC wait for outbound path in vector mode.
Currently only poll mode has it.

Fixes: 358d02d20a ("net/cnxk: support flow control for outbound inline")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:00 +02:00