Re: [net-next 03/11] ixgbe: add support for XDP_TX action

2017-04-22 Thread Jakub Kicinski
On Sat, 22 Apr 2017 20:40:22 -0700, John Fastabend wrote: > >> @@ -9557,7 +9739,21 @@ static int ixgbe_xdp_setup(struct net_device *dev, > >> struct bpf_prog *prog) > >>return -EINVAL; > >>} > >> > >> + if (nr_cpu_ids > MAX_XDP_QUEUES) > >> + return -ENOMEM; > >

Re: [net-next 03/11] ixgbe: add support for XDP_TX action

2017-04-22 Thread John Fastabend
On 17-04-22 07:24 PM, Jakub Kicinski wrote: > On Thu, 20 Apr 2017 18:50:21 -0700, Jeff Kirsher wrote: >> +static int ixgbe_xdp_queues(struct ixgbe_adapter *adapter) >> +{ >> +if (nr_cpu_ids > MAX_XDP_QUEUES) >> +return 0; >> + >> +return adapter->xdp_prog ? nr_cpu_ids : 0; >> +}

Re: [net-next 03/11] ixgbe: add support for XDP_TX action

2017-04-22 Thread Jakub Kicinski
On Thu, 20 Apr 2017 18:50:21 -0700, Jeff Kirsher wrote: > +static int ixgbe_xdp_queues(struct ixgbe_adapter *adapter) > +{ > + if (nr_cpu_ids > MAX_XDP_QUEUES) > + return 0; > + > + return adapter->xdp_prog ? nr_cpu_ids : 0; > +} Nit: AFAICT ixgbe_xdp_setup() will guarantee xdp

[net-next 03/11] ixgbe: add support for XDP_TX action

2017-04-20 Thread Jeff Kirsher
From: John Fastabend A couple design choices were made here. First I use a new ring pointer structure xdp_ring[] in the adapter struct instead of pushing the newly allocated xdp TX rings into the tx_ring[] structure. This means we have to duplicate loops around rings in places we want to initiali