All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Gal Pressman <gal@nvidia.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	Dragos Tatulea <dtatulea@nvidia.com>
Subject: [net-next 08/11] net/mlx5e: Handle iov backed netmems
Date: Thu, 16 Jan 2025 13:55:26 -0800	[thread overview]
Message-ID: <20250116215530.158886-9-saeed@kernel.org> (raw)
In-Reply-To: <20250116215530.158886-1-saeed@kernel.org>

From: Saeed Mahameed <saeedm@nvidia.com>

Special page pools can allocate an iov backed netmem, such netmem pages
are unreachable by driver, for such cases don't attempt to access those
pages in the driver. The only affected path is
mlx5e_add_skb_frag()->skb_can_coalesce().

Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index b08c2ac10b67..2ac00962c7a3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -528,15 +528,18 @@ mlx5e_add_skb_frag(struct mlx5e_rq *rq, struct sk_buff *skb,
 		   unsigned int truesize)
 {
 	dma_addr_t addr = page_pool_get_dma_addr_netmem(frag_page->netmem);
-	struct page *page = netmem_to_page(frag_page->netmem);
 	u8 next_frag = skb_shinfo(skb)->nr_frags;
 
 	dma_sync_single_for_cpu(rq->pdev, addr + frag_offset, len,
 				rq->buff.map_dir);
 
-	if (skb_can_coalesce(skb, next_frag, page, frag_offset)) {
-		skb_coalesce_rx_frag(skb, next_frag - 1, len, truesize);
-		return;
+	if (!netmem_is_net_iov(frag_page->netmem)) {
+		struct page *page = netmem_to_page(frag_page->netmem);
+
+		if (skb_can_coalesce(skb, next_frag, page, frag_offset)) {
+			skb_coalesce_rx_frag(skb, next_frag - 1, len, truesize);
+			return;
+		}
 	}
 
 	frag_page->frags++;
-- 
2.48.0


  parent reply	other threads:[~2025-01-16 21:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16 21:55 [pull request][net-next 00/11] mlx5 updates 2025-01-16 Saeed Mahameed
2025-01-16 21:55 ` [net-next 01/11] net: Kconfig NET_DEVMEM selects GENERIC_ALLOCATOR Saeed Mahameed
2025-01-16 21:55 ` [net-next 02/11] net/mlx5e: SHAMPO: Reorganize mlx5_rq_shampo_alloc Saeed Mahameed
2025-01-16 21:55 ` [net-next 03/11] net/mlx5e: SHAMPO: Remove redundant params Saeed Mahameed
2025-01-16 21:55 ` [net-next 04/11] net/mlx5e: SHAMPO: Improve hw gro capability checking Saeed Mahameed
2025-01-16 21:55 ` [net-next 05/11] net/mlx5e: SHAMPO: Separate pool for headers Saeed Mahameed
2025-01-16 21:55 ` [net-next 06/11] net/mlx5e: SHAMPO: Headers page pool stats Saeed Mahameed
2025-01-16 21:55 ` [net-next 07/11] net/mlx5e: Convert over to netmem Saeed Mahameed
2025-02-05 20:14   ` Mina Almasry
2025-04-09 12:40     ` Dragos Tatulea
2025-01-16 21:55 ` Saeed Mahameed [this message]
2025-01-16 21:55 ` [net-next 09/11] net/mlx5e: Add support for UNREADABLE netmem page pools Saeed Mahameed
2025-01-16 21:55 ` [net-next 10/11] net/mlx5e: Implement queue mgmt ops and single channel swap Saeed Mahameed
2025-01-16 23:21   ` Jakub Kicinski
2025-01-16 23:46     ` Saeed Mahameed
2025-01-16 23:54       ` Jakub Kicinski
2025-01-24  0:39         ` Stanislav Fomichev
2025-01-24  0:55           ` Jakub Kicinski
2025-01-24  3:11             ` Saeed Mahameed
2025-01-24 15:26               ` Jakub Kicinski
2025-01-24 19:34                 ` Saeed Mahameed
2025-01-27 19:27                   ` Jakub Kicinski
2025-01-16 21:55 ` [net-next 11/11] net/mlx5e: Support ethtool tcp-data-split settings Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250116215530.158886-9-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.