diff mbox

[v12,net-next,12/12] crypto: chtls - Makefile Kconfig

Message ID 1521467745-23201-13-git-send-email-atul.gupta@chelsio.com (mailing list archive)
State Not Applicable
Delegated to: Herbert Xu
Headers show

Commit Message

Atul Gupta March 19, 2018, 1:55 p.m. UTC
Entry for Inline TLS as another driver dependent on cxgb4 and chcr

Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
---
 drivers/crypto/chelsio/Kconfig        | 11 +++++++++++
 drivers/crypto/chelsio/Makefile       |  1 +
 drivers/crypto/chelsio/chtls/Makefile |  4 ++++
 3 files changed, 16 insertions(+)
 create mode 100644 drivers/crypto/chelsio/chtls/Makefile

Comments

kernel test robot March 20, 2018, 4:28 p.m. UTC | #1
Hi Atul,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20180309]
[also build test ERROR on v4.16-rc6]
[cannot apply to v4.16-rc4 v4.16-rc3 v4.16-rc2]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Atul-Gupta/Chelsio-Inline-TLS/20180320-101600
config: mips-allmodconfig (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=mips 

All errors (new ones prefixed by >>):

   drivers/crypto/chelsio/chtls/chtls_main.c: In function 'chtls_uld_state_change':
>> drivers/crypto/chelsio/chtls/chtls_main.c:319:7: error: 'CXGB4_STATE_FATAL_ERROR' undeclared (first use in this function); did you mean 'CXGB4_STATE_DETACH'?
     case CXGB4_STATE_FATAL_ERROR:
          ^~~~~~~~~~~~~~~~~~~~~~~
          CXGB4_STATE_DETACH
   drivers/crypto/chelsio/chtls/chtls_main.c:319:7: note: each undeclared identifier is reported only once for each function it appears in

vim +319 drivers/crypto/chelsio/chtls/chtls_main.c

29f9f684 Atul Gupta 2018-03-19  307  
29f9f684 Atul Gupta 2018-03-19  308  static int chtls_uld_state_change(void *handle, enum cxgb4_state new_state)
29f9f684 Atul Gupta 2018-03-19  309  {
29f9f684 Atul Gupta 2018-03-19  310  	struct chtls_dev *cdev = handle;
29f9f684 Atul Gupta 2018-03-19  311  
29f9f684 Atul Gupta 2018-03-19  312  	switch (new_state) {
29f9f684 Atul Gupta 2018-03-19  313  	case CXGB4_STATE_UP:
29f9f684 Atul Gupta 2018-03-19  314  		chtls_register_dev(cdev);
29f9f684 Atul Gupta 2018-03-19  315  		break;
29f9f684 Atul Gupta 2018-03-19  316  	case CXGB4_STATE_DOWN:
29f9f684 Atul Gupta 2018-03-19  317  		break;
29f9f684 Atul Gupta 2018-03-19  318  	case CXGB4_STATE_START_RECOVERY:
29f9f684 Atul Gupta 2018-03-19 @319  	case CXGB4_STATE_FATAL_ERROR:
29f9f684 Atul Gupta 2018-03-19  320  		break;
29f9f684 Atul Gupta 2018-03-19  321  	case CXGB4_STATE_DETACH:
29f9f684 Atul Gupta 2018-03-19  322  		mutex_lock(&cdev_mutex);
29f9f684 Atul Gupta 2018-03-19  323  		list_del(&cdev->list);
29f9f684 Atul Gupta 2018-03-19  324  		mutex_unlock(&cdev_mutex);
29f9f684 Atul Gupta 2018-03-19  325  		chtls_free_uld(cdev);
29f9f684 Atul Gupta 2018-03-19  326  		break;
29f9f684 Atul Gupta 2018-03-19  327  	}
29f9f684 Atul Gupta 2018-03-19  328  	return 0;
29f9f684 Atul Gupta 2018-03-19  329  }
29f9f684 Atul Gupta 2018-03-19  330  

:::::: The code at line 319 was first introduced by commit
:::::: 29f9f68416a9775029d6cc8135cf3f01995dd9f4 crypto: chtls - Register chtls with net tls

:::::: TO: Atul Gupta <atul.gupta@chelsio.com>
:::::: CC: 0day robot <fengguang.wu@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot March 20, 2018, 6:06 p.m. UTC | #2
Hi Atul,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on next-20180309]
[also build test WARNING on v4.16-rc6]
[cannot apply to v4.16-rc4 v4.16-rc3 v4.16-rc2]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Atul-Gupta/Chelsio-Inline-TLS/20180320-101600
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   drivers/crypto/chelsio/chtls/chtls_main.c:319:14: sparse: undefined identifier 'CXGB4_STATE_FATAL_ERROR'
>> drivers/crypto/chelsio/chtls/chtls_main.c:319:14: sparse: incompatible types for 'case' statement
   drivers/crypto/chelsio/chtls/chtls_main.c:319:14: sparse: Expected constant expression in case statement
   drivers/crypto/chelsio/chtls/chtls_main.c: In function 'chtls_uld_state_change':
   drivers/crypto/chelsio/chtls/chtls_main.c:319:7: error: 'CXGB4_STATE_FATAL_ERROR' undeclared (first use in this function); did you mean 'CXGB4_STATE_DETACH'?
     case CXGB4_STATE_FATAL_ERROR:
          ^~~~~~~~~~~~~~~~~~~~~~~
          CXGB4_STATE_DETACH
   drivers/crypto/chelsio/chtls/chtls_main.c:319:7: note: each undeclared identifier is reported only once for each function it appears in
