[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1610701570-29496-2-git-send-email-bupadhaya@marvell.com>
Date: Fri, 15 Jan 2021 01:06:08 -0800
From: Bhaskar Upadhaya <bupadhaya@...vell.com>
To: <netdev@...r.kernel.org>, <kuba@...nel.org>, <aelior@...vell.com>,
<irusskikh@...vell.com>
CC: <bupadhaya@...vell.com>
Subject: [PATCH net-next 1/3] qede: add netpoll support for qede driver
Add net poll controller support to transmit kernel printks
over UDP
Signed-off-by: Bhaskar Upadhaya <bupadhaya@...vell.com>
Signed-off-by: Igor Russkikh <irusskikh@...vell.com>
Signed-off-by: Ariel Elior <aelior@...vell.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
Powered by blists - more mailing lists