RE: [PATCH net-next 1/8] dpaa2-eth: Add basic XDP support
> -Original Message- > From: netdev-ow...@vger.kernel.org > On Behalf Of Ioana Ciocoi Radulescu > Sent: Friday, November 23, 2018 18:57 > To: netdev@vger.kernel.org; da...@davemloft.net > Subject: [PATCH net-next 1/8] dpaa2-eth: Add basic XDP support > > +static int dpaa2_eth_change_mtu(struct net_device *dev, int new_mtu) > +{ > + struct dpaa2_eth_priv *priv = netdev_priv(dev); > + int err; > + > + if (!priv->xdp_prog) > + goto out; > + > + if (!xdp_mtu_valid(priv, new_mtu)) > + return -EINVAL; An error message would be helpful to let the user know which MTU values are acceptable in XDP context.
RE: [PATCH net-next 1/8] dpaa2-eth: Add basic XDP support
> -Original Message- > From: David Ahern > Sent: Saturday, November 24, 2018 11:49 PM > To: Ioana Ciocoi Radulescu ; > netdev@vger.kernel.org; da...@davemloft.net > Cc: Ioana Ciornei > Subject: Re: [PATCH net-next 1/8] dpaa2-eth: Add basic XDP support > > 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. Thanks for the feedback, I wasn't sure whether I should count them as regular packets or not. I'll make the change in v2. Ioana
Re: [PATCH net-next 1/8] dpaa2-eth: Add basic XDP support
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.