--
>> drivers/crypto/chelsio/chtls/chtls_cm.c:1555:40: sparse: cast to restricted __be16
>> drivers/crypto/chelsio/chtls/chtls_cm.c:1555:40: sparse: cast to restricted __be16
>> drivers/crypto/chelsio/chtls/chtls_cm.c:1555:40: sparse: cast to restricted __be16
>> drivers/crypto/chelsio/chtls/chtls_cm.c:1555:40: sparse: cast to restricted __be16
   drivers/crypto/chelsio/chtls/chtls_cm.c:1556:31: sparse: cast to restricted __be16
   drivers/crypto/chelsio/chtls/chtls_cm.c:1556:31: sparse: cast to restricted __be16
   drivers/crypto/chelsio/chtls/chtls_cm.c:1556:31: sparse: cast to restricted __be16
   drivers/crypto/chelsio/chtls/chtls_cm.c:1556:31: sparse: cast to restricted __be16
>> drivers/crypto/chelsio/chtls/chtls_cm.c:1980:29: sparse: incorrect type in initializer (different base types) @@    expected restricted __be32 [usertype] credits @@    got unsignerestricted __be32 [usertype] credits @@
   drivers/crypto/chelsio/chtls/chtls_cm.c:1980:29:    expected restricted __be32 [usertype] credits
   drivers/crypto/chelsio/chtls/chtls_cm.c:1980:29:    got unsigned char [unsigned] [usertype] credits
>> drivers/crypto/chelsio/chtls/chtls_cm.c:1982:25: sparse: invalid assignment: +=
   drivers/crypto/chelsio/chtls/chtls_cm.c:1982:25:    left side has type unsigned int
   drivers/crypto/chelsio/chtls/chtls_cm.c:1982:25:    right side has type restricted __be32
   drivers/crypto/chelsio/chtls/chtls_cm.c:1992:49: sparse: invalid assignment: -=
   drivers/crypto/chelsio/chtls/chtls_cm.c:1992:49:    left side has type unsigned int
   drivers/crypto/chelsio/chtls/chtls_cm.c:1992:49:    right side has type restricted __be32
>> drivers/crypto/chelsio/chtls/chtls_cm.c:1995:21: sparse: restricted __be32 degrades to integer
>> drivers/crypto/chelsio/chtls/chtls_cm.c:1995:21: sparse: restricted __wsum degrades to integer
>> drivers/crypto/chelsio/chtls/chtls_cm.c:1996:36: sparse: bad assignment (-=) to restricted __wsum
>> drivers/crypto/chelsio/chtls/chtls_cm.c:2000:25: sparse: bad assignment (-=) to restricted __be32
>> drivers/crypto/chelsio/chtls/chtls_cm.c:1048:9: sparse: context imbalance in 'chtls_recv_sock' - unexpected unlock
--
>> drivers/crypto/chelsio/chtls/chtls_io.c:919:16: sparse: incorrect type in return expression (different base types) @@    expected unsigned short @@    got restricted __beunsigned short @@
   drivers/crypto/chelsio/chtls/chtls_io.c:919:16:    expected unsigned short
   drivers/crypto/chelsio/chtls/chtls_io.c:919:16:    got restricted __be16 [usertype] <noident>

vim +/case +319 drivers/crypto/chelsio/chtls/chtls_main.c

