aboutsummaryrefslogtreecommitdiff
path: root/drivers/crypto
AgeCommit message (Collapse)AuthorFilesLines
2020-05-23crypto: hisilicon/qm - add debugfs for QMLongfang Liu2-0/+60
Add DebugFS method to get the information of IRQ/Requests/QP .etc of QM for HPRE/ZIP/SEC drivers. Signed-off-by: Longfang Liu <[email protected]> Signed-off-by: Shukun Tan <[email protected]> Reviewed-by: Zaibo Xu <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-23crypto: stm32/crc32 - protect from concurrent accessesNicolas Toromanoff1-2/+45
Protect STM32 CRC device from concurrent accesses. As we create a spinlocked section that increase with buffer size, we provide a module parameter to release the pressure by splitting critical section in chunks. Size of each chunk is defined in burst_size module parameter. By default burst_size=0, i.e. don't split incoming buffer. Signed-off-by: Nicolas Toromanoff <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-23crypto: stm32/crc32 - don't sleep in runtime pmNicolas Toromanoff1-9/+36
Ensure stm32_crc_update() and stm32_crc_init() can be called in atomic context and can't sleep. Add pm_runtime_irq_safe() to make pm_runtime_get_sync() atomic. Change runtime pm to call clk_enable()/clk_disable() and change system pm to unprepare/prepare the clock and force runtime pm suspend/resume. Signed-off-by: Nicolas Toromanoff <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-23crypto: stm32/crc32 - fix multi-instanceNicolas Toromanoff1-12/+36
Ensure CRC algorithm is registered only once in crypto framework when there are several instances of CRC devices. Update the CRC device list management to avoid that only the first CRC instance is used. Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module") Signed-off-by: Nicolas Toromanoff <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-23crypto: stm32/crc32 - fix run-time self test issue.Nicolas Toromanoff1-3/+3
Fix wrong crc32 initialisation value: "alg: shash: stm32_crc32 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer" cra_name="crc32c" expects an init value of 0XFFFFFFFF, cra_name="crc32" expects an init value of 0. Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module") Signed-off-by: Nicolas Toromanoff <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-23crypto: stm32/crc32 - fix ext4 chksum BUG_ON()Nicolas Toromanoff1-50/+48
Allow use of crc_update without prior call to crc_init. And change (and fix) driver to use CRC device even on unaligned buffers. Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module") Signed-off-by: Nicolas Toromanoff <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon/zip - Use temporary sqe when doing workZhou Wang1-6/+5
Currently zip sqe is stored in hisi_zip_qp_ctx, which will bring corruption with multiple parallel users of the crypto tfm. This patch removes the zip_sqe in hisi_zip_qp_ctx and uses a temporary sqe instead. Signed-off-by: Zhou Wang <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]> Signed-off-by: Shukun Tan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon - add device error report through abnormal irqShukun Tan2-153/+187
By configuring the device error in firmware to report through abnormal interruption, process all NFE errors in irq handler. Signed-off-by: Shukun Tan <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon - remove codes of directly report device errors through MSIShukun Tan5-48/+13
The hardware device can be configured to report directly through MSI, but this method will not go through RAS, configure all hardware errors that should be processed by driver to NFE. Signed-off-by: Shukun Tan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon - QM memory management optimizationWeili Qian2-141/+128
Put all the code for the memory allocation into the QM initialization process. Before, The qp memory was allocated when the qp was created, and released when the qp was released, It is now changed to allocate all the qp memory once. Signed-off-by: Weili Qian <[email protected]> Signed-off-by: Shukun Tan <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon - unify initial value assignment into QMWeili Qian4-72/+81
Some initial value assignment of struct hisi_qm could put into QM. Signed-off-by: Weili Qian <[email protected]> Signed-off-by: Shukun Tan <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon - remove use_dma_api related codesShukun Tan5-25/+13
The codes related use_dma_api is useless which should be removed. Signed-off-by: Shukun Tan <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon - add FLR supportShukun Tan5-4/+165
Add callback reset_prepare and reset_done in QM, The callback reset_prepare will uninit device error configuration and stop the QM, the callback reset_done will init the device error configuration and restart the QM. Uninit the error configuration will disable device block master OOO when Multi-bit ECC error occurs to avoid the request of FLR will not return. Signed-off-by: Shukun Tan <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon/qm - add state machine for QMZhou Wang2-83/+307
Add specific states for qm and qp, every state change under critical region to prevent from race condition. Meanwhile, qp state change will also depend on qm state. Due to the introduction of these states, it is necessary to pay attention to the calls of public logic, such as concurrent scenarios resetting and releasing queue will call hisi_qm_stop, which needs to add additional status to distinguish and process. Signed-off-by: Zhou Wang <[email protected]> Signed-off-by: Shukun Tan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon - refactor module parameter pf_q_num related codeShukun Tan4-97/+49
put q_num_set similar code into qm to reduce the redundancy. Signed-off-by: Shukun Tan <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon/zip - modify the ZIP probe processLongfang Liu1-18/+42
Misc fixes on coding style: 1.Merge QM initialization code into a function 2.Merge QM's PF and VF initialization into a function Signed-off-by: Longfang Liu <[email protected]> Signed-off-by: Zaibo Xu <[email protected]> Signed-off-by: Shukun Tan <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon/hpre - modify the HPRE probe processLongfang Liu1-17/+25
Misc fixes on coding style: 1.Merge pre-initialization and initialization of QM 2.Package the initialization of QM's PF and VF into a function Signed-off-by: Longfang Liu <[email protected]> Signed-off-by: Zaibo Xu <[email protected]> Signed-off-by: Shukun Tan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon/sec2 - modify the SEC probe processLongfang Liu1-37/+30
Adjust the position of SMMU status check and SEC queue initialization in SEC probe Signed-off-by: Longfang Liu <[email protected]> Signed-off-by: Zaibo Xu <[email protected]> Signed-off-by: Shukun Tan <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon/sec2 - constify sec_dfx_regsRikard Falkeborn1-1/+1
sec_dfx_regs is never changed and can therefore be made const. This allows the compiler to put it in the text section instead of the data section. Before: text data bss dec hex filename 17982 7312 480 25774 64ae drivers/crypto/hisilicon/sec2/sec_main.o After: text data bss dec hex filename 18366 6928 480 25774 64ae drivers/crypto/hisilicon/sec2/sec_main.o Signed-off-by: Rikard Falkeborn <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon/zip - constify struct debugfs_reg32Rikard Falkeborn1-1/+1
hzip_dfx_regs is never changed and can be made const. This allows the compiler to put it in the text section instead of the data section. Before: text data bss dec hex filename 15236 6160 480 21876 5574 drivers/crypto/hisilicon/zip/zip_main.o After: text data bss dec hex filename 15620 5776 480 21876 5574 drivers/crypto/hisilicon/zip/zip_main.o Signed-off-by: Rikard Falkeborn <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: hisilicon/hpre - constify struct debugfs_reg32Rikard Falkeborn1-2/+2
hpre_cluster_dfx_regs and hpre_com_dfx_regs are never changed and can therefore be made const. This allows the compiler to put it in the text section instead of the data section. Before: text data bss dec hex filename 16455 6288 480 23223 5ab7 drivers/crypto/hisilicon/hpre/hpre_main.o After: text data bss dec hex filename 16839 5904 480 23223 5ab7 drivers/crypto/hisilicon/hpre/hpre_main.o Signed-off-by: Rikard Falkeborn <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-15crypto: ccree - constify struct debugfs_reg32Rikard Falkeborn1-2/+2
pid_cd_regs and debug_regs are never changed and can therefore be made const. This allows the compiler to put it in the text section instead of the data section. Before: text data bss dec hex filename 2871 2320 64 5255 1487 drivers/crypto/ccree/cc_debugfs.o After: text data bss dec hex filename 3255 1936 64 5255 1487 drivers/crypto/ccree/cc_debugfs.o Signed-off-by: Rikard Falkeborn <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-11Merge 5.7-rc5 into char-misc-nextGreg Kroah-Hartman4-44/+65
We want the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-05-08crypto: lib/sha1 - remove unnecessary includes of linux/cryptohash.hEric Biggers4-4/+0
<linux/cryptohash.h> sounds very generic and important, like it's the header to include if you're doing cryptographic hashing in the kernel. But actually it only includes the library implementation of the SHA-1 compression function (not even the full SHA-1). This should basically never be used anymore; SHA-1 is no longer considered secure, and there are much better ways to do cryptographic hashing in the kernel. Most files that include this header don't actually need it. So in preparation for removing it, remove all these unneeded includes of it. Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: s5p-sss - use crypto_shash_tfm_digest()Eric Biggers1-33/+6
Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Krzysztof Kozlowski <[email protected]> Cc: Vladimir Zapolskiy <[email protected]> Cc: Kamil Konieczny <[email protected]> Signed-off-by: Eric Biggers <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: omap-sham - use crypto_shash_tfm_digest()Eric Biggers1-16/+4
Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: n2 - use crypto_shash_tfm_digest()Eric Biggers1-5/+2
Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: mediatek - use crypto_shash_tfm_digest()Eric Biggers1-5/+2
Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: hisilicon/sec2 - use crypto_shash_tfm_digest()Eric Biggers1-3/+2
Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Zaibo Xu <[email protected]> Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: ccree - use crypto_shash_tfm_digest()Eric Biggers1-6/+3
Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Gilad Ben-Yossef <[email protected]> Signed-off-by: Eric Biggers <[email protected]> Acked-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: ccp - use crypto_shash_tfm_digest()Eric Biggers1-7/+2
Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Tom Lendacky <[email protected]> Signed-off-by: Eric Biggers <[email protected]> Acked-by: Tom Lendacky <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: artpec6 - use crypto_shash_tfm_digest()Eric Biggers1-7/+3
Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: Jesper Nilsson <[email protected]> Cc: Lars Persson <[email protected]> Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: bcm - Use the defined variable to clean codeTang Bin1-4/+4
Use the defined variable "dev" to make the code cleaner. Signed-off-by: Zhang Shengju <[email protected]> Signed-off-by: Tang Bin <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: stm32/hash - don't print error on probe deferralLionel Debieve1-2/+5
Change driver to not print an error message when the device probe is deferred for a clock resource. Signed-off-by: Lionel Debieve <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: stm32/hash - defer probe for dma deviceEtienne Carriere1-7/+15
Change stm32 HASH driver to defer its probe operation when DMA channel device is registered but has not been probed yet. Signed-off-by: Etienne Carriere <[email protected]> Reviewed-by: Lionel DEBIEVE <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-08crypto: stm32/hash - defer probe for reset controllerEtienne Carriere1-2/+7
Change stm32 HASH driver to defer its probe operation when reset controller device is registered but has not been probed yet. Signed-off-by: Etienne Carriere <[email protected]> Reviewed-by: Lionel DEBIEVE <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-05-06Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller4-44/+65
Conflicts were all overlapping changes. Signed-off-by: David S. Miller <[email protected]>
2020-05-06Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netLinus Torvalds1-37/+46
Pull networking fixes from David Miller: 1) Fix reference count leaks in various parts of batman-adv, from Xiyu Yang. 2) Update NAT checksum even when it is zero, from Guillaume Nault. 3) sk_psock reference count leak in tls code, also from Xiyu Yang. 4) Sanity check TCA_FQ_CODEL_DROP_BATCH_SIZE netlink attribute in fq_codel, from Eric Dumazet. 5) Fix panic in choke_reset(), also from Eric Dumazet. 6) Fix VLAN accel handling in bnxt_fix_features(), from Michael Chan. 7) Disallow out of range quantum values in sch_sfq, from Eric Dumazet. 8) Fix crash in x25_disconnect(), from Yue Haibing. 9) Don't pass pointer to local variable back to the caller in nf_osf_hdr_ctx_init(), from Arnd Bergmann. 10) Wireguard should use the ECN decap helper functions, from Toke Høiland-Jørgensen. 11) Fix command entry leak in mlx5 driver, from Moshe Shemesh. 12) Fix uninitialized variable access in mptcp's subflow_syn_recv_sock(), from Paolo Abeni. 13) Fix unnecessary out-of-order ingress frame ordering in macsec, from Scott Dial. 14) IPv6 needs to use a global serial number for dst validation just like ipv4, from David Ahern. 15) Fix up PTP_1588_CLOCK deps, from Clay McClure. 16) Missing NLM_F_MULTI flag in gtp driver netlink messages, from Yoshiyuki Kurauchi. 17) Fix a regression in that dsa user port errors should not be fatal, from Florian Fainelli. 18) Fix iomap leak in enetc driver, from Dejin Zheng. 19) Fix use after free in lec_arp_clear_vccs(), from Cong Wang. 20) Initialize protocol value earlier in neigh code paths when generating events, from Roman Mashak. 21) netdev_update_features() must be called with RTNL mutex in macsec driver, from Antoine Tenart. 22) Validate untrusted GSO packets even more strictly, from Willem de Bruijn. 23) Wireguard decrypt worker needs a cond_resched(), from Jason Donenfeld. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (111 commits) net: flow_offload: skip hw stats check for FLOW_ACTION_HW_STATS_DONT_CARE MAINTAINERS: put DYNAMIC INTERRUPT MODERATION in proper order wireguard: send/receive: use explicit unlikely branch instead of implicit coalescing wireguard: selftests: initalize ipv6 members to NULL to squelch clang warning wireguard: send/receive: cond_resched() when processing worker ringbuffers wireguard: socket: remove errant restriction on looping to self wireguard: selftests: use normal kernel stack size on ppc64 net: ethernet: ti: am65-cpsw-nuss: fix irqs type ionic: Use debugfs_create_bool() to export bool net: dsa: Do not leave DSA master with NULL netdev_ops net: dsa: remove duplicate assignment in dsa_slave_add_cls_matchall_mirred net: stricter validation of untrusted gso packets seg6: fix SRH processing to comply with RFC8754 net: mscc: ocelot: ANA_AUTOAGE_AGE_PERIOD holds a value in seconds, not ms net: dsa: ocelot: the MAC table on Felix is twice as large net: dsa: sja1105: the PTP_CLK extts input reacts on both edges selftests: net: tcp_mmap: fix SO_RCVLOWAT setting net: hsr: fix incorrect type usage for protocol variable net: macsec: fix rtnl locking issue net: mvpp2: cls: Prevent buffer overflow in mvpp2_ethtool_cls_rule_del() ...
2020-05-06Crypto/chcr: fix for hmac(sha) test failsDevulapally Shiva Krishna1-1/+1
The hmac(sha) test fails for a zero length source text data. For hmac(sha) minimum length of the data must be of block-size. So fix this by including the data_len for the last block. Signed-off-by: Ayush Sawal <[email protected]> Signed-off-by: Devulapally Shiva Krishna <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-05-06Crypto/chcr: support for 48 byte key_len in aes-xtsDevulapally Shiva Krishna1-2/+25
Added support for 48 byte key length for aes-xts. Signed-off-by: Ayush Sawal <[email protected]> Signed-off-by: Devulapally Shiva Krishna <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-05-06Crypto/chcr: fix for ccm(aes) failed testDevulapally Shiva Krishna1-1/+1
The ccm(aes) test fails when req->assoclen > ~240bytes. The problem is the value assigned to auth_offset is wrong. As auth_offset is unsigned char, it can take max value as 255. So fix it by making it unsigned int. Signed-off-by: Ayush Sawal <[email protected]> Signed-off-by: Devulapally Shiva Krishna <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-05-06Crypto/chcr: fix ctr, cbc, xts and rfc3686-ctr failed testsDevulapally Shiva Krishna2-14/+29
This solves the following issues observed during self test when CONFIG_CRYPTO_MANAGER_EXTRA_TESTS is enabled. 1. Added fallback for cbc, ctr and rfc3686 if req->nbytes is zero and for xts added a fallback case if req->nbytes is not multiple of 16. 2. In case of cbc-aes, solved wrong iv update. When chcr_cipher_fallback() is called, used req->info pointer instead of reqctx->iv. 3. In cbc-aes decryption there was a wrong result. This occurs when chcr_cipher_fallback() is called from chcr_handle_cipher_resp(). In the fallback function iv(req->info) used is wrongly updated. So use the initial iv for this case. 4)In case of ctr-aes encryption observed wrong result. In adjust_ctr_overflow() there is condition which checks if ((bytes / AES_BLOCK_SIZE) > c), where c is the number of blocks which can be processed without iv overflow, but for the above bytes (req->nbytes < 32 , not a multiple of 16) this condition fails and the 2nd block is corrupted as it requires the rollover iv. So added a '=' condition in this to take care of this. 5)In rfc3686-ctr there was wrong result observed. This occurs when chcr_cipher_fallback() is called from chcr_handle_cipher_resp(). Here also copying initial_iv in init_iv pointer for handling the fallback case correctly. Signed-off-by: Ayush Sawal <[email protected]> Signed-off-by: Devulapally Shiva Krishna <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-05-06Crypto/chcr: fix gcm-aes and rfc4106-gcm failed testsDevulapally Shiva Krishna1-4/+12
This patch fixes two issues observed during self tests with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled. 1. gcm(aes) hang issue , that happens during decryption. 2. rfc4106-gcm-aes-chcr encryption unexpectedly succeeded. For gcm-aes decryption , authtag is not mapped due to sg_nents_for_len(upto size: assoclen+ cryptlen - authsize). So fix it by dma_mapping authtag. Also replaced sg_nents() to sg_nents_for_len() in case of aead_dma_unmap(). For rfc4106-gcm-aes-chcr, used crypto_ipsec_check_assoclen() for checking the validity of assoclen. Signed-off-by: Ayush Sawal <[email protected]> Signed-off-by: Devulapally Shiva Krishna <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-05-06Revert "crypto: chelsio - Inline single pdu only"Ayush Sawal1-3/+0
This reverts commit 27c6feb0fb33a665a746346e76714826a5be5d10. For ipsec offload the chelsio's ethernet driver expects a single mtu sized packet. But when ipsec traffic is running using iperf, most of the packets in that traffic are gso packets(large sized skbs) because GSO is enabled by default in TCP, due to this commit 0a6b2a1dc2a2 ("tcp: switch to GSO being always on"), so chcr_ipsec_offload_ok() receives a gso skb(with gso_size non zero). Due to the check in chcr_ipsec_offload_ok(), this function returns false for most of the packet, then ipsec offload is skipped and the skb goes out taking the coprocessor path which reduces the bandwidth for inline ipsec. If this check is removed then for most of the packets(large sized skbs) the chcr_ipsec_offload_ok() returns true and then as GSO is on, the segmentation of the packet happens in the kernel and then finally the driver_xmit is called, which receives a segmented mtu sized packet which is what the driver expects for ipsec offload. So this case becomes unnecessary here, therefore removing it. Signed-off-by: Ayush Sawal <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-05-05crypto: xilinx - Remove set but not used variable 'drv_ctx'YueHaibing1-4/+0
Fixes gcc '-Wunused-but-set-variable' warning: drivers/crypto/xilinx/zynqmp-aes-gcm.c: In function 'zynqmp_aes_aead_cipher': drivers/crypto/xilinx/zynqmp-aes-gcm.c:83:30: warning: variable 'drv_ctx' set but not used [-Wunused-but-set-variable] commit bc86f9c54616 ("firmware: xilinx: Remove eemi ops for aes engine") left behind this, remove it. Reported-by: Hulk Robot <[email protected]> Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-05-05crypto: xilinx: Handle AES PM API return statusRajan Vaja1-2/+6
Return value of AES PM API is not handled which may result in unexpected value of "status" in zynqmp_pm_aes_engine(). Consider "status" value as valid only if AES PM API is successful. Fixes: bc86f9c54616 ("firmware: xilinx: Remove eemi ops for aes engine") Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Rajan Vaja <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-05-04cxgb4/chcr: avoid -Wreturn-local-addr warningArnd Bergmann1-37/+46
gcc-10 warns about functions that return a pointer to a stack variable. In chcr_write_cpl_set_tcb_ulp(), this does not actually happen, but it's too hard to see for the compiler: drivers/crypto/chelsio/chcr_ktls.c: In function 'chcr_write_cpl_set_tcb_ulp.constprop': drivers/crypto/chelsio/chcr_ktls.c:760:9: error: function may return address of local variable [-Werror=return-local-addr] 760 | return pos; | ^~~ drivers/crypto/chelsio/chcr_ktls.c:712:5: note: declared here 712 | u8 buf[48] = {0}; | ^~~ Split the middle part of the function out into a helper to make it easier to understand by both humans and compilers, which avoids the warning. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-04-30crypto: bcm - Fix unused assignmentTang Bin1-8/+8
Delete unused initialized value in cipher.c file. Signed-off-by: Zhang Shengju <[email protected]> Signed-off-by: Tang Bin <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-04-30crypto: bcm - Remove the unnecessary cast for PTR_ERR().Tang Bin1-1/+1
It's not necessary to specify 'int' casting for PTR_ERR(). Signed-off-by: Zhang Shengju <[email protected]> Signed-off-by: Tang Bin <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2020-04-30crypto: hisilicon/qm - Make qm_controller_reset() staticZou Wei1-1/+1
Fix the following sparse warning: drivers/crypto/hisilicon/qm.c:3079:5: warning: symbol 'qm_controller_reset' was not declared. Should it be static? Reported-by: Hulk Robot <[email protected]> Signed-off-by: Zou Wei <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>