Message ID | 1518437249-14732-1-git-send-email-atul.gupta@chelsio.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Herbert Xu |
Headers | show |
Hi Atul,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on cryptodev/master]
[cannot apply to net/master net-next/master v4.16-rc1 next-20180214]
[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/20180215-072600
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 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=ia64
All warnings (new ones prefixed by >>):
drivers/crypto/chelsio/chtls/chtls_cm.c: In function 'chtls_rx_ack':
>> drivers/crypto/chelsio/chtls/chtls_cm.c:1979:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (csk->wr_nondata)
^~
drivers/crypto/chelsio/chtls/chtls_cm.c:1981:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
break;
^~~~~
vim +/if +1979 drivers/crypto/chelsio/chtls/chtls_cm.c
763a7f5f Atul Gupta 2018-02-12 1961
763a7f5f Atul Gupta 2018-02-12 1962 static void chtls_rx_ack(struct sock *sk, struct sk_buff *skb)
763a7f5f Atul Gupta 2018-02-12 1963 {
763a7f5f Atul Gupta 2018-02-12 1964 struct cpl_fw4_ack *hdr = cplhdr(skb) + RSS_HDR;
763a7f5f Atul Gupta 2018-02-12 1965 struct chtls_sock *csk = sk->sk_user_data;
763a7f5f Atul Gupta 2018-02-12 1966 struct tcp_sock *tp = tcp_sk(sk);
763a7f5f Atul Gupta 2018-02-12 1967 u32 snd_una = ntohl(hdr->snd_una);
763a7f5f Atul Gupta 2018-02-12 1968 u8 credits = hdr->credits;
763a7f5f Atul Gupta 2018-02-12 1969
763a7f5f Atul Gupta 2018-02-12 1970 csk->wr_credits += credits;
763a7f5f Atul Gupta 2018-02-12 1971
763a7f5f Atul Gupta 2018-02-12 1972 if (csk->wr_unacked > csk->wr_max_credits - csk->wr_credits)
763a7f5f Atul Gupta 2018-02-12 1973 csk->wr_unacked = csk->wr_max_credits - csk->wr_credits;
763a7f5f Atul Gupta 2018-02-12 1974
763a7f5f Atul Gupta 2018-02-12 1975 while (credits) {
763a7f5f Atul Gupta 2018-02-12 1976 struct sk_buff *pskb = csk->wr_skb_head;
763a7f5f Atul Gupta 2018-02-12 1977
763a7f5f Atul Gupta 2018-02-12 1978 if (unlikely(!pskb)) {
763a7f5f Atul Gupta 2018-02-12 @1979 if (csk->wr_nondata)
763a7f5f Atul Gupta 2018-02-12 1980 csk->wr_nondata -= credits;
763a7f5f Atul Gupta 2018-02-12 1981 break;
763a7f5f Atul Gupta 2018-02-12 1982 }
763a7f5f Atul Gupta 2018-02-12 1983 if (unlikely(credits < pskb->csum)) {
763a7f5f Atul Gupta 2018-02-12 1984 pskb->csum -= credits;
763a7f5f Atul Gupta 2018-02-12 1985 break;
763a7f5f Atul Gupta 2018-02-12 1986 }
763a7f5f Atul Gupta 2018-02-12 1987 dequeue_wr(sk);
763a7f5f Atul Gupta 2018-02-12 1988 credits -= pskb->csum;
763a7f5f Atul Gupta 2018-02-12 1989 kfree_skb(pskb);
763a7f5f Atul Gupta 2018-02-12 1990 }
763a7f5f Atul Gupta 2018-02-12 1991 if (hdr->seq_vld & CPL_FW4_ACK_FLAGS_SEQVAL) {
763a7f5f Atul Gupta 2018-02-12 1992 if (unlikely(before(snd_una, tp->snd_una))) {
763a7f5f Atul Gupta 2018-02-12 1993 kfree_skb(skb);
763a7f5f Atul Gupta 2018-02-12 1994 return;
763a7f5f Atul Gupta 2018-02-12 1995 }
763a7f5f Atul Gupta 2018-02-12 1996
763a7f5f Atul Gupta 2018-02-12 1997 if (tp->snd_una != snd_una) {
763a7f5f Atul Gupta 2018-02-12 1998 tp->snd_una = snd_una;
763a7f5f Atul Gupta 2018-02-12 1999 dst_confirm(sk->sk_dst_cache);
763a7f5f Atul Gupta 2018-02-12 2000 tp->rcv_tstamp = tcp_time_stamp(tp);
763a7f5f Atul Gupta 2018-02-12 2001 if (tp->snd_una == tp->snd_nxt &&
763a7f5f Atul Gupta 2018-02-12 2002 !csk_flag_nochk(csk, CSK_TX_FAILOVER))
763a7f5f Atul Gupta 2018-02-12 2003 csk_reset_flag(csk, CSK_TX_WAIT_IDLE);
763a7f5f Atul Gupta 2018-02-12 2004 }
763a7f5f Atul Gupta 2018-02-12 2005 }
763a7f5f Atul Gupta 2018-02-12 2006
763a7f5f Atul Gupta 2018-02-12 2007 if (hdr->seq_vld & CPL_FW4_ACK_FLAGS_CH) {
763a7f5f Atul Gupta 2018-02-12 2008 unsigned int fclen16 = roundup(failover_flowc_wr_len, 16);
763a7f5f Atul Gupta 2018-02-12 2009
763a7f5f Atul Gupta 2018-02-12 2010 csk->wr_credits -= fclen16;
763a7f5f Atul Gupta 2018-02-12 2011 csk_reset_flag(csk, CSK_TX_WAIT_IDLE);
763a7f5f Atul Gupta 2018-02-12 2012 csk_reset_flag(csk, CSK_TX_FAILOVER);
763a7f5f Atul Gupta 2018-02-12 2013 }
763a7f5f Atul Gupta 2018-02-12 2014 if (skb_queue_len(&csk->txq) && chtls_push_frames(csk, 0))
763a7f5f Atul Gupta 2018-02-12 2015 sk->sk_write_space(sk);
763a7f5f Atul Gupta 2018-02-12 2016
763a7f5f Atul Gupta 2018-02-12 2017 kfree_skb(skb);
763a7f5f Atul Gupta 2018-02-12 2018 }
763a7f5f Atul Gupta 2018-02-12 2019
:::::: The code at line 1979 was first introduced by commit
:::::: 763a7f5f41026de851ce850ee22e2f6c29fcdf50 chtls: CPL handler definition
:::::: 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
Hi Atul, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on cryptodev/master] [cannot apply to net/master net-next/master v4.16-rc1 next-20180214] [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/20180215-072600 base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master 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:139:19: sparse: symbol 'chtls_netdev' was not declared. Should it be >> drivers/crypto/chelsio/chtls/chtls_main.c:152:6: sparse: symbol 'chtls_update_prot' was not declared. Should it be >> drivers/crypto/chelsio/chtls/chtls_main.c:157:5: sparse: symbol 'chtls_inline_feature' was not declared. Should it be >> drivers/crypto/chelsio/chtls/chtls_main.c:171:5: sparse: symbol 'chtls_create_hash' was not declared. Should it be >> drivers/crypto/chelsio/chtls/chtls_main.c:178:6: sparse: symbol 'chtls_destroy_hash' was not declared. Should it be -- >> drivers/crypto/chelsio/chtls/chtls_cm.c:373:27: sparse: incorrect type in assignment (different address spaces) @@ expected struct socket_wq @@ got @@ drivers/crypto/chelsio/chtls/chtls_cm.c:373:27: expected struct socket_wq drivers/crypto/chelsio/chtls/chtls_cm.c:373:27: got struct socket_wq >> drivers/crypto/chelsio/chtls/chtls_cm.c:395:23: sparse: incompatible types in comparison expression (different address spaces) drivers/crypto/chelsio/chtls/chtls_cm.c:714:6: sparse: symbol 'free_atid' was not declared. Should it be >> drivers/crypto/chelsio/chtls/chtls_cm.h:150:35: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct socket_wq @@ got struct socket_wq struct socket_wq @@ drivers/crypto/chelsio/chtls/chtls_cm.h:150:35: expected struct socket_wq drivers/crypto/chelsio/chtls/chtls_cm.h:150:35: got struct socket_wq >> drivers/crypto/chelsio/chtls/chtls_cm.c:1165:37: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned int local_ip @@ got ed int local_ip @@ drivers/crypto/chelsio/chtls/chtls_cm.c:1165:37: expected unsigned int local_ip drivers/crypto/chelsio/chtls/chtls_cm.c:1165:37: got restricted __be32 daddr >> drivers/crypto/chelsio/chtls/chtls_cm.c:1165:49: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned int peer_ip @@ got ed int peer_ip @@ drivers/crypto/chelsio/chtls/chtls_cm.c:1165:49: expected unsigned int peer_ip drivers/crypto/chelsio/chtls/chtls_cm.c:1165:49: got restricted __be32 saddr >> drivers/crypto/chelsio/chtls/chtls_cm.h:173:37: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 skc_rcv_saddr @@ got unsignrestricted __be32 skc_rcv_saddr @@ drivers/crypto/chelsio/chtls/chtls_cm.h:173:37: expected restricted __be32 skc_rcv_saddr drivers/crypto/chelsio/chtls/chtls_cm.h:173:37: got unsigned int local_ip >> drivers/crypto/chelsio/chtls/chtls_cm.h:174:37: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 skc_daddr @@ got unsignrestricted __be32 skc_daddr @@ drivers/crypto/chelsio/chtls/chtls_cm.h:174:37: expected restricted __be32 skc_daddr drivers/crypto/chelsio/chtls/chtls_cm.h:174:37: got unsigned int peer_ip >> drivers/crypto/chelsio/chtls/chtls_cm.c:1243:23: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct dst_entry @@ got struct dst_entry struct dst_entry @@ drivers/crypto/chelsio/chtls/chtls_cm.c:1243:23: expected struct dst_entry drivers/crypto/chelsio/chtls/chtls_cm.c:1243:23: got struct dst_entry >> drivers/crypto/chelsio/chtls/chtls_cm.c:1539:24: sparse: cast to restricted __be16 >> drivers/crypto/chelsio/chtls/chtls_cm.c:1539:24: sparse: cast to restricted __be16 >> drivers/crypto/chelsio/chtls/chtls_cm.c:1539:24: sparse: cast to restricted __be16 >> drivers/crypto/chelsio/chtls/chtls_cm.c:1539:24: sparse: cast to restricted __be16 drivers/crypto/chelsio/chtls/chtls_cm.c:1540:31: sparse: cast to restricted __be16 drivers/crypto/chelsio/chtls/chtls_cm.c:1540:31: sparse: cast to restricted __be16 drivers/crypto/chelsio/chtls/chtls_cm.c:1540:31: sparse: cast to restricted __be16 drivers/crypto/chelsio/chtls/chtls_cm.c:1540:31: sparse: cast to restricted __be16 drivers/crypto/chelsio/chtls/chtls_cm.c:1664:31: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct dst_entry @@ got struct dst_entry struct dst_entry @@ drivers/crypto/chelsio/chtls/chtls_cm.c:1664:31: expected struct dst_entry drivers/crypto/chelsio/chtls/chtls_cm.c:1664:31: got struct dst_entry >> drivers/crypto/chelsio/chtls/chtls_cm.c:1983:21: sparse: restricted __wsum degrades to integer >> drivers/crypto/chelsio/chtls/chtls_cm.c:1984:36: sparse: bad assignment (-=) to restricted __wsum >> drivers/crypto/chelsio/chtls/chtls_cm.c:1988:25: sparse: invalid assignment: -= drivers/crypto/chelsio/chtls/chtls_cm.c:1988:25: left side has type unsigned char drivers/crypto/chelsio/chtls/chtls_cm.c:1988:25: right side has type restricted __wsum drivers/crypto/chelsio/chtls/chtls_cm.c:1999:39: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct dst_entry @@ got struct dst_entry struct dst_entry @@ drivers/crypto/chelsio/chtls/chtls_cm.c:1999:39: expected struct dst_entry drivers/crypto/chelsio/chtls/chtls_cm.c:1999:39: got struct dst_entry >> drivers/crypto/chelsio/chtls/chtls_cm.c:1062:22: sparse: context imbalance in 'chtls_recv_sock' - unexpected unlock drivers/crypto/chelsio/chtls/chtls_cm.c: In function 'chtls_rx_ack': drivers/crypto/chelsio/chtls/chtls_cm.c:1979:4: warning: this 'if' clause does not guard... if (csk->wr_nondata) ^~ drivers/crypto/chelsio/chtls/chtls_cm.c:1981:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' break; ^~~~~ -- >> drivers/crypto/chelsio/chtls/chtls_io.c:343:31: sparse: incorrect type in return expression (different base types) @@ expected restricted __be64 @@ got urestricted __be64 @@ drivers/crypto/chelsio/chtls/chtls_io.c:343:31: expected restricted __be64 drivers/crypto/chelsio/chtls/chtls_io.c:343:31: got unsigned long long >> drivers/crypto/chelsio/chtls/chtls_io.c:399:36: sparse: invalid assignment: &= drivers/crypto/chelsio/chtls/chtls_io.c:399:36: left side has type restricted __be32 drivers/crypto/chelsio/chtls/chtls_io.c:399:36: right side has type unsigned int drivers/crypto/chelsio/chtls/chtls_io.c:400:36: sparse: invalid assignment: |= drivers/crypto/chelsio/chtls/chtls_io.c:400:36: left side has type restricted __be32 drivers/crypto/chelsio/chtls/chtls_io.c:400:36: right side has type int >> drivers/crypto/chelsio/chtls/chtls_io.c:462:34: sparse: cast from restricted __be32 >> drivers/crypto/chelsio/chtls/chtls_io.c:462:34: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int val @@ got ed int val @@ drivers/crypto/chelsio/chtls/chtls_io.c:462:34: expected unsigned int val drivers/crypto/chelsio/chtls/chtls_io.c:462:34: got restricted __be32 seqno_numivs >> drivers/crypto/chelsio/chtls/chtls_io.c:462:34: sparse: cast from restricted __be32 >> drivers/crypto/chelsio/chtls/chtls_io.c:462:34: sparse: cast from restricted __be32 >> drivers/crypto/chelsio/chtls/chtls_io.c:462:34: sparse: cast from restricted __be32 >> drivers/crypto/chelsio/chtls/chtls_io.c:462:34: sparse: cast from restricted __be32 drivers/crypto/chelsio/chtls/chtls_io.c:463:33: sparse: cast from restricted __be32 drivers/crypto/chelsio/chtls/chtls_io.c:463:33: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int val @@ got ed int val @@ drivers/crypto/chelsio/chtls/chtls_io.c:463:33: expected unsigned int val drivers/crypto/chelsio/chtls/chtls_io.c:463:33: got restricted __be32 ivgen_hdrlen drivers/crypto/chelsio/chtls/chtls_io.c:463:33: sparse: cast from restricted __be32 drivers/crypto/chelsio/chtls/chtls_io.c:463:33: sparse: cast from restricted __be32 drivers/crypto/chelsio/chtls/chtls_io.c:463:33: sparse: cast from restricted __be32 drivers/crypto/chelsio/chtls/chtls_io.c:463:33: sparse: cast from restricted __be32 >> drivers/crypto/chelsio/chtls/chtls_io.c:464:26: sparse: cast from restricted __be64 >> drivers/crypto/chelsio/chtls/chtls_io.c:464:26: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long val @@ got gned] val @@ drivers/crypto/chelsio/chtls/chtls_io.c:464:26: expected unsigned long long val drivers/crypto/chelsio/chtls/chtls_io.c:464:26: got restricted __be64 >> drivers/crypto/chelsio/chtls/chtls_io.c:464:26: sparse: cast from restricted __be64 >> drivers/crypto/chelsio/chtls/chtls_io.c:464:26: sparse: cast from restricted __be64 >> drivers/crypto/chelsio/chtls/chtls_io.c:464:26: sparse: cast from restricted __be64 >> drivers/crypto/chelsio/chtls/chtls_io.c:464:26: sparse: cast from restricted __be64 >> drivers/crypto/chelsio/chtls/chtls_io.c:464:26: sparse: cast from restricted __be64 >> drivers/crypto/chelsio/chtls/chtls_io.c:464:26: sparse: cast from restricted __be64 >> drivers/crypto/chelsio/chtls/chtls_io.c:464:26: sparse: cast from restricted __be64 >> drivers/crypto/chelsio/chtls/chtls_io.c:464:26: sparse: cast from restricted __be64 >> drivers/crypto/chelsio/chtls/chtls_io.c:484:21: sparse: restricted __be32 degrades to integer >> drivers/crypto/chelsio/chtls/chtls_io.c:516:6: sparse: symbol 'make_tlstx_data_wr' was not declared. Should it be >> drivers/crypto/chelsio/chtls/chtls_io.c:692:27: sparse: incorrect type in assignment (different base types) @@ expected restricted __wsum csum @@ got csum @@ drivers/crypto/chelsio/chtls/chtls_io.c:692:27: expected restricted __wsum csum drivers/crypto/chelsio/chtls/chtls_io.c:692:27: got unsigned int >> drivers/crypto/chelsio/chtls/chtls_io.c:938:16: sparse: incorrect type in return expression (different base types) @@ expected int @@ got restricted __be16 [usertypint @@ drivers/crypto/chelsio/chtls/chtls_io.c:938:16: expected int drivers/crypto/chelsio/chtls/chtls_io.c:938:16: got restricted __be16 <noident> -- >> drivers/crypto/chelsio/chtls/chtls_hw.c:293:32: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 seqno_numivs @@ got e] seqno_numivs @@ drivers/crypto/chelsio/chtls/chtls_hw.c:293:32: expected restricted __be32 seqno_numivs drivers/crypto/chelsio/chtls/chtls_hw.c:293:32: got int >> drivers/crypto/chelsio/chtls/chtls_hw.c:304:32: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 ivgen_hdrlen @@ got e] ivgen_hdrlen @@ drivers/crypto/chelsio/chtls/chtls_hw.c:304:32: expected restricted __be32 ivgen_hdrlen drivers/crypto/chelsio/chtls/chtls_hw.c:304:32: got int Please review and possibly fold the followup patch. --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
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
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