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=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 B00ECC433B4 for ; Thu, 13 May 2021 18:21:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 943E56143C for ; Thu, 13 May 2021 18:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbhEMSWg (ORCPT ); Thu, 13 May 2021 14:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbhEMSWb (ORCPT ); Thu, 13 May 2021 14:22:31 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F081C061574; Thu, 13 May 2021 11:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6uuUzWl9VoRjV4bYv78VUB4CdgmlKH2pNJlIUhKulm8=; b=NXExP0SppRPIfcFl8xuZPZ/8q hwe9BNAHh1LWQyN8f0WG69abeL20BRHNjHdIWBAjV562Qz8kygXokRSvmaIxpdQpF04UxzIgbhBpV B5p1PSXFWaqwaP5yH3k0LOOVEvLH+nxjQEY/xus4sZ8FKQkm4jpcMJeNLulqReZ4HYDNdR0KF2hzt 1CBVDHmCo5F246dT7ExCUYhyYq8lWeBWGm12AJNvpE7JHDHKxqrygJ01jdF99yF1qGvkNcL76dtN7 Ns+FC/97V1uJuX4o159qH2rJMbhddBqoxIu5AJnL/zBFfnWz/2CeM0vrrZ4AnpO6SYI1Zfmujx//g nc9kMlz+w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:43946) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lhFxE-0006az-P5; Thu, 13 May 2021 19:21:00 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lhFx2-0003ED-8H; Thu, 13 May 2021 19:20:48 +0100 Date: Thu, 13 May 2021 19:20:48 +0100 From: "Russell King (Oracle)" To: Matteo Croce Cc: netdev@vger.kernel.org, linux-mm@kvack.org, Ayush Sawal , Vinay Kumar Yadav , Rohit Maheshwari , "David S. Miller" , Jakub Kicinski , Thomas Petazzoni , Marcin Wojtas , Mirko Lindner , Stephen Hemminger , Tariq Toukan , Jesper Dangaard Brouer , Ilias Apalodimas , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Boris Pismenny , Arnd Bergmann , Andrew Morton , "Peter Zijlstra (Intel)" , Vlastimil Babka , Yu Zhao , Will Deacon , Fenghua Yu , Roman Gushchin , Hugh Dickins , Peter Xu , Jason Gunthorpe , Jonathan Lemon , Alexander Lobakin , Cong Wang , wenxu , Kevin Hao , Jakub Sitnicki , Marco Elver , Willem de Bruijn , Miaohe Lin , Yunsheng Lin , Guillaume Nault , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, Matthew Wilcox , Eric Dumazet , David Ahern , Lorenzo Bianconi , Saeed Mahameed , Andrew Lunn , Paolo Abeni , Sven Auhagen Subject: Re: [PATCH net-next v5 4/5] mvpp2: recycle buffers Message-ID: <20210513182048.GA12395@shell.armlinux.org.uk> References: <20210513165846.23722-1-mcroce@linux.microsoft.com> <20210513165846.23722-5-mcroce@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210513165846.23722-5-mcroce@linux.microsoft.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Thu, May 13, 2021 at 06:58:45PM +0200, Matteo Croce wrote: > diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > index b2259bf1d299..9dceabece56c 100644 > --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > @@ -3847,6 +3847,7 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi, > struct mvpp2_pcpu_stats ps = {}; > enum dma_data_direction dma_dir; > struct bpf_prog *xdp_prog; > + struct xdp_rxq_info *rxqi; > struct xdp_buff xdp; > int rx_received; > int rx_done = 0; > @@ -3912,15 +3913,15 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi, > else > frag_size = bm_pool->frag_size; > > + if (bm_pool->pkt_size == MVPP2_BM_SHORT_PKT_SIZE) > + rxqi = &rxq->xdp_rxq_short; > + else > + rxqi = &rxq->xdp_rxq_long; > > + if (xdp_prog) { > + xdp.rxq = rxqi; > > + xdp_init_buff(&xdp, PAGE_SIZE, rxqi); > xdp_prepare_buff(&xdp, data, > MVPP2_MH_SIZE + MVPP2_SKB_HEADROOM, > rx_bytes, false); > @@ -3964,7 +3965,7 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi, > } > > if (pp) > + skb_mark_for_recycle(skb, virt_to_page(data), pp); > else > dma_unmap_single_attrs(dev->dev.parent, dma_addr, > bm_pool->buf_size, DMA_FROM_DEVICE, Looking at the above, which I've only quoted the _resulting_ code after your patch above, I don't see why you have moved the "bm_pool->pkt_size == MVPP2_BM_SHORT_PKT_SIZE" conditional outside of the test for xdp_prog - I don't see rxqi being used except within that conditional. Please can you explain the reasoning there? Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!