netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bhaskar Upadhaya <bupadhaya@marvell.com>
To: <netdev@vger.kernel.org>, <kuba@kernel.org>, <aelior@marvell.com>,
	<irusskikh@marvell.com>
Cc: <bupadhaya@marvell.com>
Subject: [PATCH  net-next 1/3] qede: add netpoll support for qede driver
Date: Fri, 15 Jan 2021 01:06:08 -0800	[thread overview]
Message-ID: <1610701570-29496-2-git-send-email-bupadhaya@marvell.com> (raw)
In-Reply-To: <1610701570-29496-1-git-send-email-bupadhaya@marvell.com>

Add net poll controller support to transmit kernel printks
over UDP

Signed-off-by: Bhaskar Upadhaya <bupadhaya@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
---
 drivers/net/ethernet/qlogic/qede/qede.h      |  4 ++++
 drivers/net/ethernet/qlogic/qede/qede_fp.c   | 14 ++++++++++++++
 drivers/net/ethernet/qlogic/qede/qede_main.c |  3 +++
 3 files changed, 21 insertions(+)

diff --git a/drivers/net/ethernet/qlogic/qede/qede.h b/drivers/net/ethernet/qlogic/qede/qede.h
index 3efc5899f656..ac12e5beb596 100644
--- a/drivers/net/ethernet/qlogic/qede/qede.h
+++ b/drivers/net/ethernet/qlogic/qede/qede.h
@@ -582,6 +582,10 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
 
 void qede_forced_speed_maps_init(void);
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+void qede_poll_controller(struct net_device *dev);
+#endif
+
 #define RX_RING_SIZE_POW	13
 #define RX_RING_SIZE		((u16)BIT(RX_RING_SIZE_POW))
 #define NUM_RX_BDS_MAX		(RX_RING_SIZE - 1)
diff --git a/drivers/net/ethernet/qlogic/qede/qede_fp.c b/drivers/net/ethernet/qlogic/qede/qede_fp.c
index a2494bf85007..a626f1f45212 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_fp.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_fp.c
@@ -1804,3 +1804,17 @@ netdev_features_t qede_features_check(struct sk_buff *skb,
 
 	return features;
 }
+
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/* This is used by netconsole to send skbs without having to re-enable
+ * interrupts.It's not called while the normal interrupt routine is executing.
+ */
+void qede_poll_controller(struct net_device *dev)
+{
+	struct qede_dev *edev = netdev_priv(dev);
+	int i;
+
+	for_each_queue(i)
+		napi_schedule(&edev->fp_array[i].napi);
+}
+#endif
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 05e3a3b60269..2ff6c49de745 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -644,6 +644,9 @@ static const struct net_device_ops qede_netdev_ops = {
 	.ndo_set_rx_mode	= qede_set_rx_mode,
 	.ndo_set_mac_address	= qede_set_mac_addr,
 	.ndo_validate_addr	= eth_validate_addr,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.ndo_poll_controller = qede_poll_controller,
+#endif
 	.ndo_change_mtu		= qede_change_mtu,
 	.ndo_do_ioctl		= qede_ioctl,
 	.ndo_tx_timeout		= qede_tx_timeout,
-- 
2.17.1


  reply	other threads:[~2021-01-15  9:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15  9:06 [PATCH net-next 0/3] qede: add netpoll and per-queue coalesce support Bhaskar Upadhaya
2021-01-15  9:06 ` Bhaskar Upadhaya [this message]
2021-01-17  2:26   ` [PATCH net-next 1/3] qede: add netpoll support for qede driver Jakub Kicinski
2021-01-17 16:35     ` [EXT] " Igor Russkikh
2021-01-18 19:10       ` Jakub Kicinski
2021-01-15  9:06 ` [PATCH net-next 2/3] qede: add per queue coalesce " Bhaskar Upadhaya
2021-01-15  9:06 ` [PATCH net-next 3/3] qede: set default per queue rx/tx usecs coalescing parameters Bhaskar Upadhaya
2021-01-17  2:28   ` Jakub Kicinski
2021-01-17 16:37     ` [EXT] " Igor Russkikh

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=1610701570-29496-2-git-send-email-bupadhaya@marvell.com \
    --to=bupadhaya@marvell.com \
    --cc=aelior@marvell.com \
    --cc=irusskikh@marvell.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).