Commit Graph

784 Commits

Author SHA1 Message Date
Shijith Thotton
44a2cebbd4 crypto/octeontx: add crypto adapter data path
Added support for crypto adapter OP_FORWARD mode.

As OcteonTx CPT crypto completions could be out of order, each crypto op
is enqueued to CPT, dequeued from CPT and enqueued to SSO one-by-one.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:28:39 +02:00
Anoob Joseph
2a6c7922fc common/cpt: add checks for offset overflow
Add checks to catch overflow of any offsets. Offset control word
specifies,

1. 16 bits encryption offset
2. 8 bits IV offset
3. 8 bits auth offset

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:28:39 +02:00
Ankur Dwivedi
5e076b609f common/cnxk: add SE set key for crypto
The set key functions are added in roc to be used
in crypto operations.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Srujana Challa
78d03027f2 common/cnxk: add IPsec common code
Add code that can be leveraged across
lookaside and inline IPsec on cn10k.

Signed-off-by: Srujana Challa <schalla@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Kiran Kumar K
80ab347db4 common/cnxk: add EC vectors for asymmetric crypto
EC group static vectors are required for CPT asymmetric
crypto operations.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Kiran Kumar K
9514771ed9 common/cnxk: add FPM tables for asymmetric crypto
Add scalar FPM tables to be used for asymmetric crypto
operations.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Anoob Joseph
497d780e04 common/cnxk: add lmtline initialization
Add routine to initialize LMTLINE which facilitates instruction
submission to CPT. Add common macros required in the enqueue
operations.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Kiran Kumar K
1132ad0f08 common/cnxk: add AE definitions for asymmetric crypto
Microcode AE opcodes support asymmetric operations. Add defines
and structs defined by microcode.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Srujana Challa
d974d47a3b common/cnxk: add IE definitions for IPsec
Microcode IE opcodes support IPsec operations. Add defines
and structs defined by microcode.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Srujana Challa <schalla@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Kiran Kumar K
a45859312f common/cnxk: add SE definitions for symmetric crypto
Microcode SE opcodes support symmetric operations. Add defines
and structs defined by microcode.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Vidya Sagar Velumuri
ed79bf91bc common/cnxk: add inline IPsec configuration mailbox
Add mbox to configure inbound & outbound inline IPsec.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Aakash Sasidharan
507dda437f common/cnxk: add CPT LF flush
Add routine to flush context from CPT context processor cache.

Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Aakash Sasidharan
b1a22e5d4f common/cnxk: add CPT diagnostics
Add routines to fetch and dump CPT statistics and states.

Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com>
Signed-off-by: Srujana Challa <schalla@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Archana Muniganti
ed135040f0 common/cnxk: add CPT LF configuration
Add routines to init & fini CPT LFs. CPT LFs are
queues to the hardware enabling instruction submissions.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Vidya Sagar Velumuri
147b98e661 common/cnxk: add mailbox to configure RXC
Add mailbox to configure timeouts and thresholds in
CPT RXC unit.

Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Anoob Joseph
0a2879b2e8 common/cnxk: add CPT get/set
Add APIs to set & get CPT device.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Anoob Joseph
c045d2e5cb common/cnxk: add CPT configuration
Add routines to init, fini, configure & clear CPT device.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Srujana Challa
39f3b8126b common/cnxk: update Rx inline IPsec mailbox format
Updates Rx inline IPSEC mailbox message format to sync
with latest CPT PF driver.

Signed-off-by: Srujana Challa <schalla@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Vidya Sagar Velumuri
64a73ebd87 common/cnxk: add CPT hardware definitions
Add CPT hardware definitions. CPT is the hardware block on
cnxk family of processors, that can be used to offload
cryptographic operations.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
David Marchand
d07fc02fb4 drivers/net: fix memzone allocations for DMA memory
Caught by code review.

Using a random name for memzone allocations can result in init failures
in the unlikely case that a name collision occurs.
Use a simple sequential generator on 64 bits.

