]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: txgbevf: Support Rx and Tx process path
authorMengyuan Lou <mengyuanlou@net-swift.com>
Fri, 4 Jul 2025 09:49:18 +0000 (17:49 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Jul 2025 01:39:13 +0000 (18:39 -0700)
Improve the configuration of Rx and Tx ring.
Setup and alloc resources.
Configure Rx and Tx unit on hardware.
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-8-mengyuanlou@net-swift.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/wangxun/libwx/wx_vf_common.c
drivers/net/ethernet/wangxun/txgbevf/txgbevf_main.c

index 7442b195425f314efb985ef98a9706766db3849f..dc3ed0808e15d66d42b7dcc8627e0dade9a6ba1b 100644 (file)
@@ -251,10 +251,14 @@ static void wxvf_irq_enable(struct wx *wx)
 static void wxvf_up_complete(struct wx *wx)
 {
        wx_configure_msix_vf(wx);
+       smp_mb__before_atomic();
+       wx_napi_enable_all(wx);
 
        /* clear any pending interrupts, may auto mask */
        wr32(wx, WX_VXICR, U32_MAX);
        wxvf_irq_enable(wx);
+       /* enable transmits */
+       netif_tx_start_all_queues(wx->netdev);
 }
 
 int wxvf_open(struct net_device *netdev)
@@ -262,13 +266,31 @@ int wxvf_open(struct net_device *netdev)
        struct wx *wx = netdev_priv(netdev);
        int err;
 
-       err = wx_request_msix_irqs_vf(wx);
+       err = wx_setup_resources(wx);
        if (err)
                goto err_reset;
+       wx_configure_vf(wx);
+
+       err = wx_request_msix_irqs_vf(wx);
+       if (err)
+               goto err_free_resources;
+
+       /* Notify the stack of the actual queue counts. */
+       err = netif_set_real_num_tx_queues(netdev, wx->num_tx_queues);
+       if (err)
+               goto err_free_irq;
+
+       err = netif_set_real_num_rx_queues(netdev, wx->num_rx_queues);
+       if (err)
+               goto err_free_irq;
 
        wxvf_up_complete(wx);
 
        return 0;
+err_free_irq:
+       wx_free_irq(wx);
+err_free_resources:
+       wx_free_resources(wx);
 err_reset:
        wx_reset_vf(wx);
        return err;
@@ -294,6 +316,7 @@ int wxvf_close(struct net_device *netdev)
 
        wxvf_down(wx);
        wx_free_irq(wx);
+       wx_free_resources(wx);
 
        return 0;
 }
index a61e4a0781cff3e94cd9499a809cfe0defeaeda9..57e67804b8b77448ad4b58eefac8cca203770f13 100644 (file)
@@ -40,6 +40,7 @@ static const struct pci_device_id txgbevf_pci_tbl[] = {
 static const struct net_device_ops txgbevf_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,
 };
@@ -258,6 +259,7 @@ static int txgbevf_probe(struct pci_dev *pdev,
                goto err_register;
 
        pci_set_drvdata(pdev, wx);
+       netif_tx_stop_all_queues(netdev);
 
        return 0;