summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMengyuan Lou <mengyuanlou@net-swift.com>2025-07-04 17:49:22 +0800
committerJakub Kicinski <kuba@kernel.org>2025-07-09 18:39:14 -0700
commit0f71e3a6e59daa000bcebdbeab6bafda3747f3f9 (patch)
treeb31e900a80e9a2107cc14c492ca1b014e157bd44
parent85494c9bf5b0e14757fdcc75f9bff2f6f47dcb62 (diff)
net: ngbevf: init interrupts and request irqs
Add specific parameters for irq alloc, then use wx_init_interrupt_scheme to initialize interrupt allocation in probe. Add .ndo_start_xmit support and start all queues. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Link: https://patch.msgid.link/20250704094923.652-12-mengyuanlou@net-swift.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/wangxun/ngbevf/ngbevf_main.c18
-rw-r--r--drivers/net/ethernet/wangxun/ngbevf/ngbevf_type.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/ethernet/wangxun/ngbevf/ngbevf_main.c b/drivers/net/ethernet/wangxun/ngbevf/ngbevf_main.c
index 4eea682f024b..a629b645d3a1 100644
--- a/drivers/net/ethernet/wangxun/ngbevf/ngbevf_main.c
+++ b/drivers/net/ethernet/wangxun/ngbevf/ngbevf_main.c
@@ -10,6 +10,7 @@
#include "../libwx/wx_type.h"
#include "../libwx/wx_hw.h"
+#include "../libwx/wx_lib.h"
#include "../libwx/wx_mbx.h"
#include "../libwx/wx_vf.h"
#include "../libwx/wx_vf_common.h"
@@ -43,10 +44,18 @@ static const struct pci_device_id ngbevf_pci_tbl[] = {
static const struct net_device_ops ngbevf_netdev_ops = {
.ndo_open = wxvf_open,
.ndo_stop = wxvf_close,
+ .ndo_start_xmit = wx_xmit_frame,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = wx_set_mac_vf,
};
+static void ngbevf_set_num_queues(struct wx *wx)
+{
+ /* Start with base case */
+ wx->num_rx_queues = 1;
+ wx->num_tx_queues = 1;
+}
+
static int ngbevf_sw_init(struct wx *wx)
{
struct net_device *netdev = wx->netdev;
@@ -65,6 +74,7 @@ static int ngbevf_sw_init(struct wx *wx)
/* Initialize the device type */
wx->mac.type = wx_mac_em;
+ wx->mac.max_msix_vectors = NGBEVF_MAX_MSIX_VECTORS;
/* lock to protect mailbox accesses */
spin_lock_init(&wx->mbx.mbx_lock);
@@ -98,6 +108,7 @@ static int ngbevf_sw_init(struct wx *wx)
/* set default work limits */
wx->tx_work_limit = NGBEVF_DEFAULT_TX_WORK;
wx->rx_work_limit = NGBEVF_DEFAULT_RX_WORK;
+ wx->set_num_queues = ngbevf_set_num_queues;
return 0;
err_reset_hw:
@@ -186,15 +197,22 @@ static int ngbevf_probe(struct pci_dev *pdev,
eth_hw_addr_set(netdev, wx->mac.perm_addr);
ether_addr_copy(netdev->perm_addr, wx->mac.addr);
+ err = wx_init_interrupt_scheme(wx);
+ if (err)
+ goto err_free_sw_init;
+
err = register_netdev(netdev);
if (err)
goto err_register;
pci_set_drvdata(pdev, wx);
+ netif_tx_stop_all_queues(netdev);
return 0;
err_register:
+ wx_clear_interrupt_scheme(wx);
+err_free_sw_init:
kfree(wx->vfinfo);
kfree(wx->rss_key);
kfree(wx->mac_table);
diff --git a/drivers/net/ethernet/wangxun/ngbevf/ngbevf_type.h b/drivers/net/ethernet/wangxun/ngbevf/ngbevf_type.h
index dc29349304f1..67e761089e99 100644
--- a/drivers/net/ethernet/wangxun/ngbevf/ngbevf_type.h
+++ b/drivers/net/ethernet/wangxun/ngbevf/ngbevf_type.h
@@ -18,6 +18,7 @@
#define NGBEVF_DEV_ID_EM_WX1860A1 0x011a
#define NGBEVF_DEV_ID_EM_WX1860AL1 0x011b
+#define NGBEVF_MAX_MSIX_VECTORS 1
#define NGBEVF_MAX_RX_QUEUES 1
#define NGBEVF_MAX_TX_QUEUES 1
#define NGBEVF_DEFAULT_TXD 128