Fixes: 3f50f072ff ("i40e: fix memzone freeing")
Fixes: 22b123a36d ("net/avf: initialize PMD")
Fixes: 5f0978e962 ("net/ice/base: add OS specific implementation")
Fixes: 737f30e1c3 ("net/hns3: support command interface with firmware")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2021-07-07 14:30:30 +02:00
Ivan Malov
3790789980 common/sfc_efx/base: add MAE VLAN presence match bits
Introduce necessary infrastructure for these fields to
be set, validated and compared during class comparison.
Enumeration and mappings envisaged are MCDI-compatible.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2021-07-07 11:54:21 +02:00
Andrew Rybchenko
fd893e8944 common/sfc_efx/base: update MCDI headers
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2021-07-07 11:54:21 +02:00
Ting Xu
6b62423fac common/iavf: support ETS-based QoS offload configuration
This patch adds new virtchnl opcodes and structures for QoS
configuration, which includes:
1. VIRTCHNL_VF_OFFLOAD_TC, to negotiate the capability supporting QoS
configuration. If VF and PF both have this flag, then the ETS-based QoS
offload function is supported.
2. VIRTCHNL_OP_DCF_CONFIG_BW, DCF is supposed to configure min and max
bandwidth for each VF per enabled TCs. To make the VSI node bandwidth
configuration work, DCF also needs to configure TC node bandwidth
directly.
3. VIRTCHNL_OP_GET_QOS_CAPS, VF queries current QoS configuration, such
as enabled TCs, arbiter type, up2tc and bandwidth of VSI node. The
configuration is previously set by DCB and DCF, and now is the potential
QoS capability of VF. VF can take it as reference to configure queue TC
mapping.
4. VIRTCHNL_OP_CONFIG_TC_MAP, set VF queues to TC mapping for all Tx and
Rx queues. Queues mapping to one TC should be continuous and all
allocated queues should be mapped.

Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2021-07-06 04:58:14 +02:00
Wenjun Wu
5f115d7d3a common/iavf: add GRE header type
Add a virtchnl protocol header type to support AVF FDIR and RSS for GRE.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2021-07-04 16:57:03 +02:00
Harman Kalra
cb8d769fb6 common/octeontx2: send link event to VF
Currently link event is only sent to the PF by AF as soon as it comes
up, or in case of any physical change in link. PF will broadcast
these link events to all its VFs as soon as it receives it.
But no event is sent when a new VF comes up, hence it will not have
the link status.
Adding support for sending link status to the VF once it comes up
successfully.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-06-30 04:25:21 +02:00
Satheesh Paul
b65db6a879 net/octeontx2: fix flow creation limit on CN98xx
CN96xx and CN98xx have 4096 and 16384 MCAM entries respectively.
Aligning the code with the same numbers.

Fixes: 092b383418 ("net/octeontx2: add flow init and fini")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-06-30 04:02:49 +02:00
Satheesh Paul
d43a7bee1a net/cnxk: get flow operations
This patch adds flow ops get operation to enable rte_flow_ops.A

This patch also add support for flow dev dump API.
Every flow rule added will be dumped in the below format.

MCAM Index:1881
Interface :NIX-RX (0)
Priority  :1
NPC RX Action:0X00000000404001
	ActionOp:NIX_RX_ACTIONOP_UCAST (1)
	PF_FUNC: 0X400
	RQ Index:0X004
	Match Id:0000
	Flow Key Alg:0
NPC RX VTAG Action:0X00000000008100
	VTAG0:relptr:0
	lid:0X1
	type:0
Patterns:
	NPC_PARSE_NIBBLE_CHAN:000
	NPC_PARSE_NIBBLE_LA_LTYPE:LA_ETHER
	NPC_PARSE_NIBBLE_LB_LTYPE:NONE
	NPC_PARSE_NIBBLE_LC_LTYPE:LC_IP
	NPC_PARSE_NIBBLE_LD_LTYPE:LD_TCP
	NPC_PARSE_NIBBLE_LE_LTYPE:NONE
	LA_ETHER, hdr offset:0, len:0X6, key offset:0X8,\
		Data:0X4AE124FC7FFF, Mask:0XFFFFFFFFFFFF
	LA_ETHER, hdr offset:0XC, len:0X2, key offset:0X4, Data:0XCA5A,\
		Mask:0XFFFF
	LC_IP, hdr offset:0XC, len:0X8, key offset:0X10,\
		Data:0X0A01010300000000, Mask:0XFFFFFFFF00000000
	LD_TCP, hdr offset:0, len:0X4, key offset:0X18, Data:0X03450000,\
		Mask:0XFFFF0000
MCAM Raw Data :
	DW0     :0000CA5A01202000
	DW0_Mask:0000FFFF0FF0F000
	DW1     :00004AE124FC7FFF
	DW1_Mask:0000FFFFFFFFFFFF
	DW2     :0A01010300000000
	DW2_Mask:FFFFFFFF00000000
	DW3     :0000000003450000
	DW3_Mask:00000000FFFF0000
	DW4     :0000000000000000
	DW4_Mask:0000000000000000
	DW5     :0000000000000000
	DW5_Mask:0000000000000000
	DW6     :0000000000000000
	DW6_Mask:0000000000000000

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2021-06-30 02:14:27 +02:00
Satheesh Paul
19f3cc2374 common/cnxk: support VLAN push/pop flow actions
Add roc API to configure VLAN tag addition and removal.

