From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: davem@davemloft.net
Cc: oss-drivers@netronome.com, netdev@vger.kernel.org,
Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH net-next 3/9] nfp: implement netpoll ndo (thus enabling netconsole)
Date: Fri, 29 Jun 2018 17:04:36 -0700 [thread overview]
Message-ID: <20180630000442.27353-4-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20180630000442.27353-1-jakub.kicinski@netronome.com>
NFP NAPI handling will only complete the TXed packets when called
with budget of 0, implement ndo_poll_controller by scheduling NAPI
on all TX queues.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
.../ethernet/netronome/nfp/nfp_net_common.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index d4c27f849f9b..edc6ef682f6d 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -3115,6 +3115,21 @@ nfp_net_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
return nfp_net_reconfig_mbox(nn, NFP_NET_CFG_MBOX_CMD_CTAG_FILTER_KILL);
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void nfp_net_netpoll(struct net_device *netdev)
+{
+ struct nfp_net *nn = netdev_priv(netdev);
+ int i;
+
+ /* nfp_net's NAPIs are statically allocated so even if there is a race
+ * with reconfig path this will simply try to schedule some disabled
+ * NAPI instances.
+ */
+ for (i = 0; i < nn->dp.num_stack_tx_rings; i++)
+ napi_schedule_irqoff(&nn->r_vecs[i].napi);
+}
+#endif
+
static void nfp_net_stat64(struct net_device *netdev,
struct rtnl_link_stats64 *stats)
{
@@ -3482,6 +3497,9 @@ const struct net_device_ops nfp_net_netdev_ops = {
.ndo_get_stats64 = nfp_net_stat64,
.ndo_vlan_rx_add_vid = nfp_net_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = nfp_net_vlan_rx_kill_vid,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = nfp_net_netpoll,
+#endif
.ndo_set_vf_mac = nfp_app_set_vf_mac,
.ndo_set_vf_vlan = nfp_app_set_vf_vlan,
.ndo_set_vf_spoofchk = nfp_app_set_vf_spoofchk,
--
2.17.1
next prev parent reply other threads:[~2018-06-30 0:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-30 0:04 [PATCH net-next 0/9] nfp: flower updates and netconsole Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 1/9] nfp: expose ring stats of inactive rings via ethtool Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 2/9] nfp: fail probe if serial or interface id is missing Jakub Kicinski
2018-06-30 0:04 ` Jakub Kicinski [this message]
2018-06-30 0:04 ` [PATCH net-next 4/9] nfp: make use of napi_consume_skb() Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 5/9] nfp: populate bus-info on representors Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 6/9] nfp: flower: ignore checksum actions when performing pedit actions Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 7/9] nfp: flower: extract ipv4 udp tunnel ttl from route Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 8/9] nfp: flower: offload tos and tunnel flags for ipv4 udp tunnels Jakub Kicinski
2018-06-30 0:04 ` [PATCH net-next 9/9] nfp: flower: enabled offloading of Team LAG Jakub Kicinski
2018-06-30 12:32 ` [PATCH net-next 0/9] nfp: flower updates and netconsole David Miller
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=20180630000442.27353-4-jakub.kicinski@netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.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