Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1873254rwd; Thu, 18 May 2023 19:46:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5WZJmsvmzSkbha3mGwLBO0ByLfSRsRacIVz1dpsrkGzjOuYJ7bRoAMkINuSpwGKbb3hpUM X-Received: by 2002:a05:6a20:9d95:b0:105:63b0:5c05 with SMTP id mu21-20020a056a209d9500b0010563b05c05mr523430pzb.15.1684464409909; Thu, 18 May 2023 19:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684464409; cv=none; d=google.com; s=arc-20160816; b=Le1lEfI0CqPhI4bLzLWPfbxWvLAMPVwBXDl3cmVYUDT82rODpjqsn+qMBCiAzlP4WS njE+IIdkD240fr7QFmzYW2oOO6jXxoXl8vJWqlTRu65ux0XUFYD6jQ2LsdME3pjDaKRI ZLVWNWPM3TSpKnsPn6LbgpsoeKauSBqFPJ8V41TpkYgAezN5yFwOy0NaydR4fPSYPJht 9Vy0WPEGZV+i4JePt3fyE9iqV2SvedivwNRRpgJ7XXdyddWf29Z7bHg3xGXNefUjZXE6 cF+UMQf1LXIU4JvOX4DlsqpqCuYUvco7PkElehNUNd7vb6rX6qJBqhDwx9Ip4igr2w9O COHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=UClxQb3G+8Hu1J8VajrWVSTEq/GTUz2fzkCWJM93kAI=; b=kU98t+nZKEkTRmDi5v9AoR4a1Zy258P3POR3wbKj3AIMBvWwcOtlm4c509Nx5MbdJP OvUZ9F6whqFBdYtU83PZH/4VGnOOzxdq3uA01NMQmUoU6E8MuAHxxOg/DT8F75NqNdrq W2b6tUYuHCqvD4l7jND0Hpbdecxwzie+rppRv3kbBFOUBkFB6x7YRvMUgC5vnW5JyITw PauXDdQa1TS4rFaEJ4vVXdlCcvZv+qnC/l7ZbTaGvSu7+gx4hQrKfsfOn3UtFSf5PWZ6 xbZ/xyBQ+1AoROhWXPw6j63wTDRHALxpu8ciTcxYb+Pb0OxteuotUnQoLG1ZYq14sY9M 6YYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q24-20020a638c58000000b005181ce23024si2949398pgn.896.2023.05.18.19.46.37; Thu, 18 May 2023 19:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229789AbjESChG (ORCPT + 99 others); Thu, 18 May 2023 22:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjESChF (ORCPT ); Thu, 18 May 2023 22:37:05 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BB73E4D; Thu, 18 May 2023 19:37:03 -0700 (PDT) Received: from dggpemm500005.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QMrTx5Pd3zqSLG; Fri, 19 May 2023 10:32:37 +0800 (CST) Received: from [10.69.30.204] (10.69.30.204) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 19 May 2023 10:37:00 +0800 Subject: Re: [PATCH net-next v2] octeontx2-pf: Add support for page pool To: Ratheesh Kannoth , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Sunil Kovvuri Goutham , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , Subbaraya Sundeep Bhatta , Geethasowjanya Akula , Srujana Challa , Hariprasad Kelam References: <20230518055129.3129897-1-rkannoth@marvell.com> <9b576dd4-6083-9fab-5859-875287831d0a@huawei.com> From: Yunsheng Lin Message-ID: <0136fe46-eeb7-782d-0616-2a444e2f2da4@huawei.com> Date: Fri, 19 May 2023 10:37:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.69.30.204] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/5/19 9:52, Ratheesh Kannoth wrote: >> ---------------------------------------------------------------------- >> On 2023/5/18 13:51, Ratheesh Kannoth wrote: >>> Page pool for each rx queue enhance rx side performance by reclaiming >>> buffers back to each queue specific pool. DMA mapping is done only for >>> first allocation of buffers. >>> As subsequent buffers allocation avoid DMA mapping, it results in >>> performance improvement. >>> >>> Image | Performance with Linux kernel Packet Generator >> >> Is there any more detailed info for the performance data? >> 'kernel Packet Generator' means using pktgen module in the >> net/core/pktgen.c? it seems pktgen is more for tx, is there any abvious >> reason why the page pool optimization for rx have brought about ten times >> improvement? > We used packet generator for TX machine. Performance data is for RX DUT. I will remove > Packet generator text from the commit message as it gives ambiguous information > DUT Rx <------------------------- TX (Linux machine with packet generator) > (page pool support) Thanks for clarifying. DUT is for 'Device Under Test'? what does DUT do after it receive a packet? XDP DROP? > >> >>> ------------ | ----------------------------------------------- >>> Vannila | 3Mpps >>> | >>> with this | 42Mpps >>> change | >>> ------------------------------------------------------------- >>> >> >> ... >> >>> static int __otx2_alloc_rbuf(struct otx2_nic *pfvf, struct otx2_pool *pool, >>> dma_addr_t *dma) >>> { >>> u8 *buf; >>> >>> + if (pool->page_pool) >>> + return otx2_alloc_pool_buf(pfvf, pool, dma); >>> + >>> buf = napi_alloc_frag_align(pool->rbsize, OTX2_ALIGN); >>> if (unlikely(!buf)) >>> return -ENOMEM; >> >> It seems the above is dead code when using 'select PAGE_POOL', as >> PAGE_POOL config is always selected by the driver? > _otx2_alloc_rbuf() is common code for RX and TX. For RX, pool->page_pool != NULL, so allocation is from page pool. > Am I missing something here? 'buf' is dma-mapped with DMA_FROM_DEVICE, can it be used for TX? Also, what does 'r' in _otx2_alloc_rbuf() mean?