netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Tariq Toukan <tariqt@mellanox.com>
Cc: Daniel Borkmann <borkmann@iogearbox.net>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	netdev@vger.kernel.org, dsahern@gmail.com, gospo@broadcom.com,
	bjorn.topel@intel.com, michael.chan@broadcom.com,
	brouer@redhat.com
Subject: Re: [bpf-next V1-RFC PATCH 06/14] mlx4: setup xdp_rxq_info
Date: Wed, 13 Dec 2017 15:00:16 +0100	[thread overview]
Message-ID: <20171213150016.2b78ce80@redhat.com> (raw)
In-Reply-To: <5b7d2132-40c7-71f5-b939-64539c6c53bb@mellanox.com>

On Wed, 13 Dec 2017 14:42:25 +0200
Tariq Toukan <tariqt@mellanox.com> wrote:

> > @@ -650,6 +658,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
> >   	int cq_ring = cq->ring;
> >   	bool doorbell_pending;
> >   	struct mlx4_cqe *cqe;
> > +	struct xdp_buff xdp;
> >   	int polled = 0;
> >   	int index;
> >   
> > @@ -664,6 +673,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
> >   	/* Protect accesses to: ring->xdp_prog, priv->mac_hash list */
> >   	rcu_read_lock();
> >   	xdp_prog = rcu_dereference(ring->xdp_prog);
> > +	xdp.rxq = &ring->xdp_rxq;  
> 
> You moved this to update it only once, and not per packet. Right?
> This is because all fields of struct xdp_buff used to be specific 
> per-packet and filled in every iteration. Now you introduce a new field 
> which holds a context.
> 
> Well, I still need to go over the infrastructure in your other patches, 
> but from first glance it seems that we can use two separated structs: 
> one for context, and one for per-packet info.

This are two separate structs.  I guess, what you are suggesting is
passing them as separate structs to bpf_prog_run_xdp() ?

The reason I like/want to have xdp_buff point to xdp_rxq_info, is that
I want this information transferred through to the XDP_REDIRECT calls.

The plan (after this patchset) is to implement a kfree_xdp_buff() that
can free/return xdp frames directly to the driver (needed in err cases
in redirect code) by checking if the rxq->dev have defined an
ndo_xdp_return() function.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2017-12-13 14:00 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13 11:19 [bpf-next V1-RFC PATCH 00/14] xdp: new XDP rx-queue info concept Jesper Dangaard Brouer
2017-12-13 11:19 ` [bpf-next V1-RFC PATCH 01/14] xdp: base API for " Jesper Dangaard Brouer
2017-12-14  2:34   ` David Ahern
2017-12-18 10:55     ` Jesper Dangaard Brouer
2017-12-18 13:23       ` David Ahern
2017-12-18 15:52         ` Jesper Dangaard Brouer
2017-12-21 16:59       ` Jesper Dangaard Brouer
2017-12-13 11:19 ` [bpf-next V1-RFC PATCH 02/14] xdp/mlx5: setup xdp_rxq_info and extend with qtype Jesper Dangaard Brouer
2017-12-13 12:27   ` Tariq Toukan
2017-12-13 13:44     ` Jesper Dangaard Brouer
2017-12-13 23:03       ` Saeed Mahameed
2017-12-14  6:46         ` Jesper Dangaard Brouer
2017-12-13 11:19 ` [bpf-next V1-RFC PATCH 03/14] i40e: setup xdp_rxq_info Jesper Dangaard Brouer
2017-12-18 10:52   ` [Intel-wired-lan] " Björn Töpel
2017-12-18 13:05     ` Jesper Dangaard Brouer
2017-12-13 11:19 ` [bpf-next V1-RFC PATCH 04/14] ixgbe: " Jesper Dangaard Brouer
2017-12-13 11:19 ` [bpf-next V1-RFC PATCH 05/14] xdp/qede: setup xdp_rxq_info and intro xdp_rxq_info_is_reg Jesper Dangaard Brouer
2017-12-13 11:19 ` [bpf-next V1-RFC PATCH 06/14] mlx4: setup xdp_rxq_info Jesper Dangaard Brouer
2017-12-13 12:42   ` Tariq Toukan
2017-12-13 14:00     ` Jesper Dangaard Brouer [this message]
2017-12-13 11:19 ` [bpf-next V1-RFC PATCH 07/14] bnxt_en: " Jesper Dangaard Brouer
2017-12-13 11:20 ` [bpf-next V1-RFC PATCH 08/14] nfp: " Jesper Dangaard Brouer
2017-12-14  2:34   ` Jakub Kicinski
2017-12-18 20:25     ` Jesper Dangaard Brouer
2017-12-13 11:20 ` [bpf-next V1-RFC PATCH 09/14] thunderx: " Jesper Dangaard Brouer
2017-12-13 11:20 ` [bpf-next V1-RFC PATCH 10/14] tun: " Jesper Dangaard Brouer
2017-12-20  7:48   ` Jason Wang
2017-12-21 15:42     ` Jesper Dangaard Brouer
2017-12-13 11:20 ` [bpf-next V1-RFC PATCH 11/14] virtio_net: " Jesper Dangaard Brouer
2017-12-13 11:20 ` [bpf-next V1-RFC PATCH 12/14] xdp: generic XDP handling of xdp_rxq_info Jesper Dangaard Brouer
2017-12-13 22:50   ` Saeed Mahameed
2017-12-18  9:47     ` Jesper Dangaard Brouer
2017-12-13 11:20 ` [bpf-next V1-RFC PATCH 13/14] bpf: finally expose xdp_rxq_info to XDP bpf-programs Jesper Dangaard Brouer
2017-12-13 11:20 ` [bpf-next V1-RFC PATCH 14/14] samples/bpf: program demonstrating access to xdp_rxq_info Jesper Dangaard Brouer

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=20171213150016.2b78ce80@redhat.com \
    --to=brouer@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bjorn.topel@intel.com \
    --cc=borkmann@iogearbox.net \
    --cc=dsahern@gmail.com \
    --cc=gospo@broadcom.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@mellanox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).