From patchwork Mon Oct 7 22:15:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wei X-Patchwork-Id: 13825340 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 5315718CBF0 for ; Mon, 7 Oct 2024 22:16:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728339391; cv=none; b=ZvX2qKpcGssZfUb6f6MLCgnxOZ1WXjBAqPhI18rWH51aRao0GrSQjOKxxzcAVxuC+adRA1I6qtHzc1QZfi17L5ugbhZ8++9tSsT5RVJK2CeF5sdnQvYeupuGL370o0Pss0eS3by5FogN3MSYEsdPvcmj6YOc7IZ8hY+59dE4l/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728339391; c=relaxed/simple; bh=ZfCGft5xpVBEnR3/fijfSn9cgPXUCC73fR3567SvbkI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ad6xrPBWtIFPUwk8zx2lqDybfUApfeZAaTgY6d2ogXDOmyh2ou9ziUrm1AO88XIGnlf6kz78wjcY6G7uSX6ILDGxOqYEiph84sCNEk2c47w7KyoXdDYwviVe6ODP7q9W4zLdPx7EygWEAg+kZdn6LPfDVZtn6dULe43XAPFv7dI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk; spf=none smtp.mailfrom=davidwei.uk; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b=fRdt8+T2; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b="fRdt8+T2" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-71df04d3cd1so2596755b3a.2 for ; Mon, 07 Oct 2024 15:16:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davidwei-uk.20230601.gappssmtp.com; s=20230601; t=1728339389; x=1728944189; 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=mnc2aj24bs6F6f4vp0LuYLnguSpST4iVAkcBGLbjMjc=; b=fRdt8+T26mPbaYpHlAE2BnRwtLriyTgMhdDkf+3sj1kqyScp1OzAWI8BWM+kcm+bwW oVAaqWl4pWBlF/P+8HnCRUtt+DUCst2s3pMnEPkCP0SaaSt023qru7s+Ws77InQVnNB/ n7pzdyhRVwPZi3FgfM/NoiBaPRUBLzhqvRm+wLIdeYwFajV8PvCn5IBRwbMQaidE9LwJ MAHXZIbTLg2sdjc0LdVycLVXQIfsNA9pekg0+MkQT+SS92zg9UGhLLpbiGTP+y9BQXhR lr4lSxxAGhdWq4btapxjcg2cYdMwwEhJbYJbeSvQfC8CbdBSKHXg/LMoMAtA9GPCa21l uMGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728339389; x=1728944189; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mnc2aj24bs6F6f4vp0LuYLnguSpST4iVAkcBGLbjMjc=; b=tFohfgraJZnF5l11Dp/AuDqWAI48BZyStmu8mhLVLDyZTgA9JP17+ciDfTOTHdQFzD r3gVkVXHQLN8jVZ30eVC9eZfhdT6RLcsN6lrbLljhvGd1InXGo5zCh+vs65fIDo05e3n 90lqFR223gnpxGbUKEMvTnD41zMTD5vlZQ4OooZ/r5lcXUW+uLy+BnW3V0bhw81TVnt4 Oa/vcOrQmWNnbqZts1Lvjq8DGcvhUeW+dDijK+azlsuoAZZvFUzAKZ6HMd1qqR//CgJG rZ7uS7iMpAALvKJ7ixCk3sAkGsHWQUhU85T2QxHIkE8frGlJUKpGJbn+/nv9QlriUZdu 48jA== X-Forwarded-Encrypted: i=1; AJvYcCW5BzVNgaVjfKG8xTES1VOSzmOn6pNBma+2GtwR0sWSeiQKfNqcII56vKtNw7rCzO3w2iNggzs=@vger.kernel.org X-Gm-Message-State: AOJu0YyKc+AkU9TsUJ6JTxbPYPPwk3lyDxcy9O0kRAFI27/AkPWoufAI qDEjZVe0dlhSlo86UUsszbEdA+p1j0vhrez3i2NXmLLUplxDUhhtuj7mr/q8FD0= X-Google-Smtp-Source: AGHT+IGVsAURER/HsQepSDlOXpx3y6gjR1WuypY0frHO80NxNLtIO071JazgfX4mx5fkA96PITPJYg== X-Received: by 2002:a05:6a00:a91:b0:71d:d2a9:6ebf with SMTP id d2e1a72fcca58-71de23a9290mr22888892b3a.6.1728339389576; Mon, 07 Oct 2024 15:16:29 -0700 (PDT) Received: from localhost (fwdproxy-prn-112.fbsv.net. [2a03:2880:ff:70::face:b00c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71df0cd14f8sm4895835b3a.65.2024.10.07.15.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 15:16:29 -0700 (PDT) From: David Wei To: io-uring@vger.kernel.org, netdev@vger.kernel.org Cc: David Wei , Jens Axboe , Pavel Begunkov , Jakub Kicinski , Paolo Abeni , "David S. Miller" , Eric Dumazet , Jesper Dangaard Brouer , David Ahern , Mina Almasry Subject: [PATCH v1 02/15] net: prefix devmem specific helpers Date: Mon, 7 Oct 2024 15:15:50 -0700 Message-ID: <20241007221603.1703699-3-dw@davidwei.uk> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241007221603.1703699-1-dw@davidwei.uk> References: <20241007221603.1703699-1-dw@davidwei.uk> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Pavel Begunkov Add prefixes to all helpers that are specific to devmem TCP, i.e. net_iov_binding[_id]. Signed-off-by: Pavel Begunkov Signed-off-by: David Wei --- net/core/devmem.c | 2 +- net/core/devmem.h | 6 +++--- net/ipv4/tcp.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/net/core/devmem.c b/net/core/devmem.c index 11b91c12ee11..858982858f81 100644 --- a/net/core/devmem.c +++ b/net/core/devmem.c @@ -93,7 +93,7 @@ net_devmem_alloc_dmabuf(struct net_devmem_dmabuf_binding *binding) void net_devmem_free_dmabuf(struct net_iov *niov) { - struct net_devmem_dmabuf_binding *binding = net_iov_binding(niov); + struct net_devmem_dmabuf_binding *binding = net_devmem_iov_binding(niov); unsigned long dma_addr = net_devmem_get_dma_addr(niov); if (WARN_ON(!gen_pool_has_addr(binding->chunk_pool, dma_addr, diff --git a/net/core/devmem.h b/net/core/devmem.h index cf66e53b358f..80f38fe46930 100644 --- a/net/core/devmem.h +++ b/net/core/devmem.h @@ -75,14 +75,14 @@ static inline unsigned int net_iov_idx(const struct net_iov *niov) } static inline struct net_devmem_dmabuf_binding * -net_iov_binding(const struct net_iov *niov) +net_devmem_iov_binding(const struct net_iov *niov) { return net_iov_owner(niov)->binding; } -static inline u32 net_iov_binding_id(const struct net_iov *niov) +static inline u32 net_devmem_iov_binding_id(const struct net_iov *niov) { - return net_iov_owner(niov)->binding->id; + return net_devmem_iov_binding(niov)->id; } static inline unsigned long net_iov_virtual_addr(const struct net_iov *niov) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 4f77bd862e95..5feef46426f4 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2493,7 +2493,7 @@ static int tcp_recvmsg_dmabuf(struct sock *sk, const struct sk_buff *skb, /* Will perform the exchange later */ dmabuf_cmsg.frag_token = tcp_xa_pool.tokens[tcp_xa_pool.idx]; - dmabuf_cmsg.dmabuf_id = net_iov_binding_id(niov); + dmabuf_cmsg.dmabuf_id = net_devmem_iov_binding_id(niov); offset += copy; remaining_len -= copy;