From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14215C433DF for ; Sun, 14 Jun 2020 08:26:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD2E0206B7 for ; Sun, 14 Jun 2020 08:26:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="L+waR3Oa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726099AbgFNIYM (ORCPT ); Sun, 14 Jun 2020 04:24:12 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:53570 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725265AbgFNIYL (ORCPT ); Sun, 14 Jun 2020 04:24:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592123050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bAA8tAwvCqEnEOZtu0sfJMj8YHNywNJG8Pv3ts+oZ/8=; b=L+waR3OaQmuo7c2/dYvXQzblEteHt1xmNnSntxapwNaOCfggxWgP87WtN74jmMmHs1FYqi E2C8JCghzi1MPRRHjNDGfVbO61R+21KB9wiaGX818kHZdygTsvl4LBp6tOPtN1PrYPf7aR oqbNLQKX5fpZFRdI+8STIIB10ouZfmE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-261-MuaEctJNPGW8ezW78XZSAQ-1; Sun, 14 Jun 2020 04:23:51 -0400 X-MC-Unique: MuaEctJNPGW8ezW78XZSAQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9F719BFC0; Sun, 14 Jun 2020 08:23:49 +0000 (UTC) Received: from carbon (unknown [10.40.208.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DAB52B4D8; Sun, 14 Jun 2020 08:23:44 +0000 (UTC) Date: Sun, 14 Jun 2020 10:23:43 +0200 From: Jesper Dangaard Brouer To: Sven Auhagen Cc: netdev@vger.kernel.org, thomas.petazzoni@bootlin.com, lorenzo@kernel.org, brouer@redhat.com Subject: Re: [PATCH 1/1] mvneta: fix prefetch location Message-ID: <20200614102343.47837452@carbon> In-Reply-To: <20200614071128.4ezfcyhjesot4vvr@SvensMacBookAir.sven.lan> References: <20200614071128.4ezfcyhjesot4vvr@SvensMacBookAir.sven.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, 14 Jun 2020 09:11:28 +0200 Sven Auhagen wrote: > The packet header prefetch is at an offset > now. Correct the prefetch address. > > Signed-off-by: Sven Auhagen > --- > drivers/net/ethernet/marvell/mvneta.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c > index 51889770958d..344fc5f649b4 100644 > --- a/drivers/net/ethernet/marvell/mvneta.c > +++ b/drivers/net/ethernet/marvell/mvneta.c > @@ -2229,7 +2229,7 @@ mvneta_swbm_rx_frame(struct mvneta_port *pp, > len, dma_dir); > > /* Prefetch header */ > - prefetch(data); > + prefetch(data + pp->rx_offset_correction + MVNETA_MH_SIZE); The comment does say "header", so I guess your change is correct if we are talking about the packet header. Currently this prefetch will help XDP-redirect, as it store xdp_frame in this area. > xdp->data_hard_start = data; > xdp->data = data + pp->rx_offset_correction + MVNETA_MH_SIZE; If you really need to prefetch the packet headers, it would be the same as calling prefetch(xdp->data), right? Have you benchmarked that this prefetch is a benefit? -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer