Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp368499rdb; Sat, 16 Dec 2023 11:30:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMkaKqhFA1TlwMOx6p4MlVJd/+1+gwQT3/9TVx+VZN6wi2OyS/yRZZK5eWnvvV0QZGfdJG X-Received: by 2002:a17:907:7646:b0:a1d:b771:8cf0 with SMTP id kj6-20020a170907764600b00a1db7718cf0mr4094888ejc.46.1702755008911; Sat, 16 Dec 2023 11:30:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702755008; cv=none; d=google.com; s=arc-20160816; b=rXnGEDXEmeA0LlQBNM2egSbt/bpVXt0KQ2w0uI1NtGvrzyXCT1VGCL3e5mz5UUJFNX UNLv6qsuCQAifcvI5FkVcQrqMwbIpzVOtgRk0w4mvp2FYoasLYh3u60sQgvxAc44m4Hf nCardmTzFXervWeXzycXXS6rHfAhP1GZd7g4wwDTcQMZI015e9oDW7YjPGMvCqzWM3ug +EkmNWMz1lKp6X6mYQR4ENTNvcVmFsdZ6GhRYvA46bvVPBxVGUxXosZDYQWq6VCEz+JW zH9fNjU6h3guMcRt+Q4HQGptug5EkiB6v0X8GFfmqIYdV/b1zRXEvcbOaMYxkf4/X6SD WjeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1sW5Cd+VTB31iX/DuKnVMRhiTD1AO2yDdTttkJbQXDM=; fh=CJS+WlAA6Zv6VrN7cFU1mlLe9i2WbeL6rfbdDqDrwcI=; b=f8m1XNOEelVYkNX9xTjcxRGgN/HY1N/Xdd4MKAk/B0esqUT2QXQZg/30qccrhEgY+q xOJBlHFiGFwFhBdUqA1zryDLQ6Nrx/X8LXgyg9wPWdVcwG8bmUvqXzSqii6C6QhCPPeW +18gC8EeHmjlwSdA5ZDovuCXK0SvJ93K+V8cV0PysTfi6IfIfdS18BvlfG4IJMA2hnDB iFZhy8JSm4y3Ipdqsxgdb+JB530uennF+jkT1j8iw+uSoshs27ABD2cJGoN47zWDb3Er Hj6HuIyFmbIroEaE6IU429V3J+6tpZCksCE6AZbwB+gTFA6mxjykibwldI9rO3UQJJbC 8wiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=M6GL4pel; spf=pass (google.com: domain of linux-kernel+bounces-2343-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2343-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ha11-20020a170906a88b00b00a234085558asi90117ejb.1.2023.12.16.11.30.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 11:30:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2343-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=M6GL4pel; spf=pass (google.com: domain of linux-kernel+bounces-2343-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2343-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 72D301F24DC2 for ; Sat, 16 Dec 2023 19:30:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21250321B9; Sat, 16 Dec 2023 19:29:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="M6GL4pel" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A2E631A8E; Sat, 16 Dec 2023 19:29:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702754994; x=1734290994; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Lv3QWQrUmLYLwZ4qvXCie7B7tfjyaTDxGvtcOhoJsN8=; b=M6GL4pelvf5KlwJ/I852BZi3lZLnWJ9Gjl93AxduX7Fu/h7Q2W6rPptR fksUnvgAeI12feAz83x0M/U/039ycA653W8N3a6HmWk9Ve18hthlYArPC iRYTKpiu1mm6faJ/jzyKLP+9W8WUWmjiiDdK93AaD4EHsQ4qGPTCVAUS9 skid9r59k2wDGXlsf1gMXGW4nmNQ6vrs5D6i+krC90WCIP3vCr8h3XU2w c5a/uyjh6ZFA76KfjaCQXy82e/dg8oMg2QkuzkniMm5tKuEKJGThBTM5o cbxj6cT4wo29/QHeEf1pCjab/NGGTkZrVfLgBj9iEpddeTrjlvmo7idax w==; X-IronPort-AV: E=McAfee;i="6600,9927,10926"; a="2562076" X-IronPort-AV: E=Sophos;i="6.04,281,1695711600"; d="scan'208";a="2562076" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2023 11:29:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10926"; a="751307209" X-IronPort-AV: E=Sophos;i="6.04,281,1695711600"; d="scan'208";a="751307209" Received: from lkp-server02.sh.intel.com (HELO b07ab15da5fe) ([10.239.97.151]) by orsmga006.jf.intel.com with ESMTP; 16 Dec 2023 11:29:45 -0800 Received: from kbuild by b07ab15da5fe with local (Exim 4.96) (envelope-from ) id 1rEaM2-00027G-2B; Sat, 16 Dec 2023 19:29:42 +0000 Date: Sun, 17 Dec 2023 03:28:46 +0800 From: kernel test robot To: Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Boqun Feng , Daniel Borkmann , Eric Dumazet , Frederic Weisbecker , Ingo Molnar , Jakub Kicinski , Paolo Abeni , Peter Zijlstra , Thomas Gleixner , Waiman Long , Will Deacon , Sebastian Andrzej Siewior , "K. Y. Srinivasan" , "Michael S. Tsirkin" , Alexei Starovoitov , Andrii Nakryiko , Dexuan Cui , Haiyang Zhang , Hao Luo , Jesper Dangaard Brouer , Jiri Olsa , John Fastabend , Juergen Gross , KP Singh , Martin KaFai Lau , Nikolay Aleksandrov , Song Liu , Stanislav Fomichev Subject: Re: [PATCH net-next 16/24] net: netkit, veth, tun, virt*: Use nested-BH locking for XDP redirect. Message-ID: <202312170350.n7ssgNDP-lkp@intel.com> References: <20231215171020.687342-17-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231215171020.687342-17-bigeasy@linutronix.de> Hi Sebastian, kernel test robot noticed the following build errors: [auto build test ERROR on net-next/main] url: https://github.com/intel-lab-lkp/linux/commits/Sebastian-Andrzej-Siewior/locking-local_lock-Introduce-guard-definition-for-local_lock/20231216-011911 base: net-next/main patch link: https://lore.kernel.org/r/20231215171020.687342-17-bigeasy%40linutronix.de patch subject: [PATCH net-next 16/24] net: netkit, veth, tun, virt*: Use nested-BH locking for XDP redirect. config: x86_64-rhel-8.3-bpf (https://download.01.org/0day-ci/archive/20231217/202312170350.n7ssgNDP-lkp@intel.com/config) compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231217/202312170350.n7ssgNDP-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202312170350.n7ssgNDP-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/net/hyperv/netvsc_bpf.c:53:3: error: cannot jump from this goto statement to its label goto out; ^ drivers/net/hyperv/netvsc_bpf.c:61:2: note: jump bypasses initialization of variable with __attribute__((cleanup)) guard(local_lock_nested_bh)(&bpf_run_lock.redirect_lock); ^ include/linux/cleanup.h:142:15: note: expanded from macro 'guard' CLASS(_name, __UNIQUE_ID(guard)) ^ include/linux/compiler.h:180:29: note: expanded from macro '__UNIQUE_ID' #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ^ include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE' #define __PASTE(a,b) ___PASTE(a,b) ^ include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE' #define ___PASTE(a,b) a##b ^ :81:1: note: expanded from here __UNIQUE_ID_guard635 ^ drivers/net/hyperv/netvsc_bpf.c:46:3: error: cannot jump from this goto statement to its label goto out; ^ drivers/net/hyperv/netvsc_bpf.c:61:2: note: jump bypasses initialization of variable with __attribute__((cleanup)) guard(local_lock_nested_bh)(&bpf_run_lock.redirect_lock); ^ include/linux/cleanup.h:142:15: note: expanded from macro 'guard' CLASS(_name, __UNIQUE_ID(guard)) ^ include/linux/compiler.h:180:29: note: expanded from macro '__UNIQUE_ID' #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ^ include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE' #define __PASTE(a,b) ___PASTE(a,b) ^ include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE' #define ___PASTE(a,b) a##b ^ :81:1: note: expanded from here __UNIQUE_ID_guard635 ^ drivers/net/hyperv/netvsc_bpf.c:41:3: error: cannot jump from this goto statement to its label goto out; ^ drivers/net/hyperv/netvsc_bpf.c:61:2: note: jump bypasses initialization of variable with __attribute__((cleanup)) guard(local_lock_nested_bh)(&bpf_run_lock.redirect_lock); ^ include/linux/cleanup.h:142:15: note: expanded from macro 'guard' CLASS(_name, __UNIQUE_ID(guard)) ^ include/linux/compiler.h:180:29: note: expanded from macro '__UNIQUE_ID' #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ^ include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE' #define __PASTE(a,b) ___PASTE(a,b) ^ include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE' #define ___PASTE(a,b) a##b ^ :81:1: note: expanded from here __UNIQUE_ID_guard635 ^ 3 errors generated. vim +53 drivers/net/hyperv/netvsc_bpf.c 351e1581395fcc Haiyang Zhang 2020-01-23 23 351e1581395fcc Haiyang Zhang 2020-01-23 24 u32 netvsc_run_xdp(struct net_device *ndev, struct netvsc_channel *nvchan, 351e1581395fcc Haiyang Zhang 2020-01-23 25 struct xdp_buff *xdp) 351e1581395fcc Haiyang Zhang 2020-01-23 26 { 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 27 struct netvsc_stats_rx *rx_stats = &nvchan->rx_stats; 351e1581395fcc Haiyang Zhang 2020-01-23 28 void *data = nvchan->rsc.data[0]; 351e1581395fcc Haiyang Zhang 2020-01-23 29 u32 len = nvchan->rsc.len[0]; 351e1581395fcc Haiyang Zhang 2020-01-23 30 struct page *page = NULL; 351e1581395fcc Haiyang Zhang 2020-01-23 31 struct bpf_prog *prog; 351e1581395fcc Haiyang Zhang 2020-01-23 32 u32 act = XDP_PASS; 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 33 bool drop = true; 351e1581395fcc Haiyang Zhang 2020-01-23 34 351e1581395fcc Haiyang Zhang 2020-01-23 35 xdp->data_hard_start = NULL; 351e1581395fcc Haiyang Zhang 2020-01-23 36 351e1581395fcc Haiyang Zhang 2020-01-23 37 rcu_read_lock(); 351e1581395fcc Haiyang Zhang 2020-01-23 38 prog = rcu_dereference(nvchan->bpf_prog); 351e1581395fcc Haiyang Zhang 2020-01-23 39 351e1581395fcc Haiyang Zhang 2020-01-23 40 if (!prog) 351e1581395fcc Haiyang Zhang 2020-01-23 41 goto out; 351e1581395fcc Haiyang Zhang 2020-01-23 42 505e3f00c3f364 Andrea Parri (Microsoft 2021-01-14 43) /* Ensure that the below memcpy() won't overflow the page buffer. */ 505e3f00c3f364 Andrea Parri (Microsoft 2021-01-14 44) if (len > ndev->mtu + ETH_HLEN) { 505e3f00c3f364 Andrea Parri (Microsoft 2021-01-14 45) act = XDP_DROP; 505e3f00c3f364 Andrea Parri (Microsoft 2021-01-14 46) goto out; 505e3f00c3f364 Andrea Parri (Microsoft 2021-01-14 47) } 505e3f00c3f364 Andrea Parri (Microsoft 2021-01-14 48) 351e1581395fcc Haiyang Zhang 2020-01-23 49 /* allocate page buffer for data */ 351e1581395fcc Haiyang Zhang 2020-01-23 50 page = alloc_page(GFP_ATOMIC); 351e1581395fcc Haiyang Zhang 2020-01-23 51 if (!page) { 351e1581395fcc Haiyang Zhang 2020-01-23 52 act = XDP_DROP; 351e1581395fcc Haiyang Zhang 2020-01-23 @53 goto out; 351e1581395fcc Haiyang Zhang 2020-01-23 54 } 351e1581395fcc Haiyang Zhang 2020-01-23 55 43b5169d8355cc Lorenzo Bianconi 2020-12-22 56 xdp_init_buff(xdp, PAGE_SIZE, &nvchan->xdp_rxq); be9df4aff65f18 Lorenzo Bianconi 2020-12-22 57 xdp_prepare_buff(xdp, page_address(page), NETVSC_XDP_HDRM, len, false); 351e1581395fcc Haiyang Zhang 2020-01-23 58 351e1581395fcc Haiyang Zhang 2020-01-23 59 memcpy(xdp->data, data, len); 351e1581395fcc Haiyang Zhang 2020-01-23 60 31dbfc0f055c7d Sebastian Andrzej Siewior 2023-12-15 61 guard(local_lock_nested_bh)(&bpf_run_lock.redirect_lock); 351e1581395fcc Haiyang Zhang 2020-01-23 62 act = bpf_prog_run_xdp(prog, xdp); 351e1581395fcc Haiyang Zhang 2020-01-23 63 351e1581395fcc Haiyang Zhang 2020-01-23 64 switch (act) { 351e1581395fcc Haiyang Zhang 2020-01-23 65 case XDP_PASS: 351e1581395fcc Haiyang Zhang 2020-01-23 66 case XDP_TX: 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 67 drop = false; 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 68 break; 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 69 351e1581395fcc Haiyang Zhang 2020-01-23 70 case XDP_DROP: 351e1581395fcc Haiyang Zhang 2020-01-23 71 break; 351e1581395fcc Haiyang Zhang 2020-01-23 72 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 73 case XDP_REDIRECT: 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 74 if (!xdp_do_redirect(ndev, xdp, prog)) { 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 75 nvchan->xdp_flush = true; 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 76 drop = false; 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 77 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 78 u64_stats_update_begin(&rx_stats->syncp); 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 79 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 80 rx_stats->xdp_redirect++; 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 81 rx_stats->packets++; 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 82 rx_stats->bytes += nvchan->rsc.pktlen; 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 83 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 84 u64_stats_update_end(&rx_stats->syncp); 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 85 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 86 break; 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 87 } else { 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 88 u64_stats_update_begin(&rx_stats->syncp); 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 89 rx_stats->xdp_drop++; 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 90 u64_stats_update_end(&rx_stats->syncp); 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 91 } 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 92 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 93 fallthrough; 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 94 351e1581395fcc Haiyang Zhang 2020-01-23 95 case XDP_ABORTED: 351e1581395fcc Haiyang Zhang 2020-01-23 96 trace_xdp_exception(ndev, prog, act); 351e1581395fcc Haiyang Zhang 2020-01-23 97 break; 351e1581395fcc Haiyang Zhang 2020-01-23 98 351e1581395fcc Haiyang Zhang 2020-01-23 99 default: c8064e5b4adac5 Paolo Abeni 2021-11-30 100 bpf_warn_invalid_xdp_action(ndev, prog, act); 351e1581395fcc Haiyang Zhang 2020-01-23 101 } 351e1581395fcc Haiyang Zhang 2020-01-23 102 351e1581395fcc Haiyang Zhang 2020-01-23 103 out: 351e1581395fcc Haiyang Zhang 2020-01-23 104 rcu_read_unlock(); 351e1581395fcc Haiyang Zhang 2020-01-23 105 1cb9d3b6185b2a Haiyang Zhang 2022-04-07 106 if (page && drop) { 351e1581395fcc Haiyang Zhang 2020-01-23 107 __free_page(page); 351e1581395fcc Haiyang Zhang 2020-01-23 108 xdp->data_hard_start = NULL; 351e1581395fcc Haiyang Zhang 2020-01-23 109 } 351e1581395fcc Haiyang Zhang 2020-01-23 110 351e1581395fcc Haiyang Zhang 2020-01-23 111 return act; 351e1581395fcc Haiyang Zhang 2020-01-23 112 } 351e1581395fcc Haiyang Zhang 2020-01-23 113 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki