From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH net-next 1/8] dpaa2-eth: Add basic XDP support Date: Sat, 24 Nov 2018 14:49:17 -0700 Message-ID: <0e531d69-41bd-13f0-a784-fe1110cf68ff@gmail.com> References: <1542992186-26028-1-git-send-email-ruxandra.radulescu@nxp.com> <1542992186-26028-2-git-send-email-ruxandra.radulescu@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Ioana Ciornei To: Ioana Ciocoi Radulescu , "netdev@vger.kernel.org" , "davem@davemloft.net" Return-path: Received: from mail-pf1-f196.google.com ([209.85.210.196]:34515 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726251AbeKYIin (ORCPT ); Sun, 25 Nov 2018 03:38:43 -0500 Received: by mail-pf1-f196.google.com with SMTP id h3so4785304pfg.1 for ; Sat, 24 Nov 2018 13:49:20 -0800 (PST) In-Reply-To: <1542992186-26028-2-git-send-email-ruxandra.radulescu@nxp.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 11/23/18 9:56 AM, Ioana Ciocoi Radulescu wrote: > @@ -215,6 +255,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, > struct dpaa2_fas *fas; > void *buf_data; > u32 status = 0; > + u32 xdp_act; > > /* Tracing point */ > trace_dpaa2_rx_fd(priv->net_dev, fd); > @@ -231,8 +272,14 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, > percpu_extras = this_cpu_ptr(priv->percpu_extras); > > if (fd_format == dpaa2_fd_single) { > + xdp_act = run_xdp(priv, ch, (struct dpaa2_fd *)fd, vaddr); > + if (xdp_act != XDP_PASS) > + return; please bump the rx counters (packets and bytes) regardless of what XDP outcome is. Same for Tx; packets and bytes counter should be bumped for packets redirected by XDP.