Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1308500lqb; Thu, 30 May 2024 06:49:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVdSm+YCJ1HWO0GfJekm9iBV8U/hm+6GJbhtqzga1mR7seB6+Nc8G++RyaWVpwaoaI8YufV9qK+yUoYtvtEhyb3BNuuLj5DrNkCInBIhA== X-Google-Smtp-Source: AGHT+IG3tqsjUIKgb1ufpnlTH5Vm7gKAtN0QBrWuxDXfqSSY2i1nii5xzb6mYDBSNXcz9fWZEKNH X-Received: by 2002:a05:6359:4c98:b0:192:8935:4080 with SMTP id e5c5f4694b2df-199b938e488mr235696855d.5.1717076979093; Thu, 30 May 2024 06:49:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717076979; cv=pass; d=google.com; s=arc-20160816; b=eJ3xhnFsaqBW9HJNCS2Hh3U50M9r4G+iC4A5c4/m+0H5wId9MWypiiz0fnVlHgjWqU HQR13FsZUPGkW9u/CuN+ySrenY2mrPae27sSY/O0YSicPBTJ5LOYTLGm37Ywr9xx1+0O y6JBUIEty0fEBY1caZCWYSlYBxVWR+Sy7R1D1znF5tqKjkOZQXoT99xyY7EaM1yX9YVX 5ZHTpnzv29a1fCvkuKrnsaliFtNAoeHSUKNt8wJemDO59oEOok708/w4F3hNXwGEX/QN /fcTDlz8b2xhXh9y1Tv2FaD7OWUdpoImxmKQsVbigCBueSfvcp89rWQlIuLcoCYmxws+ ewdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:references:in-reply-to :message-id:cc:to:from:date:dkim-signature; bh=JOMlhJdODi5S81vxmDzTXqQ87xqgKAfMMIbljNey/4I=; fh=957/pSn9Ng/QnSE+UjunUeq1GxWKSYVoqXhxC85NQvg=; b=TEz1IuRQzizlvBqcBilIwNJBQrByE9ZnU8UPZIhpN4dTGdsqx+f6aVQusLeYoHZSgX tmh8iTXI1LF57TTDzZiLqWIovRByIipiCTPP+6FfPlDQw2jrtUJPCDXXTRj5KTcKAc3t F95sbDbnqGPOgJfnYMI5etZF490LTSAlbNNviDNgBapz1yuhSJhFzVSfJP2z1XmNhNfA 0XhAS2+Q9zZP/CAT6eYkb2HjWVYAKAzjhJL3tA/GRQOOO7/Lz90aBynihpcsN4DfyEDi FZP6nYlO/RFFOrqlALxS8gdtqTSAUISOstEruspl69wX86wuQRf+rxgt+PdixW7m0DGl +Dgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gV4TeI7A; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-195453-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195453-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6bf6f3cdb61si1608523a12.651.2024.05.30.06.49.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 06:49:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195453-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gV4TeI7A; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-195453-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195453-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9FC5E28984B for ; Thu, 30 May 2024 13:49:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3244617C9FF; Thu, 30 May 2024 13:46:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gV4TeI7A" Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D408518629C; Thu, 30 May 2024 13:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717076810; cv=none; b=aWUcuOoVuFWWHpmhGcElvIjql4qIdgK4T92LVLxklTtANOJgaTCaHvQLWnuqMzWl2ZKh1gw/GAz0h8q+IuLL7dsJm4n+UY5dI8ru/p9AbCluLhTW3upcq49EyNFE6EJp6rInh9xlOskvEjbJoFBBenCcb+tL+W5wkUyZ+Eaykos= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717076810; c=relaxed/simple; bh=xzsLYP3PvtzNldWn0y/DyKuFiLGEkM/otwUGFlTpVN0=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: Mime-Version:Content-Type; b=WJBNNR4oWesa/d1eJir8g3wH5DHb6q9rpoYMleEBNIq5t4z1RwfQ/Z0VQGtGVEvS6N+kvE1Te72le92sjoHnSdOjJrbyj5TdPwuwtnM5XTTFYvj7P1VBt0SSDJ1/STwqDad9ushOCTtHeHWv36YBPsXomzd/VwCITHfqIsd6SH0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gV4TeI7A; arc=none smtp.client-ip=209.85.222.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-794ab4480beso69184785a.1; Thu, 30 May 2024 06:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717076807; x=1717681607; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=JOMlhJdODi5S81vxmDzTXqQ87xqgKAfMMIbljNey/4I=; b=gV4TeI7AtGBWejFpGb+V13wTMrGeFDTtGCkT2U2mML3ibx954ehyONFOFoylzhb8Ru Aj1xTOWBdQ/Ltaa/KwGofCthygttwhiiIt6RmIurcVSHdX1KmIeahEyGFFduO9gtsRK/ V7nlhq69ZqWG30mEJWy8FNnZ/GDnRZIZJLYN+ix9R0xqaxMgGRewuttid9R2a3bWio9s RI6Umh8G+4x8nO43z3IhpJd5W4HBCDwOn84wZWXF7ePrl+Gk6DUrDL30ElyUMIYznxG6 SJSz+6vnR6kHlqpo7GcO4ehK08PUqCfRigtEfYipelCICkg2HyzRaZ8ZXBF4pbfi+5+M ReHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717076808; x=1717681608; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=JOMlhJdODi5S81vxmDzTXqQ87xqgKAfMMIbljNey/4I=; b=DcdnB27Hei75Anu2SVFF+8cckQBG9oQETPfQ1Efw35BZvtkJCgBk5zFsqRipN8ClS7 3zEN49YF08YulWJ6ZQRhbjEgxMzKK4sa4/DhelxmyR8JzpHUNfD6+BlG8c/kPqix1kFy GswkZke3eCYTg8G3S8il92uCxgBjCJdJiz6v64xkGjHXDBOY2grTjToDK2XKXa8Di1wF HQ5bAoR60aGSBwkgJaZC4GBNPa+A41ZohlUoJrAea3OykraPaFI4ANi+BVO3zPwr0zYR lT1wt6y/qEg3ye0VmWOgyxMlQbPvrWE02Ewqc3G341kolwO5PWF7+qPU7atLq+h5hWbE nskg== X-Forwarded-Encrypted: i=1; AJvYcCUxeOtjxZzFPkRex1yelN40SY85eUG7A8ry8V6SlOxr0278Oz3Cubj1tisZvth7dacmf2P0dVEE4Ij7JWKsTnVZP6AwtMKhwqVP2zmA5PXddezAmGQkiNwahdaae+geV3zPodSW X-Gm-Message-State: AOJu0YzXzxV1/pFjEplhBllM5DPlosjLR2QUZt6+pPGrled6Lhuzf8/K oyJdxZzc9FGWS6TFiE39VNyCZHS/PrpQzAjvbrjlMHnkh/kpsCp8 X-Received: by 2002:a05:620a:2017:b0:792:bd32:bba7 with SMTP id af79cd13be357-794e9da643amr230268885a.25.1717076807598; Thu, 30 May 2024 06:46:47 -0700 (PDT) Received: from localhost (112.49.199.35.bc.googleusercontent.com. [35.199.49.112]) by smtp.gmail.com with ESMTPSA id af79cd13be357-794abd08e8asm555462585a.87.2024.05.30.06.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 06:46:47 -0700 (PDT) Date: Thu, 30 May 2024 09:46:46 -0400 From: Willem de Bruijn To: Alexander Lobakin , intel-wired-lan@lists.osuosl.org Cc: Alexander Lobakin , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Mina Almasry , nex.sw.ncis.osdt.itp.upstreaming@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <66588346c20fd_3a92fb294da@willemb.c.googlers.com.notmuch> In-Reply-To: <20240528134846.148890-12-aleksander.lobakin@intel.com> References: <20240528134846.148890-1-aleksander.lobakin@intel.com> <20240528134846.148890-12-aleksander.lobakin@intel.com> Subject: Re: [PATCH iwl-next 11/12] idpf: convert header split mode to libeth + napi_build_skb() 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=utf-8 Content-Transfer-Encoding: 7bit Alexander Lobakin wrote: > Currently, idpf uses the following model for the header buffers: > > * buffers are allocated via dma_alloc_coherent(); > * when receiving, napi_alloc_skb() is called and then the header is > copied to the newly allocated linear part. > > This is far from optimal as DMA coherent zone is slow on many systems > and memcpy() neutralizes the idea and benefits of the header split. In the previous revision this assertion was called out, as we have lots of experience with the existing implementation and a previous one based on dynamic allocation one that performed much worse. You would share performance numbers in the next revision https://lore.kernel.org/netdev/0b1cc400-3f58-4b9c-a08b-39104b9f2d2d@intel.com/T/#me85d509365aba9279275e9b181248247e1f01bb0 This may be so integral to this patch series that asking to back it out now sets back the whole effort. That is not my intent. And I appreciate that in principle there are many potential optizations. But this (OOT) driver is already in use and regressions in existing workloads is a serious headache. As is significant code churn wrt other still OOT feature patch series. This series (of series) modifies the driver significantly, beyond the narrow scope of adding XDP and AF_XDP. > Not > speaking of that XDP can't be run on DMA coherent buffers, but at the > same time the idea of allocating an skb to run XDP program is ill. > Instead, use libeth to create page_pools for the header buffers, allocate > them dynamically and then build an skb via napi_build_skb() around them > with no memory copy. With one exception... > When you enable header split, you except you'll always have a separate > header buffer, so that you could reserve headroom and tailroom only > there and then use full buffers for the data. For example, this is how > TCP zerocopy works -- you have to have the payload aligned to PAGE_SIZE. > The current hardware running idpf does *not* guarantee that you'll > always have headers placed separately. For example, on my setup, even > ICMP packets are written as one piece to the data buffers. You can't > build a valid skb around a data buffer in this case. > To not complicate things and not lose TCP zerocopy etc., when such thing > happens, use the empty header buffer and pull either full frame (if it's > short) or the Ethernet header there and build an skb around it. GRO > layer will pull more from the data buffer later. This W/A will hopefully > be removed one day. > > Signed-off-by: Alexander Lobakin