Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2421257rdb; Fri, 8 Dec 2023 07:42:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeJ+HU0pQISWC1MJMP+LPF/wgZMC3eDoy4EzBQioT17f46Y5fHKiYkfnEahVbBOeazxFGc X-Received: by 2002:a17:90a:ae02:b0:286:9e2f:4755 with SMTP id t2-20020a17090aae0200b002869e2f4755mr250509pjq.51.1702050129093; Fri, 08 Dec 2023 07:42:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702050129; cv=none; d=google.com; s=arc-20160816; b=q8IbfHKVh26ZtRzDqNtkp6D96Mb5wKMPrQQ4rwyBMk0bVveNZ8TO/MfvZAYLB2ETqv h0uE3aTHfnjeyPhLBmG9+/WfPcD3kNKelJMKu7wzHtfn82G5N2pb+aXmJ+qfrSu9dO2Y tPRv39cMnnZYN5Io3nmtn1/wUcvzKZipv4/4zGDTTd0LmaDo/Ur9R9UyUg5FmdBqq6dM aVIloFBDYGG/L2v0yZdQdJwHul4ukYX3nHAA5PMZ8rxFOgq1HZo25Yq1mKcYEBg7YS9R G9tVm6P/kUniKx0Q4ujzucvzhzKRPW7muChtPcIsmOXqFZzuvn3JjASufpgwuwYmpM8V qRLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JdrIO80oXFYk60vvpuTpBB16pxjgcqkL+Tn0LVDxASo=; fh=ypGjMi/3kv2o3gigizkRdmllNPhpwZg4/zfNpId1SD8=; b=HL6vABC+9jshU1VDBAHbnH+Sm/NxM4GX6lL4HcxE9moDeI2G4vtyqdxBXfKbESlL4S rzVmmoMvWr2gnDm7MyYEZMxuHOWo/6dtAPOM9+w6VmWoyqwDlfAS3lHZ/8lvJEFB3BrL aGakxBCj8jm+4TZYpOyiMFxk2OylSSHI61z9skJeQes0vbHv0wEGF71GZrzo+LQ7mFWb xVEHx0LtCsvfbMhSOzUrlzmj2EETgdcFuo+OxJ3fbfytmm6sSB8ceefNIOh/nzI67HGK nu2f6mk5ZcARzmpreyBB8KfE4Gxa0e5X5htjhuITg7jrA+NZD90KjgEIthmeUluHoE7X GoWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FTpP+iTP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id c17-20020a170902d49100b001d054a8f128si1851326plg.451.2023.12.08.07.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 07:42:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FTpP+iTP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id EC92880B19D5; Fri, 8 Dec 2023 07:41:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233620AbjLHPlC (ORCPT + 99 others); Fri, 8 Dec 2023 10:41:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574424AbjLHPk7 (ORCPT ); Fri, 8 Dec 2023 10:40:59 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 206F01985; Fri, 8 Dec 2023 07:41:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702050065; x=1733586065; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=PxrakpGuqUfUuHtiDzTjJnJ7tn9jbK7epdaQHMlqyWM=; b=FTpP+iTPVbcCtaelFrP3PUcLKWPnNfzzz2gllqKyvG/TkqAaMsXuVO/7 9XIZrJHROU7NNxnfE4fseEDk4RuSy9Z5d5dVXDjSa1u7AGQJJrx1r20I1 TvvufNedWO53iKL+iiU/MmLhfzihgYvWCi2+w5DhrUoHmJqGLayTN1MMG uo8JeBa7EoQHLOqLlMUpstjype2Bc3jgwNR6qekrkjvSKihsmS3H78qmU OVpw0iox70VcijSj34wB5lcrO9F0j8iWCcgF9S2oqCrEqhOK3FvBGHkBY BekJFCb5tadsMbKP7zQI1C29r4T/Lc+GHpZ7r71jJUqDgLdhpeVNkFT9y A==; X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="397212535" X-IronPort-AV: E=Sophos;i="6.04,261,1695711600"; d="scan'208";a="397212535" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2023 07:41:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="842650843" X-IronPort-AV: E=Sophos;i="6.04,261,1695711600"; d="scan'208";a="842650843" Received: from lkp-server02.sh.intel.com (HELO b07ab15da5fe) ([10.239.97.151]) by fmsmga004.fm.intel.com with ESMTP; 08 Dec 2023 07:40:58 -0800 Received: from kbuild by b07ab15da5fe with local (Exim 4.96) (envelope-from ) id 1rBcyF-000DuR-3A; Fri, 08 Dec 2023 15:40:55 +0000 Date: Fri, 8 Dec 2023 23:40:15 +0800 From: kernel test robot To: Mina Almasry , Shailend Chand , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, bpf@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: oe-kbuild-all@lists.linux.dev, Mina Almasry , Willem de Bruijn , Kaiyuan Zhang , Jeroen de Borst , Jesper Dangaard Brouer , Arnd Bergmann , Jonathan Corbet , David Ahern , Ilias Apalodimas , Yunsheng Lin , Sumit Semwal , Eric Dumazet , Shakeel Butt , Harshitha Ramamurthy , Praveen Kaligineedi , Jakub Kicinski , Christian =?iso-8859-1?Q?K=F6nig?= , Paolo Abeni , Shuah Khan Subject: Re: [net-next v1 13/16] tcp: RX path for devmem TCP Message-ID: <202312082353.lFKTtexo-lkp@intel.com> References: <20231208005250.2910004-14-almasrymina@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231208005250.2910004-14-almasrymina@google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 08 Dec 2023 07:41:27 -0800 (PST) Hi Mina, 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/Mina-Almasry/net-page_pool-factor-out-releasing-DMA-from-releasing-the-page/20231208-085531 base: net-next/main patch link: https://lore.kernel.org/r/20231208005250.2910004-14-almasrymina%40google.com patch subject: [net-next v1 13/16] tcp: RX path for devmem TCP config: alpha-defconfig (https://download.01.org/0day-ci/archive/20231208/202312082353.lFKTtexo-lkp@intel.com/config) compiler: alpha-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231208/202312082353.lFKTtexo-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/202312082353.lFKTtexo-lkp@intel.com/ All errors (new ones prefixed by >>): net/ipv4/tcp.c: In function 'tcp_recvmsg_dmabuf': >> net/ipv4/tcp.c:2348:57: error: 'SO_DEVMEM_LINEAR' undeclared (first use in this function) 2348 | err = put_cmsg(msg, SOL_SOCKET, SO_DEVMEM_LINEAR, | ^~~~~~~~~~~~~~~~ net/ipv4/tcp.c:2348:57: note: each undeclared identifier is reported only once for each function it appears in >> net/ipv4/tcp.c:2411:48: error: 'SO_DEVMEM_DMABUF' undeclared (first use in this function) 2411 | SO_DEVMEM_DMABUF, | ^~~~~~~~~~~~~~~~ vim +/SO_DEVMEM_LINEAR +2348 net/ipv4/tcp.c 2306 2307 /* On error, returns the -errno. On success, returns number of bytes sent to the 2308 * user. May not consume all of @remaining_len. 2309 */ 2310 static int tcp_recvmsg_dmabuf(const struct sock *sk, const struct sk_buff *skb, 2311 unsigned int offset, struct msghdr *msg, 2312 int remaining_len) 2313 { 2314 struct dmabuf_cmsg dmabuf_cmsg = { 0 }; 2315 unsigned int start; 2316 int i, copy, n; 2317 int sent = 0; 2318 int err = 0; 2319 2320 do { 2321 start = skb_headlen(skb); 2322 2323 if (!skb->dmabuf) { 2324 err = -ENODEV; 2325 goto out; 2326 } 2327 2328 /* Copy header. */ 2329 copy = start - offset; 2330 if (copy > 0) { 2331 copy = min(copy, remaining_len); 2332 2333 n = copy_to_iter(skb->data + offset, copy, 2334 &msg->msg_iter); 2335 if (n != copy) { 2336 err = -EFAULT; 2337 goto out; 2338 } 2339 2340 offset += copy; 2341 remaining_len -= copy; 2342 2343 /* First a dmabuf_cmsg for # bytes copied to user 2344 * buffer. 2345 */ 2346 memset(&dmabuf_cmsg, 0, sizeof(dmabuf_cmsg)); 2347 dmabuf_cmsg.frag_size = copy; > 2348 err = put_cmsg(msg, SOL_SOCKET, SO_DEVMEM_LINEAR, 2349 sizeof(dmabuf_cmsg), &dmabuf_cmsg); 2350 if (err || msg->msg_flags & MSG_CTRUNC) { 2351 msg->msg_flags &= ~MSG_CTRUNC; 2352 if (!err) 2353 err = -ETOOSMALL; 2354 goto out; 2355 } 2356 2357 sent += copy; 2358 2359 if (remaining_len == 0) 2360 goto out; 2361 } 2362 2363 /* after that, send information of dmabuf pages through a 2364 * sequence of cmsg 2365 */ 2366 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 2367 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 2368 struct page_pool_iov *ppiov; 2369 u64 frag_offset; 2370 u32 user_token; 2371 int end; 2372 2373 /* skb->dmabuf should indicate that ALL the frags in 2374 * this skb are dmabuf page_pool_iovs. We're checking 2375 * for that flag above, but also check individual frags 2376 * here. If the tcp stack is not setting skb->dmabuf 2377 * correctly, we still don't want to crash here when 2378 * accessing pgmap or priv below. 2379 */ 2380 if (!skb_frag_page_pool_iov(frag)) { 2381 net_err_ratelimited("Found non-dmabuf skb with page_pool_iov"); 2382 err = -ENODEV; 2383 goto out; 2384 } 2385 2386 ppiov = skb_frag_page_pool_iov(frag); 2387 end = start + skb_frag_size(frag); 2388 copy = end - offset; 2389 2390 if (copy > 0) { 2391 copy = min(copy, remaining_len); 2392 2393 frag_offset = page_pool_iov_virtual_addr(ppiov) + 2394 skb_frag_off(frag) + offset - 2395 start; 2396 dmabuf_cmsg.frag_offset = frag_offset; 2397 dmabuf_cmsg.frag_size = copy; 2398 err = xa_alloc((struct xarray *)&sk->sk_user_pages, 2399 &user_token, frag->bv_page, 2400 xa_limit_31b, GFP_KERNEL); 2401 if (err) 2402 goto out; 2403 2404 dmabuf_cmsg.frag_token = user_token; 2405 dmabuf_cmsg.dmabuf_id = page_pool_iov_binding_id(ppiov); 2406 2407 offset += copy; 2408 remaining_len -= copy; 2409 2410 err = put_cmsg(msg, SOL_SOCKET, > 2411 SO_DEVMEM_DMABUF, 2412 sizeof(dmabuf_cmsg), 2413 &dmabuf_cmsg); 2414 if (err || msg->msg_flags & MSG_CTRUNC) { 2415 msg->msg_flags &= ~MSG_CTRUNC; 2416 xa_erase((struct xarray *)&sk->sk_user_pages, 2417 user_token); 2418 if (!err) 2419 err = -ETOOSMALL; 2420 goto out; 2421 } 2422 2423 __skb_frag_ref(frag); 2424 2425 sent += copy; 2426 2427 if (remaining_len == 0) 2428 goto out; 2429 } 2430 start = end; 2431 } 2432 2433 if (!remaining_len) 2434 goto out; 2435 2436 /* if remaining_len is not satisfied yet, we need to go to the 2437 * next frag in the frag_list to satisfy remaining_len. 2438 */ 2439 skb = skb_shinfo(skb)->frag_list ?: skb->next; 2440 2441 offset = offset - start; 2442 } while (skb); 2443 2444 if (remaining_len) { 2445 err = -EFAULT; 2446 goto out; 2447 } 2448 2449 out: 2450 if (!sent) 2451 sent = err; 2452 2453 return sent; 2454 } 2455 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki