Commit 89628a0e authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'use-enum-to-represent-the-napi-threaded-state'

Samiullah Khawaja says:

====================
Use enum to represent the NAPI threaded state

Instead of using 0/1 to represent the NAPI threaded states use enum
(disabled/enabled) to represent the NAPI threaded states.

This patch series is a subset of patches from the following patch series:
https://lore.kernel.org/20250718232052.1266188-1-skhawaja@google.com

The first 3 patches are being sent separately as per the feedback to
replace the usage of 0/1 as NAPI threaded states with enum. See:
https://lore.kernel.org/20250721164856.1d2208e4@kernel.org
====================

Link: https://patch.msgid.link/20250723013031.2911384-1-skhawaja@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents d2002ccb 8e7583a4
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -85,6 +85,10 @@ definitions:
    name: qstats-scope
    type: flags
    entries: [queue]
  -
    name: napi-threaded
    type: enum
    entries: [disabled, enabled]

attribute-sets:
  -
@@ -286,11 +290,10 @@ attribute-sets:
      -
        name: threaded
        doc: Whether the NAPI is configured to operate in threaded polling
             mode. If this is set to 1 then the NAPI context operates in
             threaded polling mode.
        type: uint
        checks:
          max: 1
             mode. If this is set to enabled then the NAPI context operates
             in threaded polling mode.
        type: u32
        enum: napi-threaded
  -
    name: xsk-info
    attributes: []
+1 −1
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ unsigned_char addr_assign_type
unsigned_char                       addr_len
unsigned_char                       upper_level
unsigned_char                       lower_level
u8                                  threaded                                                            napi_poll(napi_enable,netif_set_threaded)
unsigned_short                      neigh_priv_len
unsigned_short                      padded
unsigned_short                      dev_id
@@ -165,7 +166,6 @@ struct sfp_bus* sfp_bus
struct lock_class_key*              qdisc_tx_busylock
bool                                proto_down
unsigned:1                          wol_enabled
unsigned:1                          threaded                                                            napi_poll(napi_enable,netif_set_threaded)
unsigned_long:1                     see_all_hwtstamp_requests
unsigned_long:1                     change_proto_down
unsigned_long:1                     netns_immutable
+1 −1
Original line number Diff line number Diff line
@@ -2688,7 +2688,7 @@ static int atl1c_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	adapter->mii.mdio_write = atl1c_mdio_write;
	adapter->mii.phy_id_mask = 0x1f;
	adapter->mii.reg_num_mask = MDIO_CTRL_REG_MASK;
	netif_set_threaded(netdev, true);
	netif_threaded_enable(netdev);
	for (i = 0; i < adapter->rx_queue_count; ++i)
		netif_napi_add(netdev, &adapter->rrd_ring[i].napi,
			       atl1c_clean_rx);
+1 −1
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ static int mlxsw_pci_napi_devs_init(struct mlxsw_pci *mlxsw_pci)
	}
	strscpy(mlxsw_pci->napi_dev_rx->name, "mlxsw_rx",
		sizeof(mlxsw_pci->napi_dev_rx->name));
	netif_set_threaded(mlxsw_pci->napi_dev_rx, true);
	netif_threaded_enable(mlxsw_pci->napi_dev_rx);

	return 0;

+1 −1
Original line number Diff line number Diff line
@@ -3075,7 +3075,7 @@ static int ravb_probe(struct platform_device *pdev)
	if (info->coalesce_irqs) {
		netdev_sw_irq_coalesce_default_on(ndev);
		if (num_present_cpus() == 1)
			netif_set_threaded(ndev, true);
			netif_threaded_enable(ndev);
	}

	/* Network device register */
Loading