netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: netdev@vger.kernel.org, jaswinder.singh@linaro.org,
	ard.biesheuvel@linaro.org, bjorn.topel@intel.com,
	magnus.karlsson@intel.com, brouer@redhat.com,
	daniel@iogearbox.net, ast@kernel.org,
	makita.toshiaki@lab.ntt.co.jp, jakub.kicinski@netronome.com,
	john.fastabend@gmail.com, davem@davemloft.net,
	maciejromanfijalkowski@gmail.com
Subject: Re: [net-next, PATCH 3/3, v2] net: netsec: add XDP support
Date: Sun, 30 Jun 2019 19:45:13 +0300	[thread overview]
Message-ID: <20190630164512.GD12704@khorivan> (raw)
In-Reply-To: <20190630163417.GB10484@apalos>

On Sun, Jun 30, 2019 at 07:34:17PM +0300, Ilias Apalodimas wrote:
>Hi Ivan,
>>
>> [...]
>>
>> >+
>> >+static int netsec_xdp(struct net_device *ndev, struct netdev_bpf *xdp)
>> >+{
>> >+	struct netsec_priv *priv = netdev_priv(ndev);
>> >+
>> >+	switch (xdp->command) {
>> >+	case XDP_SETUP_PROG:
>> >+		return netsec_xdp_setup(priv, xdp->prog, xdp->extack);
>> >+	case XDP_QUERY_PROG:
>> >+		xdp->prog_id = priv->xdp_prog ? priv->xdp_prog->aux->id : 0;
>> xdp_attachment family to save bpf flags?
>Sure why not. This can always be added later though since many drivers are
>already doing it similarly no?
yes.
I can work w/o this ofc.
But netronome and cpsw (me) added this.
What I've seen it allows to prevent prog update if flag doesn't allow it.
Usually it doesn't allow, but can be forced with flag. In another case it can
be updated any time w/o reason...and seems like in your case it's sensitive.

>
>>
>> >+		return 0;
>> >+	default:
>> >+		return -EINVAL;
>> >+	}
>> >+}
>> >+
>> >static const struct net_device_ops netsec_netdev_ops = {
>> >	.ndo_init		= netsec_netdev_init,
>> >	.ndo_uninit		= netsec_netdev_uninit,
>> >@@ -1537,6 +1842,8 @@ static const struct net_device_ops netsec_netdev_ops = {
>> >	.ndo_set_mac_address    = eth_mac_addr,
>> >	.ndo_validate_addr	= eth_validate_addr,
>> >	.ndo_do_ioctl		= netsec_netdev_ioctl,
>> >+	.ndo_xdp_xmit		= netsec_xdp_xmit,
>> >+	.ndo_bpf		= netsec_xdp,
>> >};
>> >
>> >static int netsec_of_probe(struct platform_device *pdev,
>> >--
>> >2.20.1
>> >
>>
>> --
>> Regards,
>> Ivan Khoronzhuk
>
>Thanks
>/Ilias

-- 
Regards,
Ivan Khoronzhuk

  reply	other threads:[~2019-06-30 16:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-29  5:23 [PATCH 0/3, net-next, v2] net: netsec: Add XDP Support Ilias Apalodimas
2019-06-29  5:23 ` [net-next, PATCH 1/3, v2] net: netsec: Use page_pool API Ilias Apalodimas
2019-06-29  5:23 ` [net-next, PATCH 2/3, v2] net: page_pool: add helper function for retrieving dma direction Ilias Apalodimas
2019-06-29  5:23 ` [net-next, PATCH 3/3, v2] net: netsec: add XDP support Ilias Apalodimas
2019-06-29 10:36   ` Jesper Dangaard Brouer
2019-06-30 16:20   ` Ivan Khoronzhuk
2019-06-30 16:34     ` Ilias Apalodimas
2019-06-30 16:45       ` Ivan Khoronzhuk [this message]
2019-06-30 16:50         ` Ilias Apalodimas
2019-06-30 16:25   ` Ivan Khoronzhuk
2019-06-30 16:32     ` Ilias Apalodimas
2019-06-30 16:41       ` Ivan Khoronzhuk
2019-06-30 16:47         ` Ilias Apalodimas
2019-06-30 16:51           ` Ivan Khoronzhuk
2019-06-30 17:09           ` Ivan Khoronzhuk
2019-07-02  2:27 ` [PATCH 0/3, net-next, v2] net: netsec: Add XDP Support David Miller
2019-07-02  3:18   ` Ilias Apalodimas

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=20190630164512.GD12704@khorivan \
    --to=ivan.khoronzhuk@linaro.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=john.fastabend@gmail.com \
    --cc=maciejromanfijalkowski@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=makita.toshiaki@lab.ntt.co.jp \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).