Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH v3 8/9] igc: Add support for XDP_TX action
Date: Mon, 2 Nov 2020 19:26:59 +0100	[thread overview]
Message-ID: <20201102182659.GK6427@ranger.igk.intel.com> (raw)
In-Reply-To: <20201030210351.46482-9-andre.guedes@intel.com>

On Fri, Oct 30, 2020 at 02:03:50PM -0700, Andre Guedes wrote:
> This patch adds support for XDP_TX action which enables XDP programs to
> transmit back receiving frames.
> 
> I225 controller has only 4 tx hardware queues. Since XDP programs may
> not even issue an XDP_TX action, this patch doesn't reserve dedicated
> queues just for XDP like other Intel drivers do. Instead, the queues
> are shared between the network stack and XDP. The netdev queue lock is
> used to ensure mutual exclusion.
> 
> Since frames can now be transmitted via XDP_TX, the igc_tx_buffer
> structure is modified so we are able to save a reference to the xdp
> frame for later clean up once the packet is transmitted. The tx_buffer
> is mapped to either a skb or a xdpf so we use a union to save the skb
> or xdpf pointer and have a bit in tx_flags to indicate which field to
> use.
> 
> This patch has been tested with the sample app "xdp2" located in
> samples/bpf/ dir.
> 
> Signed-off-by: Andre Guedes <andre.guedes@intel.com>
> ---

[...]

> +
> +static struct igc_ring *igc_xdp_get_tx_ring(struct igc_adapter *adapter,
> +					    int cpu)
> +{
> +	int index = cpu;
> +
> +	if (index >= adapter->num_tx_queues)
> +		index = index % adapter->num_tx_queues;

I'm not sure why you don't want to take the suggestion for getting rid of
modulo op. I won't insist anymore ;)

> +
> +	return adapter->tx_ring[index];
> +}

[...]

  reply	other threads:[~2020-11-02 18:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 21:03 [Intel-wired-lan] [PATCH v3 0/9] igc: Add XDP support Andre Guedes
2020-10-30 21:03 ` [Intel-wired-lan] [PATCH v3 1/9] igc: Fix igc_ptp_rx_pktstamp() Andre Guedes
2020-11-02 17:56   ` Maciej Fijalkowski
2020-11-03 23:39     ` Andre Guedes
2020-11-04 22:26       ` Maciej Fijalkowski
2020-11-06  1:01         ` Guedes, Andre
2020-10-30 21:03 ` [Intel-wired-lan] [PATCH v3 2/9] igc: Remove unused argument from igc_tx_cmd_type() Andre Guedes
2020-10-30 21:03 ` [Intel-wired-lan] [PATCH v3 3/9] igc: Introduce igc_rx_buffer_flip() helper Andre Guedes
2020-10-30 21:03 ` [Intel-wired-lan] [PATCH v3 4/9] igc: Introduce igc_get_rx_frame_truesize() helper Andre Guedes
2020-10-30 21:03 ` [Intel-wired-lan] [PATCH v3 5/9] igc: Refactor rx timestamp handling Andre Guedes
2020-10-30 21:03 ` [Intel-wired-lan] [PATCH v3 6/9] igc: Add set/clear large buffer helpers Andre Guedes
2020-10-30 21:03 ` [Intel-wired-lan] [PATCH v3 7/9] igc: Add initial XDP support Andre Guedes
2020-11-02 18:07   ` Maciej Fijalkowski
2020-11-03 23:40     ` Andre Guedes
2020-11-04 21:56       ` Maciej Fijalkowski
2020-10-30 21:03 ` [Intel-wired-lan] [PATCH v3 8/9] igc: Add support for XDP_TX action Andre Guedes
2020-11-02 18:26   ` Maciej Fijalkowski [this message]
2020-11-03 23:40     ` Andre Guedes
2020-11-05 22:03       ` Vinicius Costa Gomes
2020-10-30 21:03 ` [Intel-wired-lan] [PATCH v3 9/9] igc: Add support for XDP_REDIRECT action Andre Guedes
2020-11-02 18:30   ` Maciej Fijalkowski
2020-11-03 23:41     ` Andre Guedes
2020-11-02 18:31 ` [Intel-wired-lan] [PATCH v3 0/9] igc: Add XDP support Maciej Fijalkowski
2020-11-03 23:41   ` Andre Guedes

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=20201102182659.GK6427@ranger.igk.intel.com \
    --to=maciej.fijalkowski@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /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