Commit ce12ba25 authored by Mengyuan Lou's avatar Mengyuan Lou Committed by Jakub Kicinski
Browse files

net: txgbevf: Support Rx and Tx process path



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: default avatarMengyuan Lou <mengyuanlou@net-swift.com>
Link: https://patch.msgid.link/20250704094923.652-8-mengyuanlou@net-swift.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent fd0a2e03
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -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;
}
+2 −0
Original line number Diff line number Diff line
@@ -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;