Skip to content

Commit 9114148

Browse files
committed
Merge: crypto: octeontx2: update octeontx2 crypto driver to v6.15-rc1
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6734 ``` JIRA: https://issues.redhat.com/browse/RHEL-74335 Upstream Status: 11 commits are merged into the linux.git 2 conflicts, 2 partial commits Bring in the latest OcteonTX2 driver bugfixes and updates. All the commits apply cleanly, except 2 small context conflicts. Two commits hava a partial scope limited to OcteonTX2 driver only. Signed-off-by: Vladis Dronov <vdronov@redhat.com> ``` Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: Phil Auld <pauld@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents 50ca9da + 62f1e76 commit 9114148

File tree

12 files changed

+128
-289
lines changed

12 files changed

+128
-289
lines changed

MAINTAINERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11592,8 +11592,6 @@ F: drivers/gpu/drm/armada/
1159211592
F: include/uapi/drm/armada_drm.h
1159311593

1159411594
MARVELL CRYPTO DRIVER
11595-
M: Boris Brezillon <bbrezillon@kernel.org>
11596-
M: Arnaud Ebalard <arno@natisbad.org>
1159711595
M: Srujana Challa <schalla@marvell.com>
1159811596
L: linux-crypto@vger.kernel.org
1159911597
S: Maintained

drivers/crypto/marvell/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ config CRYPTO_DEV_OCTEONTX2_CPT
4747
select CRYPTO_SKCIPHER
4848
select CRYPTO_HASH
4949
select CRYPTO_AEAD
50+
select CRYPTO_AUTHENC
51+
select NET_DEVLINK
5052
help
5153
This driver allows you to utilize the Marvell Cryptographic
5254
Accelerator Unit(CPT) found in OcteonTX2 series of processors.

