On Thu, Aug 9, 2018 at 10:02 AM Ilias Apalodimas
<[email protected]> wrote:
>
> MMIO reads for remaining packets in queue occur (at least)twice per
> invocation of netsec_process_rx(). We can use the packet descriptor to
> identify if it's owned by the hardware and break out, avoiding the more
> expensive MMIO read operations. This has a ~2% increase on the pps of the
> Rx path when tested with 64byte packets
>
> Signed-off-by: Ilias Apalodimas <[email protected]>
> ---
> drivers/net/ethernet/socionext/netsec.c | 19 +++++--------------
> 1 file changed, 5 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/ethernet/socionext/netsec.c
> b/drivers/net/ethernet/socionext/netsec.c
> index 01589b6..ae32909 100644
> --- a/drivers/net/ethernet/socionext/netsec.c
> +++ b/drivers/net/ethernet/socionext/netsec.c
> @@ -657,8 +657,6 @@ static struct sk_buff *netsec_get_rx_pkt_data(struct
> netsec_priv *priv,
> + if (de->attr & (1U << NETSEC_RX_PKT_OWN_FIELD))
> + break;
> done++;
Should this use READ_ONCE() to prevent the compiler from moving the
access around? I see that netsec_get_rx_pkt_data() has a dma_rmb()
before reading the data, which prevents the CPU from doing something
wrong here, but not the compiler.
Arnd