Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1490432 > unrolled thread
| Started by | Calvin Owens <calvinowens@fb.com> |
|---|---|
| First post | 2016-09-23 22:20 +0200 |
| Last post | 2016-09-30 08:20 +0200 |
| Articles | 7 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] mlx5: Add ndo_poll_controller() implementation Calvin Owens <calvinowens@fb.com> - 2016-09-23 22:20 +0200
Re: [PATCH] mlx5: Add ndo_poll_controller() implementation Saeed Mahameed <saeedm@dev.mellanox.co.il> - 2016-09-24 13:00 +0200
[PATCH v2] mlx5: Add ndo_poll_controller() implementation Calvin Owens <calvinowens@fb.com> - 2016-09-28 00:30 +0200
Re: [PATCH v2] mlx5: Add ndo_poll_controller() implementation Saeed Mahameed <saeedm@dev.mellanox.co.il> - 2016-09-28 10:50 +0200
Re: [PATCH v2] mlx5: Add ndo_poll_controller() implementation David Miller <davem@davemloft.net> - 2016-09-28 11:00 +0200
[PATCH v2 net-next] mlx5: Add ndo_poll_controller() implementation Calvin Owens <calvinowens@fb.com> - 2016-09-29 06:50 +0200
Re: [PATCH v2 net-next] mlx5: Add ndo_poll_controller() implementation David Miller <davem@davemloft.net> - 2016-09-30 08:20 +0200
| From | Calvin Owens <calvinowens@fb.com> |
|---|---|
| Date | 2016-09-23 22:20 +0200 |
| Subject | [PATCH] mlx5: Add ndo_poll_controller() implementation |
| Message-ID | <skF6W-8rR-11@gated-at.bofh.it> |
This implements ndo_poll_controller in net_device_ops for mlx5, which is
necessary to use netconsole with this driver.
Signed-off-by: Calvin Owens <calvinowens@fb.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 2459c7f..439476f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -2786,6 +2786,20 @@ static void mlx5e_tx_timeout(struct net_device *dev)
schedule_work(&priv->tx_timeout_work);
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/* Fake "interrupt" called by netpoll (eg netconsole) to send skbs without
+ * reenabling interrupts.
+ */
+static void mlx5e_netpoll(struct net_device *dev)
+{
+ struct mlx5e_priv *priv = netdev_priv(dev);
+ int i, nr_sq = priv->params.num_channels * priv->params.num_tc;
+
+ for (i = 0; i < nr_sq; i++)
+ napi_schedule(priv->txq_to_sq_map[i]->cq.napi);
+}
+#endif
+
static const struct net_device_ops mlx5e_netdev_ops_basic = {
.ndo_open = mlx5e_open,
.ndo_stop = mlx5e_close,
@@ -2805,6 +2819,9 @@ static const struct net_device_ops mlx5e_netdev_ops_basic = {
.ndo_rx_flow_steer = mlx5e_rx_flow_steer,
#endif
.ndo_tx_timeout = mlx5e_tx_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = mlx5e_netpoll,
+#endif
};
static const struct net_device_ops mlx5e_netdev_ops_sriov = {
@@ -2836,6 +2853,9 @@ static const struct net_device_ops mlx5e_netdev_ops_sriov = {
.ndo_set_vf_link_state = mlx5e_set_vf_link_state,
.ndo_get_vf_stats = mlx5e_get_vf_stats,
.ndo_tx_timeout = mlx5e_tx_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = mlx5e_netpoll,
+#endif
};
static int mlx5e_check_required_hca_cap(struct mlx5_core_dev *mdev)
--
2.9.3
[toc] | [next] | [standalone]
| From | Saeed Mahameed <saeedm@dev.mellanox.co.il> |
|---|---|
| Date | 2016-09-24 13:00 +0200 |
| Message-ID | <skSQx-8qH-1@gated-at.bofh.it> |
| In reply to | #1490432 |
On Fri, Sep 23, 2016 at 11:13 PM, Calvin Owens <calvinowens@fb.com> wrote:
> This implements ndo_poll_controller in net_device_ops for mlx5, which is
> necessary to use netconsole with this driver.
>
> Signed-off-by: Calvin Owens <calvinowens@fb.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index 2459c7f..439476f 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -2786,6 +2786,20 @@ static void mlx5e_tx_timeout(struct net_device *dev)
> schedule_work(&priv->tx_timeout_work);
> }
>
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +/* Fake "interrupt" called by netpoll (eg netconsole) to send skbs without
> + * reenabling interrupts.
> + */
> +static void mlx5e_netpoll(struct net_device *dev)
> +{
> + struct mlx5e_priv *priv = netdev_priv(dev);
> + int i, nr_sq = priv->params.num_channels * priv->params.num_tc;
> +
> + for (i = 0; i < nr_sq; i++)
> + napi_schedule(priv->txq_to_sq_map[i]->cq.napi);
Hi Calvin,
Basically all CQs on the same channel are sharing the same napi, so
here you will end up calling napi_schedule more than once for each
napi (channel).
iterating over the SQs map is irrelevant here, all you need to do is
to iterate over the channels:
for (i = 0; i < priv->params.num_channels; i++)
napi_schedule(priv->channel[i]->napi);
Thanks,
Saeed.
> +}
> +#endif
> +
> static const struct net_device_ops mlx5e_netdev_ops_basic = {
> .ndo_open = mlx5e_open,
> .ndo_stop = mlx5e_close,
> @@ -2805,6 +2819,9 @@ static const struct net_device_ops mlx5e_netdev_ops_basic = {
> .ndo_rx_flow_steer = mlx5e_rx_flow_steer,
> #endif
> .ndo_tx_timeout = mlx5e_tx_timeout,
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> + .ndo_poll_controller = mlx5e_netpoll,
> +#endif
> };
>
> static const struct net_device_ops mlx5e_netdev_ops_sriov = {
> @@ -2836,6 +2853,9 @@ static const struct net_device_ops mlx5e_netdev_ops_sriov = {
> .ndo_set_vf_link_state = mlx5e_set_vf_link_state,
> .ndo_get_vf_stats = mlx5e_get_vf_stats,
> .ndo_tx_timeout = mlx5e_tx_timeout,
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> + .ndo_poll_controller = mlx5e_netpoll,
> +#endif
> };
>
> static int mlx5e_check_required_hca_cap(struct mlx5_core_dev *mdev)
> --
> 2.9.3
>
[toc] | [prev] | [next] | [standalone]
| From | Calvin Owens <calvinowens@fb.com> |
|---|---|
| Date | 2016-09-28 00:30 +0200 |
| Subject | [PATCH v2] mlx5: Add ndo_poll_controller() implementation |
| Message-ID | <sm92W-6Te-35@gated-at.bofh.it> |
| In reply to | #1490625 |
This implements ndo_poll_controller in net_device_ops callback for mlx5,
which is necessary to use netconsole with this driver.
Cc: Saeed Mahameed <saeedm@dev.mellanox.co.il>
Signed-off-by: Calvin Owens <calvinowens@fb.com>
---
Changes in v2:
* Only iterate channels to avoid redundant napi_schedule() calls
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 2459c7f..830b8d0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -2786,6 +2786,20 @@ static void mlx5e_tx_timeout(struct net_device *dev)
schedule_work(&priv->tx_timeout_work);
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/* Fake "interrupt" called by netpoll (eg netconsole) to send skbs without
+ * reenabling interrupts.
+ */
+static void mlx5e_netpoll(struct net_device *dev)
+{
+ struct mlx5e_priv *priv = netdev_priv(dev);
+ int i;
+
+ for (i = 0; i < priv->params.num_channels; i++)
+ napi_schedule(&priv->channel[i]->napi);
+}
+#endif
+
static const struct net_device_ops mlx5e_netdev_ops_basic = {
.ndo_open = mlx5e_open,
.ndo_stop = mlx5e_close,
@@ -2805,6 +2819,9 @@ static const struct net_device_ops mlx5e_netdev_ops_basic = {
.ndo_rx_flow_steer = mlx5e_rx_flow_steer,
#endif
.ndo_tx_timeout = mlx5e_tx_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = mlx5e_netpoll,
+#endif
};
static const struct net_device_ops mlx5e_netdev_ops_sriov = {
@@ -2836,6 +2853,9 @@ static const struct net_device_ops mlx5e_netdev_ops_sriov = {
.ndo_set_vf_link_state = mlx5e_set_vf_link_state,
.ndo_get_vf_stats = mlx5e_get_vf_stats,
.ndo_tx_timeout = mlx5e_tx_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = mlx5e_netpoll,
+#endif
};
static int mlx5e_check_required_hca_cap(struct mlx5_core_dev *mdev)
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Saeed Mahameed <saeedm@dev.mellanox.co.il> |
|---|---|
| Date | 2016-09-28 10:50 +0200 |
| Subject | Re: [PATCH v2] mlx5: Add ndo_poll_controller() implementation |
| Message-ID | <smiIV-4q0-3@gated-at.bofh.it> |
| In reply to | #1492196 |
On Wed, Sep 28, 2016 at 1:23 AM, Calvin Owens <calvinowens@fb.com> wrote: > This implements ndo_poll_controller in net_device_ops callback for mlx5, > which is necessary to use netconsole with this driver. > > Cc: Saeed Mahameed <saeedm@dev.mellanox.co.il> > Signed-off-by: Calvin Owens <calvinowens@fb.com> Acked-By: Saeed Mahameed <saeedm@mellanox.com>
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2016-09-28 11:00 +0200 |
| Subject | Re: [PATCH v2] mlx5: Add ndo_poll_controller() implementation |
| Message-ID | <smiSC-4tf-5@gated-at.bofh.it> |
| In reply to | #1492196 |
From: Calvin Owens <calvinowens@fb.com> Date: Tue, 27 Sep 2016 15:23:27 -0700 > This implements ndo_poll_controller in net_device_ops callback for mlx5, > which is necessary to use netconsole with this driver. > > Cc: Saeed Mahameed <saeedm@dev.mellanox.co.il> > Signed-off-by: Calvin Owens <calvinowens@fb.com> > --- > Changes in v2: > * Only iterate channels to avoid redundant napi_schedule() calls This doesn't apply cleanly to net-next, please respin.
[toc] | [prev] | [next] | [standalone]
| From | Calvin Owens <calvinowens@fb.com> |
|---|---|
| Date | 2016-09-29 06:50 +0200 |
| Subject | [PATCH v2 net-next] mlx5: Add ndo_poll_controller() implementation |
| Message-ID | <smBsd-7OH-3@gated-at.bofh.it> |
| In reply to | #1492345 |
This implements ndo_poll_controller in net_device_ops callbacks for mlx5,
which is necessary to use netconsole with this driver.
Acked-By: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Calvin Owens <calvinowens@fb.com>
---
Changes in v2:
* Only iterate channels to avoid redundant napi_schedule() calls
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index b58cfe3..7eaf380 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3188,6 +3188,20 @@ static int mlx5e_xdp(struct net_device *dev, struct netdev_xdp *xdp)
}
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/* Fake "interrupt" called by netpoll (eg netconsole) to send skbs without
+ * reenabling interrupts.
+ */
+static void mlx5e_netpoll(struct net_device *dev)
+{
+ struct mlx5e_priv *priv = netdev_priv(dev);
+ int i;
+
+ for (i = 0; i < priv->params.num_channels; i++)
+ napi_schedule(&priv->channel[i]->napi);
+}
+#endif
+
static const struct net_device_ops mlx5e_netdev_ops_basic = {
.ndo_open = mlx5e_open,
.ndo_stop = mlx5e_close,
@@ -3208,6 +3222,9 @@ static const struct net_device_ops mlx5e_netdev_ops_basic = {
#endif
.ndo_tx_timeout = mlx5e_tx_timeout,
.ndo_xdp = mlx5e_xdp,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = mlx5e_netpoll,
+#endif
};
static const struct net_device_ops mlx5e_netdev_ops_sriov = {
@@ -3240,6 +3257,9 @@ static const struct net_device_ops mlx5e_netdev_ops_sriov = {
.ndo_get_vf_stats = mlx5e_get_vf_stats,
.ndo_tx_timeout = mlx5e_tx_timeout,
.ndo_xdp = mlx5e_xdp,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = mlx5e_netpoll,
+#endif
};
static int mlx5e_check_required_hca_cap(struct mlx5_core_dev *mdev)
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2016-09-30 08:20 +0200 |
| Subject | Re: [PATCH v2 net-next] mlx5: Add ndo_poll_controller() implementation |
| Message-ID | <smZkS-6ys-15@gated-at.bofh.it> |
| In reply to | #1493131 |
From: Calvin Owens <calvinowens@fb.com> Date: Wed, 28 Sep 2016 21:46:39 -0700 > This implements ndo_poll_controller in net_device_ops callbacks for mlx5, > which is necessary to use netconsole with this driver. > > Acked-By: Saeed Mahameed <saeedm@mellanox.com> > Signed-off-by: Calvin Owens <calvinowens@fb.com> > --- > Changes in v2: > * Only iterate channels to avoid redundant napi_schedule() calls Applied, thanks.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web