summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_client.c149
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_main.c8
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/lib/clock.h10
3 files changed, 10 insertions, 157 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
index e07ed065d3a4..ea2bb0140a6e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -8,8 +8,6 @@
#include "i40e.h"
#include "i40e_prototype.h"
-static const char i40e_client_interface_version_str[] = I40E_CLIENT_VERSION_STR;
-static struct i40e_client *registered_client;
static LIST_HEAD(i40e_devices);
static DEFINE_MUTEX(i40e_device_mutex);
DEFINE_IDA(i40e_client_ida);
@@ -367,7 +365,6 @@ static void i40e_client_add_instance(struct i40e_pf *pf)
else
dev_err(&pf->pdev->dev, "MAC address list is empty!\n");
- cdev->client = registered_client;
pf->cinst = cdev;
cdev->lan_info.msix_count = pf->num_iwarp_msix;
@@ -526,69 +523,6 @@ int i40e_lan_del_device(struct i40e_pf *pf)
}
/**
- * i40e_client_release - release client specific resources
- * @client: pointer to the registered client
- *
- **/
-static void i40e_client_release(struct i40e_client *client)
-{
- struct i40e_client_instance *cdev;
- struct i40e_device *ldev;
- struct i40e_pf *pf;
-
- mutex_lock(&i40e_device_mutex);
- list_for_each_entry(ldev, &i40e_devices, list) {
- pf = ldev->pf;
- cdev = pf->cinst;
- if (!cdev)
- continue;
-
- while (test_and_set_bit(__I40E_SERVICE_SCHED,
- pf->state))
- usleep_range(500, 1000);
-
- if (test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {
- if (client->ops && client->ops->close)
- client->ops->close(&cdev->lan_info, client,
- false);
- i40e_client_release_qvlist(&cdev->lan_info);
- clear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);
-
- dev_warn(&pf->pdev->dev,
- "Client %s instance for PF id %d closed\n",
- client->name, pf->hw.pf_id);
- }
- /* delete the client instance */
- i40e_client_del_instance(pf);
- dev_info(&pf->pdev->dev, "Deleted client instance of Client %s\n",
- client->name);
- clear_bit(__I40E_SERVICE_SCHED, pf->state);
- }
- mutex_unlock(&i40e_device_mutex);
-}
-
-/**
- * i40e_client_prepare - prepare client specific resources
- * @client: pointer to the registered client
- *
- **/
-static void i40e_client_prepare(struct i40e_client *client)
-{
- struct i40e_device *ldev;
- struct i40e_pf *pf;
-
- mutex_lock(&i40e_device_mutex);
- list_for_each_entry(ldev, &i40e_devices, list) {
- pf = ldev->pf;
- i40e_client_add_instance(pf);
- /* Start the client subtask */
- set_bit(__I40E_CLIENT_SERVICE_REQUESTED, pf->state);
- i40e_service_event_schedule(pf);
- }
- mutex_unlock(&i40e_device_mutex);
-}
-
-/**
* i40e_client_virtchnl_send - TBD
* @ldev: pointer to L2 context
* @client: Client pointer
@@ -817,86 +751,3 @@ void i40e_client_device_unregister(struct i40e_info *ldev)
clear_bit(__I40E_SERVICE_SCHED, pf->state);
}
EXPORT_SYMBOL_GPL(i40e_client_device_unregister);
-
-/* Retain these legacy global registration/unregistration calls till i40iw is
- * removed from the kernel. The irdma unified driver does not use these
- * exported symbols.
- */
-/**
- * i40e_register_client - Register a i40e client driver with the L2 driver
- * @client: pointer to the i40e_client struct
- *
- * Returns 0 on success or non-0 on error
- **/
-int i40e_register_client(struct i40e_client *client)
-{
- int ret = 0;
-
- if (!client) {
- ret = -EIO;
- goto out;
- }
-
- if (strlen(client->name) == 0) {
- pr_info("i40e: Failed to register client with no name\n");
- ret = -EIO;
- goto out;
- }
-
- if (registered_client) {
- pr_info("i40e: Client %s has already been registered!\n",
- client->name);
- ret = -EEXIST;
- goto out;
- }
-
- if ((client->version.major != I40E_CLIENT_VERSION_MAJOR) ||
- (client->version.minor != I40E_CLIENT_VERSION_MINOR)) {
- pr_info("i40e: Failed to register client %s due to mismatched client interface version\n",
- client->name);
- pr_info("Client is using version: %02d.%02d.%02d while LAN driver supports %s\n",
- client->version.major, client->version.minor,
- client->version.build,
- i40e_client_interface_version_str);
- ret = -EIO;
- goto out;
- }
-
- registered_client = client;
-
- i40e_client_prepare(client);
-
- pr_info("i40e: Registered client %s\n", client->name);
-out:
- return ret;
-}
-EXPORT_SYMBOL(i40e_register_client);
-
-/**
- * i40e_unregister_client - Unregister a i40e client driver with the L2 driver
- * @client: pointer to the i40e_client struct
- *
- * Returns 0 on success or non-0 on error
- **/
-int i40e_unregister_client(struct i40e_client *client)
-{
- int ret = 0;
-
- if (registered_client != client) {
- pr_info("i40e: Client %s has not been registered\n",
- client->name);
- ret = -ENODEV;
- goto out;
- }
- registered_client = NULL;
- /* When a unregister request comes through we would have to send
- * a close for each of the client instances that were opened.
- * client_release function is called to handle this.
- */
- i40e_client_release(client);
-
- pr_info("i40e: Unregistered client %s\n", client->name);
-out:
- return ret;
-}
-EXPORT_SYMBOL(i40e_unregister_client);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 414a73d16619..d09e65557e75 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -648,8 +648,8 @@ int mlx5e_create_rq(struct mlx5e_rq *rq, struct mlx5e_rq_param *param)
return -ENOMEM;
ts_format = mlx5_is_real_time_rq(mdev) ?
- MLX5_RQC_TIMESTAMP_FORMAT_REAL_TIME :
- MLX5_RQC_TIMESTAMP_FORMAT_FREE_RUNNING;
+ MLX5_TIMESTAMP_FORMAT_REAL_TIME :
+ MLX5_TIMESTAMP_FORMAT_FREE_RUNNING;
rqc = MLX5_ADDR_OF(create_rq_in, in, ctx);
wq = MLX5_ADDR_OF(rqc, rqc, wq);
@@ -1192,8 +1192,8 @@ static int mlx5e_create_sq(struct mlx5_core_dev *mdev,
return -ENOMEM;
ts_format = mlx5_is_real_time_sq(mdev) ?
- MLX5_SQC_TIMESTAMP_FORMAT_REAL_TIME :
- MLX5_SQC_TIMESTAMP_FORMAT_FREE_RUNNING;
+ MLX5_TIMESTAMP_FORMAT_REAL_TIME :
+ MLX5_TIMESTAMP_FORMAT_FREE_RUNNING;
sqc = MLX5_ADDR_OF(create_sq_in, in, ctx);
wq = MLX5_ADDR_OF(sqc, sqc, wq);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.h
index ceae6bc378e0..bd95b9f8d143 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.h
@@ -37,16 +37,18 @@ static inline bool mlx5_is_real_time_rq(struct mlx5_core_dev *mdev)
{
u8 rq_ts_format_cap = MLX5_CAP_GEN(mdev, rq_ts_format);
- return (rq_ts_format_cap == MLX5_RQ_TIMESTAMP_FORMAT_CAP_REAL_TIME ||
- rq_ts_format_cap == MLX5_RQ_TIMESTAMP_FORMAT_CAP_FREE_RUNNING_AND_REAL_TIME);
+ return (rq_ts_format_cap == MLX5_TIMESTAMP_FORMAT_CAP_REAL_TIME ||
+ rq_ts_format_cap ==
+ MLX5_TIMESTAMP_FORMAT_CAP_FREE_RUNNING_AND_REAL_TIME);
}
static inline bool mlx5_is_real_time_sq(struct mlx5_core_dev *mdev)
{
u8 sq_ts_format_cap = MLX5_CAP_GEN(mdev, sq_ts_format);
- return (sq_ts_format_cap == MLX5_SQ_TIMESTAMP_FORMAT_CAP_REAL_TIME ||
- sq_ts_format_cap == MLX5_SQ_TIMESTAMP_FORMAT_CAP_FREE_RUNNING_AND_REAL_TIME);
+ return (sq_ts_format_cap == MLX5_TIMESTAMP_FORMAT_CAP_REAL_TIME ||
+ sq_ts_format_cap ==
+ MLX5_TIMESTAMP_FORMAT_CAP_FREE_RUNNING_AND_REAL_TIME);
}
typedef ktime_t (*cqe_ts_to_ns)(struct mlx5_clock *, u64);