[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241105184859.741473-3-tarun.k.singh@intel.com>
Date: Tue, 5 Nov 2024 13:48:57 -0500
From: Tarun K Singh <tarun.k.singh@...el.com>
To: intel-wired-lan@...ts.osuosl.org
Cc: netdev@...r.kernel.org
Subject: [PATCH iwl-net v1 2/4] idpf: rename vport_ctrl_lock
Rename 'vport_ctrl_lock' to 'vport_cfg_lock'. Rename related
functions name for lock and unlock.
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Signed-off-by: Tarun K Singh <tarun.k.singh@...el.com>
---
drivers/net/ethernet/intel/idpf/idpf.h | 16 +++----
.../net/ethernet/intel/idpf/idpf_ethtool.c | 46 +++++++++----------
drivers/net/ethernet/intel/idpf/idpf_lib.c | 24 +++++-----
drivers/net/ethernet/intel/idpf/idpf_main.c | 4 +-
4 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/drivers/net/ethernet/intel/idpf/idpf.h b/drivers/net/ethernet/intel/idpf/idpf.h
index d87ed50af681..8dea2dd784af 100644
--- a/drivers/net/ethernet/intel/idpf/idpf.h
+++ b/drivers/net/ethernet/intel/idpf/idpf.h
@@ -526,7 +526,7 @@ struct idpf_vc_xn_manager;
* @crc_enable: Enable CRC insertion offload
* @req_tx_splitq: TX split or single queue model to request
* @req_rx_splitq: RX split or single queue model to request
- * @vport_ctrl_lock: Lock to protect the vport control flow
+ * @vport_cfg_lock: Lock to protect the vport config flow
* @vector_lock: Lock to protect vector distribution
* @queue_lock: Lock to protect queue distribution
* @vc_buf_lock: Lock to protect virtchnl buffer
@@ -583,7 +583,7 @@ struct idpf_adapter {
bool req_tx_splitq;
bool req_rx_splitq;
- struct mutex vport_ctrl_lock;
+ struct mutex vport_cfg_lock;
struct mutex vector_lock;
struct mutex queue_lock;
struct mutex vc_buf_lock;
@@ -787,24 +787,24 @@ static inline u16 idpf_get_max_tx_hdr_size(struct idpf_adapter *adapter)
}
/**
- * idpf_vport_ctrl_lock - Acquire the vport control lock
+ * idpf_vport_cfg_lock - Acquire the vport config lock
* @adapter: private data struct
*
* This lock should be used by non-datapath code to protect against vport
* destruction.
*/
-static inline void idpf_vport_ctrl_lock(struct idpf_adapter *adapter)
+static inline void idpf_vport_cfg_lock(struct idpf_adapter *adapter)
{
- mutex_lock(&adapter->vport_ctrl_lock);
+ mutex_lock(&adapter->vport_cfg_lock);
}
/**
- * idpf_vport_ctrl_unlock - Release the vport control lock
+ * idpf_vport_cfg_unlock - Release the vport config lock
* @adapter: private data struct
*/
-static inline void idpf_vport_ctrl_unlock(struct idpf_adapter *adapter)
+static inline void idpf_vport_cfg_unlock(struct idpf_adapter *adapter)
{
- mutex_unlock(&adapter->vport_ctrl_lock);
+ mutex_unlock(&adapter->vport_cfg_lock);
}
void idpf_statistics_task(struct work_struct *work);
diff --git a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
index e5ac3e5a50ce..b3ed1d9a80ae 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
@@ -17,20 +17,20 @@ static int idpf_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
struct idpf_adapter *adapter = idpf_netdev_to_adapter(netdev);
struct idpf_vport *vport;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
switch (cmd->cmd) {
case ETHTOOL_GRXRINGS:
cmd->data = vport->num_rxq;
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return 0;
default:
break;
}
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return -EOPNOTSUPP;
}
@@ -90,7 +90,7 @@ static int idpf_get_rxfh(struct net_device *netdev,
u16 i;
adapter = np->adapter;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
if (!idpf_is_cap_ena_all(adapter, IDPF_RSS_CAPS, IDPF_CAP_RSS)) {
err = -EOPNOTSUPP;
@@ -112,7 +112,7 @@ static int idpf_get_rxfh(struct net_device *netdev,
}
unlock_mutex:
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
@@ -137,7 +137,7 @@ static int idpf_set_rxfh(struct net_device *netdev,
int err = 0;
u16 lut;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
if (!idpf_is_cap_ena_all(adapter, IDPF_RSS_CAPS, IDPF_CAP_RSS)) {
@@ -166,7 +166,7 @@ static int idpf_set_rxfh(struct net_device *netdev,
err = idpf_config_rss(vport);
unlock_mutex:
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
@@ -234,7 +234,7 @@ static int idpf_set_channels(struct net_device *netdev,
return -EINVAL;
}
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
idx = vport->idx;
@@ -278,7 +278,7 @@ static int idpf_set_channels(struct net_device *netdev,
}
unlock_mutex:
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
@@ -301,7 +301,7 @@ static void idpf_get_ringparam(struct net_device *netdev,
struct idpf_adapter *adapter = idpf_netdev_to_adapter(netdev);
struct idpf_vport *vport;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
ring->rx_max_pending = IDPF_MAX_RXQ_DESC;
@@ -311,7 +311,7 @@ static void idpf_get_ringparam(struct net_device *netdev,
kring->tcp_data_split = idpf_vport_get_hsplit(vport);
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
}
/**
@@ -336,7 +336,7 @@ static int idpf_set_ringparam(struct net_device *netdev,
int i, err = 0;
u16 idx;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
idx = vport->idx;
@@ -395,7 +395,7 @@ static int idpf_set_ringparam(struct net_device *netdev,
err = idpf_initiate_soft_reset(vport, IDPF_SR_Q_DESC_CHANGE);
unlock_mutex:
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
@@ -878,11 +878,11 @@ static void idpf_get_ethtool_stats(struct net_device *netdev,
bool is_splitq;
u16 qtype;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
if (np->state != __IDPF_VPORT_UP) {
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return;
}
@@ -949,7 +949,7 @@ static void idpf_get_ethtool_stats(struct net_device *netdev,
rcu_read_unlock();
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
}
/**
@@ -1031,7 +1031,7 @@ static int idpf_get_q_coalesce(struct net_device *netdev,
const struct idpf_vport *vport;
int err = 0;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
if (np->state != __IDPF_VPORT_UP)
@@ -1051,7 +1051,7 @@ static int idpf_get_q_coalesce(struct net_device *netdev,
VIRTCHNL2_QUEUE_TYPE_TX);
unlock_mutex:
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
@@ -1207,7 +1207,7 @@ static int idpf_set_coalesce(struct net_device *netdev,
struct idpf_vport *vport;
int i, err = 0;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
if (np->state != __IDPF_VPORT_UP)
@@ -1226,7 +1226,7 @@ static int idpf_set_coalesce(struct net_device *netdev,
}
unlock_mutex:
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
@@ -1246,19 +1246,19 @@ static int idpf_set_per_q_coalesce(struct net_device *netdev, u32 q_num,
struct idpf_vport *vport;
int err;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
err = idpf_set_q_coalesce(vport, ec, q_num, false);
if (err) {
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
err = idpf_set_q_coalesce(vport, ec, q_num, true);
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/intel/idpf/idpf_lib.c
index a870748a8be7..778dc71fbf4a 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_lib.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c
@@ -910,12 +910,12 @@ static int idpf_stop(struct net_device *netdev)
if (test_bit(IDPF_REMOVE_IN_PROG, adapter->flags))
return 0;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
idpf_vport_stop(vport);
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return 0;
}
@@ -1733,7 +1733,7 @@ static int idpf_init_hard_reset(struct idpf_adapter *adapter)
int err;
u16 i;
- mutex_lock(&adapter->vport_ctrl_lock);
+ mutex_lock(&adapter->vport_cfg_lock);
dev_info(dev, "Device HW Reset initiated\n");
@@ -1798,7 +1798,7 @@ static int idpf_init_hard_reset(struct idpf_adapter *adapter)
msleep(100);
unlock_mutex:
- mutex_unlock(&adapter->vport_ctrl_lock);
+ mutex_unlock(&adapter->vport_cfg_lock);
return err;
}
@@ -2103,7 +2103,7 @@ static int idpf_set_features(struct net_device *netdev,
struct idpf_vport *vport;
int err = 0;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
if (idpf_is_reset_in_prog(adapter)) {
@@ -2132,7 +2132,7 @@ static int idpf_set_features(struct net_device *netdev,
}
unlock_mutex:
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
@@ -2155,12 +2155,12 @@ static int idpf_open(struct net_device *netdev)
struct idpf_vport *vport;
int err;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
err = idpf_vport_open(vport);
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
@@ -2178,14 +2178,14 @@ static int idpf_change_mtu(struct net_device *netdev, int new_mtu)
struct idpf_vport *vport;
int err;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
WRITE_ONCE(netdev->mtu, new_mtu);
err = idpf_initiate_soft_reset(vport, IDPF_SR_MTU_CHANGE);
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
@@ -2267,7 +2267,7 @@ static int idpf_set_mac(struct net_device *netdev, void *p)
struct idpf_vport *vport;
int err = 0;
- idpf_vport_ctrl_lock(adapter);
+ idpf_vport_cfg_lock(adapter);
vport = idpf_netdev_to_vport(netdev);
if (!idpf_is_cap_ena(adapter, IDPF_OTHER_CAPS,
@@ -2301,7 +2301,7 @@ static int idpf_set_mac(struct net_device *netdev, void *p)
eth_hw_addr_set(netdev, addr->sa_data);
unlock_mutex:
- idpf_vport_ctrl_unlock(adapter);
+ idpf_vport_cfg_unlock(adapter);
return err;
}
diff --git a/drivers/net/ethernet/intel/idpf/idpf_main.c b/drivers/net/ethernet/intel/idpf/idpf_main.c
index db476b3314c8..0522b3a6f42c 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_main.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_main.c
@@ -72,7 +72,7 @@ static void idpf_remove(struct pci_dev *pdev)
kfree(adapter->vcxn_mngr);
adapter->vcxn_mngr = NULL;
- mutex_destroy(&adapter->vport_ctrl_lock);
+ mutex_destroy(&adapter->vport_cfg_lock);
mutex_destroy(&adapter->vector_lock);
mutex_destroy(&adapter->queue_lock);
mutex_destroy(&adapter->vc_buf_lock);
@@ -229,7 +229,7 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_cfg_hw;
}
- mutex_init(&adapter->vport_ctrl_lock);
+ mutex_init(&adapter->vport_cfg_lock);
mutex_init(&adapter->vector_lock);
mutex_init(&adapter->queue_lock);
mutex_init(&adapter->vc_buf_lock);
--
2.46.0
Powered by blists - more mailing lists