Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2829037lqp; Mon, 25 Mar 2024 10:18:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUKKQwyLc3asKZ+r6ZNts+ppNZI9rQR20kJFJ4YpVRsnWhMfGlUPXnK+7AXxJNVxaLOlrHBKNJw/k+hITphiUlI8svTpbayP5OeQcKQpw== X-Google-Smtp-Source: AGHT+IEvfI/fIp/gLad9XUQ4CIPhRo4ZTRw2/sFjSHV6BhXdq5+tuB9TuJrc1n6PqWIF6yLrZXk0 X-Received: by 2002:a05:620a:223b:b0:78a:462d:1bda with SMTP id n27-20020a05620a223b00b0078a462d1bdamr7858782qkh.66.1711387117945; Mon, 25 Mar 2024 10:18:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711387117; cv=pass; d=google.com; s=arc-20160816; b=XuW24zG+KpuhJIpI6IJbfwGVGs1BsyM7JYZ4A+hqzHAg0Ex+AJN3IY9OQ8n4apjxbh S6ScpD3EEggCdJO5BIIDTNXElftWaWp9CGwdcPLOT/79sbeBwHgL7K8Coe+sVkB9VPcv Rruh7CAgaUHkoiD/hxVDQ1UiEe9AfyDS/b1A2sOTyziGWBDj+7V9dif/vTDdgO+HnChb TCPH5dmEeB/RINaYMt2rma5g+a5GqaGDO6wZjdbXIppU7GnjJpl4beyGr8puO8LqoUnZ 8DZNUPG/CbtIGMDpUp1UejcNAOWjazUshZx021WG+lY9J/Kz2ijPCAbn6RKiZg+B6ILt udeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=XguyOTPW8SaIMkmqZ21Rgli3joUrKCpC0w2AVoDmBo8=; fh=ydCyE1GNuC4868s42v+1Xgc2EFo2kpiDGD0/rKC+TRo=; b=JipGpKoOgdiUaUmILwWnb5oQepRlxntOlHbmN1Pk5wGB2eVCAilM28dd1FU59lJB/U jPJlbUGaE53XGGS/baVBFZW2xKFz5jdlq6E+u/JOP4KaowdU13QgL4h8vOwRMkERbCVP dXYLIGNMDdPDhgjFPbZQc5/9nirGiCGsZfQrTy9VTPhNiQ5Mj3km3LcREpsPBBLPNuBr +7mT8Ns7/avNMckxKzx08VfOQJbTuLDZFJiU82xg+R6WCodvDlDUGVqfgOgFBcVolwJz shmBsEXmu7E5K+3ibSozusaLbrYH0o2ciUOkvNkns7neGd3mnFljqMvWHXbIYXU8uCVn +g5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=F4DiX7MJ; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-117426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117426-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bk29-20020a05620a1a1d00b00789e7e8dae2si6368520qkb.278.2024.03.25.10.18.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 10:18:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=F4DiX7MJ; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-117426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117426-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AAE621C35B60 for ; Mon, 25 Mar 2024 17:18:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35E26757F5; Mon, 25 Mar 2024 16:00:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="F4DiX7MJ" Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 F2F3745034 for ; Mon, 25 Mar 2024 16:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711382451; cv=none; b=mBt0mjXNmTSwcStHmFBeqcYDDIZrFID3Z4vymdhDnxS2hsDMaWun+KDHp+EaVBL7VXWYfL7XUR25+K9bRjc8stBO3AshlTUh+uxwvtVereSSI4hKcW8EOFd9wB6Qi6xhjRtNJHbds0CHs++dh4N5AxmrTnq3WGk3nCrnt7olwTg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711382451; c=relaxed/simple; bh=wqQe2DJZDzzMYImWv6Ki1IImWaVqSXITlgGJEpik5FA=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=ULmO3JzDaNQBfWUMOQUdfBp/Eet8heeOye72opSsgDNlDsTrp9lHcv6mVo7X64Iw4VbnBwuYa4l8kRBZAmuBE+yKfwhQZ8+esldNZbLGenM2WzfiQEJSAyKW0BGW7+gsi2Hfnnpe7Y9Xn1fy1tDxHxvIVKj3nhusgZCHQZaGcxE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=F4DiX7MJ; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-34175878e3cso3216477f8f.0 for ; Mon, 25 Mar 2024 09:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1711382447; x=1711987247; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=XguyOTPW8SaIMkmqZ21Rgli3joUrKCpC0w2AVoDmBo8=; b=F4DiX7MJqyVEHpWldAiPsZtv6b3WfYNZD0xT7ypua34yOhi0UI6Q7CVUok+CLSUhlu HA5p2jb04ilhNXD/Yk264dQ8YAMZ3lhrMpG3v+/yY6S60NQjBMG09mf0S3g1Oqxhztkk 2/ewEBjMfEWQs31rpZ70mYQQxG//XWEEeEalc3V+rogq25pHTz3Fhu2xCNkDyzIDq4J0 ZAeKy5cr+sqpRg9GNClvtb+tGX7LcYQTfkoPHlMx2Gb9Y2vLWGpL13uYF7qCgQc6yf8y RwthqhhfdK1DC9Wz1xxpJ5AWLEFCvaKfom2+9BmXcSIWQB3+rGLNUpf3vt2v6Ap1WpAZ FWXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711382447; x=1711987247; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XguyOTPW8SaIMkmqZ21Rgli3joUrKCpC0w2AVoDmBo8=; b=LclnguOZ9aJ3exCUtlq1e5iVu1BT7dfceBUGUgIUQUdKUVVviVlo1L6c39NnWuRPwZ dYVVWNzjSzWAue4x6vt0+RpevWi+y0qhP+WiHwOMAnj4XQekw6fcPVKPYbABWH6AgvGv RNngVvnEP/M7a/cXmxJhk4D8VP/1y1B/UdmaUinLm78J8VtpzYII356uCknSKRqCqhzi EvkjjbrYUP8AUzar939pIyLnNfrJBPZOWOOM79TGRkgOWVUijXbZpyvyV9C+OJ960ivk DtjXUBYpJ3DD536eF+npzMGMGpD1tOQ48T4ue2O2FwK9+jJJ+CxJEJYgSg4I7OuFeFRd s1pQ== X-Forwarded-Encrypted: i=1; AJvYcCUrWGFn0SLdcpaObuy5FDxXHzJUIJUTEuOLfWvGloqF9IQ+GpLF2IQoRwYw8FN8E+uqw5r/hE5gVoE9YwDj44wEQMlbkEnP2Za0YBSp X-Gm-Message-State: AOJu0YyKahInUtFMcsKjyZnfylkP5U+hcCfTKaRIrdbqY3JVueLzJoPz oh43L8lXZ9ydlTj/U/tsiOBN8+5hb1RL6DJMn2hmw0QvINl544ICbMZTZUWFIL4= X-Received: by 2002:a5d:51d1:0:b0:33e:34b7:895f with SMTP id n17-20020a5d51d1000000b0033e34b7895fmr5048233wrv.24.1711382447213; Mon, 25 Mar 2024 09:00:47 -0700 (PDT) Received: from [127.0.1.1] (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id r17-20020adff711000000b0033b6e26f0f9sm9839361wrp.42.2024.03.25.09.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 09:00:46 -0700 (PDT) From: Julien Panis Subject: [PATCH net-next v4 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver Date: Mon, 25 Mar 2024 17:00:34 +0100 Message-Id: <20240223-am65-cpsw-xdp-basic-v4-0-2e45e5dec048@baylibre.com> 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 X-B4-Tracking: v=1; b=H4sIAKKfAWYC/42OzWrDMBCEXyXo3G31ZyHn1PcoIexKSq0Sy0Yyj kPwu1fxsYTi4+zMfDsPVkKOobDj4cFymGOJQ6pCvx2Y6zB9B4i+aia51FxKBdibBtxYbrD4EQh LdKA9WWkbbklbVpv1GoAyJtc9uz8jplg+av7cY0zXmMJ55s/gmMMlLtv7L5bCBCksEztVp4tlG vJ92zWLzf93wixAQHvhZBx5VIJ/Et6vkXJ4d0O/IWe5AyOBAxfOOESHROYFRu3AqIppfKs1tt5 qfLVG78DoilFWGYFGobb0B7Ou6y/0kPBSwQEAAA== To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , Simon Horman , Andrew Lunn Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Julien Panis X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1711382445; l=2133; i=jpanis@baylibre.com; s=20230526; h=from:subject:message-id; bh=wqQe2DJZDzzMYImWv6Ki1IImWaVqSXITlgGJEpik5FA=; b=P1yzfio0eDcxAyUAY/a+nfJisXG0eTNG56agA256QD3aW0IbWjpNBGzvns98Nsg9Qqsm9+Nq5 4QVR/fm2KNpAOWGfAES1MKvawg2+uGBn3Y7SBGyJB+8SciyAJxTQ5R3 X-Developer-Key: i=jpanis@baylibre.com; a=ed25519; pk=8eSM4/xkiHWz2M1Cw1U3m2/YfPbsUdEJPCWY3Mh9ekQ= This patch adds XDP support to TI AM65 CPSW Ethernet driver. The following features are implemented: NETDEV_XDP_ACT_BASIC, NETDEV_XDP_ACT_REDIRECT, and NETDEV_XDP_ACT_NDO_XMIT. Zero-copy and non-linear XDP buffer supports are NOT implemented. Besides, the page pool memory model is used to get better performance. Signed-off-by: Julien Panis --- Changes in v4: - Add skb_mark_for_recycle() in am65_cpsw_nuss_rx_packets() function. - Specify napi page pool parameter in am65_cpsw_create_xdp_rxqs() function. - Add benchmark numbers (with VS without page pool) in the commit description. - Add xdp_do_flush() in am65_cpsw_run_xdp() function for XDP_REDIRECT case. - Link to v3: https://lore.kernel.org/r/20240223-am65-cpsw-xdp-basic-v3-0-5d944a9d84a0@baylibre.com Changes in v3: - Fix a potential issue with TX buffer type, which is now set for each buffer. - Link to v2: https://lore.kernel.org/r/20240223-am65-cpsw-xdp-basic-v2-0-01c6caacabb6@baylibre.com Changes in v2: - Use page pool memory model instead of MEM_TYPE_PAGE_ORDER0. - In am65_cpsw_alloc_skb(), release reference on the page pool page in case of error returned by build_skb(). - [nit] Cleanup am65_cpsw_nuss_common_open/stop() functions. - [nit] Arrange local variables in reverse xmas tree order. - Link to v1: https://lore.kernel.org/r/20240223-am65-cpsw-xdp-basic-v1-1-9f0b6cbda310@baylibre.com --- Julien Panis (3): net: ethernet: ti: Add accessors for struct k3_cppi_desc_pool members net: ethernet: ti: Add desc_infos member to struct k3_cppi_desc_pool net: ethernet: ti: am65-cpsw: Add minimal XDP support drivers/net/ethernet/ti/am65-cpsw-nuss.c | 536 +++++++++++++++++++++++++--- drivers/net/ethernet/ti/am65-cpsw-nuss.h | 13 + drivers/net/ethernet/ti/k3-cppi-desc-pool.c | 36 ++ drivers/net/ethernet/ti/k3-cppi-desc-pool.h | 4 + 4 files changed, 539 insertions(+), 50 deletions(-) --- base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d change-id: 20240223-am65-cpsw-xdp-basic-4db828508b48 Best regards, -- Julien Panis