From nobody Tue Apr 7 16:16:02 2026 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (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 D7FB3397E80 for ; Thu, 12 Mar 2026 22:35:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773354910; cv=none; b=TnLd4JZkVVgEEbBvSP57OdFNtIE4wIWHKZ8Z7PwS5SlHD8lnF1b3/fF4hjWD7+/ah6t39iB7ay8O3LF6embnck/j8x2bvBz2tSIox3jWm90bIeFoO4lsroKxcRgfh/jlSDQabMVQ4Ijcb4GFXGfR+Tmvd/h5ulLxsZAfq1Od6fw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773354910; c=relaxed/simple; bh=Z/ESX+LLNY5t82nBsQH8Qqv4GqQzNnZ9UJQed+Rqsn4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hOYdBE+eVvNG9daeOAyqDYuJMwDY96OmJC3OmquBDQT5n9nnTHTdRZ/x7ZYtDa3SAd28Z0LwRLOXg6B+bfWeXeRv8pJhDOCYENLkHzqbw7OYQichguFhfuHGIqvG5EmTw34aRcw5v4UFzgPjc+erL6WZEPMGX25toE/fgC5CgAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to; spf=none smtp.mailfrom=dama.to; dkim=pass (2048-bit key) header.d=dama-to.20230601.gappssmtp.com header.i=@dama-to.20230601.gappssmtp.com header.b=ALM2w1B6; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dama-to.20230601.gappssmtp.com header.i=@dama-to.20230601.gappssmtp.com header.b="ALM2w1B6" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-c738fecf349so995862a12.0 for ; Thu, 12 Mar 2026 15:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20230601.gappssmtp.com; s=20230601; t=1773354908; x=1773959708; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fhbXK6hap671NF5qoYb68AsIxNo8RyyFm3WoVwNRKKg=; b=ALM2w1B6qU98oRWzwOpue/SZqP+/jeMEJwh3g7KH5J6svrCZ4OPmDGVZN4sa1XTmBA M2d4NjqB2WKZOtgIjf402UWRGL3f1NK22atGEQrYRcjjx3EUmZ3piMYAF/HV0nh3Z8xy c1i6XQ9nlUPHnMWdzNg9kTVV8G5phty6xm1eLiyUq/NKX0UDmQSx7YCX8zk7G11OpCly Nmm4ejQlz8N18fCjxl+6p8TUb/0OjLslvlKoMww6k68B1EGOQ430zuZDTXwzP/58wf/B ES3MF71eb03gRA0QgKIUNwjCahbS6AEkJlsF0BFzczuUi2dBrK2J/IzeaERnjTJlz6NA pg+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773354908; x=1773959708; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fhbXK6hap671NF5qoYb68AsIxNo8RyyFm3WoVwNRKKg=; b=lnsEwvFEyoAjAwmmwuobSsiZfa9T/YhX+NK7o18wpCGbqhR1Z7iqZKPiYmE+c5rkY7 No7pz1zK+43lQInrTtzMrw0Fll/mDu3R5UBs+aqvOooKA5kN3gJ5aYu8JsE+F8LKekS3 nqRKjaTgzzm28BDILVJYZtKqsw1/TJZDXyNrjEoTU36tcaEJTGh186FeucgJQr5B3TkC Z8ScFQlkDBS10MeKmT09LzoXxp8UgzFFnIFHZBxTOtYvhmT00UPblxsE3X5XRBV//HzQ 4Gb0dV7HBjH4vf9dmvXkz2MdzOOiOb0kgHuYzrIiOKHoV/gX7uxafDtexFfbcfhTiMZL uEVw== X-Forwarded-Encrypted: i=1; AJvYcCXwyF05k1NmreyPLhtsVq0oJDYYJWfHYFpJzzRgUF/3js8uX5ZcMwqaF+0FEchcNtk53WchB19ezWuK8uU=@vger.kernel.org X-Gm-Message-State: AOJu0YxjFTfHpw1UQmOFzMFEXYkFK0TpQMejcTwQvCzHYPaq8bICFqZD AvePsQHOgHBJ/vN6COvVC4juFpsjUydSNDNlFOBAqnSmUPHngFnsDDO/DCE7WiUXofk= X-Gm-Gg: ATEYQzy+pepiRkfYfL/mCdaOPju8uk48HnRfby0G24mjE1+1V8WvciRjcMtDHHQkjNf P5At2uuYCW7jHmEtX6BRS/Dsh93jphK2cwpnaGj4u9Bs47mdc6P0NVVGHTVn+ZBIYs/n7mBdIya hJ2ccd9TYg3uofzJnyaJgaztVklxUtjMyNgoxcio00Yyx1kvzNeY8KqxlC6OT1b1r4Vo+ARcaXf 4iuKe523K5Fh/oEMrmvIrYpgm/MJiCoecLFBg0aNcFE7N9S8o2sN+hD/LJJa6H3G2hWdT+KWboQ K57wz1wtmFPev71aZBsHo9BC3+rfrIEg3Wd5f65R48UMS/1eO3Tq8dqxH3ebuFzey1M/fuE+K3y 6js8xQmlczGY5xuiKpvBD1o9ZoQ4tS7o8ZYsJCKCiiHV8g8gy6rOQyC1DYX3haKYS9rO+3njJZx sxJoRB X-Received: by 2002:a17:90b:2b4d:b0:359:f5f4:7740 with SMTP id 98e67ed59e1d1-35a2208696fmr831058a91.17.1773354908222; Thu, 12 Mar 2026 15:35:08 -0700 (PDT) Received: from localhost ([2a03:2880:2ff:73::]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a1ac3baf8sm2718951a91.12.2026.03.12.15.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2026 15:35:07 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: michael.chan@broadcom.com, pavan.chebbi@broadcom.com, linux-kernel@vger.kernel.org, Joe Damato Subject: [RFC net-next v2 01/12] net: tso: Introduce tso_dma_map Date: Thu, 12 Mar 2026 15:34:38 -0700 Message-ID: <20260312223457.1999489-2-joe@dama.to> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260312223457.1999489-1-joe@dama.to> References: <20260312223457.1999489-1-joe@dama.to> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add struct tso_dma_map to tso.h for tracking DMA addresses of mapped GSO payload data. The struct combines DMA mapping storage (linear_dma, frags[]) with iterator state (frag_idx, offset), allowing drivers to walk pre-mapped DMA regions linearly. Helpers to initialize and operate on this struct will be added in the next commit. Suggested-by: Jakub Kicinski Signed-off-by: Joe Damato --- include/net/tso.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/include/net/tso.h b/include/net/tso.h index e7e157ae0526..cd4b98dbea71 100644 --- a/include/net/tso.h +++ b/include/net/tso.h @@ -3,6 +3,7 @@ #define _TSO_H =20 #include +#include #include =20 #define TSO_HEADER_SIZE 256 @@ -28,4 +29,37 @@ void tso_build_hdr(const struct sk_buff *skb, char *hdr,= struct tso_t *tso, void tso_build_data(const struct sk_buff *skb, struct tso_t *tso, int size= ); int tso_start(struct sk_buff *skb, struct tso_t *tso); =20 +/** + * struct tso_dma_map - DMA mapping state for GSO payload + * @dev: device used for DMA mapping + * @skb: the GSO skb being mapped + * @hdr_len: per-segment header length + * @frag_idx: current region (-1 =3D linear, 0..nr_frags-1 =3D frag) + * @offset: byte offset within current region + * @linear_dma: DMA address of the linear payload (after headers) + * @linear_len: length of the linear payload + * @nr_frags: number of frags successfully DMA-mapped + * @frags: per-frag DMA address and length + * + * Struct that DMA-maps the payload regions of a GSO skb + * (linear data + frags) upfront, then provides iteration to yield + * (dma_addr, chunk_len) pairs bounded by region boundaries. + */ +struct tso_dma_map { + struct device *dev; + const struct sk_buff *skb; + unsigned int hdr_len; + /* Iterator state */ + int frag_idx; + unsigned int offset; + /* Pre-mapped regions */ + dma_addr_t linear_dma; + unsigned int linear_len; + unsigned int nr_frags; + struct { + dma_addr_t dma; + unsigned int len; + } frags[MAX_SKB_FRAGS]; +}; + #endif /* _TSO_H */ --=20 2.52.0