Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

eth: fbnic: move page pool alloc to fbnic_alloc_rx_qt_resources()

page pools are now at the ring level, move page pool alloc
to fbnic_alloc_rx_qt_resources(), and freeing to
fbnic_free_qt_resources().

This significantly simplifies fbnic_alloc_napi_vector() error
handling, by removing a late failure point.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20250901211214.1027927-4-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Jakub Kicinski and committed by
Paolo Abeni
b6396b71 894d4a4e

+9 -28
+9 -28
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
··· 1485 1485 fbnic_remove_rx_ring(fbn, &nv->qt[i].sub0); 1486 1486 fbnic_remove_rx_ring(fbn, &nv->qt[i].sub1); 1487 1487 fbnic_remove_rx_ring(fbn, &nv->qt[i].cmpl); 1488 - fbnic_free_qt_page_pools(&nv->qt[i]); 1489 1488 } 1490 1489 1491 1490 fbnic_napi_free_irq(fbd, nv); ··· 1680 1681 fbnic_ring_init(&qt->cmpl, db, rxq_idx, FBNIC_RING_F_STATS); 1681 1682 fbn->rx[rxq_idx] = &qt->cmpl; 1682 1683 1683 - err = fbnic_alloc_qt_page_pools(fbn, nv, qt); 1684 - if (err) 1685 - goto free_ring_cur_qt; 1686 - 1687 1684 /* Update Rx queue index */ 1688 1685 rxt_count--; 1689 1686 rxq_idx += v_count; ··· 1690 1695 1691 1696 return 0; 1692 1697 1693 - while (rxt_count < nv->rxt_count) { 1694 - qt--; 1695 - 1696 - fbnic_free_qt_page_pools(qt); 1697 - free_ring_cur_qt: 1698 - fbnic_remove_rx_ring(fbn, &qt->sub0); 1699 - fbnic_remove_rx_ring(fbn, &qt->sub1); 1700 - fbnic_remove_rx_ring(fbn, &qt->cmpl); 1701 - rxt_count++; 1702 - } 1703 - while (txt_count < nv->txt_count) { 1704 - qt--; 1705 - 1706 - fbnic_remove_tx_ring(fbn, &qt->sub0); 1707 - fbnic_remove_xdp_ring(fbn, &qt->sub1); 1708 - fbnic_remove_tx_ring(fbn, &qt->cmpl); 1709 - 1710 - txt_count++; 1711 - } 1712 - fbnic_napi_free_irq(fbd, nv); 1713 1698 napi_del: 1714 1699 netif_napi_del(&nv->napi); 1715 1700 fbn->napi[fbnic_napi_idx(nv)] = NULL; ··· 1909 1934 if (xdp_rxq_info_is_reg(&qt->xdp_rxq)) { 1910 1935 xdp_rxq_info_unreg_mem_model(&qt->xdp_rxq); 1911 1936 xdp_rxq_info_unreg(&qt->xdp_rxq); 1937 + fbnic_free_qt_page_pools(qt); 1912 1938 } 1913 1939 } 1914 1940 ··· 1947 1971 struct device *dev = fbn->netdev->dev.parent; 1948 1972 int err; 1949 1973 1950 - err = xdp_rxq_info_reg(&qt->xdp_rxq, fbn->netdev, qt->sub0.q_idx, 1951 - nv->napi.napi_id); 1974 + err = fbnic_alloc_qt_page_pools(fbn, nv, qt); 1952 1975 if (err) 1953 1976 return err; 1954 1977 1955 - /* Register XDP memory model for completion queue */ 1978 + err = xdp_rxq_info_reg(&qt->xdp_rxq, fbn->netdev, qt->sub0.q_idx, 1979 + nv->napi.napi_id); 1980 + if (err) 1981 + goto free_page_pools; 1982 + 1956 1983 err = xdp_rxq_info_reg_mem_model(&qt->xdp_rxq, MEM_TYPE_PAGE_POOL, 1957 1984 qt->sub0.page_pool); 1958 1985 if (err) ··· 1983 2004 xdp_rxq_info_unreg_mem_model(&qt->xdp_rxq); 1984 2005 unreg_rxq: 1985 2006 xdp_rxq_info_unreg(&qt->xdp_rxq); 2007 + free_page_pools: 2008 + fbnic_free_qt_page_pools(qt); 1986 2009 return err; 1987 2010 } 1988 2011