netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Camelia Groza <camelia.groza@nxp.com>
Cc: brouer@redhat.com, saeed@kernel.org, davem@davemloft.net,
	madalin.bucur@oss.nxp.com, ioana.ciornei@nxp.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/7] dpaa_eth: add basic XDP support
Date: Wed, 18 Nov 2020 16:21:37 -0800	[thread overview]
Message-ID: <20201118162137.149625e3@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> (raw)
In-Reply-To: <e8f6ede91ab1c3fa50953076e7983979de04d2b5.1605535745.git.camelia.groza@nxp.com>

On Mon, 16 Nov 2020 16:42:28 +0200 Camelia Groza wrote:
> +	if (likely(fd_format == qm_fd_contig)) {
> +		xdp_act = dpaa_run_xdp(priv, (struct qm_fd *)fd, vaddr,
> +				       &xdp_meta_len);
> +		if (xdp_act != XDP_PASS) {
> +			percpu_stats->rx_packets++;
> +			percpu_stats->rx_bytes += qm_fd_get_length(fd);
> +			return qman_cb_dqrr_consume;
> +		}
>  		skb = contig_fd_to_skb(priv, fd);
> -	else
> +	} else {
> +		WARN_ONCE(priv->xdp_prog, "S/G frames not supported under XDP\n");
>  		skb = sg_fd_to_skb(priv, fd);

It'd be safer to drop the packet if the format does not allow XDP 
to run. Otherwise someone can bypass whatever policy XDP is trying 
to enforce.


  reply	other threads:[~2020-11-19  0:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 14:42 [PATCH net-next v2 0/7] dpaa_eth: add XDP support Camelia Groza
2020-11-16 14:42 ` [PATCH net-next v2 1/7] dpaa_eth: add struct for software backpointers Camelia Groza
2020-11-16 14:42 ` [PATCH net-next v2 2/7] dpaa_eth: add basic XDP support Camelia Groza
2020-11-19  0:21   ` Jakub Kicinski [this message]
2020-11-19 13:50     ` Camelia Alexandra Groza
2020-11-16 14:42 ` [PATCH net-next v2 3/7] dpaa_eth: limit the possible MTU range when XDP is enabled Camelia Groza
2020-11-16 14:42 ` [PATCH net-next v2 4/7] dpaa_eth: add XDP_TX support Camelia Groza
2020-11-16 14:42 ` [PATCH net-next v2 5/7] dpaa_eth: add XDP_REDIRECT support Camelia Groza
2020-11-16 14:42 ` [PATCH net-next v2 6/7] dpaa_eth: rename current skb A050385 erratum workaround Camelia Groza
2020-11-16 14:42 ` [PATCH net-next v2 7/7] dpaa_eth: implement the A050385 erratum workaround for XDP Camelia Groza
2020-11-16 15:39 ` [PATCH net-next v2 0/7] dpaa_eth: add XDP support Madalin Bucur (OSS)

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=20201118162137.149625e3@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net \
    --to=kuba@kernel.org \
    --cc=brouer@redhat.com \
    --cc=camelia.groza@nxp.com \
    --cc=davem@davemloft.net \
    --cc=ioana.ciornei@nxp.com \
    --cc=madalin.bucur@oss.nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeed@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).