* drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used
@ 2020-12-09 10:37 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-12-09 10:37 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: kbuild-all, linux-kernel, Jakub Kicinski, Matthieu Baerts
[-- Attachment #1: Type: text/plain, Size: 8021 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a68a0262abdaa251e12c53715f48e698a18ef402
commit: 010b430d5df556d5d232e3751ac691ba9e88c041 mptcp: MPTCP_IPV6 should depend on IPV6 instead of selecting it
date: 7 weeks ago
config: parisc-randconfig-r033-20201209 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=010b430d5df556d5d232e3751ac691ba9e88c041
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 010b430d5df556d5d232e3751ac691ba9e88c041
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_rx_resync_req':
>> drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used [-Wunused-but-set-variable]
477 | struct ipv6hdr *ipv6h;
| ^~~~~
In file included from include/linux/compiler_types.h:65,
from <command-line>:
drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_add':
>> include/linux/compiler_attributes.h:208:41: warning: statement will never be executed [-Wswitch-unreachable]
208 | # define fallthrough __attribute__((__fallthrough__))
| ^~~~~~~~~~~~~
drivers/net/ethernet/netronome/nfp/crypto/tls.c:299:3: note: in expansion of macro 'fallthrough'
299 | fallthrough;
| ^~~~~~~~~~~
vim +/ipv6h +477 drivers/net/ethernet/netronome/nfp/crypto/tls.c
232eeb1f84eb2d4 Jakub Kicinski 2019-06-05 470
6a35ddc5445a829 Jakub Kicinski 2019-12-17 471 int nfp_net_tls_rx_resync_req(struct net_device *netdev,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 472 struct nfp_net_tls_resync_req *req,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 473 void *pkt, unsigned int pkt_len)
6a35ddc5445a829 Jakub Kicinski 2019-12-17 474 {
6a35ddc5445a829 Jakub Kicinski 2019-12-17 475 struct nfp_net *nn = netdev_priv(netdev);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 476 struct nfp_net_tls_offload_ctx *ntls;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 @477 struct ipv6hdr *ipv6h;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 478 struct tcphdr *th;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 479 struct iphdr *iph;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 480 struct sock *sk;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 481 __be32 tcp_seq;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 482 int err;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 483
6a35ddc5445a829 Jakub Kicinski 2019-12-17 484 iph = pkt + req->l3_offset;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 485 ipv6h = pkt + req->l3_offset;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 486 th = pkt + req->l4_offset;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 487
6a35ddc5445a829 Jakub Kicinski 2019-12-17 488 if ((u8 *)&th[1] > (u8 *)pkt + pkt_len) {
6a35ddc5445a829 Jakub Kicinski 2019-12-17 489 netdev_warn_once(netdev, "invalid TLS RX resync request (l3_off: %hhu l4_off: %hhu pkt_len: %u)\n",
6a35ddc5445a829 Jakub Kicinski 2019-12-17 490 req->l3_offset, req->l4_offset, pkt_len);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 491 err = -EINVAL;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 492 goto err_cnt_ign;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 493 }
6a35ddc5445a829 Jakub Kicinski 2019-12-17 494
6a35ddc5445a829 Jakub Kicinski 2019-12-17 495 switch (iph->version) {
6a35ddc5445a829 Jakub Kicinski 2019-12-17 496 case 4:
6a35ddc5445a829 Jakub Kicinski 2019-12-17 497 sk = inet_lookup_established(dev_net(netdev), &tcp_hashinfo,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 498 iph->saddr, th->source, iph->daddr,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 499 th->dest, netdev->ifindex);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 500 break;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 501 #if IS_ENABLED(CONFIG_IPV6)
6a35ddc5445a829 Jakub Kicinski 2019-12-17 502 case 6:
6a35ddc5445a829 Jakub Kicinski 2019-12-17 503 sk = __inet6_lookup_established(dev_net(netdev), &tcp_hashinfo,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 504 &ipv6h->saddr, th->source,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 505 &ipv6h->daddr, ntohs(th->dest),
6a35ddc5445a829 Jakub Kicinski 2019-12-17 506 netdev->ifindex, 0);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 507 break;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 508 #endif
6a35ddc5445a829 Jakub Kicinski 2019-12-17 509 default:
6a35ddc5445a829 Jakub Kicinski 2019-12-17 510 netdev_warn_once(netdev, "invalid TLS RX resync request (l3_off: %hhu l4_off: %hhu ipver: %u)\n",
6a35ddc5445a829 Jakub Kicinski 2019-12-17 511 req->l3_offset, req->l4_offset, iph->version);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 512 err = -EINVAL;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 513 goto err_cnt_ign;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 514 }
6a35ddc5445a829 Jakub Kicinski 2019-12-17 515
6a35ddc5445a829 Jakub Kicinski 2019-12-17 516 err = 0;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 517 if (!sk)
6a35ddc5445a829 Jakub Kicinski 2019-12-17 518 goto err_cnt_ign;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 519 if (!tls_is_sk_rx_device_offloaded(sk) ||
6a35ddc5445a829 Jakub Kicinski 2019-12-17 520 sk->sk_shutdown & RCV_SHUTDOWN)
6a35ddc5445a829 Jakub Kicinski 2019-12-17 521 goto err_put_sock;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 522
6a35ddc5445a829 Jakub Kicinski 2019-12-17 523 ntls = tls_driver_ctx(sk, TLS_OFFLOAD_CTX_DIR_RX);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 524 /* some FW versions can't report the handle and report 0s */
6a35ddc5445a829 Jakub Kicinski 2019-12-17 525 if (memchr_inv(&req->fw_handle, 0, sizeof(req->fw_handle)) &&
6a35ddc5445a829 Jakub Kicinski 2019-12-17 526 memcmp(&req->fw_handle, &ntls->fw_handle, sizeof(ntls->fw_handle)))
6a35ddc5445a829 Jakub Kicinski 2019-12-17 527 goto err_put_sock;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 528
6a35ddc5445a829 Jakub Kicinski 2019-12-17 529 /* copy to ensure alignment */
6a35ddc5445a829 Jakub Kicinski 2019-12-17 530 memcpy(&tcp_seq, &req->tcp_seq, sizeof(tcp_seq));
6a35ddc5445a829 Jakub Kicinski 2019-12-17 531 tls_offload_rx_resync_request(sk, tcp_seq);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 532 atomic_inc(&nn->ktls_rx_resync_req);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 533
6a35ddc5445a829 Jakub Kicinski 2019-12-17 534 sock_gen_put(sk);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 535 return 0;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 536
6a35ddc5445a829 Jakub Kicinski 2019-12-17 537 err_put_sock:
6a35ddc5445a829 Jakub Kicinski 2019-12-17 538 sock_gen_put(sk);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 539 err_cnt_ign:
6a35ddc5445a829 Jakub Kicinski 2019-12-17 540 atomic_inc(&nn->ktls_rx_resync_ign);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 541 return err;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 542 }
6a35ddc5445a829 Jakub Kicinski 2019-12-17 543
:::::: The code at line 477 was first introduced by commit
:::::: 6a35ddc5445a8291ced6247a67977e110275acde nfp: tls: implement the stream sync RX resync
:::::: TO: Jakub Kicinski <jakub.kicinski@netronome.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28892 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used
2020-11-17 16:39 kernel test robot
@ 2020-11-17 16:56 ` Gustavo A. R. Silva
0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2020-11-17 16:56 UTC (permalink / raw)
To: kernel test robot, Geert Uytterhoeven
Cc: kbuild-all, linux-kernel, Jakub Kicinski, Matthieu Baerts
On 11/17/20 10:39, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 9c87c9f41245baa3fc4716cf39141439cf405b01
> commit: b142083b585c2c03af24cca4d274f797796a4064 mptcp: MPTCP_KUNIT_TESTS should depend on MPTCP instead of selecting it
> date: 4 weeks ago
> config: arc-randconfig-r005-20201117 (attached as .config)
> compiler: arceb-elf-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b142083b585c2c03af24cca4d274f797796a4064
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout b142083b585c2c03af24cca4d274f797796a4064
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
[..]
> drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_add':
> include/linux/compiler_attributes.h:208:41: warning: statement will never be executed [-Wswitch-unreachable]
> 208 | # define fallthrough __attribute__((__fallthrough__))
> | ^~~~~~~~~~~~~
> drivers/net/ethernet/netronome/nfp/crypto/tls.c:299:3: note: in expansion of macro 'fallthrough'
> 299 | fallthrough;
> | ^~~~~~~~~~~
>
This should fix the issue reported above:
diff --git a/drivers/net/ethernet/netronome/nfp/crypto/tls.c b/drivers/net/ethernet/netronome/nfp/crypto/tls.c
index 76c51da5b66f..9b32ae46011c 100644
--- a/drivers/net/ethernet/netronome/nfp/crypto/tls.c
+++ b/drivers/net/ethernet/netronome/nfp/crypto/tls.c
@@ -295,8 +295,8 @@ nfp_net_tls_add(struct net_device *netdev, struct sock *sk,
ipv6 = true;
break;
}
-#endif
fallthrough;
+#endif
case AF_INET:
req_sz = sizeof(struct nfp_crypto_req_add_v4);
ipv6 = false;
--
Gustavo
^ permalink raw reply related [flat|nested] 6+ messages in thread
* drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used
@ 2020-11-17 16:39 kernel test robot
2020-11-17 16:56 ` Gustavo A. R. Silva
0 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2020-11-17 16:39 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: kbuild-all, linux-kernel, Jakub Kicinski, Matthieu Baerts
[-- Attachment #1: Type: text/plain, Size: 8022 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9c87c9f41245baa3fc4716cf39141439cf405b01
commit: b142083b585c2c03af24cca4d274f797796a4064 mptcp: MPTCP_KUNIT_TESTS should depend on MPTCP instead of selecting it
date: 4 weeks ago
config: arc-randconfig-r005-20201117 (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b142083b585c2c03af24cca4d274f797796a4064
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout b142083b585c2c03af24cca4d274f797796a4064
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_rx_resync_req':
>> drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used [-Wunused-but-set-variable]
477 | struct ipv6hdr *ipv6h;
| ^~~~~
In file included from include/linux/compiler_types.h:65,
from <command-line>:
drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_add':
include/linux/compiler_attributes.h:208:41: warning: statement will never be executed [-Wswitch-unreachable]
208 | # define fallthrough __attribute__((__fallthrough__))
| ^~~~~~~~~~~~~
drivers/net/ethernet/netronome/nfp/crypto/tls.c:299:3: note: in expansion of macro 'fallthrough'
299 | fallthrough;
| ^~~~~~~~~~~
vim +/ipv6h +477 drivers/net/ethernet/netronome/nfp/crypto/tls.c
232eeb1f84eb2d4 Jakub Kicinski 2019-06-05 470
6a35ddc5445a829 Jakub Kicinski 2019-12-17 471 int nfp_net_tls_rx_resync_req(struct net_device *netdev,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 472 struct nfp_net_tls_resync_req *req,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 473 void *pkt, unsigned int pkt_len)
6a35ddc5445a829 Jakub Kicinski 2019-12-17 474 {
6a35ddc5445a829 Jakub Kicinski 2019-12-17 475 struct nfp_net *nn = netdev_priv(netdev);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 476 struct nfp_net_tls_offload_ctx *ntls;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 @477 struct ipv6hdr *ipv6h;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 478 struct tcphdr *th;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 479 struct iphdr *iph;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 480 struct sock *sk;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 481 __be32 tcp_seq;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 482 int err;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 483
6a35ddc5445a829 Jakub Kicinski 2019-12-17 484 iph = pkt + req->l3_offset;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 485 ipv6h = pkt + req->l3_offset;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 486 th = pkt + req->l4_offset;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 487
6a35ddc5445a829 Jakub Kicinski 2019-12-17 488 if ((u8 *)&th[1] > (u8 *)pkt + pkt_len) {
6a35ddc5445a829 Jakub Kicinski 2019-12-17 489 netdev_warn_once(netdev, "invalid TLS RX resync request (l3_off: %hhu l4_off: %hhu pkt_len: %u)\n",
6a35ddc5445a829 Jakub Kicinski 2019-12-17 490 req->l3_offset, req->l4_offset, pkt_len);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 491 err = -EINVAL;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 492 goto err_cnt_ign;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 493 }
6a35ddc5445a829 Jakub Kicinski 2019-12-17 494
6a35ddc5445a829 Jakub Kicinski 2019-12-17 495 switch (iph->version) {
6a35ddc5445a829 Jakub Kicinski 2019-12-17 496 case 4:
6a35ddc5445a829 Jakub Kicinski 2019-12-17 497 sk = inet_lookup_established(dev_net(netdev), &tcp_hashinfo,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 498 iph->saddr, th->source, iph->daddr,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 499 th->dest, netdev->ifindex);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 500 break;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 501 #if IS_ENABLED(CONFIG_IPV6)
6a35ddc5445a829 Jakub Kicinski 2019-12-17 502 case 6:
6a35ddc5445a829 Jakub Kicinski 2019-12-17 503 sk = __inet6_lookup_established(dev_net(netdev), &tcp_hashinfo,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 504 &ipv6h->saddr, th->source,
6a35ddc5445a829 Jakub Kicinski 2019-12-17 505 &ipv6h->daddr, ntohs(th->dest),
6a35ddc5445a829 Jakub Kicinski 2019-12-17 506 netdev->ifindex, 0);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 507 break;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 508 #endif
6a35ddc5445a829 Jakub Kicinski 2019-12-17 509 default:
6a35ddc5445a829 Jakub Kicinski 2019-12-17 510 netdev_warn_once(netdev, "invalid TLS RX resync request (l3_off: %hhu l4_off: %hhu ipver: %u)\n",
6a35ddc5445a829 Jakub Kicinski 2019-12-17 511 req->l3_offset, req->l4_offset, iph->version);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 512 err = -EINVAL;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 513 goto err_cnt_ign;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 514 }
6a35ddc5445a829 Jakub Kicinski 2019-12-17 515
6a35ddc5445a829 Jakub Kicinski 2019-12-17 516 err = 0;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 517 if (!sk)
6a35ddc5445a829 Jakub Kicinski 2019-12-17 518 goto err_cnt_ign;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 519 if (!tls_is_sk_rx_device_offloaded(sk) ||
6a35ddc5445a829 Jakub Kicinski 2019-12-17 520 sk->sk_shutdown & RCV_SHUTDOWN)
6a35ddc5445a829 Jakub Kicinski 2019-12-17 521 goto err_put_sock;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 522
6a35ddc5445a829 Jakub Kicinski 2019-12-17 523 ntls = tls_driver_ctx(sk, TLS_OFFLOAD_CTX_DIR_RX);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 524 /* some FW versions can't report the handle and report 0s */
6a35ddc5445a829 Jakub Kicinski 2019-12-17 525 if (memchr_inv(&req->fw_handle, 0, sizeof(req->fw_handle)) &&
6a35ddc5445a829 Jakub Kicinski 2019-12-17 526 memcmp(&req->fw_handle, &ntls->fw_handle, sizeof(ntls->fw_handle)))
6a35ddc5445a829 Jakub Kicinski 2019-12-17 527 goto err_put_sock;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 528
6a35ddc5445a829 Jakub Kicinski 2019-12-17 529 /* copy to ensure alignment */
6a35ddc5445a829 Jakub Kicinski 2019-12-17 530 memcpy(&tcp_seq, &req->tcp_seq, sizeof(tcp_seq));
6a35ddc5445a829 Jakub Kicinski 2019-12-17 531 tls_offload_rx_resync_request(sk, tcp_seq);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 532 atomic_inc(&nn->ktls_rx_resync_req);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 533
6a35ddc5445a829 Jakub Kicinski 2019-12-17 534 sock_gen_put(sk);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 535 return 0;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 536
6a35ddc5445a829 Jakub Kicinski 2019-12-17 537 err_put_sock:
6a35ddc5445a829 Jakub Kicinski 2019-12-17 538 sock_gen_put(sk);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 539 err_cnt_ign:
6a35ddc5445a829 Jakub Kicinski 2019-12-17 540 atomic_inc(&nn->ktls_rx_resync_ign);
6a35ddc5445a829 Jakub Kicinski 2019-12-17 541 return err;
6a35ddc5445a829 Jakub Kicinski 2019-12-17 542 }
6a35ddc5445a829 Jakub Kicinski 2019-12-17 543
:::::: The code at line 477 was first introduced by commit
:::::: 6a35ddc5445a8291ced6247a67977e110275acde nfp: tls: implement the stream sync RX resync
:::::: TO: Jakub Kicinski <jakub.kicinski@netronome.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41772 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used
@ 2020-09-12 9:02 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-09-12 9:02 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: kbuild-all, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 4189 bytes --]
Hi Jakub,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 729e3d091984487f7aa1ebfabfe594e5b317ed0f
commit: 6a35ddc5445a8291ced6247a67977e110275acde nfp: tls: implement the stream sync RX resync
date: 9 months ago
config: ia64-randconfig-r005-20200911 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 6a35ddc5445a8291ced6247a67977e110275acde
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_rx_resync_req':
>> drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used [-Wunused-but-set-variable]
477 | struct ipv6hdr *ipv6h;
| ^~~~~
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6a35ddc5445a8291ced6247a67977e110275acde
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 6a35ddc5445a8291ced6247a67977e110275acde
vim +/ipv6h +477 drivers/net/ethernet/netronome/nfp/crypto/tls.c
470
471 int nfp_net_tls_rx_resync_req(struct net_device *netdev,
472 struct nfp_net_tls_resync_req *req,
473 void *pkt, unsigned int pkt_len)
474 {
475 struct nfp_net *nn = netdev_priv(netdev);
476 struct nfp_net_tls_offload_ctx *ntls;
> 477 struct ipv6hdr *ipv6h;
478 struct tcphdr *th;
479 struct iphdr *iph;
480 struct sock *sk;
481 __be32 tcp_seq;
482 int err;
483
484 iph = pkt + req->l3_offset;
485 ipv6h = pkt + req->l3_offset;
486 th = pkt + req->l4_offset;
487
488 if ((u8 *)&th[1] > (u8 *)pkt + pkt_len) {
489 netdev_warn_once(netdev, "invalid TLS RX resync request (l3_off: %hhu l4_off: %hhu pkt_len: %u)\n",
490 req->l3_offset, req->l4_offset, pkt_len);
491 err = -EINVAL;
492 goto err_cnt_ign;
493 }
494
495 switch (iph->version) {
496 case 4:
497 sk = inet_lookup_established(dev_net(netdev), &tcp_hashinfo,
498 iph->saddr, th->source, iph->daddr,
499 th->dest, netdev->ifindex);
500 break;
501 #if IS_ENABLED(CONFIG_IPV6)
502 case 6:
503 sk = __inet6_lookup_established(dev_net(netdev), &tcp_hashinfo,
504 &ipv6h->saddr, th->source,
505 &ipv6h->daddr, ntohs(th->dest),
506 netdev->ifindex, 0);
507 break;
508 #endif
509 default:
510 netdev_warn_once(netdev, "invalid TLS RX resync request (l3_off: %hhu l4_off: %hhu ipver: %u)\n",
511 req->l3_offset, req->l4_offset, iph->version);
512 err = -EINVAL;
513 goto err_cnt_ign;
514 }
515
516 err = 0;
517 if (!sk)
518 goto err_cnt_ign;
519 if (!tls_is_sk_rx_device_offloaded(sk) ||
520 sk->sk_shutdown & RCV_SHUTDOWN)
521 goto err_put_sock;
522
523 ntls = tls_driver_ctx(sk, TLS_OFFLOAD_CTX_DIR_RX);
524 /* some FW versions can't report the handle and report 0s */
525 if (memchr_inv(&req->fw_handle, 0, sizeof(req->fw_handle)) &&
526 memcmp(&req->fw_handle, &ntls->fw_handle, sizeof(ntls->fw_handle)))
527 goto err_put_sock;
528
529 /* copy to ensure alignment */
530 memcpy(&tcp_seq, &req->tcp_seq, sizeof(tcp_seq));
531 tls_offload_rx_resync_request(sk, tcp_seq);
532 atomic_inc(&nn->ktls_rx_resync_req);
533
534 sock_gen_put(sk);
535 return 0;
536
537 err_put_sock:
538 sock_gen_put(sk);
539 err_cnt_ign:
540 atomic_inc(&nn->ktls_rx_resync_ign);
541 return err;
542 }
543
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 44458 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used
@ 2020-07-11 20:31 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-07-11 20:31 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: kbuild-all, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3813 bytes --]
Hi Jakub,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1df0d8960499e58963fd6c8ac75e544f2b417b29
commit: 6a35ddc5445a8291ced6247a67977e110275acde nfp: tls: implement the stream sync RX resync
date: 7 months ago
config: i386-randconfig-s002-20200712 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-37-gc9676a3b-dirty
git checkout 6a35ddc5445a8291ced6247a67977e110275acde
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_rx_resync_req':
>> drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used [-Wunused-but-set-variable]
477 | struct ipv6hdr *ipv6h;
| ^~~~~
vim +/ipv6h +477 drivers/net/ethernet/netronome/nfp/crypto/tls.c
470
471 int nfp_net_tls_rx_resync_req(struct net_device *netdev,
472 struct nfp_net_tls_resync_req *req,
473 void *pkt, unsigned int pkt_len)
474 {
475 struct nfp_net *nn = netdev_priv(netdev);
476 struct nfp_net_tls_offload_ctx *ntls;
> 477 struct ipv6hdr *ipv6h;
478 struct tcphdr *th;
479 struct iphdr *iph;
480 struct sock *sk;
481 __be32 tcp_seq;
482 int err;
483
484 iph = pkt + req->l3_offset;
485 ipv6h = pkt + req->l3_offset;
486 th = pkt + req->l4_offset;
487
488 if ((u8 *)&th[1] > (u8 *)pkt + pkt_len) {
489 netdev_warn_once(netdev, "invalid TLS RX resync request (l3_off: %hhu l4_off: %hhu pkt_len: %u)\n",
490 req->l3_offset, req->l4_offset, pkt_len);
491 err = -EINVAL;
492 goto err_cnt_ign;
493 }
494
495 switch (iph->version) {
496 case 4:
497 sk = inet_lookup_established(dev_net(netdev), &tcp_hashinfo,
498 iph->saddr, th->source, iph->daddr,
499 th->dest, netdev->ifindex);
500 break;
501 #if IS_ENABLED(CONFIG_IPV6)
502 case 6:
503 sk = __inet6_lookup_established(dev_net(netdev), &tcp_hashinfo,
504 &ipv6h->saddr, th->source,
505 &ipv6h->daddr, ntohs(th->dest),
506 netdev->ifindex, 0);
507 break;
508 #endif
509 default:
510 netdev_warn_once(netdev, "invalid TLS RX resync request (l3_off: %hhu l4_off: %hhu ipver: %u)\n",
511 req->l3_offset, req->l4_offset, iph->version);
512 err = -EINVAL;
513 goto err_cnt_ign;
514 }
515
516 err = 0;
517 if (!sk)
518 goto err_cnt_ign;
519 if (!tls_is_sk_rx_device_offloaded(sk) ||
520 sk->sk_shutdown & RCV_SHUTDOWN)
521 goto err_put_sock;
522
523 ntls = tls_driver_ctx(sk, TLS_OFFLOAD_CTX_DIR_RX);
524 /* some FW versions can't report the handle and report 0s */
525 if (memchr_inv(&req->fw_handle, 0, sizeof(req->fw_handle)) &&
526 memcmp(&req->fw_handle, &ntls->fw_handle, sizeof(ntls->fw_handle)))
527 goto err_put_sock;
528
529 /* copy to ensure alignment */
530 memcpy(&tcp_seq, &req->tcp_seq, sizeof(tcp_seq));
531 tls_offload_rx_resync_request(sk, tcp_seq);
532 atomic_inc(&nn->ktls_rx_resync_req);
533
534 sock_gen_put(sk);
535 return 0;
536
537 err_put_sock:
538 sock_gen_put(sk);
539 err_cnt_ign:
540 atomic_inc(&nn->ktls_rx_resync_ign);
541 return err;
542 }
543
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41304 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used
@ 2020-06-03 13:38 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-06-03 13:38 UTC (permalink / raw)
To: Jakub, Kicinski,; +Cc: kbuild-all, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3856 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d6f9469a03d832dcd17041ed67774ffb5f3e73b3
commit: 6a35ddc5445a8291ced6247a67977e110275acde nfp: tls: implement the stream sync RX resync
date: 6 months ago
config: arm64-randconfig-r033-20200603 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 6a35ddc5445a8291ced6247a67977e110275acde
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_rx_resync_req':
>> drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used [-Wunused-but-set-variable]
477 | struct ipv6hdr *ipv6h;
| ^~~~~
vim +/ipv6h +477 drivers/net/ethernet/netronome/nfp/crypto/tls.c
470
471 int nfp_net_tls_rx_resync_req(struct net_device *netdev,
472 struct nfp_net_tls_resync_req *req,
473 void *pkt, unsigned int pkt_len)
474 {
475 struct nfp_net *nn = netdev_priv(netdev);
476 struct nfp_net_tls_offload_ctx *ntls;
> 477 struct ipv6hdr *ipv6h;
478 struct tcphdr *th;
479 struct iphdr *iph;
480 struct sock *sk;
481 __be32 tcp_seq;
482 int err;
483
484 iph = pkt + req->l3_offset;
485 ipv6h = pkt + req->l3_offset;
486 th = pkt + req->l4_offset;
487
488 if ((u8 *)&th[1] > (u8 *)pkt + pkt_len) {
489 netdev_warn_once(netdev, "invalid TLS RX resync request (l3_off: %hhu l4_off: %hhu pkt_len: %u)\n",
490 req->l3_offset, req->l4_offset, pkt_len);
491 err = -EINVAL;
492 goto err_cnt_ign;
493 }
494
495 switch (iph->version) {
496 case 4:
497 sk = inet_lookup_established(dev_net(netdev), &tcp_hashinfo,
498 iph->saddr, th->source, iph->daddr,
499 th->dest, netdev->ifindex);
500 break;
501 #if IS_ENABLED(CONFIG_IPV6)
502 case 6:
503 sk = __inet6_lookup_established(dev_net(netdev), &tcp_hashinfo,
504 &ipv6h->saddr, th->source,
505 &ipv6h->daddr, ntohs(th->dest),
506 netdev->ifindex, 0);
507 break;
508 #endif
509 default:
510 netdev_warn_once(netdev, "invalid TLS RX resync request (l3_off: %hhu l4_off: %hhu ipver: %u)\n",
511 req->l3_offset, req->l4_offset, iph->version);
512 err = -EINVAL;
513 goto err_cnt_ign;
514 }
515
516 err = 0;
517 if (!sk)
518 goto err_cnt_ign;
519 if (!tls_is_sk_rx_device_offloaded(sk) ||
520 sk->sk_shutdown & RCV_SHUTDOWN)
521 goto err_put_sock;
522
523 ntls = tls_driver_ctx(sk, TLS_OFFLOAD_CTX_DIR_RX);
524 /* some FW versions can't report the handle and report 0s */
525 if (memchr_inv(&req->fw_handle, 0, sizeof(req->fw_handle)) &&
526 memcmp(&req->fw_handle, &ntls->fw_handle, sizeof(ntls->fw_handle)))
527 goto err_put_sock;
528
529 /* copy to ensure alignment */
530 memcpy(&tcp_seq, &req->tcp_seq, sizeof(tcp_seq));
531 tls_offload_rx_resync_request(sk, tcp_seq);
532 atomic_inc(&nn->ktls_rx_resync_req);
533
534 sock_gen_put(sk);
535 return 0;
536
537 err_put_sock:
538 sock_gen_put(sk);
539 err_cnt_ign:
540 atomic_inc(&nn->ktls_rx_resync_ign);
541 return err;
542 }
543
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41105 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-12-09 10:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 10:37 drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2020-11-17 16:39 kernel test robot
2020-11-17 16:56 ` Gustavo A. R. Silva
2020-09-12 9:02 kernel test robot
2020-07-11 20:31 kernel test robot
2020-06-03 13:38 kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).