This patch also adds 98xx support for increased MCAM
entries for rte flow.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2021-06-29 21:05:28 +02:00
Nithin Dabilpuram
7fef6b0992 common/cnxk: remove camel case from model API
Change model check API's to not use Camel case in function
names.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2021-06-29 20:58:07 +02:00
Satha Rao
95bec117a3 common/cnxk: add provision to enable RED on RQ
Send RED pass/drop levels based on rq configurations to kernel.
Fixed the aura and pool shift value calculation.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
2021-06-29 20:50:50 +02:00
Harman Kalra
9854e5db5d common/cnxk: allocate LMT region in userspace
As per the new LMTST design, userspace shall allocate LMT region,
setup the DMA translation and share the IOVA with kernel via MBOX.
Kernel will convert this IOVA to physical memory and update the
LMT table entry with the same.
With this new design also shared mode (i.e. all pci funcs sharing
the LMT region allocated by primary/base pci func) is intact.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-06-29 20:43:26 +02:00
Satheesh Paul
0c22452d47 common/cnxk: support flow action mark and flag
Add roc API to get mark action.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
2021-06-29 20:36:07 +02:00
Satheesh Paul
9869c39918 common/cnxk: support flow entry dump
Add NPC support API to dump created flow entries.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
2021-06-29 20:28:42 +02:00
Jerin Jacob
50d08d3934 common/cnxk: fix batch alloc completion poll logic
The instruction generation was not correct due to
fact that volatile suppose to use with ccode variable
as well.

Change the logic to use gcc atomic builtin to
simplify and avoid explicit volatile from the code.

Fixes: 81af267893 ("common/cnxk: support NPA batch alloc/free")
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
2021-06-29 20:21:22 +02:00
Satha Rao
6b7fcb7a5d common/cnxk: support locking NIX RQ contexts
This patch will consider device argument to lock RSS table
in NIX.

This patch also adds few misc fixes such as disabling NIX Tx
vlan insertion conf in SMQ, enabling SSO in NIX Tx SQ
for Tx completions and TM related stats API.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
2021-06-29 20:12:25 +02:00
Tomasz Duszynski
603c65bfc9 common/cnxk: register BPHY IRQ
Add support for registering user supplied baseband PHY IRQ handler.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:08:08 +02:00
Tomasz Duszynski
b10c81ec7c common/cnxk: clear BPHY IRQ handler
Add support for clearing previously register baseband PHY IRQ handler.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:08:05 +02:00
Tomasz Duszynski
804c108b03 common/cnxk: set BPHY IRQ handler
Add support for setting custom baseband PHY IRQ handler.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:08:02 +02:00
Tomasz Duszynski
3a0abb7102 common/cnxk: remove BPHY IRQ stack
Add support for removing existing IRQ stack.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:07:59 +02:00
Tomasz Duszynski
1da18cb444 common/cnxk: retrieve BPHY IRQ stack
Add support for retrieving IRQ stack.
If stack does not exist then it gets created.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:07:56 +02:00
Tomasz Duszynski
c968c6188c common/cnxk: check BPHY IRQ availability
Add support for checking whether given IRQ is available.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:07:52 +02:00
Tomasz Duszynski
81c7f0e422 common/cnxk: add BPHY IRQ setup
Add support for initializing baseband PHY IRQs. While at it
also add support for reverting back to the default state.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:07:37 +02:00
Tomasz Duszynski
4ced2b04df common/cnxk: add BPHY device init and fini
Add support for device init and fini. It merely saves
baseband phy state container in a globally accessible
resource chest.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:07:33 +02:00
Tomasz Duszynski
2c19694c8e common/cnxk: start and stop BPHY LMAC
Add support for starting or stopping specific lmac.
Start enables Rx/Tx traffic while stop does the opposite.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:07:03 +02:00
Tomasz Duszynski
7fb5075a53 common/cnxk: set BPHY link state
Add support for setting link up or down.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:07:01 +02:00
Tomasz Duszynski
ba901d33e6 common/cnxk: set BPHY link mode
Add support for setting link mode.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:06:59 +02:00
Tomasz Duszynski
72096a4793 common/cnxk: enable and disable BPHY PTP mode
Add support for enabling or disablig PTP mode.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:06:57 +02:00
Tomasz Duszynski
6c870ee8f1 common/cnxk: enable and disable BPHY internal loopback
Add support for enabling or disabling internal loopback.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:06:50 +02:00
Tomasz Duszynski
1fa0045149 common/cnxk: get BPHY link information
Add support for retrieving link information.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:06:47 +02:00
Tomasz Duszynski
857721d62d common/cnxk: add BPHY communication with atf
Messages can be exchanged between userspace software and firmware
via set of two dedicated registers, namely scratch1 and scratch0.

scratch1 acts as a command register i.e message is sent to firmware,
while scratch0 holds response to previously sent message.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-07-05 23:06:45 +02:00