Re: [Crypto v4 12/12] Makefile Kconfig
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 >>
Re: [Crypto v4 12/12] Makefile Kconfig
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 1964struct cpl_fw4_ack *hdr = cplhdr(skb) + RSS_HDR; 763a7f5f Atul Gupta 2018-02-12 1965struct chtls_sock *csk = sk->sk_user_data; 763a7f5f Atul Gupta 2018-02-12 1966struct tcp_sock *tp = tcp_sk(sk); 763a7f5f Atul Gupta 2018-02-12 1967u32 snd_una = ntohl(hdr->snd_una); 763a7f5f Atul Gupta 2018-02-12 1968u8 credits = hdr->credits; 763a7f5f Atul Gupta 2018-02-12 1969 763a7f5f Atul Gupta 2018-02-12 1970csk->wr_credits += credits; 763a7f5f Atul Gupta 2018-02-12 1971 763a7f5f Atul Gupta 2018-02-12 1972if (csk->wr_unacked > csk->wr_max_credits - csk->wr_credits) 763a7f5f Atul Gupta 2018-02-12 1973csk->wr_unacked = csk->wr_max_credits - csk->wr_credits; 763a7f5f Atul Gupta 2018-02-12 1974 763a7f5f Atul Gupta 2018-02-12 1975while (credits) { 763a7f5f Atul Gupta 2018-02-12 1976struct sk_buff *pskb = csk->wr_skb_head; 763a7f5f Atul Gupta 2018-02-12 1977 763a7f5f Atul Gupta 2018-02-12 1978if (unlikely(!pskb)) { 763a7f5f Atul Gupta 2018-02-12 @1979if (csk->wr_nondata) 763a7f5f Atul Gupta 2018-02-12 1980csk->wr_nondata -= credits; 763a7f5f Atul Gupta 2018-02-12 1981break; 763a7f5f Atul Gupta 2018-02-12 1982} 763a7f5f Atul Gupta 2018-02-12 1983if (unlikely(credits < pskb->csum)) { 763a7f5f Atul Gupta 2018-02-12 1984pskb->csum -= credits; 763a7f5f Atul Gupta 2018-02-12 1985break; 763a7f5f Atul Gupta 2018-02-12 1986} 763a7f5f Atul Gupta 2018-02-12 1987dequeue_wr(sk); 763a7f5f Atul Gupta 2018-02-12 1988credits -= pskb->csum; 763a7f5f Atul Gupta 2018-02-12 1989kfree_skb(pskb); 763a7f5f Atul Gupta 2018-02-12 1990} 763a7f5f Atul Gupta 2018-02-12 1991if (hdr->seq_vld & CPL_FW4_ACK_FLAGS_SEQVAL) { 763a7f5f Atul Gupta 2018-02-12 1992if (unlikely(before(snd_una, tp->snd_una))) { 763a7f5f Atul Gupta 2018-02-12 1993kfree_skb(skb); 763a7f5f Atul Gupta 2018-02-12 1994return; 763a7f5f Atul Gupta 2018-02-12 1995} 763a7f5f Atul Gupta 2018-02-12 1996 763a7f5f Atul Gupta 2018-02-12 1997if (tp->snd_una != snd_una) { 763a7f5f Atul Gupta 2018-02-12 1998tp->snd_una = snd_una; 763a7f5f Atul Gupta 2018-02-12 1999 dst_confirm(sk->sk_dst_cache); 763a7f5f Atul Gupta 2018-02-12 2000tp->rcv_tstamp = tcp_time_stamp(tp); 763a7f5f Atul Gupta 2018-02-12 2001if (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 2007if (hdr->seq_vld & CPL_FW4_ACK_FLAGS_CH) { 763a7f5f Atul Gupta 2018-02-12 2008unsigned int fclen16 = roundup(failover_flowc_wr_len, 16); 763a7f5f Atul Gupta 2018-02-12 2009 763a7f5f Atul Gupta 2018-02-12 2010csk->wr_credits -= fclen16; 763a7f5f Atul Gupta 2018-02-12 2011csk_reset_flag(csk, CSK_TX_WAIT_IDLE); 763a7f5f Atul Gupta 2018-02-12 2012csk_reset_flag(csk, CSK_TX_FAILOVER);
[Crypto v4 12/12] Makefile Kconfig
Entry for Inline TLS as another driver dependent on cxgb4 and chcr Signed-off-by: Atul Gupta--- 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 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 000..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 -- 1.8.3.1