29f9f684 Atul Gupta 2018-03-19  307  
29f9f684 Atul Gupta 2018-03-19  308  static int chtls_uld_state_change(void *handle, enum cxgb4_state new_state)
29f9f684 Atul Gupta 2018-03-19  309  {
29f9f684 Atul Gupta 2018-03-19  310  	struct chtls_dev *cdev = handle;
29f9f684 Atul Gupta 2018-03-19  311  
29f9f684 Atul Gupta 2018-03-19  312  	switch (new_state) {
29f9f684 Atul Gupta 2018-03-19  313  	case CXGB4_STATE_UP:
29f9f684 Atul Gupta 2018-03-19  314  		chtls_register_dev(cdev);
29f9f684 Atul Gupta 2018-03-19  315  		break;
29f9f684 Atul Gupta 2018-03-19  316  	case CXGB4_STATE_DOWN:
29f9f684 Atul Gupta 2018-03-19  317  		break;
29f9f684 Atul Gupta 2018-03-19  318  	case CXGB4_STATE_START_RECOVERY:
29f9f684 Atul Gupta 2018-03-19 @319  	case CXGB4_STATE_FATAL_ERROR:
29f9f684 Atul Gupta 2018-03-19  320  		break;
29f9f684 Atul Gupta 2018-03-19  321  	case CXGB4_STATE_DETACH:
29f9f684 Atul Gupta 2018-03-19  322  		mutex_lock(&cdev_mutex);
29f9f684 Atul Gupta 2018-03-19  323  		list_del(&cdev->list);
29f9f684 Atul Gupta 2018-03-19  324  		mutex_unlock(&cdev_mutex);
29f9f684 Atul Gupta 2018-03-19  325  		chtls_free_uld(cdev);
29f9f684 Atul Gupta 2018-03-19  326  		break;
29f9f684 Atul Gupta 2018-03-19  327  	}
29f9f684 Atul Gupta 2018-03-19  328  	return 0;
29f9f684 Atul Gupta 2018-03-19  329  }
29f9f684 Atul Gupta 2018-03-19  330  

:::::: The code at line 319 was first introduced by commit
:::::: 29f9f68416a9775029d6cc8135cf3f01995dd9f4 crypto: chtls - Register chtls with net tls

:::::: TO: Atul Gupta <atul.gupta@chelsio.com>
:::::: CC: 0day robot <fengguang.wu@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/crypto/chelsio/Kconfig b/drivers/crypto/chelsio/Kconfig
index 5ae9f87..930d82d 100644
--- a/drivers/crypto/chelsio/Kconfig
+++ b/drivers/crypto/chelsio/Kconfig
@@ -29,3 +29,14 @@  config CHELSIO_IPSEC_INLINE
         default n
         ---help---
           Enable support for IPSec Tx Inline.
+
+config CRYPTO_DEV_CHELSIO_TLS
+        tristate "Chelsio Crypto Inline TLS Driver"
+        depends on CHELSIO_T4
+        depends on TLS
+        select CRYPTO_DEV_CHELSIO
+        ---help---
+          Support Chelsio Inline TLS with Chelsio crypto accelerator.
+
+          To compile this driver as a module, choose M here: the module
+          will be called chtls.
diff --git a/drivers/crypto/chelsio/Makefile b/drivers/crypto/chelsio/Makefile
index eaecaf1..639e571 100644
--- a/drivers/crypto/chelsio/Makefile
+++ b/drivers/crypto/chelsio/Makefile
@@ -3,3 +3,4 @@  ccflags-y := -Idrivers/net/ethernet/chelsio/cxgb4
 obj-$(CONFIG_CRYPTO_DEV_CHELSIO) += chcr.o
 chcr-objs :=  chcr_core.o chcr_algo.o
 chcr-$(CONFIG_CHELSIO_IPSEC_INLINE) += chcr_ipsec.o
+obj-$(CONFIG_CRYPTO_DEV_CHELSIO_TLS) += chtls/
diff --git a/drivers/crypto/chelsio/chtls/Makefile b/drivers/crypto/chelsio/chtls/Makefile
new file mode 100644
index 0000000..df13795
--- /dev/null
+++ b/drivers/crypto/chelsio/chtls/Makefile
@@ -0,0 +1,4 @@ 
+ccflags-y := -Idrivers/net/ethernet/chelsio/cxgb4 -Idrivers/crypto/chelsio/
+
+obj-$(CONFIG_CRYPTO_DEV_CHELSIO_TLS) += chtls.o
+chtls-objs := chtls_main.o chtls_cm.o chtls_io.o chtls_hw.o