From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Aya Levin <ayal@nvidia.com>,
Tariq Toukan <tariqt@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next V2 12/13] net/mlx5e: Cleanup PTP
Date: Thu, 25 Mar 2021 19:53:44 -0700 [thread overview]
Message-ID: <20210326025345.456475-13-saeed@kernel.org> (raw)
In-Reply-To: <20210326025345.456475-1-saeed@kernel.org>
From: Aya Levin <ayal@nvidia.com>
Reduce scope of mlx5e_ptp_params, move to its c file. Remove unneeded
variables from mlx5e_ptp_open and state bitmap from PTP channel. In
addition, remove channel index from PTP channel since it is set to a
hard coded value, use define instead.
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
.../net/ethernet/mellanox/mlx5/core/en/ptp.c | 18 ++++++++++--------
.../net/ethernet/mellanox/mlx5/core/en/ptp.h | 8 --------
2 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
index 2bc6d4362670..92a41b1bcdb0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
@@ -3,6 +3,14 @@
#include "en/ptp.h"
#include "en/txrx.h"
+#include "en/params.h"
+
+#define MLX5E_PTP_CHANNEL_IX 0
+
+struct mlx5e_ptp_params {
+ struct mlx5e_params params;
+ struct mlx5e_sq_param txq_sq_param;
+};
struct mlx5e_skb_cb_hwtstamp {
ktime_t cqe_hwtstamp;
@@ -171,7 +179,7 @@ static int mlx5e_ptp_alloc_txqsq(struct mlx5e_ptp *c, int txq_ix,
sq->netdev = c->netdev;
sq->priv = c->priv;
sq->mdev = mdev;
- sq->ch_ix = c->ix;
+ sq->ch_ix = MLX5E_PTP_CHANNEL_IX;
sq->txq_ix = txq_ix;
sq->uar_map = mdev->mlx5e_res.hw_objs.bfreg.map;
sq->min_inline_mode = params->tx_min_inline_mode;
@@ -339,7 +347,7 @@ static int mlx5e_ptp_open_cqs(struct mlx5e_ptp *c,
ccp.node = dev_to_node(mlx5_core_dma_dev(c->mdev));
ccp.ch_stats = c->stats;
ccp.napi = &c->napi;
- ccp.ix = c->ix;
+ ccp.ix = MLX5E_PTP_CHANNEL_IX;
cq_param = &cparams->txq_sq_param.cqp;
@@ -453,13 +461,8 @@ int mlx5e_ptp_open(struct mlx5e_priv *priv, struct mlx5e_params *params,
struct mlx5_core_dev *mdev = priv->mdev;
struct mlx5e_ptp_params *cparams;
struct mlx5e_ptp *c;
- unsigned int irq;
int err;
- int eqn;
- err = mlx5_vector2eqn(priv->mdev, 0, &eqn, &irq);
- if (err)
- return err;
c = kvzalloc_node(sizeof(*c), GFP_KERNEL, dev_to_node(mlx5_core_dma_dev(mdev)));
cparams = kvzalloc(sizeof(*cparams), GFP_KERNEL);
@@ -469,7 +472,6 @@ int mlx5e_ptp_open(struct mlx5e_priv *priv, struct mlx5e_params *params,
c->priv = priv;
c->mdev = priv->mdev;
c->tstamp = &priv->tstamp;
- c->ix = 0;
c->pdev = mlx5_core_dma_dev(priv->mdev);
c->netdev = priv->netdev;
c->mkey_be = cpu_to_be32(priv->mdev->mlx5e_res.hw_objs.mkey.key);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h
index 4cae06f2c312..937530afaf14 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h
@@ -5,7 +5,6 @@
#define __MLX5_EN_PTP_H__
#include "en.h"
-#include "en/params.h"
#include "en_stats.h"
struct mlx5e_ptpsq {
@@ -34,13 +33,6 @@ struct mlx5e_ptp {
struct mlx5e_priv *priv;
struct mlx5_core_dev *mdev;
struct hwtstamp_config *tstamp;
- DECLARE_BITMAP(state, MLX5E_CHANNEL_NUM_STATES);
- int ix;
-};
-
-struct mlx5e_ptp_params {
- struct mlx5e_params params;
- struct mlx5e_sq_param txq_sq_param;
};
int mlx5e_ptp_open(struct mlx5e_priv *priv, struct mlx5e_params *params,
--
2.30.2
next prev parent reply other threads:[~2021-03-26 2:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-26 2:53 [pull request][net-next V2 00/13] mlx5 updates 2021-03-24 Saeed Mahameed
2021-03-26 2:53 ` [net-next V2 01/13] net/mlx5e: alloc the correct size for indirection_rqt Saeed Mahameed
2021-03-26 8:45 ` Arnd Bergmann
2021-03-26 22:10 ` patchwork-bot+netdevbpf
2021-03-26 2:53 ` [net-next V2 02/13] net/mlx5e: Pass q_counter indentifier as parameter to rq_param builders Saeed Mahameed
2021-03-26 2:53 ` [net-next V2 03/13] net/mlx5e: Move params logic into its dedicated file Saeed Mahameed
2021-03-26 2:53 ` [net-next V2 04/13] net/mlx5e: Restrict usage of mlx5e_priv in params logic functions Saeed Mahameed
2021-03-26 2:53 ` [net-next V2 05/13] net/mlx5e: Allow creating mpwqe info without channel Saeed Mahameed
2021-03-26 2:53 ` [net-next V2 06/13] net/mlx5: Add helper to set time-stamp translator on a queue Saeed Mahameed
2021-03-26 2:53 ` [net-next V2 07/13] net/mlx5e: Generalize open RQ Saeed Mahameed
2021-03-26 2:53 ` [net-next V2 08/13] net/mlx5e: Generalize RQ activation Saeed Mahameed
2021-03-26 2:53 ` [net-next V2 09/13] net/mlx5e: Generalize close RQ Saeed Mahameed
2021-03-26 2:53 ` [net-next V2 10/13] net/mlx5e: Generalize direct-TIRs and direct-RQTs API Saeed Mahameed
2021-03-26 2:53 ` [net-next V2 11/13] net/mlx5e: Generalize PTP implementation Saeed Mahameed
2021-03-26 2:53 ` Saeed Mahameed [this message]
2021-03-26 2:53 ` [net-next V2 13/13] net/mlx5: Fix spelling mistakes in mlx5_core_info message Saeed Mahameed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210326025345.456475-13-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=ayal@nvidia.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).