All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Damato <jdamato@fastly.com>
To: Justin Lai <justinlai0215@realtek.com>
Cc: kuba@kernel.org, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, andrew@lunn.ch, jiri@resnulli.us,
	horms@kernel.org, rkannoth@marvell.com, pkshih@realtek.com,
	larry.chiu@realtek.com
Subject: Re: [PATCH net-next v21 02/13] rtase: Implement the .ndo_open function
Date: Thu, 27 Jun 2024 12:41:34 -0400	[thread overview]
Message-ID: <Zn2WPhHOgBZFEvPE@LQ3V64L9R2> (raw)
In-Reply-To: <20240624062821.6840-3-justinlai0215@realtek.com>

On Mon, Jun 24, 2024 at 02:28:10PM +0800, Justin Lai wrote:

[...]

> +static int rtase_open(struct net_device *dev)
> +{
> +	struct rtase_private *tp = netdev_priv(dev);
> +	const struct pci_dev *pdev = tp->pdev;
> +	struct rtase_int_vector *ivec;
> +	u16 i = 0, j;
> +	int ret;
> +
> +	ivec = &tp->int_vector[0];
> +	tp->rx_buf_sz = RTASE_RX_BUF_SIZE;
> +
> +	ret = rtase_alloc_desc(tp);
> +	if (ret)
> +		return ret;
> +
> +	ret = rtase_init_ring(dev);
> +	if (ret)
> +		goto err_free_all_allocated_mem;
> +
> +	rtase_hw_config(dev);
> +
> +	if (tp->sw_flag & RTASE_SWF_MSIX_ENABLED) {
> +		ret = request_irq(ivec->irq, rtase_interrupt, 0,
> +				  dev->name, ivec);
> +		if (ret)
> +			goto err_free_all_allocated_irq;
> +
> +		/* request other interrupts to handle multiqueue */
> +		for (i = 1; i < tp->int_nums; i++) {
> +			ivec = &tp->int_vector[i];
> +			snprintf(ivec->name, sizeof(ivec->name), "%s_int%i",
> +				 tp->dev->name, i);
> +			ret = request_irq(ivec->irq, rtase_q_interrupt, 0,
> +					  ivec->name, ivec);
> +			if (ret)
> +				goto err_free_all_allocated_irq;
> +		}
> +	} else {
> +		ret = request_irq(pdev->irq, rtase_interrupt, 0, dev->name,
> +				  ivec);
> +		if (ret)
> +			goto err_free_all_allocated_mem;
> +	}
> +
> +	rtase_hw_start(dev);
> +
> +	for (i = 0; i < tp->int_nums; i++) {
> +		ivec = &tp->int_vector[i];
> +		napi_enable(&ivec->napi);

nit / suggestion for the future (not to hold this back): it'd be
nice to add support for netif_napi_set_irq and netif_queue_set_napi
so that userland can use netdev-genl to get queue/irq/napi mappings.

  reply	other threads:[~2024-06-27 16:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24  6:28 [PATCH net-next v21 00/13] Add Realtek automotive PCIe driver Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 01/13] rtase: Add support for a pci table in this module Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 02/13] rtase: Implement the .ndo_open function Justin Lai
2024-06-27 16:41   ` Joe Damato [this message]
2024-06-28 10:05     ` Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 03/13] rtase: Implement the rtase_down function Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 04/13] rtase: Implement the interrupt routine and rtase_poll Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 05/13] rtase: Implement hardware configuration function Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 06/13] rtase: Implement .ndo_start_xmit function Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 07/13] rtase: Implement a function to receive packets Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 08/13] rtase: Implement net_device_ops Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 09/13] rtase: Implement pci_driver suspend and resume function Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 10/13] rtase: Implement ethtool function Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 11/13] rtase: Add a Makefile in the rtase folder Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 12/13] realtek: Update the Makefile and Kconfig in the realtek folder Justin Lai
2024-06-26  1:07   ` Jakub Kicinski
2024-06-26  5:28     ` Justin Lai
2024-06-24  6:28 ` [PATCH net-next v21 13/13] MAINTAINERS: Add the rtase ethernet driver entry Justin Lai

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=Zn2WPhHOgBZFEvPE@LQ3V64L9R2 \
    --to=jdamato@fastly.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=justinlai0215@realtek.com \
    --cc=kuba@kernel.org \
    --cc=larry.chiu@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pkshih@realtek.com \
    --cc=rkannoth@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.