octeontx2-pf: mcs: Generate hash key using ecb(aes)
authorSubbaraya Sundeep <sbhatta@marvell.com>
Mon, 17 Jul 2023 06:16:43 +0000 (11:46 +0530)
committerJakub Kicinski <kuba@kernel.org>
Wed, 19 Jul 2023 02:21:56 +0000 (19:21 -0700)
commite7002b3b20c58bce4a88c15aca8e6cc894e3a7ed
tree94113f912fe2f80a426f84094a8a29da8cf91c20
parent78adb4bcf99effbb960c5f9091e2e062509d1030
octeontx2-pf: mcs: Generate hash key using ecb(aes)

Hardware generated encryption and ICV tags are found to
be wrong when tested with IEEE MACSEC test vectors.
This is because as per the HRM, the hash key (derived by
AES-ECB block encryption of an all 0s block with the SAK)
has to be programmed by the software in
MCSX_RS_MCS_CPM_TX_SLAVE_SA_PLCY_MEM_4X register.
Hence fix this by generating hash key in software and
configuring in hardware.

Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Link: https://lore.kernel.org/r/1689574603-28093-1-git-send-email-sbhatta@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c