lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240528131429.3012910-11-maciej.fijalkowski@intel.com>
Date: Tue, 28 May 2024 15:14:28 +0200
From: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
To: intel-wired-lan@...ts.osuosl.org
Cc: netdev@...r.kernel.org,
	anthony.l.nguyen@...el.com,
	magnus.karlsson@...el.com,
	michal.kubiak@...el.com,
	larysa.zaremba@...el.com
Subject: [PATCH iwl-net 10/11] ice: lock with PF state instead of VSI state in ice_xsk_pool_setup()

From: Larysa Zaremba <larysa.zaremba@...el.com>

The main intent of using ICE_CFG_BUSY is to prevent the reset from
starting, when other configuration is being processed. pf->state is checked
before starting reset, but ice_xsk_pool_setup sets the flag in vsi->state,
which is almost useless. Also, ICE_CFG_BUSY belongs to enum ice_pf_state,
not ice_vsi_state.

Change vsi->state to pf->state in ice_xsk_pool_setup() locking code, so
reset would not interfere with AF_XDP configuration.

Fixes: 2d4238f55697 ("ice: Add support for AF_XDP")
Signed-off-by: Larysa Zaremba <larysa.zaremba@...el.com>
---
 drivers/net/ethernet/intel/ice/ice_xsk.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
index fe4aa4b537dd..225d027d3d7a 100644
--- a/drivers/net/ethernet/intel/ice/ice_xsk.c
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
@@ -370,6 +370,7 @@ int ice_xsk_pool_setup(struct ice_vsi *vsi, struct xsk_buff_pool *pool, u16 qid)
 {
 	bool if_running, pool_present = !!pool;
 	int ret = 0, pool_failure = 0;
+	struct ice_pf *pf = vsi->back;
 
 	if (qid >= vsi->num_rxq || qid >= vsi->num_txq) {
 		netdev_err(vsi->netdev, "Please use queue id in scope of combined queues count\n");
@@ -383,7 +384,7 @@ int ice_xsk_pool_setup(struct ice_vsi *vsi, struct xsk_buff_pool *pool, u16 qid)
 		struct ice_rx_ring *rx_ring = vsi->rx_rings[qid];
 		int timeout = 50;
 
-		while (test_and_set_bit(ICE_CFG_BUSY, vsi->state)) {
+		while (test_and_set_bit(ICE_CFG_BUSY, pf->state)) {
 			timeout--;
 			if (!timeout)
 				return -EBUSY;
@@ -411,7 +412,7 @@ int ice_xsk_pool_setup(struct ice_vsi *vsi, struct xsk_buff_pool *pool, u16 qid)
 			napi_schedule(&vsi->rx_rings[qid]->xdp_ring->q_vector->napi);
 		else if (ret)
 			netdev_err(vsi->netdev, "ice_qp_ena error = %d\n", ret);
-		clear_bit(ICE_CFG_BUSY, vsi->state);
+		clear_bit(ICE_CFG_BUSY, pf->state);
 	}
 
 failure:
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