drivers/crypto/marvell/octeontx2/otx2_cpt_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ struct otx2_cpt_rx_inline_lf_cfg {
5656
u16 param2;
5757
u16 opcode;
5858
u32 credit;
59+
u32 credit_th;
60+
u16 bpid;
5961
u32 reserved;
6062
u8 ctx_ilen_valid : 1;
6163
u8 ctx_ilen : 7;

drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -739,18 +739,22 @@ static int otx2_cptpf_probe(struct pci_dev *pdev,
739739
dev_err(dev, "Unable to get usable DMA configuration\n");
740740
goto clear_drvdata;
741741
}
742-
/* Map PF's configuration registers */
743-
err = pcim_iomap_regions_request_all(pdev, 1 << PCI_PF_REG_BAR_NUM,
744-
OTX2_CPT_DRV_NAME);
742+
err = pcim_request_all_regions(pdev, OTX2_CPT_DRV_NAME);
745743
if (err) {
746-
dev_err(dev, "Couldn't get PCI resources 0x%x\n", err);
744+
dev_err(dev, "Couldn't request PCI resources 0x%x\n", err);
747745
goto clear_drvdata;
748746
}
749747
pci_set_master(pdev);
750748
pci_set_drvdata(pdev, cptpf);
751749
cptpf->pdev = pdev;
752750

753-
cptpf->reg_base = pcim_iomap_table(pdev)[PCI_PF_REG_BAR_NUM];
751+
/* Map PF's configuration registers */
752+
cptpf->reg_base = pcim_iomap(pdev, PCI_PF_REG_BAR_NUM, 0);
753+
if (!cptpf->reg_base) {
754+
err = -ENOMEM;
755+
dev_err(dev, "Couldn't ioremap PCI resource 0x%x\n", err);
756+
goto clear_drvdata;
757+
}
754758

755759
/* Check if AF driver is up, otherwise defer probe */
756760
err = cpt_is_pf_usable(cptpf);

drivers/crypto/marvell/octeontx2/otx2_cptpf_mbox.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ static int rx_inline_ipsec_lf_cfg(struct otx2_cptpf_dev *cptpf, u8 egrp,
171171
nix_req->hdr.id = MBOX_MSG_NIX_INLINE_IPSEC_CFG;
172172
nix_req->hdr.sig = OTX2_MBOX_REQ_SIG;
173173
nix_req->enable = 1;
174+
nix_req->credit_th = req->credit_th;
175+
nix_req->bpid = req->bpid;
174176
if (!req->credit || req->credit > OTX2_CPT_INST_QLEN_MSGS)
175177
nix_req->cpt_credit = OTX2_CPT_INST_QLEN_MSGS - 1;
176178
else

drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c

Lines changed: 6 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <linux/ctype.h>
55
#include <linux/firmware.h>
6+
#include <linux/string_choices.h>
67
#include "otx2_cptpf_ucode.h"
78
#include "otx2_cpt_common.h"
89
#include "otx2_cptpf.h"
@@ -16,7 +17,11 @@
1617
#define LOADFVC_MAJOR_OP 0x01
1718
#define LOADFVC_MINOR_OP 0x08
1819

19-
#define CTX_FLUSH_TIMER_CNT 0xFFFFFF
20+
/*
21+
* Interval to flush dirty data for next CTX entry. The interval is measured
22+
* in increments of 10ns(interval time = CTX_FLUSH_TIMER_COUNT * 10ns).
23+
*/
24+
#define CTX_FLUSH_TIMER_CNT 0x2FAF0
2025

2126
struct fw_info_t {
2227
struct list_head ucodes;
@@ -1770,102 +1775,3 @@ int otx2_cpt_dl_custom_egrp_delete(struct otx2_cptpf_dev *cptpf,
17701775
dev_err(dev, "%s\n", err_msg);
17711776
return -EINVAL;
17721777
}
1773-
1774-
static void get_engs_info(struct otx2_cpt_eng_grp_info *eng_grp, char *buf,
1775-
int size, int idx)
1776-
{
1777-
struct otx2_cpt_engs_rsvd *mirrored_engs = NULL;
1778-
struct otx2_cpt_engs_rsvd *engs;
1779-
int len, i;
1780-
1781-
buf[0] = '\0';
1782-
for (i = 0; i < OTX2_CPT_MAX_ETYPES_PER_GRP; i++) {
1783-
engs = &eng_grp->engs[i];
1784-
if (!engs->type)
1785-
continue;
1786-
if (idx != -1 && idx != i)
1787-
continue;
1788-
1789-
if (eng_grp->mirror.is_ena)
1790-
mirrored_engs = find_engines_by_type(
1791-
&eng_grp->g->grp[eng_grp->mirror.idx],
1792-
engs->type);
1793-
if (i > 0 && idx == -1) {
1794-
len = strlen(buf);
1795-
scnprintf(buf + len, size - len, ", ");
1796-
}
1797-
1798-
len = strlen(buf);
1799-
scnprintf(buf + len, size - len, "%d %s ",
1800-
mirrored_engs ? engs->count + mirrored_engs->count :
1801-
engs->count,
1802-
get_eng_type_str(engs->type));
1803-
if (mirrored_engs) {
1804-
len = strlen(buf);
1805-
scnprintf(buf + len, size - len,
1806-
"(%d shared with engine_group%d) ",
1807-
engs->count <= 0 ?
1808-
engs->count + mirrored_engs->count :
1809-
mirrored_engs->count,
1810-
eng_grp->mirror.idx);
1811-
}
1812-
}
1813-
}
1814-
1815-
void otx2_cpt_print_uc_dbg_info(struct otx2_cptpf_dev *cptpf)
1816-
{
1817-
struct otx2_cpt_eng_grps *eng_grps = &cptpf->eng_grps;
1818-
struct otx2_cpt_eng_grp_info *mirrored_grp;
1819-
char engs_info[2 * OTX2_CPT_NAME_LENGTH];
1820-
struct otx2_cpt_eng_grp_info *grp;
1821-
struct otx2_cpt_engs_rsvd *engs;
1822-
int i, j;
1823-
1824-
pr_debug("Engine groups global info");
1825-
pr_debug("max SE %d, max IE %d, max AE %d", eng_grps->avail.max_se_cnt,
1826-
eng_grps->avail.max_ie_cnt, eng_grps->avail.max_ae_cnt);
1827-
pr_debug("free SE %d", eng_grps->avail.se_cnt);
1828-
pr_debug("free IE %d", eng_grps->avail.ie_cnt);
1829-
pr_debug("free AE %d", eng_grps->avail.ae_cnt);
1830-
1831-
for (i = 0; i < OTX2_CPT_MAX_ENGINE_GROUPS; i++) {
1832-
grp = &eng_grps->grp[i];
1833-
pr_debug("engine_group%d, state %s", i,
1834-
grp->is_enabled ? "enabled" : "disabled");
1835-
if (grp->is_enabled) {
1836-
mirrored_grp = &eng_grps->grp[grp->mirror.idx];
1837-
pr_debug("Ucode0 filename %s, version %s",
1838-
grp->mirror.is_ena ?
1839-
mirrored_grp->ucode[0].filename :
1840-
grp->ucode[0].filename,
1841-
grp->mirror.is_ena ?
1842-
mirrored_grp->ucode[0].ver_str :
1843-
grp->ucode[0].ver_str);
1844-
if (is_2nd_ucode_used(grp))
1845-
pr_debug("Ucode1 filename %s, version %s",
1846-
grp->ucode[1].filename,
1847-
grp->ucode[1].ver_str);
1848-
}
1849-
1850-
for (j = 0; j < OTX2_CPT_MAX_ETYPES_PER_GRP; j++) {
1851-
engs = &grp->engs[j];
1852-
if (engs->type) {
1853-
u32 mask[5] = { };
1854-
1855-
get_engs_info(grp, engs_info,
1856-
2 * OTX2_CPT_NAME_LENGTH, j);
1857-
pr_debug("Slot%d: %s", j, engs_info);
1858-
bitmap_to_arr32(mask, engs->bmap,
1859-
eng_grps->engs_num);
1860-
if (is_dev_otx2(cptpf->pdev))
1861-
pr_debug("Mask: %8.8x %8.8x %8.8x %8.8x",
1862-
mask[3], mask[2], mask[1],
1863-
mask[0]);
1864-
else
1865-
pr_debug("Mask: %8.8x %8.8x %8.8x %8.8x %8.8x",
1866-
mask[4], mask[3], mask[2], mask[1],
1867-
mask[0]);
1868-
}
1869-
}
1870-
}
1871-
}

drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ int otx2_cpt_dl_custom_egrp_create(struct otx2_cptpf_dev *cptpf,
166166
struct devlink_param_gset_ctx *ctx);
167167
int otx2_cpt_dl_custom_egrp_delete(struct otx2_cptpf_dev *cptpf,
168168
struct devlink_param_gset_ctx *ctx);
169-
void otx2_cpt_print_uc_dbg_info(struct otx2_cptpf_dev *cptpf);
170169
struct otx2_cpt_engs_rsvd *find_engines_by_type(
171170
struct otx2_cpt_eng_grp_info *eng_grp,
172171
int eng_type);

0 commit comments

Comments
 (0)