Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6455786rwb; Tue, 22 Nov 2022 13:43:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gWvCFsRHaA5iqC4SguOaR1nBAW9PbkuO/qs+b9qptn1nmM1d5kI83LZP8ABM7d7Yglukm X-Received: by 2002:a17:906:68a:b0:78d:3188:9116 with SMTP id u10-20020a170906068a00b0078d31889116mr21536761ejb.176.1669153421062; Tue, 22 Nov 2022 13:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669153421; cv=none; d=google.com; s=arc-20160816; b=vq1DWoNZhohwRuFXQevL3hi6jMsXfmAOGVwGdJr+sycQQ+kZguO7ARIWXIKrELUKSK 4dq+RCU3PwrzRcNGSwg0+XmPmvb0AxsYM47O6NY2xAeB2ccu2ClYk3b4oppLK2bEFXoI DpqgLwaYS13p+/avNPSCMtmicO09s5T1D6nEXbeJ8qliMghTc6SgydiHzTf28R8Ub1/4 Rsgf+jeiHE5Bdt1DQhXyeWjvVYxc+IYY0/pOdJgfrvHJ3Z9tDuFqF9X3283STAvv9QhL +858Po8bQrp6G9QaicTkEwOiavvvqE9NGcyfnrSEE0imY59tx+5gKHqiWkSANnQWrZqq hMHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nX2hWXVjMhhMybVig3F2Yk4KbZB7+j9aXhSoDAG9wSo=; b=M5zTq/v1HQAtlBrXiQkOpaKwgaQNdGCYDK1A2NOpkpqeOCb4R/uaSlmxdwRN2uLmSe XoPIbWuYDaugAqOkoC58Q2uJUBDLKWgguiLziKEkc9jzT0gHUC+55okG4b1uY7PJleii a2NUO3QFsRtq15h2V5eGkHSVg9OXTGQ3wMiX9VyKueVEhOk1agifkGDSVnbgQ7zsCzFW lHSVxULnVQYepvAHxns5t6VHARYVLeLXz0A/e2ss++6nVCiWNC09ruZrspQTbIIvbA0d p6AnFMjMGu1AhGzRX9BPO3w2cgakG5lOTpLxNcLLTamF6gT10/6Qh4NU+aYoc6u70WlK 1pTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ipvmtCfb; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a05640235d300b00461f10cb543si14405981edc.154.2022.11.22.13.43.19; Tue, 22 Nov 2022 13:43:41 -0800 (PST) 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=@microchip.com header.s=mchp header.b=ipvmtCfb; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234965AbiKVVSz (ORCPT + 89 others); Tue, 22 Nov 2022 16:18:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234906AbiKVVSj (ORCPT ); Tue, 22 Nov 2022 16:18:39 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 457BC8F3C5; Tue, 22 Nov 2022 13:18:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669151914; x=1700687914; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=LThJ1ttg1CyFpkPz/PkEmhwyOX/XhzArLbbxws3J7f8=; b=ipvmtCfbksG9BdcFrqBr1cgBp+4ILfjMqcDkkBZfFqziFfb+nQXiaCa+ YRkLo/2b8sUJ+E/Cjgz8R5aSVGqENoFsjwRILt8//9emwr412sj3NW9GL Ad5VGMpcyt6oq7V89fxEA7JCDsn67SfpONUeWBnEdpo/hI8iLtiY3eNNO UqTc4LFZEY/z0Wysy8e0vT3gnH1GSuSbpMPwnP/r7Nh2dwm//jjGPrFHn CX9TfMuMH5Ip1q8/rb6gn1FzJmqcfWLwIYYbnPAfsj678tVValtjGwqc8 QgelXwhE80jJT8KJelQvcV4P44sKibJ2v+9fbtsKUSHI66NfBIZ5vA9vZ Q==; X-IronPort-AV: E=Sophos;i="5.96,185,1665471600"; d="scan'208";a="190169312" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Nov 2022 14:18:31 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Tue, 22 Nov 2022 14:18:25 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Tue, 22 Nov 2022 14:18:25 -0700 Date: Tue, 22 Nov 2022 22:23:16 +0100 From: Horatiu Vultur To: Alexander Lobakin CC: , , , , , , , , , , , Subject: Re: [PATCH net-next v3 4/7] net: lan966x: Update rxq memory model Message-ID: <20221122212316.vqsynpwkrghxewi3@soft-dev3-1> References: <20221121212850.3212649-1-horatiu.vultur@microchip.com> <20221121212850.3212649-5-horatiu.vultur@microchip.com> <20221122113851.418993-1-alexandr.lobakin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20221122113851.418993-1-alexandr.lobakin@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_SPF_TEMPERROR 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 The 11/22/2022 12:38, Alexander Lobakin wrote: > > From: Horatiu Vultur > Date: Mon, 21 Nov 2022 22:28:47 +0100 > > > By default the rxq memory model is MEM_TYPE_PAGE_SHARED but to be able > > to reuse pages on the TX side, when the XDP action XDP_TX it is required > > to update the memory model to PAGE_POOL. > > > > Signed-off-by: Horatiu Vultur > > --- > > .../net/ethernet/microchip/lan966x/lan966x_fdma.c | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c > > index 384ed34197d58..483d1470c8362 100644 > > --- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c > > +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c > > @@ -78,8 +78,22 @@ static int lan966x_fdma_rx_alloc_page_pool(struct lan966x_rx *rx) > > .max_len = rx->max_mtu - > > SKB_DATA_ALIGN(sizeof(struct skb_shared_info)), > > }; > > + struct lan966x_port *port; > > + int i; > > > > rx->page_pool = page_pool_create(&pp_params); > > + > > + for (i = 0; i < lan966x->num_phys_ports; ++i) { > > + if (!lan966x->ports[i]) > > + continue; > > + > > + port = lan966x->ports[i]; > > + > > + xdp_rxq_info_unreg_mem_model(&port->xdp_rxq); > > xdp_rxq_info_unreg_mem_model() can emit a splat if currently the > corresponding xdp_rxq_info is not registered[0]. Can't we face it > here if called from lan966x_fdma_init()? We will not face that issue here because before lan966x_fdma_init is called, we call lan966x_xdp_port_init which registers xdp_rxq_info. > > > + xdp_rxq_info_reg_mem_model(&port->xdp_rxq, MEM_TYPE_PAGE_POOL, > > + rx->page_pool); > > + } > > + > > return PTR_ERR_OR_ZERO(rx->page_pool); > > } > > > > -- > > 2.38.0 > > Thanks, > Olek -- /Horatiu