Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1067638rdg; Fri, 11 Aug 2023 08:43:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzPmOWHfLnAT4BIco+OnINqIdIJL1FhMJmDHCdEFnmVWnYIWVDrOkj/jYcjWviRuUPS5r8 X-Received: by 2002:a17:906:21c:b0:98e:419b:4cbc with SMTP id 28-20020a170906021c00b0098e419b4cbcmr1975282ejd.12.1691768622851; Fri, 11 Aug 2023 08:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691768622; cv=none; d=google.com; s=arc-20160816; b=GL4SN8LoVK9gm66CBudr2G1ndY5t19fHffDb/ALe574CTiEUfShnFKXFri+edcqlaQ x/9wIDjLypV+2Spak19XN954F3jkM+755vIZ1B85vi759H+lmiikWVcennGHBZUHG4yd 2CbjVKwL2bY/HCepNdRMTCHzkiS39c8EUJ5kM1eUF9tTHEFo6ILp08uzA8Y3tmsnTTRW qYVziepnuEQC+8RbJT+EEUyaXPvZdhAsIkQR8A5QD9N9/FzFb4e8UkexaY7wudcPFzvB Vku0kdmaSJ9/ACBZ96Elwp1Epv6mHa2tn447RdbAKJ6g3n3uktlU3m8JNIBtry79NZ74 iZjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=luHMA3UqbI/FgvFbFibbqp60MC4Drq2QMdmC0pTNims=; fh=baAFjnnNjNRF7QGCygF70odJ7hfMQc4pguFs9U0T8NE=; b=C97hdelQMz0s6rm65Imz0v30GVQxrLLlkW6BVxoG2xB1mb64g+OxsAaBCVLaI6E8WG mRilQdYAR1hqLBR4egm4ItBuInJgQ+o1N1GXt458reP5wACjqjF/WgClc4WATo/GWwz6 HbfYZi78i9CoE3ekMqSXhvgt0nW34j3ZSIDLl7nFBTRW0hW02pRYBo7Pg+/Wz0tIQ4LC 5HRFpy/zttPdglb6FR0tjszP26l7ZMVwoE2H1IPpDIYsfxTfOfOHF3PqS+jW3mcRy7/D obsIyxBt2SI1yD0RTANl9mUb5/BVplaAKhUeoaHBKTQUK37a4LMNFliMYNBztU9mT7zy c7NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="f1/eNXFX"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p16-20020a1709060e9000b00992d6e88081si3488925ejf.956.2023.08.11.08.43.18; Fri, 11 Aug 2023 08:43:42 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="f1/eNXFX"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234414AbjHKPJD (ORCPT + 99 others); Fri, 11 Aug 2023 11:09:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbjHKPJC (ORCPT ); Fri, 11 Aug 2023 11:09:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41044171F for ; Fri, 11 Aug 2023 08:09:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C312F66C07 for ; Fri, 11 Aug 2023 15:09:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E404BC433C8; Fri, 11 Aug 2023 15:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691766541; bh=B9H8DIEwZ4OoBS2kfl3LqlTOO0srRHKGp/4wPDMFu1Q=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=f1/eNXFXk5g4fN8S4EVmpVE3o75jiLV9hpORZaLzoHe8uS0Tn2nDNTKRRwG6mvHzV /EINHN+MYIEeRDYWtrANimCcTqWxnaIUGPupJG2PHiqFxWQnL6IXYenZOWEEnZJ1Z5 ckIB7zwK2fJuXah2nmrvK+9u1Rh4Bd1owAYwn8Ari/SICmCOMviC0qn6wYSCngSqUG mIhBpwscIRgedhLHJGBj+9MdvAd0in7K8eXNifwR3ZDODA6igUg5fHkQdrRpnF98PQ tu9KhElc1ONi0qP33OqTWFK7LOyluLZ9hqNpKf4kz33mBz/YcvGR0ozNr7/0LMs/lI PyoQ4Va6VxsOw== Message-ID: Date: Fri, 11 Aug 2023 17:08:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: dl-linux-imx , "linux-kernel@vger.kernel.org" , "bpf@vger.kernel.org" Subject: Re: [PATCH V5 net-next 1/2] net: fec: add XDP_TX feature support Content-Language: en-US To: Wei Fang , Jesper Dangaard Brouer , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , Shenwei Wang , Clark Wang , "ast@kernel.org" , "daniel@iogearbox.net" , "john.fastabend@gmail.com" , "larysa.zaremba@intel.com" , "aleksander.lobakin@intel.com" , "jbrouer@redhat.com" , "netdev@vger.kernel.org" References: <20230810064514.104470-1-wei.fang@nxp.com> <20230810064514.104470-2-wei.fang@nxp.com> From: Jesper Dangaard Brouer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 11/08/2023 03.26, Wei Fang wrote: >> If you add below code comment you can add my ACK in V6: >> > Okay, I will add the annotation to the code in V6. Thanks. > Great, one adjustment to my suggested comment below. >> Acked-by: Jesper Dangaard Brouer >> >>> @@ -1482,7 +1488,13 @@ fec_enet_tx_queue(struct net_device *ndev, >> u16 queue_id, int budget) >>> /* Free the sk buffer associated with this last transmit */ >>> dev_kfree_skb_any(skb); >>> } else { >>> - xdp_return_frame(xdpf); >>> + if (txq->tx_buf[index].type == FEC_TXBUF_T_XDP_NDO) { >>> + xdp_return_frame_rx_napi(xdpf); >>> + } else { >>> + struct page *page = virt_to_head_page(xdpf->data); >>> + >> >> I think this usage of page_pool_put_page() with dma_sync_size=0 requires a >> comment, else we will forget why this okay... >> I suggest: >> >> /* PP dma_sync_size=0 as xmit already synced DMA for_device */ >> I update my suggestion to: /* PP dma_sync_size=0 as XDP_TX already synced DMA for_device */ Reading code path there is an simple "else" to reach this spot, and it will be good to hint to code-reader that this code path deals with XDP_TX completion handling. You are of-cause free to come up with a better comment yourself. >>> + page_pool_put_page(page->pp, page, 0, true); >>> + } >>> >>> txq->tx_buf[index].xdp = NULL; >>> /* restore default tx buffer type: FEC_TXBUF_T_SKB */ >> @@ -1541,7 > --Jesper