<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/net/page_pool, branch v6.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-01-27T22:37:41Z</updated>
<entry>
<title>net: page_pool: don't try to stash the napi id</title>
<updated>2025-01-27T22:37:41Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2025-01-23T23:16:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=67e4bb2ced0f2d8fbd414f932daea94ba63ae4c4'/>
<id>urn:sha1:67e4bb2ced0f2d8fbd414f932daea94ba63ae4c4</id>
<content type='text'>
Page ppol tried to cache the NAPI ID in page pool info to avoid
having a dependency on the life cycle of the NAPI instance.
Since commit under Fixes the NAPI ID is not populated until
napi_enable() and there's a good chance that page pool is
created before NAPI gets enabled.

Protect the NAPI pointer with the existing page pool mutex,
the reading path already holds it. napi_id itself we need
to READ_ONCE(), it's protected by netdev_lock() which are
not holding in page pool.

Before this patch napi IDs were missing for mlx5:

 # ./cli.py --spec netlink/specs/netdev.yaml --dump page-pool-get

 [{'id': 144, 'ifindex': 2, 'inflight': 3072, 'inflight-mem': 12582912},
  {'id': 143, 'ifindex': 2, 'inflight': 5568, 'inflight-mem': 22806528},
  {'id': 142, 'ifindex': 2, 'inflight': 5120, 'inflight-mem': 20971520},
  {'id': 141, 'ifindex': 2, 'inflight': 4992, 'inflight-mem': 20447232},
  ...

After:

 [{'id': 144, 'ifindex': 2, 'inflight': 3072, 'inflight-mem': 12582912,
   'napi-id': 565},
  {'id': 143, 'ifindex': 2, 'inflight': 4224, 'inflight-mem': 17301504,
   'napi-id': 525},
  {'id': 142, 'ifindex': 2, 'inflight': 4288, 'inflight-mem': 17563648,
   'napi-id': 524},
  ...

Fixes: 86e25f40aa1e ("net: napi: Add napi_config")
Reviewed-by: Mina Almasry &lt;almasrymina@google.com&gt;
Reviewed-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Link: https://patch.msgid.link/20250123231620.1086401-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2025-01-16T18:34:59Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2025-01-16T18:30:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2ee738e90e80850582cbe10f34c6447965c1d87b'/>
<id>urn:sha1:2ee738e90e80850582cbe10f34c6447965c1d87b</id>
<content type='text'>
Cross-merge networking fixes after downstream PR (net-6.13-rc8).

Conflicts:

drivers/net/ethernet/realtek/r8169_main.c
  1f691a1fc4be ("r8169: remove redundant hwmon support")
  152d00a91396 ("r8169: simplify setting hwmon attribute visibility")
https://lore.kernel.org/20250115122152.760b4e8d@canb.auug.org.au

Adjacent changes:

drivers/net/ethernet/broadcom/bnxt/bnxt.c
  152f4da05aee ("bnxt_en: add support for rx-copybreak ethtool command")
  f0aa6a37a3db ("eth: bnxt: always recalculate features after XDP clearing, fix null-deref")

drivers/net/ethernet/intel/ice/ice_type.h
  50327223a8bb ("ice: add lock to protect low latency interface")
  dc26548d729e ("ice: Fix quad registers read on E825")

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: make page_pool_ref_netmem work with net iovs</title>
<updated>2025-01-16T02:44:30Z</updated>
<author>
<name>Pavel Begunkov</name>
<email>asml.silence@gmail.com</email>
</author>
<published>2025-01-08T22:06:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cbc16bceea784210d585a42ac9f8f10ce62b300e'/>
<id>urn:sha1:cbc16bceea784210d585a42ac9f8f10ce62b300e</id>
<content type='text'>
page_pool_ref_netmem() should work with either netmem representation, but
currently it casts to a page with netmem_to_page(), which will fail with
net iovs. Use netmem_get_pp_ref_count_ref() instead.

Fixes: 8ab79ed50cf1 ("page_pool: devmem support")
Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Signed-off-by: David Wei &lt;dw@davidwei.uk&gt;
Link: https://lore.kernel.org/20250108220644.3528845-2-dw@davidwei.uk
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>page_pool: add page_pool_dev_alloc_netmem()</title>
<updated>2024-12-20T03:51:13Z</updated>
<author>
<name>Alexander Lobakin</name>
<email>aleksander.lobakin@intel.com</email>
</author>
<published>2024-12-18T17:44:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a19d0236f466f1ce8f44a04a96c302d3023eebf4'/>
<id>urn:sha1:a19d0236f466f1ce8f44a04a96c302d3023eebf4</id>
<content type='text'>
Similarly to other _dev shorthands, add one for page_pool_alloc_netmem()
to allocate a netmem using the default Rx GFP flags (ATOMIC | NOWARN) to
make the page -&gt; netmem transition of drivers easier.

Signed-off-by: Alexander Lobakin &lt;aleksander.lobakin@intel.com&gt;
Link: https://patch.msgid.link/20241218174435.1445282-2-aleksander.lobakin@intel.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: page_pool: rename page_pool_is_last_ref()</title>
<updated>2024-12-18T01:45:17Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2024-12-15T21:29:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d3c9510dc900e9ff3ea330189c0465c9f00fba18'/>
<id>urn:sha1:d3c9510dc900e9ff3ea330189c0465c9f00fba18</id>
<content type='text'>
page_pool_is_last_ref() releases a reference while the name,
to me at least, suggests it just checks if the refcount is 1.
The semantics of the function are the same as those of
atomic_dec_and_test() and refcount_dec_and_test(), so just
use the _and_test() suffix.

Reviewed-by: Alexander Lobakin &lt;aleksander.lobakin@intel.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Acked-by: Jesper Dangaard Brouer &lt;hawk@kernel.org&gt;
Link: https://patch.msgid.link/20241215212938.99210-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>page_pool: disable sync for cpu for dmabuf memory provider</title>
<updated>2024-12-13T02:49:08Z</updated>
<author>
<name>Mina Almasry</name>
<email>almasrymina@google.com</email>
</author>
<published>2024-12-11T21:20:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7dba339faae991a23c54f7b93a58798c58f8c16f'/>
<id>urn:sha1:7dba339faae991a23c54f7b93a58798c58f8c16f</id>
<content type='text'>
dmabuf dma-addresses should not be dma_sync'd for CPU/device. Typically
its the driver responsibility to dma_sync for CPU, but the driver should
not dma_sync for CPU if the netmem is actually coming from a dmabuf
memory provider.

The page_pool already exposes a helper for dma_sync_for_cpu:
page_pool_dma_sync_for_cpu. Upgrade this existing helper to handle
netmem, and have it skip dma_sync if the memory is from a dmabuf memory
provider. Drivers should migrate to using this helper when adding
support for netmem.

Also minimize the impact on the dma syncing performance for pages. Special
case the dma-sync path for pages to not go through the overhead checks
for dma-syncing and conversion to netmem.

Cc: Alexander Lobakin &lt;aleksander.lobakin@intel.com&gt;
Cc: Jason Gunthorpe &lt;jgg@ziepe.ca&gt;
Signed-off-by: Mina Almasry &lt;almasrymina@google.com&gt;
Link: https://patch.msgid.link/20241211212033.1684197-5-almasrymina@google.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: page_pool: create page_pool_alloc_netmem</title>
<updated>2024-12-13T02:49:07Z</updated>
<author>
<name>Mina Almasry</name>
<email>almasrymina@google.com</email>
</author>
<published>2024-12-11T21:20:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8156c310499a34c8f42b2e2b7360abb805683bbe'/>
<id>urn:sha1:8156c310499a34c8f42b2e2b7360abb805683bbe</id>
<content type='text'>
Create page_pool_alloc_netmem to be the mirror of page_pool_alloc.

This enables drivers that want currently use page_pool_alloc to
transition to netmem by converting the call sites to
page_pool_alloc_netmem.

Signed-off-by: Mina Almasry &lt;almasrymina@google.com&gt;
Acked-by: Stanislav Fomichev &lt;sdf@fomichev.me&gt;
Link: https://patch.msgid.link/20241211212033.1684197-3-almasrymina@google.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: page_pool: rename page_pool_alloc_netmem to *_netmems</title>
<updated>2024-12-13T02:49:07Z</updated>
<author>
<name>Mina Almasry</name>
<email>almasrymina@google.com</email>
</author>
<published>2024-12-11T21:20:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=91a152cbb49c26609d217cf2f116d46143b9b8be'/>
<id>urn:sha1:91a152cbb49c26609d217cf2f116d46143b9b8be</id>
<content type='text'>
page_pool_alloc_netmem (without an s) was the mirror of
page_pool_alloc_pages (with an s), which was confusing.

Rename to page_pool_alloc_netmems so it's the mirror of
page_pool_alloc_pages.

Signed-off-by: Mina Almasry &lt;almasrymina@google.com&gt;
Acked-by: Stanislav Fomichev &lt;sdf@fomichev.me&gt;
Link: https://patch.msgid.link/20241211212033.1684197-2-almasrymina@google.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>page_pool: allow mixing PPs within one bulk</title>
<updated>2024-12-13T02:22:51Z</updated>
<author>
<name>Alexander Lobakin</name>
<email>aleksander.lobakin@intel.com</email>
</author>
<published>2024-12-11T17:26:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fcc680a647ba77370480fe753664cc10d572b240'/>
<id>urn:sha1:fcc680a647ba77370480fe753664cc10d572b240</id>
<content type='text'>
The main reason for this change was to allow mixing pages from different
&amp;page_pools within one &amp;xdp_buff/&amp;xdp_frame. Why not? With stuff like
devmem and io_uring zerocopy Rx, it's required to have separate PPs for
header buffers and payload buffers.
Adjust xdp_return_frame_bulk() and page_pool_put_netmem_bulk(), so that
they won't be tied to a particular pool. Let the latter create a
separate bulk of pages which's PP is different from the first netmem of
the bulk and process it after the main loop.
This greatly optimizes xdp_return_frame_bulk(): no more hashtable
lookups and forced flushes on PP mismatch. Also make
xdp_flush_frame_bulk() inline, as it's just one if + function call + one
u32 read, not worth extending the call ladder.

Co-developed-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt; # iterative
Signed-off-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Suggested-by: Jakub Kicinski &lt;kuba@kernel.org&gt; # while (count)
Signed-off-by: Alexander Lobakin &lt;aleksander.lobakin@intel.com&gt;
Link: https://patch.msgid.link/20241211172649.761483-2-aleksander.lobakin@intel.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: reformat kdoc return statements</title>
<updated>2024-12-09T22:44:59Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2024-12-05T16:59:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3f330db30638b6489d548084a7e8843374d41ad0'/>
<id>urn:sha1:3f330db30638b6489d548084a7e8843374d41ad0</id>
<content type='text'>
kernel-doc -Wall warns about missing Return: statement for non-void
functions. We have a number of kdocs in our headers which are missing
the colon, IOW they use
 * Return some value
or
 * Returns some value

Having the colon makes some sense, it should help kdoc parser avoid
false positives. So add them. This is mostly done with a sed script,
and removing the unnecessary cases (mostly the comments which aren't
kdoc).

Acked-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Acked-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Acked-by: Sergey Ryazanov &lt;ryazanov.s.a@gmail.com&gt;
Reviewed-by: Edward Cree &lt;ecree.xilinx@gmail.com&gt;
Acked-by: Alexandra Winter &lt;wintera@linux.ibm.com&gt;
Acked-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Link: https://patch.msgid.link/20241205165914.1071102-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
